https://github.com/lovasko/ctfdiff
CTF diff
https://github.com/lovasko/ctfdiff
Last synced: 10 months ago
JSON representation
CTF diff
- Host: GitHub
- URL: https://github.com/lovasko/ctfdiff
- Owner: lovasko
- License: bsd-2-clause
- Created: 2015-01-18T19:46:23.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-03-22T19:35:48.000Z (about 11 years ago)
- Last Synced: 2025-02-16T19:48:25.129Z (over 1 year ago)
- Language: C
- Size: 148 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ctfdiff
CTF diff of two files.
## Build
```
$ ninja
```
### Dependencies
* libbsdctf
## Usage
```
ctfdiff [-afFhilLoOqtT] file1 file2
```
### General options
* `-h` help message
* `-q` quiet mode
* `-i` ignore integral types (allows for equality between 32bit and 64bit
memory models)
* `-a` compare all sections
### Label options
* `-l` compare all labels
### Object options
* `-o` compare all objects
* `-O name` compare object with the specified name (may repeat)
### Function options
* `-f` compare all functions
* `-F name` compare function with the specified name (may repeat)
### Type options
* `-s` compare structs and unions
* `-t` compare all types
* `-T name` compare type with the specified name (may repeat)
## Comparison algorithm
### Label
Two labels are equal, if they have the same name.
### Object
Two objects are equal, if they have the same name and type.
### Function
Two functions are equal, if they have the same name, return type and arguments
(both count- and type-wise)
### Type
Two types are equal, if they have the same kind and the variable data
(properties and lists) stored with the type is the same (e.g. member offsets, enum entry values, integer content, float encoding, ...).
#### Struct
Two structs are equal, if they have the same member names and member offsets.
## Exit status
The result of the diff can be determined also by the return code/exit status of the
program.
### 0
The requested diff query contains no differences.
### 1
The requested diff query contains differences.
### 2
Wrong arguments.
### 3
An error occurred during the execution.
## Run
```
$ ctfdiff -q -T 'struct proc' /boot/kernel.old/kernel /boot/kernel/kernel
$ echo $?
0
```
## Authors
* Daniel Lovasko lovasko@freebsd.org