You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- WebAssembly API, [web interface](https://github.com/encounter/objdiff-web) and [Visual Studio Code extension](https://marketplace.visualstudio.com/items?itemName=decomp-dev.objdiff) (WIP)
16
18
17
19
Supports:
18
20
@@ -40,7 +42,7 @@ For Linux and macOS, run `chmod +x objdiff-*` to make the binary executable.
40
42
41
43
### CLI
42
44
43
-
CLI binaries can be found on the [releases page](https://github.com/encounter/objdiff/releases).
45
+
CLI binaries are available on the [releases page](https://github.com/encounter/objdiff/releases).
44
46
45
47
## Screenshots
46
48
@@ -49,33 +51,30 @@ CLI binaries can be found on the [releases page](https://github.com/encounter/ob
49
51
50
52
## Usage
51
53
52
-
objdiff works by comparing two relocatable object files (`.o`). The objects are expected to have the same relative path
53
-
from the "target" and "base" directories.
54
+
objdiff compares two relocatable object files (`.o`). Here's how it works:
54
55
55
-
For example, if the target ("expected") object is located at `build/asm/MetroTRK/mslsupp.o` and the base ("actual")
56
-
object is located at `build/src/MetroTRK/mslsupp.o`, the following configuration would be used:
56
+
1.**Create an `objdiff.json` configuration file** in your project root (or generate it with your build script).
57
+
This file lists **all objects in the project** with their target ("expected") and base ("current") paths.
57
58
58
-
- Target build directory: `build/asm`
59
-
- Base build directory: `build/src`
60
-
- Object: `MetroTRK/mslsupp.o`
59
+
2.**Load the project** in objdiff.
61
60
62
-
objdiff will then execute the build system from the project directory to build both objects:
61
+
3.**Select an object**from the sidebar to begin diffing.
63
62
64
-
```sh
65
-
$ make build/asm/MetroTRK/mslsupp.o # Only if "Build target object" is enabled
66
-
$ make build/src/MetroTRK/mslsupp.o
67
-
```
63
+
4.**objdiff automatically:**
64
+
- Executes the build system to compile the base object (from current source code)
65
+
- Compares the two objects and displays the differences
66
+
- Watches for source file changes and rebuilds when detected
68
67
69
-
The objects will then be compared and the results will be displayed in the UI.
68
+
The configuration file allows complete flexibility in project structure - your build directories can have any layout as long as the paths are specified correctly.
70
69
71
-
See [Configuration](#configuration) for more information.
70
+
See [Configuration](#configuration) for setup details.
72
71
73
72
## Configuration
74
73
75
-
While **not required** (most settings can be specified in the UI), projects can add an `objdiff.json` file to configure the tool automatically. The configuration file must be located in
74
+
Projects can add an `objdiff.json` file to configure the tool automatically. The configuration file must be located in
76
75
the root project directory.
77
76
78
-
If your project has a generator script (e.g. `configure.py`), it's recommended to generate the objdiff configuration
77
+
If your project has a generator script (e.g. `configure.py`), it's highly recommended to generate the objdiff configuration
79
78
file as well. You can then add `objdiff.json` to your `.gitignore` to prevent it from being committed.
80
79
81
80
```json
@@ -128,78 +127,69 @@ file as well. You can then add `objdiff.json` to your `.gitignore` to prevent it
128
127
129
128
### Schema
130
129
131
-
View [config.schema.json](config.schema.json) for all available options. The below list is a summary of the most important options.
130
+
> [!NOTE]
131
+
> View [config.schema.json](config.schema.json) for all available options. Below is a summary of the most important options.
132
+
133
+
#### Build Configuration
134
+
135
+
**`custom_make`**_(optional, default: `"make"`)_
136
+
If the project uses a different build system (e.g. `ninja`), specify it here. The build command will be `[custom_make] [custom_args] path/to/object.o`.
132
137
133
-
`custom_make`_(optional)_: By default, objdiff will use `make` to build the project.
134
-
If the project uses a different build system (e.g. `ninja`), specify it here.
135
-
The build command will be `[custom_make] [custom_args] path/to/object.o`.
138
+
**`custom_args`**_(optional)_
139
+
Additional arguments to pass to the build command prior to the object path.
136
140
137
-
`custom_args`_(optional)_: Additional arguments to pass to the build command prior to the object path.
141
+
**`build_target`**_(default: `false`)_
142
+
If true, objdiff will build the target objects before diffing (e.g. `make path/to/target.o`). Useful if target objects are not built by default or can change based on project configuration. Requires proper build system configuration.
138
143
139
-
`build_target`: If true, objdiff will tell the build system to build the target objects before diffing (e.g.
140
-
`make path/to/target.o`).
141
-
This is useful if the target objects are not built by default or can change based on project configuration or edits
142
-
to assembly files.
143
-
Requires the build system to be configured properly.
144
+
**`build_base`**_(default: `true`)_
145
+
If true, objdiff will build the base objects before diffing (e.g. `make path/to/base.o`). It's unlikely you'll want to disable this unless using an external tool to rebuild the base object.
144
146
145
-
`build_base`: If true, objdiff will tell the build system to build the base objects before diffing (e.g. `make path/to/base.o`).
146
-
It's unlikely you'll want to disable this, unless you're using an external tool to rebuild the base object on source file changes.
147
+
#### File Watching
147
148
148
-
`watch_patterns`_(optional)_: A list of glob patterns to watch for changes.
A list of glob patterns to watch for changes ([supported syntax](https://docs.rs/globset/latest/globset/#syntax)). When these files change, objdiff automatically rebuilds and re-compares objects.
152
151
153
-
`ignore_patterns`_(optional)_: A list of glob patterns to explicitly ignore when watching for changes.
Copy file name to clipboardExpand all lines: config.schema.json
+10-10Lines changed: 10 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@
15
15
},
16
16
"custom_make": {
17
17
"type": "string",
18
-
"description": "By default, objdiff will use make to build the project.\nIf the project uses a different build system (e.g. ninja), specify it here.\nThe build command will be `[custom_make] [custom_args] path/to/object.o`.",
18
+
"description": "If the project uses a different build system (e.g. ninja), specify it here.\nThe build command will be `[custom_make] [custom_args] path/to/object.o`.",
19
19
"examples": [
20
20
"make",
21
21
"ninja"
@@ -41,17 +41,17 @@
41
41
},
42
42
"build_target": {
43
43
"type": "boolean",
44
-
"description": "If true, objdiff will tell the build system to build the target objects before diffing (e.g. `make path/to/target.o`).\nThis is useful if the target objects are not built by default or can change based on project configuration or edits to assembly files.\nRequires the build system to be configured properly.",
44
+
"description": "If true, objdiff will build the target objects before diffing (e.g. `make path/to/target.o`).\nUseful if target objects are not built by default or can change based on project configuration.\nRequires proper build system configuration.",
45
45
"default": false
46
46
},
47
47
"build_base": {
48
48
"type": "boolean",
49
-
"description": "If true, objdiff will tell the build system to build the base objects before diffing (e.g. `make path/to/base.o`).\nIt's unlikely you'll want to disable this, unless you're using an external tool to rebuild the base object on source file changes.",
49
+
"description": "If true, objdiff will build the base objects before diffing (e.g. `make path/to/base.o`).\nIt's unlikely you'll want to disable this unless using an external tool to rebuild the base object.",
50
50
"default": true
51
51
},
52
52
"watch_patterns": {
53
53
"type": "array",
54
-
"description": "List of glob patterns to watch for changes in the project.\nIf any of these files change, objdiff will automatically rebuild the objects and re-compare them.\nSupported syntax: https://docs.rs/globset/latest/globset/#syntax",
54
+
"description": "A list of glob patterns to watch for changes.\nWhen these files change, objdiff automatically rebuilds and re-compares objects.\nSupported syntax: https://docs.rs/globset/latest/globset/#syntax",
55
55
"items": {
56
56
"type": "string"
57
57
},
@@ -82,7 +82,7 @@
82
82
},
83
83
"ignore_patterns": {
84
84
"type": "array",
85
-
"description": "List of glob patterns to explicitly ignore when watching for changes.\nFiles matching these patterns will not trigger a rebuild.\nSupported syntax: https://docs.rs/globset/latest/globset/#syntax",
85
+
"description": "A list of glob patterns to explicitly ignore when watching for changes.\nSupported syntax: https://docs.rs/globset/latest/globset/#syntax",
86
86
"items": {
87
87
"type": "string"
88
88
},
@@ -119,7 +119,7 @@
119
119
"properties": {
120
120
"name": {
121
121
"type": "string",
122
-
"description": "The name of the object in the UI. If not specified, the object's path will be used."
122
+
"description": "The display name in the UI. Defaults to the object's path."
123
123
},
124
124
"path": {
125
125
"type": "string",
@@ -128,11 +128,11 @@
128
128
},
129
129
"target_path": {
130
130
"type": "string",
131
-
"description": "Path to the target object from the project root.\nRequired if path is not specified."
131
+
"description": "Path to the \"target\" or \"expected\" object (the intended result)."
132
132
},
133
133
"base_path": {
134
134
"type": "string",
135
-
"description": "Path to the baseobject from the project root.\nRequired if path is not specified."
135
+
"description": "Path to the \"base\" or \"current\"object (built from current source code).\nOmit if there is no source object yet."
136
136
},
137
137
"reverse_fn_order": {
138
138
"type": "boolean",
@@ -207,7 +207,7 @@
207
207
"properties": {
208
208
"complete": {
209
209
"type": "boolean",
210
-
"description": "Marks the object as \"complete\" (or \"linked\") in the object list.\nThis is useful for marking objects that are fully decompiled. A value of `false` will mark the object as \"incomplete\"."
210
+
"description": "Marks the object as \"complete\" (linked) when `true` or \"incomplete\" when `false`."
211
211
},
212
212
"reverse_fn_order": {
213
213
"type": "boolean",
@@ -227,7 +227,7 @@
227
227
},
228
228
"auto_generated": {
229
229
"type": "boolean",
230
-
"description": "Hides the object from the object list by default, but still includes it in reports."
230
+
"description": "Hides the object from the sidebar but includes it in progress reports."
0 commit comments