mirror of
https://github.com/encounter/objdiff.git
synced 2025-12-17 17:05:29 +00:00
Compare commits
3 Commits
mips-gprel
...
v3.3.1
| Author | SHA1 | Date | |
|---|---|---|---|
| 2ad0898efa | |||
|
|
03f2bcb8b1 | ||
|
|
781071761a |
8
Cargo.lock
generated
8
Cargo.lock
generated
@@ -3484,7 +3484,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "objdiff-cli"
|
name = "objdiff-cli"
|
||||||
version = "3.3.0"
|
version = "3.3.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"argp",
|
"argp",
|
||||||
@@ -3507,7 +3507,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "objdiff-core"
|
name = "objdiff-core"
|
||||||
version = "3.3.0"
|
version = "3.3.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"arm-attr",
|
"arm-attr",
|
||||||
@@ -3563,7 +3563,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "objdiff-gui"
|
name = "objdiff-gui"
|
||||||
version = "3.3.0"
|
version = "3.3.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"argp",
|
"argp",
|
||||||
@@ -3601,7 +3601,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "objdiff-wasm"
|
name = "objdiff-wasm"
|
||||||
version = "3.3.0"
|
version = "3.3.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"log",
|
"log",
|
||||||
"objdiff-core",
|
"objdiff-core",
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ default-members = [
|
|||||||
resolver = "3"
|
resolver = "3"
|
||||||
|
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
version = "3.3.0"
|
version = "3.3.1"
|
||||||
authors = ["Luke Street <luke@street.dev>"]
|
authors = ["Luke Street <luke@street.dev>"]
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
|
|||||||
@@ -82,6 +82,27 @@
|
|||||||
"name": "Space between args",
|
"name": "Space between args",
|
||||||
"description": "Adds a space between arguments in the diff output."
|
"description": "Adds a space between arguments in the diff output."
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "showSymbolSizes",
|
||||||
|
"type": "choice",
|
||||||
|
"default": "off",
|
||||||
|
"name": "Show symbol sizes",
|
||||||
|
"description": "Shows symbol sizes in the symbol view.",
|
||||||
|
"items": [
|
||||||
|
{
|
||||||
|
"value": "off",
|
||||||
|
"name": "Off"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "hex",
|
||||||
|
"name": "Hex"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "decimal",
|
||||||
|
"name": "Decimal"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "combineDataSections",
|
"id": "combineDataSections",
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
@@ -296,6 +317,7 @@
|
|||||||
"properties": [
|
"properties": [
|
||||||
"functionRelocDiffs",
|
"functionRelocDiffs",
|
||||||
"demangler",
|
"demangler",
|
||||||
|
"showSymbolSizes",
|
||||||
"spaceBetweenArgs",
|
"spaceBetweenArgs",
|
||||||
"combineDataSections",
|
"combineDataSections",
|
||||||
"combineTextSections"
|
"combineTextSections"
|
||||||
|
|||||||
@@ -293,6 +293,7 @@ impl Arch for ArchMips {
|
|||||||
}
|
}
|
||||||
elf::R_MIPS_PC16 => 0, // PC-relative relocation
|
elf::R_MIPS_PC16 => 0, // PC-relative relocation
|
||||||
R_MIPS15_S3 => ((code & 0x001FFFC0) >> 3) as i64,
|
R_MIPS15_S3 => ((code & 0x001FFFC0) >> 3) as i64,
|
||||||
|
elf::R_MIPS_GPREL32 => (code as i32 as i64) + self.ri_gp_value as i64,
|
||||||
flags => bail!("Unsupported MIPS implicit relocation {flags:?}"),
|
flags => bail!("Unsupported MIPS implicit relocation {flags:?}"),
|
||||||
};
|
};
|
||||||
Ok(Some(RelocationOverride { target: RelocationOverrideTarget::Keep, addend }))
|
Ok(Some(RelocationOverride { target: RelocationOverrideTarget::Keep, addend }))
|
||||||
@@ -318,6 +319,7 @@ impl Arch for ArchMips {
|
|||||||
elf::R_MIPS_GOT16 => Some("R_MIPS_GOT16"),
|
elf::R_MIPS_GOT16 => Some("R_MIPS_GOT16"),
|
||||||
elf::R_MIPS_PC16 => Some("R_MIPS_PC16"),
|
elf::R_MIPS_PC16 => Some("R_MIPS_PC16"),
|
||||||
elf::R_MIPS_CALL16 => Some("R_MIPS_CALL16"),
|
elf::R_MIPS_CALL16 => Some("R_MIPS_CALL16"),
|
||||||
|
elf::R_MIPS_GPREL32 => Some("R_MIPS_GPREL32"),
|
||||||
R_MIPS15_S3 => Some("R_MIPS15_S3"),
|
R_MIPS15_S3 => Some("R_MIPS15_S3"),
|
||||||
_ => None,
|
_ => None,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ use objdiff_core::{
|
|||||||
config::ScratchConfig,
|
config::ScratchConfig,
|
||||||
diff::{
|
diff::{
|
||||||
ArmArchVersion, ArmR9Usage, DiffObjConfig, FunctionRelocDiffs, MipsAbi, MipsInstrCategory,
|
ArmArchVersion, ArmR9Usage, DiffObjConfig, FunctionRelocDiffs, MipsAbi, MipsInstrCategory,
|
||||||
X86Formatter,
|
ShowSymbolSizes, X86Formatter,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
use typed_path::{Utf8PlatformPathBuf, Utf8UnixPathBuf};
|
use typed_path::{Utf8PlatformPathBuf, Utf8UnixPathBuf};
|
||||||
@@ -227,6 +227,7 @@ pub struct DiffObjConfigV1 {
|
|||||||
pub relax_reloc_diffs: bool,
|
pub relax_reloc_diffs: bool,
|
||||||
#[serde(default = "bool_true")]
|
#[serde(default = "bool_true")]
|
||||||
pub space_between_args: bool,
|
pub space_between_args: bool,
|
||||||
|
pub show_symbol_sizes: ShowSymbolSizes,
|
||||||
pub combine_data_sections: bool,
|
pub combine_data_sections: bool,
|
||||||
// x86
|
// x86
|
||||||
pub x86_formatter: X86Formatter,
|
pub x86_formatter: X86Formatter,
|
||||||
@@ -248,6 +249,7 @@ impl Default for DiffObjConfigV1 {
|
|||||||
Self {
|
Self {
|
||||||
relax_reloc_diffs: false,
|
relax_reloc_diffs: false,
|
||||||
space_between_args: true,
|
space_between_args: true,
|
||||||
|
show_symbol_sizes: Default::default(),
|
||||||
combine_data_sections: false,
|
combine_data_sections: false,
|
||||||
x86_formatter: Default::default(),
|
x86_formatter: Default::default(),
|
||||||
mips_abi: Default::default(),
|
mips_abi: Default::default(),
|
||||||
@@ -272,6 +274,7 @@ impl DiffObjConfigV1 {
|
|||||||
FunctionRelocDiffs::default()
|
FunctionRelocDiffs::default()
|
||||||
},
|
},
|
||||||
space_between_args: self.space_between_args,
|
space_between_args: self.space_between_args,
|
||||||
|
show_symbol_sizes: self.show_symbol_sizes,
|
||||||
combine_data_sections: self.combine_data_sections,
|
combine_data_sections: self.combine_data_sections,
|
||||||
x86_formatter: self.x86_formatter,
|
x86_formatter: self.x86_formatter,
|
||||||
mips_abi: self.mips_abi,
|
mips_abi: self.mips_abi,
|
||||||
|
|||||||
@@ -665,6 +665,7 @@ fn diff_col_ui(
|
|||||||
appearance,
|
appearance,
|
||||||
column,
|
column,
|
||||||
open_sections,
|
open_sections,
|
||||||
|
diff_config,
|
||||||
) {
|
) {
|
||||||
match (column, action) {
|
match (column, action) {
|
||||||
(
|
(
|
||||||
@@ -703,6 +704,7 @@ fn diff_col_ui(
|
|||||||
appearance,
|
appearance,
|
||||||
column,
|
column,
|
||||||
open_sections,
|
open_sections,
|
||||||
|
diff_config,
|
||||||
) {
|
) {
|
||||||
ret = Some(result);
|
ret = Some(result);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ use egui::{
|
|||||||
};
|
};
|
||||||
use objdiff_core::{
|
use objdiff_core::{
|
||||||
diff::{
|
diff::{
|
||||||
ObjectDiff, SymbolDiff,
|
DiffObjConfig, ObjectDiff, ShowSymbolSizes, SymbolDiff,
|
||||||
display::{
|
display::{
|
||||||
HighlightKind, SectionDisplay, SymbolFilter, SymbolNavigationKind, display_sections,
|
HighlightKind, SectionDisplay, SymbolFilter, SymbolNavigationKind, display_sections,
|
||||||
symbol_context, symbol_hover,
|
symbol_context, symbol_hover,
|
||||||
@@ -525,6 +525,7 @@ fn symbol_ui(
|
|||||||
state: &SymbolViewState,
|
state: &SymbolViewState,
|
||||||
appearance: &Appearance,
|
appearance: &Appearance,
|
||||||
column: usize,
|
column: usize,
|
||||||
|
diff_config: &DiffObjConfig,
|
||||||
) -> Option<DiffViewAction> {
|
) -> Option<DiffViewAction> {
|
||||||
let mut ret = None;
|
let mut ret = None;
|
||||||
let mut job = LayoutJob::default();
|
let mut job = LayoutJob::default();
|
||||||
@@ -572,6 +573,21 @@ fn symbol_ui(
|
|||||||
write_text(") ", appearance.text_color, &mut job, appearance.code_font.clone());
|
write_text(") ", appearance.text_color, &mut job, appearance.code_font.clone());
|
||||||
}
|
}
|
||||||
write_text(name, appearance.highlight_color, &mut job, appearance.code_font.clone());
|
write_text(name, appearance.highlight_color, &mut job, appearance.code_font.clone());
|
||||||
|
if diff_config.show_symbol_sizes == ShowSymbolSizes::Decimal {
|
||||||
|
write_text(
|
||||||
|
&format!(" (size={})", symbol.size),
|
||||||
|
appearance.deemphasized_text_color,
|
||||||
|
&mut job,
|
||||||
|
appearance.code_font.clone(),
|
||||||
|
);
|
||||||
|
} else if diff_config.show_symbol_sizes == ShowSymbolSizes::Hex {
|
||||||
|
write_text(
|
||||||
|
&format!(" (size={:x})", symbol.size),
|
||||||
|
appearance.deemphasized_text_color,
|
||||||
|
&mut job,
|
||||||
|
appearance.code_font.clone(),
|
||||||
|
);
|
||||||
|
}
|
||||||
let response = egui::Button::selectable(selected, job)
|
let response = egui::Button::selectable(selected, job)
|
||||||
.ui(ui)
|
.ui(ui)
|
||||||
.on_hover_ui_at_pointer(|ui| symbol_hover_ui(ui, ctx, symbol_idx, appearance));
|
.on_hover_ui_at_pointer(|ui| symbol_hover_ui(ui, ctx, symbol_idx, appearance));
|
||||||
@@ -646,6 +662,7 @@ pub fn symbol_list_ui(
|
|||||||
appearance: &Appearance,
|
appearance: &Appearance,
|
||||||
column: usize,
|
column: usize,
|
||||||
open_sections: Option<bool>,
|
open_sections: Option<bool>,
|
||||||
|
diff_config: &DiffObjConfig,
|
||||||
) -> Option<DiffViewAction> {
|
) -> Option<DiffViewAction> {
|
||||||
let mut ret = None;
|
let mut ret = None;
|
||||||
ScrollArea::both().auto_shrink([false, false]).show(ui, |ui| {
|
ScrollArea::both().auto_shrink([false, false]).show(ui, |ui| {
|
||||||
@@ -770,6 +787,7 @@ pub fn symbol_list_ui(
|
|||||||
state,
|
state,
|
||||||
appearance,
|
appearance,
|
||||||
column,
|
column,
|
||||||
|
diff_config,
|
||||||
) {
|
) {
|
||||||
ret = Some(result);
|
ret = Some(result);
|
||||||
}
|
}
|
||||||
|
|||||||
8
objdiff-wasm/package-lock.json
generated
8
objdiff-wasm/package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "objdiff-wasm",
|
"name": "objdiff-wasm",
|
||||||
"version": "3.3.0",
|
"version": "3.3.1",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "objdiff-wasm",
|
"name": "objdiff-wasm",
|
||||||
"version": "3.3.0",
|
"version": "3.3.1",
|
||||||
"license": "MIT OR Apache-2.0",
|
"license": "MIT OR Apache-2.0",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@biomejs/biome": "^1.9.3",
|
"@biomejs/biome": "^1.9.3",
|
||||||
@@ -852,6 +852,7 @@
|
|||||||
"integrity": "sha512-Y3b4Y7lGIvNPywspP38deHkp/EEkTXrJEHeX1K5yz8U/94PkWvPlDebjjiSvmI6TT+9iVzsq22qDlBEdDuJZhA==",
|
"integrity": "sha512-Y3b4Y7lGIvNPywspP38deHkp/EEkTXrJEHeX1K5yz8U/94PkWvPlDebjjiSvmI6TT+9iVzsq22qDlBEdDuJZhA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@rspack/core": "1.2.3",
|
"@rspack/core": "1.2.3",
|
||||||
"@rspack/lite-tapable": "~1.0.1",
|
"@rspack/lite-tapable": "~1.0.1",
|
||||||
@@ -1083,6 +1084,7 @@
|
|||||||
"integrity": "sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g==",
|
"integrity": "sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"tslib": "^2.8.0"
|
"tslib": "^2.8.0"
|
||||||
}
|
}
|
||||||
@@ -2139,6 +2141,7 @@
|
|||||||
"integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==",
|
"integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=12"
|
"node": ">=12"
|
||||||
},
|
},
|
||||||
@@ -2166,6 +2169,7 @@
|
|||||||
"integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==",
|
"integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
|
"peer": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"tsc": "bin/tsc",
|
"tsc": "bin/tsc",
|
||||||
"tsserver": "bin/tsserver"
|
"tsserver": "bin/tsserver"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "objdiff-wasm",
|
"name": "objdiff-wasm",
|
||||||
"version": "3.3.0",
|
"version": "3.3.1",
|
||||||
"description": "A local diffing tool for decompilation projects.",
|
"description": "A local diffing tool for decompilation projects.",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Luke Street",
|
"name": "Luke Street",
|
||||||
|
|||||||
Reference in New Issue
Block a user