Compare commits

..

No commits in common. "main" and "v3.0.0-beta.6" have entirely different histories.

53 changed files with 898 additions and 2320 deletions

View File

@ -1,4 +1,5 @@
# statically link the C runtime so the executable does not depend on
# that shared/dynamic library.
[target.'cfg(all(target_env = "msvc", target_os = "windows"))']
rustflags = ["-C", "target-feature=+crt-static"]
[target.x86_64-pc-windows-msvc]
linker = "rust-lld"
[target.aarch64-pc-windows-msvc]
linker = "rust-lld"

689
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -14,7 +14,7 @@ strip = "debuginfo"
codegen-units = 1
[workspace.package]
version = "3.0.0-beta.9"
version = "3.0.0-beta.6"
authors = ["Luke Street <luke@street.dev>"]
edition = "2024"
license = "MIT OR Apache-2.0"

View File

@ -16,12 +16,11 @@ Features:
Supports:
- ARM (GBA, DS, 3DS)
- ARM64 (Switch)
- PowerPC 750CL (GameCube, Wii)
- MIPS (N64, PS1, PS2, PSP)
- PowerPC (GameCube, Wii)
- SuperH (Saturn, Dreamcast)
- x86 (COFF only)
- x86 (COFF only at the moment)
- ARM (GBA, DS, 3DS)
- ARM64 (Switch, experimental)
See [Usage](#usage) for more information.

View File

@ -175,10 +175,6 @@
"type": "boolean",
"description": "If true, objdiff will run the build command with the context file as an argument to generate it.",
"default": false
},
"preset_id": {
"type": "number",
"description": "The decomp.me preset ID to use for the scratch.\nCompiler and flags in the config will take precedence over the preset, but the preset is useful for organizational purposes."
}
},
"required": [

View File

@ -103,7 +103,6 @@ allow = [
"0BSD",
"OFL-1.1",
"Ubuntu-font-1.0",
"CDLA-Permissive-2.0",
]
# The confidence threshold for detecting a license from license text.
# The higher the value, the more closely the license text must be to the

View File

@ -28,7 +28,7 @@ supports-color = "3.0"
time = { version = "0.3", features = ["formatting", "local-offset"] }
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
typed-path = "0.11"
typed-path = "0.10"
[target.'cfg(target_env = "musl")'.dependencies]
mimalloc = "0.1"

View File

@ -85,9 +85,6 @@ pub fn run(args: Args) -> Result<()> {
fn generate(args: GenerateArgs) -> Result<()> {
let mut diff_config = diff::DiffObjConfig {
function_reloc_diffs: diff::FunctionRelocDiffs::None,
combine_data_sections: true,
combine_text_sections: true,
ppc_calculate_pool_relocations: false,
..Default::default()
};
apply_config_args(&mut diff_config, &args.config)?;
@ -228,7 +225,6 @@ fn report_object(
demangled_name: None,
virtual_address: section.virtual_address,
}),
address: None,
});
match section.kind {
@ -276,7 +272,6 @@ fn report_object(
demangled_name: symbol.demangled_name.clone(),
virtual_address: symbol.virtual_address,
}),
address: symbol.address.checked_sub(section.address),
});
if match_percent == 100.0 {
measures.matched_functions += 1;
@ -284,16 +279,6 @@ fn report_object(
measures.total_functions += 1;
}
}
sections.sort_by(|a, b| a.name.cmp(&b.name));
let reverse_fn_order = object.metadata.reverse_fn_order.unwrap_or(false);
functions.sort_by(|a, b| {
if reverse_fn_order {
b.address.unwrap_or(0).cmp(&a.address.unwrap_or(0))
} else {
a.address.unwrap_or(u64::MAX).cmp(&b.address.unwrap_or(u64::MAX))
}
.then_with(|| a.size.cmp(&b.size))
});
if metadata.complete.unwrap_or(false) {
measures.complete_code = measures.total_code;
measures.complete_data = measures.total_data;

View File

@ -450,11 +450,11 @@ impl UiView for FunctionDiffUi {
fn reload(&mut self, state: &AppState) -> Result<()> {
let left_sym =
state.left_obj.as_ref().and_then(|(o, _)| o.symbol_by_name(&self.symbol_name));
state.left_obj.as_ref().and_then(|(o, _)| find_function(o, &self.symbol_name));
let right_sym =
state.right_obj.as_ref().and_then(|(o, _)| o.symbol_by_name(&self.symbol_name));
state.right_obj.as_ref().and_then(|(o, _)| find_function(o, &self.symbol_name));
let prev_sym =
state.prev_obj.as_ref().and_then(|(o, _)| o.symbol_by_name(&self.symbol_name));
state.prev_obj.as_ref().and_then(|(o, _)| find_function(o, &self.symbol_name));
self.num_rows = match (
get_symbol(state.left_obj.as_ref(), left_sym),
get_symbol(state.right_obj.as_ref(), right_sym),
@ -650,3 +650,12 @@ fn get_symbol(
let sym = sym?;
Some((obj, sym, &diff.symbols[sym]))
}
fn find_function(obj: &Object, name: &str) -> Option<usize> {
for (symbol_idx, symbol) in obj.symbols.iter().enumerate() {
if symbol.name == name {
return Some(symbol_idx);
}
}
None
}

View File

@ -41,7 +41,6 @@ any-arch = [
"dep:regex",
"dep:similar",
"dep:syn",
"dep:encoding_rs"
]
bindings = [
"dep:prost",
@ -134,7 +133,7 @@ prost = { version = "0.13", default-features = false, features = ["prost-derive"
regex = { version = "1.11", default-features = false, features = [], optional = true }
serde = { version = "1.0", default-features = false, features = ["derive"], optional = true }
similar = { version = "2.7", default-features = false, features = ["hashbrown"], optional = true, git = "https://github.com/encounter/similar.git", branch = "no_std" }
typed-path = { version = "0.11", default-features = false, optional = true }
typed-path = { version = "0.10", default-features = false, optional = true }
# config
globset = { version = "0.4", default-features = false, optional = true }
@ -159,7 +158,7 @@ iced-x86 = { version = "1.21", default-features = false, features = ["decoder",
msvc-demangler = { version = "0.11", optional = true }
# arm
unarm = { version = "1.8", optional = true }
unarm = { version = "1.7", optional = true }
arm-attr = { version = "0.2", optional = true }
# arm64
@ -172,7 +171,7 @@ notify-debouncer-full = { version = "0.5.0", optional = true }
shell-escape = { version = "0.1", optional = true }
tempfile = { version = "3.19", optional = true }
time = { version = "0.3", optional = true }
encoding_rs = { version = "0.8.35", optional = true }
encoding_rs = "0.8.35"
[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3", optional = true }
@ -201,4 +200,4 @@ syn = { version = "2.0", optional = true }
[dev-dependencies]
# Enable all features for tests
objdiff-core = { path = ".", features = ["all"] }
insta = "1.43"
insta = "1.42"

View File

@ -5,12 +5,11 @@ objdiff-core contains the core functionality of [objdiff](https://github.com/enc
## Crate feature flags
- **`all`**: Enables all main features.
- **`bindings`**: Enables serialization and deserialization of objdiff data structures.
- **`config`**: Enables objdiff configuration file support.
- **`dwarf`**: Enables extraction of line number information from DWARF debug sections.
- **`arm64`**: Enables the ARM64 backend powered by [yaxpeax-arm](https://github.com/iximeow/yaxpeax-arm).
- **`arm`**: Enables the ARM backend powered by [unarm](https://github.com/AetiasHax/unarm).
- **`mips`**: Enables the MIPS backend powered by [rabbitizer](https://github.com/Decompollaborate/rabbitizer).
- **`mips`**: Enables the MIPS backend powered by [rabbitizer](https://github.com/Decompollaborate/rabbitizer). (Note: C library with Rust bindings)
- **`ppc`**: Enables the PowerPC backend powered by [ppc750cl](https://github.com/encounter/ppc750cl).
- **`superh`**: Enables the SuperH backend powered by an included disassembler.
- **`x86`**: Enables the x86 backend powered by [iced-x86](https://crates.io/crates/iced-x86).
- **`arm`**: Enables the ARM backend powered by [unarm](https://github.com/AetiasHax/unarm).
- **`arm64`**: Enables the ARM64 backend powered by [yaxpeax-arm](https://github.com/iximeow/yaxpeax-arm).
- **`bindings`**: Enables serialization and deserialization of objdiff data structures.

View File

@ -99,8 +99,6 @@ message ReportItem {
float fuzzy_match_percent = 3;
// Extra metadata for this item
optional ReportItemMetadata metadata = 4;
// Address of the item (section-relative offset)
optional uint64 address = 5;
}
// Extra metadata for an item

View File

@ -15,7 +15,7 @@ use crate::{
diff::{ArmArchVersion, ArmR9Usage, DiffObjConfig, display::InstructionPart},
obj::{
InstructionRef, Relocation, RelocationFlags, ResolvedInstructionRef, ResolvedRelocation,
Section, SectionKind, Symbol, SymbolFlag, SymbolFlagSet, SymbolKind,
ScannedInstruction, Section, SectionKind, Symbol, SymbolFlag, SymbolFlagSet, SymbolKind,
},
};
@ -187,14 +187,14 @@ impl Arch for ArchArm {
self.disasm_modes = Self::get_mapping_symbols(sections, symbols);
}
fn scan_instructions_internal(
fn scan_instructions(
&self,
address: u64,
code: &[u8],
section_index: usize,
_relocations: &[Relocation],
diff_config: &DiffObjConfig,
) -> Result<Vec<InstructionRef>> {
) -> Result<Vec<ScannedInstruction>> {
let start_addr = address as u32;
let end_addr = start_addr + code.len() as u32;
@ -219,13 +219,13 @@ impl Arch for ArchArm {
let mut next_mapping = mappings_iter.next();
let ins_count = code.len() / mode.instruction_size(start_addr);
let mut ops = Vec::<InstructionRef>::with_capacity(ins_count);
let mut ops = Vec::<ScannedInstruction>::with_capacity(ins_count);
let parse_flags = self.parse_flags(diff_config);
let mut address = start_addr;
while address < end_addr {
while let Some(next) = next_mapping.filter(|x| address >= x.address) {
while let Some(next) = next_mapping.take_if(|x| address >= x.address) {
// Change mapping
mode = next.mapping;
next_mapping = mappings_iter.next();
@ -235,10 +235,12 @@ impl Arch for ArchArm {
let data = &code[(address - start_addr) as usize..];
if data.len() < ins_size {
// Push the remainder as data
ops.push(InstructionRef {
ops.push(ScannedInstruction {
ins_ref: InstructionRef {
address: address as u64,
size: data.len() as u8,
opcode: u16::MAX,
},
branch_dest: None,
});
break;
@ -254,10 +256,12 @@ impl Arch for ArchArm {
}
_ => {
// Invalid instruction size
ops.push(InstructionRef {
ops.push(ScannedInstruction {
ins_ref: InstructionRef {
address: address as u64,
size: ins_size as u8,
opcode: u16::MAX,
},
branch_dest: None,
});
address += ins_size as u32;
@ -321,10 +325,8 @@ impl Arch for ArchArm {
unarm::ParseMode::Data => (u16::MAX, None),
};
ops.push(InstructionRef {
address: address as u64,
size: ins_size as u8,
opcode,
ops.push(ScannedInstruction {
ins_ref: InstructionRef { address: address as u64, size: ins_size as u8, opcode },
branch_dest: branch_dest.map(|x| x as u64),
});
address += ins_size as u32;

View File

@ -18,6 +18,7 @@ use crate::{
diff::{DiffObjConfig, display::InstructionPart},
obj::{
InstructionRef, Relocation, RelocationFlags, ResolvedInstructionRef, ResolvedRelocation,
ScannedInstruction,
},
};
@ -29,16 +30,16 @@ impl ArchArm64 {
}
impl Arch for ArchArm64 {
fn scan_instructions_internal(
fn scan_instructions(
&self,
address: u64,
code: &[u8],
_section_index: usize,
_relocations: &[Relocation],
_diff_config: &DiffObjConfig,
) -> Result<Vec<InstructionRef>> {
) -> Result<Vec<ScannedInstruction>> {
let start_address = address;
let mut ops = Vec::<InstructionRef>::with_capacity(code.len() / 4);
let mut ops = Vec::<ScannedInstruction>::with_capacity(code.len() / 4);
let mut reader = U8Reader::new(code);
let decoder = InstDecoder::default();
@ -57,10 +58,8 @@ impl Arch for ArchArm64 {
DecodeError::InvalidOpcode
| DecodeError::InvalidOperand
| DecodeError::IncompleteDecoder => {
ops.push(InstructionRef {
address,
size: 4,
opcode: u16::MAX,
ops.push(ScannedInstruction {
ins_ref: InstructionRef { address, size: 4, opcode: u16::MAX },
branch_dest: None,
});
continue;
@ -69,9 +68,9 @@ impl Arch for ArchArm64 {
}
let opcode = opcode_to_u16(ins.opcode);
let branch_dest =
branch_dest(opcode, address, &code[offset as usize..offset as usize + 4]);
ops.push(InstructionRef { address, size: 4, opcode, branch_dest });
let ins_ref = InstructionRef { address, size: 4, opcode };
let branch_dest = branch_dest(ins_ref, &code[offset as usize..offset as usize + 4]);
ops.push(ScannedInstruction { ins_ref, branch_dest });
}
Ok(ops)
@ -164,7 +163,7 @@ impl Arch for ArchArm64 {
}
}
fn branch_dest(opcode: u16, address: u64, code: &[u8]) -> Option<u64> {
fn branch_dest(ins_ref: InstructionRef, code: &[u8]) -> Option<u64> {
const OPCODE_B: u16 = opcode_to_u16(Opcode::B);
const OPCODE_BL: u16 = opcode_to_u16(Opcode::BL);
const OPCODE_BCC: u16 = opcode_to_u16(Opcode::Bcc(0));
@ -174,21 +173,21 @@ fn branch_dest(opcode: u16, address: u64, code: &[u8]) -> Option<u64> {
const OPCODE_TBNZ: u16 = opcode_to_u16(Opcode::TBNZ);
let word = u32::from_le_bytes(code.try_into().ok()?);
match opcode {
match ins_ref.opcode {
OPCODE_B | OPCODE_BL => {
let offset = ((word & 0x03ff_ffff) << 2) as i32;
let extended_offset = (offset << 4) >> 4;
address.checked_add_signed(extended_offset as i64)
ins_ref.address.checked_add_signed(extended_offset as i64)
}
OPCODE_BCC | OPCODE_CBZ | OPCODE_CBNZ => {
let offset = (word as i32 & 0x00ff_ffe0) >> 3;
let extended_offset = (offset << 11) >> 11;
address.checked_add_signed(extended_offset as i64)
ins_ref.address.checked_add_signed(extended_offset as i64)
}
OPCODE_TBZ | OPCODE_TBNZ => {
let offset = (word as i32 & 0x0007_ffe0) >> 3;
let extended_offset = (offset << 16) >> 16;
address.checked_add_signed(extended_offset as i64)
ins_ref.address.checked_add_signed(extended_offset as i64)
}
_ => None,
}

View File

@ -3,6 +3,7 @@ use alloc::{
string::{String, ToString},
vec::Vec,
};
use core::ops::Range;
use anyhow::{Result, bail};
use object::{Endian as _, Object as _, ObjectSection as _, ObjectSymbol as _, elf};
@ -18,7 +19,7 @@ use crate::{
diff::{DiffObjConfig, MipsAbi, MipsInstrCategory, display::InstructionPart},
obj::{
InstructionArg, InstructionArgValue, InstructionRef, Relocation, RelocationFlags,
ResolvedInstructionRef, ResolvedRelocation, SymbolFlag, SymbolFlagSet,
ResolvedInstructionRef, ResolvedRelocation, ScannedInstruction, SymbolFlag, SymbolFlagSet,
},
};
@ -188,16 +189,16 @@ impl ArchMips {
}
impl Arch for ArchMips {
fn scan_instructions_internal(
fn scan_instructions(
&self,
address: u64,
code: &[u8],
_section_index: usize,
_relocations: &[Relocation],
diff_config: &DiffObjConfig,
) -> Result<Vec<InstructionRef>> {
) -> Result<Vec<ScannedInstruction>> {
let instruction_flags = self.instruction_flags(diff_config);
let mut ops = Vec::<InstructionRef>::with_capacity(code.len() / 4);
let mut ops = Vec::<ScannedInstruction>::with_capacity(code.len() / 4);
let mut cur_addr = address as u32;
for chunk in code.chunks_exact(4) {
let code = self.endianness.read_u32_bytes(chunk.try_into()?);
@ -205,7 +206,10 @@ impl Arch for ArchMips {
rabbitizer::Instruction::new(code, Vram::new(cur_addr), instruction_flags);
let opcode = instruction.opcode() as u16;
let branch_dest = instruction.get_branch_vram_generic().map(|v| v.inner() as u64);
ops.push(InstructionRef { address: cur_addr as u64, size: 4, opcode, branch_dest });
ops.push(ScannedInstruction {
ins_ref: InstructionRef { address: cur_addr as u64, size: 4, opcode },
branch_dest,
});
cur_addr += 4;
}
Ok(ops)
@ -221,7 +225,16 @@ impl Arch for ArchMips {
let display_flags = self.instruction_display_flags(diff_config);
let opcode = instruction.opcode();
cb(InstructionPart::opcode(opcode.name(), opcode as u16))?;
push_args(&instruction, resolved.relocation, &display_flags, cb)?;
let start_address = resolved.symbol.address;
let function_range = start_address..start_address + resolved.symbol.size;
push_args(
&instruction,
resolved.relocation,
function_range,
resolved.section_index,
&display_flags,
cb,
)?;
Ok(())
}
@ -325,6 +338,8 @@ impl Arch for ArchMips {
fn push_args(
instruction: &rabbitizer::Instruction,
relocation: Option<ResolvedRelocation>,
function_range: Range<u64>,
section_index: usize,
display_flags: &rabbitizer::InstructionDisplayFlags,
mut arg_cb: impl FnMut(InstructionPart) -> Result<()>,
) -> Result<()> {
@ -347,7 +362,23 @@ fn push_args(
}
ValuedOperand::core_label(..) | ValuedOperand::core_branch_target_label(..) => {
if let Some(resolved) = relocation {
// If the relocation target is within the current function, we can
// convert it into a relative branch target. Note that we check
// target_address > start_address instead of >= so that recursive
// tail calls are not considered branch targets.
let target_address =
resolved.symbol.address.checked_add_signed(resolved.relocation.addend);
if resolved.symbol.section == Some(section_index)
&& target_address.is_some_and(|addr| {
addr > function_range.start && addr < function_range.end
})
{
// TODO move this logic up a level
let target_address = target_address.unwrap();
arg_cb(InstructionPart::branch_dest(target_address))?;
} else {
push_reloc(resolved.relocation, &mut arg_cb)?;
}
} else if let Some(branch_dest) = instruction
.get_branch_offset_generic()
.map(|o| (instruction.vram() + o).inner() as u64)

View File

@ -11,8 +11,8 @@ use crate::{
display::{ContextItem, HoverItem, InstructionPart},
},
obj::{
InstructionArg, InstructionRef, Object, ParsedInstruction, Relocation, RelocationFlags,
ResolvedInstructionRef, ResolvedSymbol, Section, Symbol, SymbolFlagSet, SymbolKind,
InstructionArg, Object, ParsedInstruction, Relocation, RelocationFlags,
ResolvedInstructionRef, ScannedInstruction, Section, Symbol, SymbolFlagSet, SymbolKind,
},
util::ReallySigned,
};
@ -182,120 +182,8 @@ impl DataType {
}
}
impl dyn Arch {
/// Generate a list of instructions references (offset, size, opcode) from the given code.
///
/// See [`scan_instructions_internal`] for more details.
pub fn scan_instructions(
&self,
resolved: ResolvedSymbol,
diff_config: &DiffObjConfig,
) -> Result<Vec<InstructionRef>> {
let mut result = self.scan_instructions_internal(
resolved.symbol.address,
resolved.data,
resolved.section_index,
&resolved.section.relocations,
diff_config,
)?;
let function_start = resolved.symbol.address;
let function_end = function_start + resolved.symbol.size;
// Remove any branch destinations that are outside the function range
for ins in result.iter_mut() {
if let Some(branch_dest) = ins.branch_dest {
if branch_dest < function_start || branch_dest >= function_end {
ins.branch_dest = None;
}
}
}
// Resolve relocation targets within the same function to branch destinations
let mut ins_iter = result.iter_mut().peekable();
'outer: for reloc in resolved
.section
.relocations
.iter()
.skip_while(|r| r.address < function_start)
.take_while(|r| r.address < function_end)
{
let ins = loop {
let Some(ins) = ins_iter.peek_mut() else {
break 'outer;
};
if reloc.address < ins.address {
continue 'outer;
}
let ins = ins_iter.next().unwrap();
if reloc.address >= ins.address && reloc.address < ins.address + ins.size as u64 {
break ins;
}
};
// Clear existing branch destination for instructions with relocations
ins.branch_dest = None;
let Some(target) = resolved.obj.symbols.get(reloc.target_symbol) else {
continue;
};
if target.section != Some(resolved.section_index) {
continue;
}
let Some(target_address) = target.address.checked_add_signed(reloc.addend) else {
continue;
};
// If the target address is within the function range, set it as a branch destination
if target_address >= function_start && target_address < function_end {
ins.branch_dest = Some(target_address);
}
}
Ok(result)
}
/// Parse an instruction to gather its mnemonic and arguments for more detailed comparison.
///
/// This is called only when we need to compare the arguments of an instruction.
pub fn process_instruction(
&self,
resolved: ResolvedInstructionRef,
diff_config: &DiffObjConfig,
) -> Result<ParsedInstruction> {
let mut mnemonic = None;
let mut args = Vec::with_capacity(8);
let mut relocation_emitted = false;
self.display_instruction(resolved, diff_config, &mut |part| {
match part {
InstructionPart::Opcode(m, _) => mnemonic = Some(Cow::Owned(m.into_owned())),
InstructionPart::Arg(arg) => {
if arg == InstructionArg::Reloc {
relocation_emitted = true;
// If the relocation was resolved to a branch destination, emit that instead.
if let Some(dest) = resolved.ins_ref.branch_dest {
args.push(InstructionArg::BranchDest(dest));
return Ok(());
}
}
args.push(arg.into_static());
}
_ => {}
}
Ok(())
})?;
// If the instruction has a relocation, but we didn't format it in the display, add it to
// the end of the arguments list.
if resolved.relocation.is_some() && !relocation_emitted {
args.push(InstructionArg::Reloc);
}
Ok(ParsedInstruction {
ins_ref: resolved.ins_ref,
mnemonic: mnemonic.unwrap_or_default(),
args,
})
}
}
pub trait Arch: Send + Sync + Debug {
/// Finishes arch-specific initialization that must be done after sections have been combined.
// Finishes arch-specific initialization that must be done after sections have been combined.
fn post_init(&mut self, _sections: &[Section], _symbols: &[Symbol]) {}
/// Generate a list of instructions references (offset, size, opcode) from the given code.
@ -304,14 +192,44 @@ pub trait Arch: Send + Sync + Debug {
/// parsing as possible here: just enough to identify the base instruction opcode, size, and
/// possible branch destination (for visual representation). As needed, instructions are parsed
/// via `process_instruction` to compare their arguments.
fn scan_instructions_internal(
fn scan_instructions(
&self,
address: u64,
code: &[u8],
section_index: usize,
relocations: &[Relocation],
diff_config: &DiffObjConfig,
) -> Result<Vec<InstructionRef>>;
) -> Result<Vec<ScannedInstruction>>;
/// Parse an instruction to gather its mnemonic and arguments for more detailed comparison.
///
/// This is called only when we need to compare the arguments of an instruction.
fn process_instruction(
&self,
resolved: ResolvedInstructionRef,
diff_config: &DiffObjConfig,
) -> Result<ParsedInstruction> {
let mut mnemonic = None;
let mut args = Vec::with_capacity(8);
self.display_instruction(resolved, diff_config, &mut |part| {
match part {
InstructionPart::Opcode(m, _) => mnemonic = Some(Cow::Owned(m.into_owned())),
InstructionPart::Arg(arg) => args.push(arg.into_static()),
_ => {}
}
Ok(())
})?;
// If the instruction has a relocation, but we didn't format it in the display, add it to
// the end of the arguments list.
if resolved.relocation.is_some() && !args.contains(&InstructionArg::Reloc) {
args.push(InstructionArg::Reloc);
}
Ok(ParsedInstruction {
ins_ref: resolved.ins_ref,
mnemonic: mnemonic.unwrap_or_default(),
args,
})
}
/// Format an instruction for display.
///
@ -414,14 +332,14 @@ impl ArchDummy {
}
impl Arch for ArchDummy {
fn scan_instructions_internal(
fn scan_instructions(
&self,
_address: u64,
_code: &[u8],
_section_index: usize,
_relocations: &[Relocation],
_diff_config: &DiffObjConfig,
) -> Result<Vec<InstructionRef>> {
) -> Result<Vec<ScannedInstruction>> {
Ok(Vec::new())
}

View File

@ -19,7 +19,7 @@ use crate::{
},
obj::{
InstructionRef, Object, Relocation, RelocationFlags, ResolvedInstructionRef,
ResolvedRelocation, Symbol, SymbolFlag, SymbolFlagSet,
ResolvedRelocation, ScannedInstruction, Symbol, SymbolFlag, SymbolFlagSet,
},
};
@ -82,22 +82,24 @@ impl ArchPpc {
}
impl Arch for ArchPpc {
fn scan_instructions_internal(
fn scan_instructions(
&self,
address: u64,
code: &[u8],
_section_index: usize,
_relocations: &[Relocation],
_diff_config: &DiffObjConfig,
) -> Result<Vec<InstructionRef>> {
) -> Result<Vec<ScannedInstruction>> {
ensure!(code.len() & 3 == 0, "Code length must be a multiple of 4");
let ins_count = code.len() / 4;
let mut insts = Vec::<InstructionRef>::with_capacity(ins_count);
let mut insts = Vec::<ScannedInstruction>::with_capacity(ins_count);
for (cur_addr, ins) in ppc750cl::InsIter::new(code, address as u32) {
insts.push(InstructionRef {
insts.push(ScannedInstruction {
ins_ref: InstructionRef {
address: cur_addr as u64,
size: 4,
opcode: u8::from(ins.op) as u16,
},
branch_dest: ins.branch_dest(cur_addr).map(u64::from),
});
}

View File

@ -1,5 +1,3 @@
use alloc::{format, vec::Vec};
use crate::{diff::display::InstructionPart, obj::ResolvedInstructionRef};
static REG_NAMES: [&str; 16] = [

View File

@ -1,4 +1,5 @@
use alloc::{collections::BTreeMap, format, string::String, vec, vec::Vec};
use alloc::{string::String, vec::Vec};
use std::collections::HashMap;
use anyhow::{Result, bail};
use object::elf;
@ -6,7 +7,9 @@ use object::elf;
use crate::{
arch::{Arch, superh::disasm::sh2_disasm},
diff::{DiffObjConfig, display::InstructionPart},
obj::{InstructionRef, Relocation, RelocationFlags, ResolvedInstructionRef},
obj::{
InstructionRef, Relocation, RelocationFlags, ResolvedInstructionRef, ScannedInstruction,
},
};
pub mod disasm;
@ -24,15 +27,15 @@ struct DataInfo {
}
impl Arch for ArchSuperH {
fn scan_instructions_internal(
fn scan_instructions(
&self,
address: u64,
code: &[u8],
_section_index: usize,
_relocations: &[Relocation],
_diff_config: &DiffObjConfig,
) -> Result<Vec<InstructionRef>> {
let mut ops = Vec::<InstructionRef>::with_capacity(code.len() / 2);
) -> Result<Vec<ScannedInstruction>> {
let mut ops = Vec::<ScannedInstruction>::with_capacity(code.len() / 2);
let mut offset = address;
for chunk in code.chunks_exact(2) {
@ -53,7 +56,9 @@ impl Arch for ArchSuperH {
Some(InstructionPart::Opcode(_, val)) => *val,
_ => 0,
};
ops.push(InstructionRef { address: offset, size: 2, opcode: opcode_enum, branch_dest });
let ins_ref: InstructionRef =
InstructionRef { address: offset, size: 2, opcode: opcode_enum };
ops.push(ScannedInstruction { ins_ref, branch_dest });
offset += 2;
}
@ -72,12 +77,10 @@ impl Arch for ArchSuperH {
sh2_disasm(0, opcode, true, &mut parts, &resolved, &mut branch_dest);
if let Some(symbol_data) =
resolved.section.data_range(resolved.symbol.address, resolved.symbol.size as usize)
{
if let Some(symbol_data) = resolved.section.symbol_data(resolved.symbol) {
// scan for data
// map of instruction offsets to data target offsets
let mut data_offsets = BTreeMap::<u64, DataInfo>::new();
let mut data_offsets: HashMap<u64, DataInfo> = HashMap::<u64, DataInfo>::new();
let mut pos: u64 = 0;
for chunk in symbol_data.chunks_exact(2) {
@ -252,7 +255,7 @@ mod test {
arch.display_instruction(
ResolvedInstructionRef {
ins_ref: InstructionRef { address: 0x1000, size: 2, opcode, branch_dest: None },
ins_ref: InstructionRef { address: 0x1000, size: 2, opcode },
code: &code,
..Default::default()
},
@ -330,7 +333,7 @@ mod test {
arch.display_instruction(
ResolvedInstructionRef {
ins_ref: InstructionRef { address: 0x1000, size: 2, opcode, branch_dest: None },
ins_ref: InstructionRef { address: 0x1000, size: 2, opcode },
code: &code,
..Default::default()
},
@ -413,7 +416,7 @@ mod test {
arch.display_instruction(
ResolvedInstructionRef {
ins_ref: InstructionRef { address: 0x1000, size: 2, opcode, branch_dest: None },
ins_ref: InstructionRef { address: 0x1000, size: 2, opcode },
code: &code,
..Default::default()
},
@ -450,7 +453,7 @@ mod test {
arch.display_instruction(
ResolvedInstructionRef {
ins_ref: InstructionRef { address: 0x1000, size: 2, opcode, branch_dest: None },
ins_ref: InstructionRef { address: 0x1000, size: 2, opcode },
code: &code,
..Default::default()
},
@ -499,12 +502,7 @@ mod test {
arch.display_instruction(
ResolvedInstructionRef {
ins_ref: InstructionRef {
address: addr as u64,
size: 2,
opcode,
branch_dest: None,
},
ins_ref: InstructionRef { address: addr as u64, size: 2, opcode },
code: &code,
..Default::default()
},
@ -540,12 +538,7 @@ mod test {
arch.display_instruction(
ResolvedInstructionRef {
ins_ref: InstructionRef {
address: addr as u64,
size: 2,
opcode,
branch_dest: None,
},
ins_ref: InstructionRef { address: addr as u64, size: 2, opcode },
code: &code,
..Default::default()
},
@ -584,12 +577,7 @@ mod test {
arch.display_instruction(
ResolvedInstructionRef {
ins_ref: InstructionRef {
address: addr as u64,
size: 2,
opcode,
branch_dest: None,
},
ins_ref: InstructionRef { address: addr as u64, size: 2, opcode },
code: &code,
..Default::default()
},
@ -628,12 +616,7 @@ mod test {
arch.display_instruction(
ResolvedInstructionRef {
ins_ref: InstructionRef {
address: addr as u64,
size: 2,
opcode,
branch_dest: None,
},
ins_ref: InstructionRef { address: addr as u64, size: 2, opcode },
code: &code,
..Default::default()
},
@ -665,12 +648,7 @@ mod test {
arch.display_instruction(
ResolvedInstructionRef {
ins_ref: InstructionRef {
address: addr as u64,
size: 2,
opcode,
branch_dest: None,
},
ins_ref: InstructionRef { address: addr as u64, size: 2, opcode },
code: &code,
..Default::default()
},
@ -699,12 +677,7 @@ mod test {
arch.display_instruction(
ResolvedInstructionRef {
ins_ref: InstructionRef {
address: addr as u64,
size: 2,
opcode,
branch_dest: None,
},
ins_ref: InstructionRef { address: addr as u64, size: 2, opcode },
code: &code,
..Default::default()
},
@ -736,12 +709,7 @@ mod test {
arch.display_instruction(
ResolvedInstructionRef {
ins_ref: InstructionRef {
address: addr as u64,
size: 2,
opcode,
branch_dest: None,
},
ins_ref: InstructionRef { address: addr as u64, size: 2, opcode },
code: &opcode.to_be_bytes(),
symbol: &Symbol {
address: 0x0606F378, // func base address
@ -786,12 +754,7 @@ mod test {
arch.display_instruction(
ResolvedInstructionRef {
ins_ref: InstructionRef {
address: addr as u64,
size: 2,
opcode,
branch_dest: None,
},
ins_ref: InstructionRef { address: addr as u64, size: 2, opcode },
code: &opcode.to_be_bytes(),
symbol: &Symbol {
address: 0x0606F378, // func base address

View File

@ -6,12 +6,14 @@ use iced_x86::{
Decoder, DecoderOptions, DecoratorKind, FormatterOutput, FormatterTextKind, GasFormatter,
Instruction, IntelFormatter, MasmFormatter, NasmFormatter, NumberKind, OpKind, Register,
};
use object::{Endian as _, Object as _, ObjectSection as _, elf, pe};
use object::{Endian as _, Object as _, ObjectSection as _, pe};
use crate::{
arch::Arch,
diff::{DiffObjConfig, X86Formatter, display::InstructionPart},
obj::{InstructionRef, Relocation, RelocationFlags, ResolvedInstructionRef},
obj::{
InstructionRef, Relocation, RelocationFlags, ResolvedInstructionRef, ScannedInstruction,
},
};
#[derive(Debug)]
@ -67,24 +69,16 @@ impl ArchX86 {
pe::IMAGE_REL_I386_DIR32 | pe::IMAGE_REL_I386_REL32 => Some(4),
_ => None,
},
RelocationFlags::Elf(typ) => match typ {
elf::R_386_32 | elf::R_386_PC32 => Some(4),
elf::R_386_16 => Some(2),
_ => None,
},
},
Architecture::X86_64 => match flags {
RelocationFlags::Coff(typ) => match typ {
pe::IMAGE_REL_AMD64_ADDR32NB | pe::IMAGE_REL_AMD64_REL32 => Some(4),
pe::IMAGE_REL_AMD64_ADDR64 => Some(8),
_ => None,
},
RelocationFlags::Elf(typ) => match typ {
elf::R_X86_64_PC32 => Some(4),
elf::R_X86_64_64 => Some(8),
_ => None,
},
},
}
}
}
@ -92,14 +86,14 @@ impl ArchX86 {
const DATA_OPCODE: u16 = u16::MAX - 1;
impl Arch for ArchX86 {
fn scan_instructions_internal(
fn scan_instructions(
&self,
address: u64,
code: &[u8],
_section_index: usize,
relocations: &[Relocation],
_diff_config: &DiffObjConfig,
) -> Result<Vec<InstructionRef>> {
) -> Result<Vec<ScannedInstruction>> {
let mut out = Vec::with_capacity(code.len() / 2);
let mut decoder = self.decoder(code, address);
let mut instruction = Instruction::default();
@ -118,10 +112,12 @@ impl Arch for ArchX86 {
})?;
if decoder.set_position(decoder.position() + size).is_ok() {
decoder.set_ip(address + size as u64);
out.push(InstructionRef {
out.push(ScannedInstruction {
ins_ref: InstructionRef {
address,
size: size as u8,
opcode: DATA_OPCODE,
},
branch_dest: None,
});
reloc_iter.next();
@ -138,10 +134,12 @@ impl Arch for ArchX86 {
OpKind::NearBranch64 => Some(instruction.near_branch64()),
_ => None,
};
out.push(InstructionRef {
out.push(ScannedInstruction {
ins_ref: InstructionRef {
address,
size: instruction.len() as u8,
opcode: instruction.mnemonic() as u16,
},
branch_dest,
});
}
@ -235,8 +233,7 @@ impl Arch for ArchX86 {
) -> Result<i64> {
match self.arch {
Architecture::X86 => match flags {
RelocationFlags::Coff(pe::IMAGE_REL_I386_DIR32 | pe::IMAGE_REL_I386_REL32)
| RelocationFlags::Elf(elf::R_386_32 | elf::R_386_PC32) => {
RelocationFlags::Coff(pe::IMAGE_REL_I386_DIR32 | pe::IMAGE_REL_I386_REL32) => {
let data =
section.data()?[address as usize..address as usize + 4].try_into()?;
Ok(self.endianness.read_i32_bytes(data) as i64)
@ -244,14 +241,12 @@ impl Arch for ArchX86 {
flags => bail!("Unsupported x86 implicit relocation {flags:?}"),
},
Architecture::X86_64 => match flags {
RelocationFlags::Coff(pe::IMAGE_REL_AMD64_ADDR32NB | pe::IMAGE_REL_AMD64_REL32)
| RelocationFlags::Elf(elf::R_X86_64_32 | elf::R_X86_64_PC32) => {
RelocationFlags::Coff(pe::IMAGE_REL_AMD64_ADDR32NB | pe::IMAGE_REL_AMD64_REL32) => {
let data =
section.data()?[address as usize..address as usize + 4].try_into()?;
Ok(self.endianness.read_i32_bytes(data) as i64)
}
RelocationFlags::Coff(pe::IMAGE_REL_AMD64_ADDR64)
| RelocationFlags::Elf(elf::R_X86_64_64) => {
RelocationFlags::Coff(pe::IMAGE_REL_AMD64_ADDR64) => {
let data =
section.data()?[address as usize..address as usize + 8].try_into()?;
Ok(self.endianness.read_i64_bytes(data))
@ -462,16 +457,15 @@ mod test {
0xc7, 0x85, 0x68, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x8b, 0x04, 0x85, 0x00,
0x00, 0x00, 0x00,
];
let scanned =
arch.scan_instructions_internal(0, &code, 0, &[], &DiffObjConfig::default()).unwrap();
let scanned = arch.scan_instructions(0, &code, 0, &[], &DiffObjConfig::default()).unwrap();
assert_eq!(scanned.len(), 2);
assert_eq!(scanned[0].address, 0);
assert_eq!(scanned[0].size, 10);
assert_eq!(scanned[0].opcode, iced_x86::Mnemonic::Mov as u16);
assert_eq!(scanned[0].ins_ref.address, 0);
assert_eq!(scanned[0].ins_ref.size, 10);
assert_eq!(scanned[0].ins_ref.opcode, iced_x86::Mnemonic::Mov as u16);
assert_eq!(scanned[0].branch_dest, None);
assert_eq!(scanned[1].address, 10);
assert_eq!(scanned[1].size, 7);
assert_eq!(scanned[1].opcode, iced_x86::Mnemonic::Mov as u16);
assert_eq!(scanned[1].ins_ref.address, 10);
assert_eq!(scanned[1].ins_ref.size, 7);
assert_eq!(scanned[1].ins_ref.opcode, iced_x86::Mnemonic::Mov as u16);
assert_eq!(scanned[1].branch_dest, None);
}
@ -483,7 +477,7 @@ mod test {
let mut parts = Vec::new();
arch.display_instruction(
ResolvedInstructionRef {
ins_ref: InstructionRef { address: 0x1234, size: 10, opcode, branch_dest: None },
ins_ref: InstructionRef { address: 0x1234, size: 10, opcode },
code: &code,
..Default::default()
},
@ -519,7 +513,7 @@ mod test {
let mut parts = Vec::new();
arch.display_instruction(
ResolvedInstructionRef {
ins_ref: InstructionRef { address: 0x1234, size: 10, opcode, branch_dest: None },
ins_ref: InstructionRef { address: 0x1234, size: 10, opcode },
code: &code,
relocation: Some(ResolvedRelocation {
relocation: &Relocation {
@ -564,7 +558,7 @@ mod test {
let mut parts = Vec::new();
arch.display_instruction(
ResolvedInstructionRef {
ins_ref: InstructionRef { address: 0x1234, size: 7, opcode, branch_dest: None },
ins_ref: InstructionRef { address: 0x1234, size: 7, opcode },
code: &code,
relocation: Some(ResolvedRelocation {
relocation: &Relocation {
@ -607,7 +601,7 @@ mod test {
let mut parts = Vec::new();
arch.display_instruction(
ResolvedInstructionRef {
ins_ref: InstructionRef { address: 0x1234, size: 5, opcode, branch_dest: None },
ins_ref: InstructionRef { address: 0x1234, size: 5, opcode },
code: &code,
relocation: Some(ResolvedRelocation {
relocation: &Relocation {
@ -638,7 +632,7 @@ mod test {
let mut parts = Vec::new();
arch.display_instruction(
ResolvedInstructionRef {
ins_ref: InstructionRef { address: 0x1234, size: 6, opcode, branch_dest: None },
ins_ref: InstructionRef { address: 0x1234, size: 6, opcode },
code: &code,
relocation: Some(ResolvedRelocation {
relocation: &Relocation {
@ -677,7 +671,7 @@ mod test {
let mut parts = Vec::new();
arch.display_instruction(
ResolvedInstructionRef {
ins_ref: InstructionRef { address: 0x1234, size: 7, opcode, branch_dest: None },
ins_ref: InstructionRef { address: 0x1234, size: 7, opcode },
code: &code,
relocation: Some(ResolvedRelocation {
relocation: &Relocation {
@ -716,7 +710,7 @@ mod test {
let mut parts = Vec::new();
arch.display_instruction(
ResolvedInstructionRef {
ins_ref: InstructionRef { address: 0x1234, size: 5, opcode, branch_dest: None },
ins_ref: InstructionRef { address: 0x1234, size: 5, opcode },
code: &code,
relocation: Some(ResolvedRelocation {
relocation: &Relocation {

View File

@ -434,7 +434,6 @@ impl From<LegacyReportItem> for ReportItem {
demangled_name: value.demangled_name,
virtual_address: value.address,
}),
address: None,
}
}
}

View File

@ -14,15 +14,15 @@ use super::{
};
use crate::obj::{
InstructionArg, InstructionArgValue, InstructionRef, Object, ResolvedInstructionRef,
ResolvedRelocation, ResolvedSymbol, SymbolFlag, SymbolKind,
ResolvedRelocation, ScannedInstruction, SymbolFlag, SymbolKind,
};
pub fn no_diff_code(
obj: &Object,
symbol_index: usize,
symbol_idx: usize,
diff_config: &DiffObjConfig,
) -> Result<SymbolDiff> {
let symbol = &obj.symbols[symbol_index];
let symbol = &obj.symbols[symbol_idx];
let section_index = symbol.section.ok_or_else(|| anyhow!("Missing section for symbol"))?;
let section = &obj.sections[section_index];
let data = section.data_range(symbol.address, symbol.size as usize).ok_or_else(|| {
@ -33,14 +33,18 @@ pub fn no_diff_code(
)
})?;
let ops = obj.arch.scan_instructions(
ResolvedSymbol { obj, symbol_index, symbol, section_index, section, data },
symbol.address,
data,
section_index,
&section.relocations,
diff_config,
)?;
let mut instruction_rows = Vec::<InstructionDiffRow>::new();
for i in &ops {
instruction_rows.push(InstructionDiffRow { ins_ref: Some(*i), ..Default::default() });
instruction_rows
.push(InstructionDiffRow { ins_ref: Some(i.ins_ref), ..Default::default() });
}
resolve_branches(&ops, &mut instruction_rows);
resolve_branches(obj, section_index, &ops, &mut instruction_rows);
Ok(SymbolDiff { target_symbol: None, match_percent: None, diff_score: None, instruction_rows })
}
@ -88,30 +92,22 @@ pub fn diff_code(
let left_section_idx = left_symbol.section.unwrap();
let right_section_idx = right_symbol.section.unwrap();
let left_ops = left_obj.arch.scan_instructions(
ResolvedSymbol {
obj: left_obj,
symbol_index: left_symbol_idx,
symbol: left_symbol,
section_index: left_section_idx,
section: left_section,
data: left_data,
},
left_symbol.address,
left_data,
left_section_idx,
&left_section.relocations,
diff_config,
)?;
let right_ops = right_obj.arch.scan_instructions(
ResolvedSymbol {
obj: right_obj,
symbol_index: right_symbol_idx,
symbol: right_symbol,
section_index: right_section_idx,
section: right_section,
data: right_data,
},
right_symbol.address,
right_data,
right_section_idx,
&right_section.relocations,
diff_config,
)?;
let (mut left_rows, mut right_rows) = diff_instructions(&left_ops, &right_ops)?;
resolve_branches(&left_ops, &mut left_rows);
resolve_branches(&right_ops, &mut right_rows);
resolve_branches(left_obj, left_section_idx, &left_ops, &mut left_rows);
resolve_branches(right_obj, right_section_idx, &right_ops, &mut right_rows);
let mut diff_state = InstructionDiffState::default();
for (left_row, right_row) in left_rows.iter_mut().zip(right_rows.iter_mut()) {
@ -158,21 +154,21 @@ pub fn diff_code(
}
fn diff_instructions(
left_insts: &[InstructionRef],
right_insts: &[InstructionRef],
left_insts: &[ScannedInstruction],
right_insts: &[ScannedInstruction],
) -> Result<(Vec<InstructionDiffRow>, Vec<InstructionDiffRow>)> {
let left_ops = left_insts.iter().map(|i| i.opcode).collect::<Vec<_>>();
let right_ops = right_insts.iter().map(|i| i.opcode).collect::<Vec<_>>();
let left_ops = left_insts.iter().map(|i| i.ins_ref.opcode).collect::<Vec<_>>();
let right_ops = right_insts.iter().map(|i| i.ins_ref.opcode).collect::<Vec<_>>();
let ops = similar::capture_diff_slices(similar::Algorithm::Patience, &left_ops, &right_ops);
if ops.is_empty() {
ensure!(left_insts.len() == right_insts.len());
let left_diff = left_insts
.iter()
.map(|i| InstructionDiffRow { ins_ref: Some(*i), ..Default::default() })
.map(|i| InstructionDiffRow { ins_ref: Some(i.ins_ref), ..Default::default() })
.collect();
let right_diff = right_insts
.iter()
.map(|i| InstructionDiffRow { ins_ref: Some(*i), ..Default::default() })
.map(|i| InstructionDiffRow { ins_ref: Some(i.ins_ref), ..Default::default() })
.collect();
return Ok((left_diff, right_diff));
}
@ -191,17 +187,14 @@ fn diff_instructions(
for op in ops {
let (_tag, left_range, right_range) = op.as_tag_tuple();
let len = left_range.len().max(right_range.len());
left_diff.extend(
left_range
.clone()
.map(|i| InstructionDiffRow { ins_ref: Some(left_insts[i]), ..Default::default() }),
);
right_diff.extend(
right_range.clone().map(|i| InstructionDiffRow {
ins_ref: Some(right_insts[i]),
left_diff.extend(left_range.clone().map(|i| InstructionDiffRow {
ins_ref: Some(left_insts[i].ins_ref),
..Default::default()
}),
);
}));
right_diff.extend(right_range.clone().map(|i| InstructionDiffRow {
ins_ref: Some(right_insts[i].ins_ref),
..Default::default()
}));
if left_range.len() < len {
left_diff.extend((left_range.len()..len).map(|_| InstructionDiffRow::default()));
}
@ -222,7 +215,13 @@ fn arg_to_string(arg: &InstructionArg, reloc: Option<ResolvedRelocation>) -> Str
}
}
fn resolve_branches(ops: &[InstructionRef], rows: &mut [InstructionDiffRow]) {
fn resolve_branches(
obj: &Object,
section_index: usize,
ops: &[ScannedInstruction],
rows: &mut [InstructionDiffRow],
) {
let section = &obj.sections[section_index];
let mut branch_idx = 0u32;
// Map addresses to indices
let mut addr_map = BTreeMap::<u64, u32>::new();
@ -236,7 +235,17 @@ fn resolve_branches(ops: &[InstructionRef], rows: &mut [InstructionDiffRow]) {
for ((i, ins_diff), ins) in
rows.iter_mut().enumerate().filter(|(_, row)| row.ins_ref.is_some()).zip(ops)
{
if let Some(ins_idx) = ins.branch_dest.and_then(|a| addr_map.get(&a).copied()) {
let branch_dest = if let Some(resolved) = section.relocation_at(obj, ins.ins_ref) {
if resolved.symbol.section == Some(section_index) {
// If the relocation target is in the same section, use it as the branch destination
resolved.symbol.address.checked_add_signed(resolved.relocation.addend)
} else {
None
}
} else {
ins.branch_dest
};
if let Some(ins_idx) = branch_dest.and_then(|a| addr_map.get(&a).copied()) {
match branches.entry(ins_idx) {
btree_map::Entry::Vacant(e) => {
ins_diff.branch_to = Some(InstructionBranchTo { ins_idx, branch_idx });
@ -325,11 +334,12 @@ fn reloc_eq(
|| display_ins_data_literals(left_obj, left_ins)
== display_ins_data_literals(right_obj, right_ins))
}
(Some(_), None) => false,
(None, Some(_)) => {
// Match if possibly stripped weak symbol
symbol_name_addend_matches && right_reloc.symbol.flags.contains(SymbolFlag::Weak)
}
(Some(_), None) | (None, None) => symbol_name_addend_matches,
(None, None) => symbol_name_addend_matches,
}
}

View File

@ -53,11 +53,12 @@ fn reloc_eq(
section_name_eq(left_obj, right_obj, sl, sr)
&& (symbol_name_addend_matches || address_eq(left, right))
}
(Some(_), None) => false,
(None, Some(_)) => {
// Match if possibly stripped weak symbol
symbol_name_addend_matches && right.symbol.flags.contains(SymbolFlag::Weak)
}
(Some(_), None) | (None, None) => symbol_name_addend_matches,
(None, None) => symbol_name_addend_matches,
}
}
@ -273,6 +274,7 @@ pub fn diff_data_section(
// We only do this when all relocations on the left side match.
if left_section_diff.match_percent.unwrap_or(-1.0) < match_percent {
left_section_diff.match_percent = Some(match_percent);
right_section_diff.match_percent = Some(match_percent);
}
}
Ok((left_section_diff, right_section_diff))
@ -411,7 +413,7 @@ pub fn diff_generic_section(
};
Ok((
SectionDiff { match_percent: Some(match_percent), data_diff: vec![], reloc_diff: vec![] },
SectionDiff { match_percent: None, data_diff: vec![], reloc_diff: vec![] },
SectionDiff { match_percent: Some(match_percent), data_diff: vec![], reloc_diff: vec![] },
))
}
@ -452,7 +454,7 @@ pub fn diff_bss_section(
Ok((
SectionDiff { match_percent: Some(match_percent), data_diff: vec![], reloc_diff: vec![] },
SectionDiff { match_percent: None, data_diff: vec![], reloc_diff: vec![] },
SectionDiff { match_percent: Some(match_percent), data_diff: vec![], reloc_diff: vec![] },
))
}

View File

@ -77,7 +77,7 @@ impl<'a> DiffTextSegment<'a> {
const EOL_SEGMENT: DiffTextSegment<'static> =
DiffTextSegment { text: DiffText::Eol, color: DiffTextColor::Normal, pad_to: 0 };
#[derive(Debug, Default, Clone)]
#[derive(Debug, Default, Clone, PartialEq, Eq)]
pub enum HighlightKind {
#[default]
None,
@ -205,18 +205,16 @@ pub fn display_row(
InstructionPart::Arg(arg) => {
let diff_index = ins_row.arg_diff.get(arg_idx).copied().unwrap_or_default();
arg_idx += 1;
if arg == InstructionArg::Reloc {
displayed_relocation = true;
}
match (arg, resolved.ins_ref.branch_dest) {
(InstructionArg::Value(value), _) => cb(DiffTextSegment {
match arg {
InstructionArg::Value(value) => cb(DiffTextSegment {
text: DiffText::Argument(value),
color: diff_index
.get()
.map_or(base_color, |i| DiffTextColor::Rotating(i as u8)),
pad_to: 0,
}),
(InstructionArg::Reloc, None) => {
InstructionArg::Reloc => {
displayed_relocation = true;
let resolved = resolved.relocation.unwrap();
let color = diff_index
.get()
@ -235,9 +233,7 @@ pub fn display_row(
}
Ok(())
}
(InstructionArg::BranchDest(dest), _) |
// If the relocation was resolved to a branch destination, emit that instead.
(InstructionArg::Reloc, Some(dest)) => {
InstructionArg::BranchDest(dest) => {
if let Some(addr) = dest.checked_sub(resolved.symbol.address) {
cb(DiffTextSegment {
text: DiffText::BranchDest(addr),
@ -288,18 +284,6 @@ pub fn display_row(
Ok(())
}
impl PartialEq<HighlightKind> for HighlightKind {
fn eq(&self, other: &HighlightKind) -> bool {
match (self, other) {
(HighlightKind::Opcode(a), HighlightKind::Opcode(b)) => a == b,
(HighlightKind::Argument(a), HighlightKind::Argument(b)) => a.loose_eq(b),
(HighlightKind::Symbol(a), HighlightKind::Symbol(b)) => a == b,
(HighlightKind::Address(a), HighlightKind::Address(b)) => a == b,
_ => false,
}
}
}
impl PartialEq<DiffText<'_>> for HighlightKind {
fn eq(&self, other: &DiffText) -> bool {
match (self, other) {
@ -700,25 +684,24 @@ pub fn display_sections(
.collect::<Vec<_>>();
if let Some(section_idx) = section_idx {
let section = &obj.sections[section_idx];
if section.kind == SectionKind::Unknown {
if section.kind == SectionKind::Unknown || section.flags.contains(SectionFlag::Hidden) {
// Skip unknown and hidden sections
continue;
}
let section_diff = &diff.sections[section_idx];
let reverse_fn_order = section.kind == SectionKind::Code && reverse_fn_order;
if section.kind == SectionKind::Code && reverse_fn_order {
symbols.sort_by(|a, b| {
let a = &obj.symbols[a.symbol];
let b = &obj.symbols[b.symbol];
section_symbol_sort(a, b)
.then_with(|| {
if reverse_fn_order {
b.address.cmp(&a.address)
} else {
a.address.cmp(&b.address)
}
})
.then_with(|| a.size.cmp(&b.size))
let a_symbol = &obj.symbols[a.symbol];
let b_symbol = &obj.symbols[b.symbol];
symbol_sort_reverse(a_symbol, b_symbol)
});
} else {
symbols.sort_by(|a, b| {
let a_symbol = &obj.symbols[a.symbol];
let b_symbol = &obj.symbols[b.symbol];
symbol_sort(a_symbol, b_symbol)
});
}
sections.push(SectionDisplay {
id: section.id.clone(),
name: if section.flags.contains(SectionFlag::Combined) {
@ -756,6 +739,14 @@ fn section_symbol_sort(a: &Symbol, b: &Symbol) -> Ordering {
Ordering::Equal
}
fn symbol_sort(a: &Symbol, b: &Symbol) -> Ordering {
section_symbol_sort(a, b).then(a.address.cmp(&b.address)).then(a.size.cmp(&b.size))
}
fn symbol_sort_reverse(a: &Symbol, b: &Symbol) -> Ordering {
section_symbol_sort(a, b).then(b.address.cmp(&a.address)).then(b.size.cmp(&a.size))
}
pub fn display_ins_data_labels(obj: &Object, resolved: ResolvedInstructionRef) -> Vec<String> {
let Some(reloc) = resolved.relocation else {
return Vec::new();

View File

@ -341,25 +341,11 @@ pub fn diff_objs(
if let (Some((right_obj, right_out)), Some((left_obj, left_out))) =
(right.as_mut(), left.as_mut())
{
if let Some(right_name) = mapping_config.selecting_left.as_deref() {
generate_mapping_symbols(
left_obj,
left_out,
right_obj,
right_out,
MappingSymbol::Right(right_name),
diff_config,
)?;
if let Some(right_name) = &mapping_config.selecting_left {
generate_mapping_symbols(right_obj, right_name, left_obj, left_out, diff_config)?;
}
if let Some(left_name) = mapping_config.selecting_right.as_deref() {
generate_mapping_symbols(
left_obj,
left_out,
right_obj,
right_out,
MappingSymbol::Left(left_name),
diff_config,
)?;
if let Some(left_name) = &mapping_config.selecting_right {
generate_mapping_symbols(left_obj, left_name, right_obj, right_out, diff_config)?;
}
}
@ -370,28 +356,17 @@ pub fn diff_objs(
})
}
#[derive(Clone, Copy)]
enum MappingSymbol<'a> {
Left(&'a str),
Right(&'a str),
}
/// When we're selecting a symbol to use as a comparison, we'll create comparisons for all
/// symbols in the other object that match the selected symbol's section and kind. This allows
/// us to display match percentages for all symbols in the other object that could be selected.
fn generate_mapping_symbols(
left_obj: &Object,
left_out: &mut ObjectDiff,
right_obj: &Object,
right_out: &mut ObjectDiff,
mapping_symbol: MappingSymbol,
base_obj: &Object,
base_name: &str,
target_obj: &Object,
target_out: &mut ObjectDiff,
config: &DiffObjConfig,
) -> Result<()> {
let (base_obj, base_name, target_obj) = match mapping_symbol {
MappingSymbol::Left(name) => (left_obj, name, right_obj),
MappingSymbol::Right(name) => (right_obj, name, left_obj),
};
let Some(base_symbol_ref) = base_obj.symbol_by_name(base_name) else {
let Some(base_symbol_ref) = symbol_ref_by_name(base_obj, base_name) else {
return Ok(());
};
let base_section_kind = symbol_section_kind(base_obj, &base_obj.symbols[base_symbol_ref]);
@ -402,30 +377,32 @@ fn generate_mapping_symbols(
{
continue;
}
let (left_symbol_idx, right_symbol_idx) = match mapping_symbol {
MappingSymbol::Left(_) => (base_symbol_ref, target_symbol_index),
MappingSymbol::Right(_) => (target_symbol_index, base_symbol_ref),
};
let (left_diff, right_diff) = match base_section_kind {
match base_section_kind {
SectionKind::Code => {
diff_code(left_obj, right_obj, left_symbol_idx, right_symbol_idx, config)
let (left_diff, _right_diff) =
diff_code(target_obj, base_obj, target_symbol_index, base_symbol_ref, config)?;
target_out.mapping_symbols.push(MappingSymbolDiff {
symbol_index: target_symbol_index,
symbol_diff: left_diff,
});
}
SectionKind::Data => {
diff_data_symbol(left_obj, right_obj, left_symbol_idx, right_symbol_idx)
let (left_diff, _right_diff) =
diff_data_symbol(target_obj, base_obj, target_symbol_index, base_symbol_ref)?;
target_out.mapping_symbols.push(MappingSymbolDiff {
symbol_index: target_symbol_index,
symbol_diff: left_diff,
});
}
SectionKind::Bss | SectionKind::Common => {
diff_bss_symbol(left_obj, right_obj, left_symbol_idx, right_symbol_idx)
let (left_diff, _right_diff) =
diff_bss_symbol(target_obj, base_obj, target_symbol_index, base_symbol_ref)?;
target_out.mapping_symbols.push(MappingSymbolDiff {
symbol_index: target_symbol_index,
symbol_diff: left_diff,
});
}
SectionKind::Unknown => continue,
}?;
match mapping_symbol {
MappingSymbol::Left(_) => right_out.mapping_symbols.push(MappingSymbolDiff {
symbol_index: right_symbol_idx,
symbol_diff: right_diff,
}),
MappingSymbol::Right(_) => left_out
.mapping_symbols
.push(MappingSymbolDiff { symbol_index: left_symbol_idx, symbol_diff: left_diff }),
SectionKind::Unknown => {}
}
}
Ok(())
@ -457,6 +434,10 @@ pub struct MappingConfig {
pub selecting_right: Option<String>,
}
fn symbol_ref_by_name(obj: &Object, name: &str) -> Option<usize> {
obj.symbols.iter().position(|s| s.name == name)
}
fn apply_symbol_mappings(
left: &Object,
right: &Object,
@ -468,25 +449,25 @@ fn apply_symbol_mappings(
// If we're selecting a symbol to use as a comparison, mark it as used
// This ensures that we don't match it to another symbol at any point
if let Some(left_name) = &mapping_config.selecting_left {
if let Some(left_symbol) = left.symbol_by_name(left_name) {
if let Some(left_symbol) = symbol_ref_by_name(left, left_name) {
left_used.insert(left_symbol);
}
}
if let Some(right_name) = &mapping_config.selecting_right {
if let Some(right_symbol) = right.symbol_by_name(right_name) {
if let Some(right_symbol) = symbol_ref_by_name(right, right_name) {
right_used.insert(right_symbol);
}
}
// Apply manual symbol mappings
for (left_name, right_name) in &mapping_config.mappings {
let Some(left_symbol_index) = left.symbol_by_name(left_name) else {
let Some(left_symbol_index) = symbol_ref_by_name(left, left_name) else {
continue;
};
if left_used.contains(&left_symbol_index) {
continue;
}
let Some(right_symbol_index) = right.symbol_by_name(right_name) else {
let Some(right_symbol_index) = symbol_ref_by_name(right, right_name) else {
continue;
};
if right_used.contains(&right_symbol_index) {
@ -677,11 +658,7 @@ fn find_symbol(
/// Find matching sections between each object.
fn matching_sections(left: Option<&Object>, right: Option<&Object>) -> Result<Vec<SectionMatch>> {
let mut matches = Vec::with_capacity(
left.as_ref()
.map_or(0, |o| o.sections.len())
.max(right.as_ref().map_or(0, |o| o.sections.len())),
);
let mut matches = Vec::new();
if let Some(left) = left {
for (section_idx, section) in left.sections.iter().enumerate() {
if section.kind == SectionKind::Unknown {
@ -689,7 +666,7 @@ fn matching_sections(left: Option<&Object>, right: Option<&Object>) -> Result<Ve
}
matches.push(SectionMatch {
left: Some(section_idx),
right: find_section(right, &section.name, section.kind, &matches),
right: find_section(right, &section.name, section.kind),
section_kind: section.kind,
});
}
@ -712,13 +689,6 @@ fn matching_sections(left: Option<&Object>, right: Option<&Object>) -> Result<Ve
Ok(matches)
}
fn find_section(
obj: Option<&Object>,
name: &str,
section_kind: SectionKind,
matches: &[SectionMatch],
) -> Option<usize> {
obj?.sections.iter().enumerate().position(|(i, s)| {
s.kind == section_kind && s.name == name && !matches.iter().any(|m| m.right == Some(i))
})
fn find_section(obj: Option<&Object>, name: &str, section_kind: SectionKind) -> Option<usize> {
obj?.sections.iter().position(|s| s.kind == section_kind && s.name == name)
}

View File

@ -57,6 +57,7 @@ flags! {
pub enum SectionFlag: u8 {
/// Section combined from multiple input sections
Combined,
Hidden,
}
}
@ -98,8 +99,19 @@ impl fmt::Debug for SectionData {
impl Section {
pub fn data_range(&self, address: u64, size: usize) -> Option<&[u8]> {
let offset = address.checked_sub(self.address)?;
self.data.get(offset as usize..offset as usize + size)
let start = self.address;
let end = start + self.size;
if address >= start && address + size as u64 <= end {
let offset = (address - start) as usize;
Some(&self.data[offset..offset + size])
} else {
None
}
}
pub fn symbol_data(&self, symbol: &Symbol) -> Option<&[u8]> {
let offset = symbol.address.checked_sub(self.address)?;
self.data.get(offset as usize..offset as usize + symbol.size as usize)
}
// The alignment to use when "Combine data/text sections" is enabled.
@ -118,7 +130,7 @@ impl Section {
Err(i) => self
.relocations
.get(i)
.filter(|r| r.address < ins_ref.address + ins_ref.size as u64),
.take_if(|r| r.address < ins_ref.address + ins_ref.size as u64),
}
.and_then(|relocation| {
let symbol = obj.symbols.get(relocation.target_symbol)?;
@ -214,6 +226,11 @@ pub struct InstructionRef {
pub address: u64,
pub size: u8,
pub opcode: u16,
}
#[derive(Copy, Clone, Debug)]
pub struct ScannedInstruction {
pub ins_ref: InstructionRef,
pub branch_dest: Option<u64>,
}
@ -308,10 +325,6 @@ impl Object {
let offset = symbol.address.checked_sub(section.address)?;
section.data.get(offset as usize..offset as usize + symbol.size as usize)
}
pub fn symbol_by_name(&self, name: &str) -> Option<usize> {
self.symbols.iter().position(|symbol| symbol.section.is_some() && symbol.name == name)
}
}
#[derive(Debug, Clone, Eq, PartialEq, Hash)]
@ -334,16 +347,6 @@ pub struct ResolvedRelocation<'a> {
pub symbol: &'a Symbol,
}
#[derive(Debug, Copy, Clone)]
pub struct ResolvedSymbol<'obj> {
pub obj: &'obj Object,
pub symbol_index: usize,
pub symbol: &'obj Symbol,
pub section_index: usize,
pub section: &'obj Section,
pub data: &'obj [u8],
}
#[derive(Debug, Copy, Clone)]
pub struct ResolvedInstructionRef<'obj> {
pub ins_ref: InstructionRef,

View File

@ -121,15 +121,6 @@ fn map_symbols(
Ok((symbols, symbol_indices))
}
/// When inferring a symbol's size, we ignore symbols that start with specific prefixes. They are
/// usually emitted as branch targets and do not represent the start of a function or object.
fn is_local_label(symbol: &Symbol) -> bool {
const LABEL_PREFIXES: &[&str] = &[".L", "LAB_"];
symbol.size == 0
&& symbol.flags.contains(SymbolFlag::Local)
&& LABEL_PREFIXES.iter().any(|p| symbol.name.starts_with(p))
}
fn infer_symbol_sizes(symbols: &mut [Symbol], sections: &[Section]) {
// Create a sorted list of symbol indices by section
let mut symbols_with_section = Vec::<usize>::with_capacity(symbols.len());
@ -176,7 +167,10 @@ fn infer_symbol_sizes(symbols: &mut [Symbol], sections: &[Section]) {
if last_end.0 == section_idx && last_end.1 > symbol.address {
continue;
}
let next_symbol = loop {
let next_symbol = match symbol.kind {
// For function/object symbols, find the next function/object symbol (in other words:
// skip over labels)
SymbolKind::Function | SymbolKind::Object => loop {
if iter_idx >= symbols_with_section.len() {
break None;
}
@ -184,20 +178,16 @@ fn infer_symbol_sizes(symbols: &mut [Symbol], sections: &[Section]) {
if next_symbol.section != Some(section_idx) {
break None;
}
if match symbol.kind {
SymbolKind::Function | SymbolKind::Object => {
// For function/object symbols, find the next function/object
matches!(next_symbol.kind, SymbolKind::Function | SymbolKind::Object)
}
SymbolKind::Unknown | SymbolKind::Section => {
// For labels (or anything else), stop at any symbol
true
}
} && !is_local_label(next_symbol)
{
if let SymbolKind::Function | SymbolKind::Object = next_symbol.kind {
break Some(next_symbol);
}
iter_idx += 1;
},
// For labels (or anything else), simply use the next symbol's address
SymbolKind::Unknown | SymbolKind::Section => symbols_with_section
.get(iter_idx)
.map(|&i| &symbols[i])
.take_if(|s| s.section == Some(section_idx)),
};
let next_address = next_symbol.map(|s| s.address).unwrap_or_else(|| {
let section = &sections[section_idx];
@ -351,7 +341,7 @@ fn map_section_relocations(
let idx = if let Some(section_symbol) = obj_file
.symbol_by_index(idx)
.ok()
.filter(|s| s.kind() == object::SymbolKind::Section)
.take_if(|s| s.kind() == object::SymbolKind::Section)
{
let section_index =
section_symbol.section_index().context("Section symbol without section")?;
@ -774,7 +764,7 @@ fn do_combine_sections(
line_info.append(&mut section.line_info.iter().map(|(&a, &l)| (a + offset, l)).collect());
section.line_info.clear();
if offset > 0 {
section.kind = SectionKind::Unknown;
section.flags |= SectionFlag::Hidden;
}
}
{

View File

@ -84,11 +84,11 @@ expression: "(sections, symbols)"
name: ".data",
address: 0,
size: 0,
kind: Unknown,
kind: Data,
data: SectionData(
0,
),
flags: FlagSet(),
flags: FlagSet(Hidden),
align: None,
relocations: [],
line_info: {},
@ -99,11 +99,11 @@ expression: "(sections, symbols)"
name: ".data",
address: 0,
size: 0,
kind: Unknown,
kind: Data,
data: SectionData(
0,
),
flags: FlagSet(),
flags: FlagSet(Hidden),
align: None,
relocations: [],
line_info: {},

View File

@ -57,5 +57,6 @@ pub fn align_data_to_4<W: std::io::Write + ?Sized>(
pub fn align_u64_to(len: u64, align: u64) -> u64 { len + ((align - (len % align)) % align) }
pub fn align_data_slice_to(data: &mut Vec<u8>, align: u64) {
data.resize(align_u64_to(data.len() as u64, align) as usize, 0);
const ALIGN_BYTE: u8 = 0;
data.resize(align_u64_to(data.len() as u64, align) as usize, ALIGN_BYTE);
}

View File

@ -68,12 +68,3 @@ fn read_x86_jumptable() {
let output = common::display_diff(&obj, &diff, symbol_idx, &diff_config);
insta::assert_snapshot!(output);
}
// Inferred size of functions should ignore symbols with specific prefixes
#[test]
#[cfg(feature = "x86")]
fn read_x86_local_labels() {
let diff_config = diff::DiffObjConfig::default();
let obj = obj::read::parse(include_object!("data/x86/local_labels.obj"), &diff_config).unwrap();
insta::assert_debug_snapshot!(obj);
}

View File

@ -1,5 +1,6 @@
---
source: objdiff-core/tests/arch_arm.rs
assertion_line: 43
expression: diff.instruction_rows
---
[
@ -9,7 +10,6 @@ expression: diff.instruction_rows
address: 76,
size: 4,
opcode: 32799,
branch_dest: None,
},
),
kind: None,
@ -23,7 +23,6 @@ expression: diff.instruction_rows
address: 80,
size: 4,
opcode: 32779,
branch_dest: None,
},
),
kind: None,
@ -37,7 +36,6 @@ expression: diff.instruction_rows
address: 84,
size: 4,
opcode: 65535,
branch_dest: None,
},
),
kind: None,

View File

@ -9,7 +9,6 @@ expression: diff.instruction_rows
address: 40,
size: 4,
opcode: 32895,
branch_dest: None,
},
),
kind: None,
@ -23,7 +22,6 @@ expression: diff.instruction_rows
address: 44,
size: 4,
opcode: 32818,
branch_dest: None,
},
),
kind: None,
@ -37,7 +35,6 @@ expression: diff.instruction_rows
address: 48,
size: 4,
opcode: 32818,
branch_dest: None,
},
),
kind: None,
@ -51,7 +48,6 @@ expression: diff.instruction_rows
address: 52,
size: 4,
opcode: 32774,
branch_dest: None,
},
),
kind: None,
@ -65,7 +61,6 @@ expression: diff.instruction_rows
address: 56,
size: 4,
opcode: 32799,
branch_dest: None,
},
),
kind: None,
@ -79,7 +74,6 @@ expression: diff.instruction_rows
address: 60,
size: 4,
opcode: 32786,
branch_dest: None,
},
),
kind: None,
@ -93,7 +87,6 @@ expression: diff.instruction_rows
address: 64,
size: 4,
opcode: 32770,
branch_dest: None,
},
),
kind: None,
@ -107,9 +100,6 @@ expression: diff.instruction_rows
address: 68,
size: 4,
opcode: 32773,
branch_dest: Some(
240,
),
},
),
kind: None,
@ -128,9 +118,6 @@ expression: diff.instruction_rows
address: 72,
size: 4,
opcode: 32773,
branch_dest: Some(
240,
),
},
),
kind: None,
@ -149,9 +136,6 @@ expression: diff.instruction_rows
address: 76,
size: 4,
opcode: 32773,
branch_dest: Some(
240,
),
},
),
kind: None,
@ -170,9 +154,6 @@ expression: diff.instruction_rows
address: 80,
size: 4,
opcode: 32773,
branch_dest: Some(
240,
),
},
),
kind: None,
@ -191,9 +172,6 @@ expression: diff.instruction_rows
address: 84,
size: 4,
opcode: 32773,
branch_dest: Some(
232,
),
},
),
kind: None,
@ -212,9 +190,6 @@ expression: diff.instruction_rows
address: 88,
size: 4,
opcode: 32773,
branch_dest: Some(
164,
),
},
),
kind: None,
@ -233,9 +208,6 @@ expression: diff.instruction_rows
address: 92,
size: 4,
opcode: 32773,
branch_dest: Some(
240,
),
},
),
kind: None,
@ -254,9 +226,6 @@ expression: diff.instruction_rows
address: 96,
size: 4,
opcode: 32773,
branch_dest: Some(
180,
),
},
),
kind: None,
@ -275,9 +244,6 @@ expression: diff.instruction_rows
address: 100,
size: 4,
opcode: 32773,
branch_dest: Some(
116,
),
},
),
kind: None,
@ -296,9 +262,6 @@ expression: diff.instruction_rows
address: 104,
size: 4,
opcode: 32773,
branch_dest: Some(
192,
),
},
),
kind: None,
@ -317,9 +280,6 @@ expression: diff.instruction_rows
address: 108,
size: 4,
opcode: 32773,
branch_dest: Some(
204,
),
},
),
kind: None,
@ -338,9 +298,6 @@ expression: diff.instruction_rows
address: 112,
size: 4,
opcode: 32773,
branch_dest: Some(
204,
),
},
),
kind: None,
@ -359,7 +316,6 @@ expression: diff.instruction_rows
address: 116,
size: 4,
opcode: 32799,
branch_dest: None,
},
),
kind: None,
@ -380,7 +336,6 @@ expression: diff.instruction_rows
address: 120,
size: 4,
opcode: 32799,
branch_dest: None,
},
),
kind: None,
@ -394,7 +349,6 @@ expression: diff.instruction_rows
address: 124,
size: 4,
opcode: 32774,
branch_dest: None,
},
),
kind: None,
@ -408,7 +362,6 @@ expression: diff.instruction_rows
address: 128,
size: 4,
opcode: 32800,
branch_dest: None,
},
),
kind: None,
@ -422,7 +375,6 @@ expression: diff.instruction_rows
address: 132,
size: 4,
opcode: 32786,
branch_dest: None,
},
),
kind: None,
@ -436,9 +388,6 @@ expression: diff.instruction_rows
address: 136,
size: 4,
opcode: 32773,
branch_dest: Some(
148,
),
},
),
kind: None,
@ -457,9 +406,6 @@ expression: diff.instruction_rows
address: 140,
size: 4,
opcode: 32774,
branch_dest: Some(
464,
),
},
),
kind: None,
@ -478,7 +424,6 @@ expression: diff.instruction_rows
address: 144,
size: 4,
opcode: 32774,
branch_dest: None,
},
),
kind: None,
@ -492,7 +437,6 @@ expression: diff.instruction_rows
address: 148,
size: 4,
opcode: 32799,
branch_dest: None,
},
),
kind: None,
@ -513,7 +457,6 @@ expression: diff.instruction_rows
address: 152,
size: 4,
opcode: 32799,
branch_dest: None,
},
),
kind: None,
@ -527,7 +470,6 @@ expression: diff.instruction_rows
address: 156,
size: 4,
opcode: 32777,
branch_dest: None,
},
),
kind: None,
@ -541,9 +483,6 @@ expression: diff.instruction_rows
address: 160,
size: 4,
opcode: 32773,
branch_dest: Some(
240,
),
},
),
kind: None,
@ -562,7 +501,6 @@ expression: diff.instruction_rows
address: 164,
size: 4,
opcode: 32818,
branch_dest: None,
},
),
kind: None,
@ -583,7 +521,6 @@ expression: diff.instruction_rows
address: 168,
size: 4,
opcode: 32818,
branch_dest: None,
},
),
kind: None,
@ -597,7 +534,6 @@ expression: diff.instruction_rows
address: 172,
size: 4,
opcode: 32774,
branch_dest: None,
},
),
kind: None,
@ -611,9 +547,6 @@ expression: diff.instruction_rows
address: 176,
size: 4,
opcode: 32773,
branch_dest: Some(
240,
),
},
),
kind: None,
@ -632,7 +565,6 @@ expression: diff.instruction_rows
address: 180,
size: 4,
opcode: 32818,
branch_dest: None,
},
),
kind: None,
@ -653,7 +585,6 @@ expression: diff.instruction_rows
address: 184,
size: 4,
opcode: 32774,
branch_dest: None,
},
),
kind: None,
@ -667,9 +598,6 @@ expression: diff.instruction_rows
address: 188,
size: 4,
opcode: 32773,
branch_dest: Some(
240,
),
},
),
kind: None,
@ -688,7 +616,6 @@ expression: diff.instruction_rows
address: 192,
size: 4,
opcode: 32818,
branch_dest: None,
},
),
kind: None,
@ -709,7 +636,6 @@ expression: diff.instruction_rows
address: 196,
size: 4,
opcode: 32774,
branch_dest: None,
},
),
kind: None,
@ -723,9 +649,6 @@ expression: diff.instruction_rows
address: 200,
size: 4,
opcode: 32773,
branch_dest: Some(
240,
),
},
),
kind: None,
@ -744,7 +667,6 @@ expression: diff.instruction_rows
address: 204,
size: 4,
opcode: 32799,
branch_dest: None,
},
),
kind: None,
@ -766,7 +688,6 @@ expression: diff.instruction_rows
address: 208,
size: 4,
opcode: 32818,
branch_dest: None,
},
),
kind: None,
@ -780,7 +701,6 @@ expression: diff.instruction_rows
address: 212,
size: 4,
opcode: 32799,
branch_dest: None,
},
),
kind: None,
@ -794,7 +714,6 @@ expression: diff.instruction_rows
address: 216,
size: 4,
opcode: 32818,
branch_dest: None,
},
),
kind: None,
@ -808,7 +727,6 @@ expression: diff.instruction_rows
address: 220,
size: 4,
opcode: 32899,
branch_dest: None,
},
),
kind: None,
@ -822,7 +740,6 @@ expression: diff.instruction_rows
address: 224,
size: 4,
opcode: 32774,
branch_dest: None,
},
),
kind: None,
@ -836,9 +753,6 @@ expression: diff.instruction_rows
address: 228,
size: 4,
opcode: 32773,
branch_dest: Some(
240,
),
},
),
kind: None,
@ -857,7 +771,6 @@ expression: diff.instruction_rows
address: 232,
size: 4,
opcode: 32818,
branch_dest: None,
},
),
kind: None,
@ -878,7 +791,6 @@ expression: diff.instruction_rows
address: 236,
size: 4,
opcode: 32774,
branch_dest: None,
},
),
kind: None,
@ -892,7 +804,6 @@ expression: diff.instruction_rows
address: 240,
size: 4,
opcode: 32799,
branch_dest: None,
},
),
kind: None,
@ -922,7 +833,6 @@ expression: diff.instruction_rows
address: 244,
size: 4,
opcode: 32829,
branch_dest: None,
},
),
kind: None,
@ -936,7 +846,6 @@ expression: diff.instruction_rows
address: 248,
size: 4,
opcode: 32786,
branch_dest: None,
},
),
kind: None,
@ -950,9 +859,6 @@ expression: diff.instruction_rows
address: 252,
size: 4,
opcode: 32773,
branch_dest: Some(
276,
),
},
),
kind: None,
@ -971,7 +877,6 @@ expression: diff.instruction_rows
address: 256,
size: 4,
opcode: 32818,
branch_dest: None,
},
),
kind: None,
@ -985,7 +890,6 @@ expression: diff.instruction_rows
address: 260,
size: 4,
opcode: 32774,
branch_dest: None,
},
),
kind: None,
@ -999,7 +903,6 @@ expression: diff.instruction_rows
address: 264,
size: 4,
opcode: 32799,
branch_dest: None,
},
),
kind: None,
@ -1013,7 +916,6 @@ expression: diff.instruction_rows
address: 268,
size: 4,
opcode: 32799,
branch_dest: None,
},
),
kind: None,
@ -1027,7 +929,6 @@ expression: diff.instruction_rows
address: 272,
size: 4,
opcode: 32778,
branch_dest: None,
},
),
kind: None,
@ -1041,7 +942,6 @@ expression: diff.instruction_rows
address: 276,
size: 4,
opcode: 32799,
branch_dest: None,
},
),
kind: None,
@ -1062,7 +962,6 @@ expression: diff.instruction_rows
address: 280,
size: 4,
opcode: 32786,
branch_dest: None,
},
),
kind: None,
@ -1076,9 +975,6 @@ expression: diff.instruction_rows
address: 284,
size: 4,
opcode: 32773,
branch_dest: Some(
328,
),
},
),
kind: None,
@ -1097,9 +993,6 @@ expression: diff.instruction_rows
address: 288,
size: 4,
opcode: 32773,
branch_dest: Some(
336,
),
},
),
kind: None,
@ -1118,7 +1011,6 @@ expression: diff.instruction_rows
address: 292,
size: 4,
opcode: 32786,
branch_dest: None,
},
),
kind: None,
@ -1132,9 +1024,6 @@ expression: diff.instruction_rows
address: 296,
size: 4,
opcode: 32773,
branch_dest: Some(
348,
),
},
),
kind: None,
@ -1153,7 +1042,6 @@ expression: diff.instruction_rows
address: 300,
size: 4,
opcode: 32829,
branch_dest: None,
},
),
kind: None,
@ -1167,7 +1055,6 @@ expression: diff.instruction_rows
address: 304,
size: 4,
opcode: 32786,
branch_dest: None,
},
),
kind: None,
@ -1181,9 +1068,6 @@ expression: diff.instruction_rows
address: 308,
size: 4,
opcode: 32773,
branch_dest: Some(
348,
),
},
),
kind: None,
@ -1202,7 +1086,6 @@ expression: diff.instruction_rows
address: 312,
size: 4,
opcode: 32786,
branch_dest: None,
},
),
kind: None,
@ -1216,7 +1099,6 @@ expression: diff.instruction_rows
address: 316,
size: 4,
opcode: 32786,
branch_dest: None,
},
),
kind: None,
@ -1230,9 +1112,6 @@ expression: diff.instruction_rows
address: 320,
size: 4,
opcode: 32773,
branch_dest: Some(
380,
),
},
),
kind: None,
@ -1251,9 +1130,6 @@ expression: diff.instruction_rows
address: 324,
size: 4,
opcode: 32773,
branch_dest: Some(
348,
),
},
),
kind: None,
@ -1272,7 +1148,6 @@ expression: diff.instruction_rows
address: 328,
size: 4,
opcode: 32786,
branch_dest: None,
},
),
kind: None,
@ -1293,9 +1168,6 @@ expression: diff.instruction_rows
address: 332,
size: 4,
opcode: 32773,
branch_dest: Some(
348,
),
},
),
kind: None,
@ -1314,7 +1186,6 @@ expression: diff.instruction_rows
address: 336,
size: 4,
opcode: 32818,
branch_dest: None,
},
),
kind: None,
@ -1335,7 +1206,6 @@ expression: diff.instruction_rows
address: 340,
size: 4,
opcode: 32774,
branch_dest: None,
},
),
kind: None,
@ -1349,9 +1219,6 @@ expression: diff.instruction_rows
address: 344,
size: 4,
opcode: 32773,
branch_dest: Some(
380,
),
},
),
kind: None,
@ -1370,7 +1237,6 @@ expression: diff.instruction_rows
address: 348,
size: 4,
opcode: 32818,
branch_dest: None,
},
),
kind: None,
@ -1394,7 +1260,6 @@ expression: diff.instruction_rows
address: 352,
size: 4,
opcode: 32774,
branch_dest: None,
},
),
kind: None,
@ -1408,7 +1273,6 @@ expression: diff.instruction_rows
address: 356,
size: 4,
opcode: 32786,
branch_dest: None,
},
),
kind: None,
@ -1422,7 +1286,6 @@ expression: diff.instruction_rows
address: 360,
size: 4,
opcode: 32786,
branch_dest: None,
},
),
kind: None,
@ -1436,9 +1299,6 @@ expression: diff.instruction_rows
address: 364,
size: 4,
opcode: 32773,
branch_dest: Some(
380,
),
},
),
kind: None,
@ -1457,7 +1317,6 @@ expression: diff.instruction_rows
address: 368,
size: 4,
opcode: 32774,
branch_dest: None,
},
),
kind: None,
@ -1471,7 +1330,6 @@ expression: diff.instruction_rows
address: 372,
size: 4,
opcode: 32818,
branch_dest: None,
},
),
kind: None,
@ -1485,7 +1343,6 @@ expression: diff.instruction_rows
address: 376,
size: 4,
opcode: 32899,
branch_dest: None,
},
),
kind: None,
@ -1499,7 +1356,6 @@ expression: diff.instruction_rows
address: 380,
size: 4,
opcode: 32829,
branch_dest: None,
},
),
kind: None,
@ -1522,7 +1378,6 @@ expression: diff.instruction_rows
address: 384,
size: 4,
opcode: 32770,
branch_dest: None,
},
),
kind: None,
@ -1536,7 +1391,6 @@ expression: diff.instruction_rows
address: 388,
size: 4,
opcode: 32770,
branch_dest: None,
},
),
kind: None,
@ -1550,7 +1404,6 @@ expression: diff.instruction_rows
address: 392,
size: 4,
opcode: 32898,
branch_dest: None,
},
),
kind: None,
@ -1564,7 +1417,6 @@ expression: diff.instruction_rows
address: 396,
size: 4,
opcode: 32786,
branch_dest: None,
},
),
kind: None,
@ -1578,9 +1430,6 @@ expression: diff.instruction_rows
address: 400,
size: 4,
opcode: 32773,
branch_dest: Some(
424,
),
},
),
kind: None,
@ -1599,7 +1448,6 @@ expression: diff.instruction_rows
address: 404,
size: 4,
opcode: 32818,
branch_dest: None,
},
),
kind: None,
@ -1620,7 +1468,6 @@ expression: diff.instruction_rows
address: 408,
size: 4,
opcode: 32774,
branch_dest: None,
},
),
kind: None,
@ -1634,7 +1481,6 @@ expression: diff.instruction_rows
address: 412,
size: 4,
opcode: 32770,
branch_dest: None,
},
),
kind: None,
@ -1648,7 +1494,6 @@ expression: diff.instruction_rows
address: 416,
size: 4,
opcode: 32786,
branch_dest: None,
},
),
kind: None,
@ -1662,9 +1507,6 @@ expression: diff.instruction_rows
address: 420,
size: 4,
opcode: 32773,
branch_dest: Some(
404,
),
},
),
kind: None,
@ -1683,7 +1525,6 @@ expression: diff.instruction_rows
address: 424,
size: 4,
opcode: 32799,
branch_dest: None,
},
),
kind: None,
@ -1704,7 +1545,6 @@ expression: diff.instruction_rows
address: 428,
size: 4,
opcode: 32799,
branch_dest: None,
},
),
kind: None,
@ -1718,7 +1558,6 @@ expression: diff.instruction_rows
address: 432,
size: 4,
opcode: 32800,
branch_dest: None,
},
),
kind: None,
@ -1732,7 +1571,6 @@ expression: diff.instruction_rows
address: 436,
size: 4,
opcode: 32786,
branch_dest: None,
},
),
kind: None,
@ -1746,9 +1584,6 @@ expression: diff.instruction_rows
address: 440,
size: 4,
opcode: 32773,
branch_dest: Some(
448,
),
},
),
kind: None,
@ -1767,7 +1602,6 @@ expression: diff.instruction_rows
address: 444,
size: 4,
opcode: 32774,
branch_dest: None,
},
),
kind: None,
@ -1781,7 +1615,6 @@ expression: diff.instruction_rows
address: 448,
size: 4,
opcode: 32818,
branch_dest: None,
},
),
kind: None,
@ -1802,7 +1635,6 @@ expression: diff.instruction_rows
address: 452,
size: 4,
opcode: 32899,
branch_dest: None,
},
),
kind: None,
@ -1816,7 +1648,6 @@ expression: diff.instruction_rows
address: 456,
size: 4,
opcode: 32793,
branch_dest: None,
},
),
kind: None,
@ -1830,7 +1661,6 @@ expression: diff.instruction_rows
address: 460,
size: 4,
opcode: 65535,
branch_dest: None,
},
),
kind: None,
@ -1844,7 +1674,6 @@ expression: diff.instruction_rows
address: 464,
size: 4,
opcode: 65535,
branch_dest: None,
},
),
kind: None,
@ -1865,7 +1694,6 @@ expression: diff.instruction_rows
address: 468,
size: 4,
opcode: 65535,
branch_dest: None,
},
),
kind: None,

View File

@ -1,5 +1,6 @@
---
source: objdiff-core/tests/arch_arm.rs
assertion_line: 16
expression: output
---
[(Address(0), Normal, 5), (Spacing(4), Normal, 0), (Opcode("stmdb", 32895), Normal, 10), (Argument(Opaque("sp")), Normal, 0), (Argument(Opaque("!")), Normal, 0), (Basic(", "), Normal, 0), (Basic("{"), Normal, 0), (Argument(Opaque("r4")), Normal, 0), (Basic(", "), Normal, 0), (Argument(Opaque("r5")), Normal, 0), (Basic(", "), Normal, 0), (Argument(Opaque("r6")), Normal, 0), (Basic(", "), Normal, 0), (Argument(Opaque("lr")), Normal, 0), (Basic("}"), Normal, 0), (Eol, Normal, 0)]
@ -27,7 +28,7 @@ expression: output
[(Address(88), Normal, 5), (Spacing(4), Normal, 0), (Opcode("ldrb", 32800), Normal, 10), (Argument(Opaque("r0")), Normal, 0), (Basic(", "), Normal, 0), (Basic("["), Normal, 0), (Argument(Opaque("r0")), Normal, 0), (Basic(", "), Normal, 0), (Basic("#"), Normal, 0), (Argument(Signed(224)), Normal, 0), (Basic("]"), Normal, 0), (Eol, Normal, 0)]
[(Address(92), Normal, 5), (Spacing(4), Normal, 0), (Opcode("cmp", 32786), Normal, 10), (Argument(Opaque("r0")), Normal, 0), (Basic(", "), Normal, 0), (Basic("#"), Normal, 0), (Argument(Unsigned(0)), Normal, 0), (Eol, Normal, 0)]
[(Address(96), Normal, 5), (Spacing(4), Normal, 0), (Opcode("bne", 32773), Normal, 10), (BranchDest(108), Normal, 0), (Basic(" ~>"), Rotating(7), 0), (Eol, Normal, 0)]
[(Address(100), Normal, 5), (Spacing(4), Normal, 0), (Opcode("bl", 32774), Normal, 10), (BranchDest(424), Normal, 0), (Basic(" ~>"), Rotating(8), 0), (Eol, Normal, 0)]
[(Address(100), Normal, 5), (Spacing(4), Normal, 0), (Opcode("bl", 32774), Normal, 10), (Symbol(Symbol { name: "_ZN13LinkStateItem15GetEquipBombchuEv", demangled_name: Some("LinkStateItem::GetEquipBombchu()"), address: 472, size: 16, kind: Function, section: Some(0), flags: FlagSet(Global), align: None, virtual_address: None }), Bright, 0), (Addend(-8), Bright, 0), (Basic(" ~>"), Rotating(8), 0), (Eol, Normal, 0)]
[(Address(104), Normal, 5), (Spacing(4), Normal, 0), (Opcode("bl", 32774), Normal, 10), (Symbol(Symbol { name: "_ZN12EquipBombchu19func_ov014_0213ec64Ev", demangled_name: Some("EquipBombchu::func_ov014_0213ec64()"), address: 0, size: 0, kind: Unknown, section: None, flags: FlagSet(Global | Weak), align: None, virtual_address: None }), Bright, 0), (Addend(-8), Bright, 0), (Eol, Normal, 0)]
[(Address(108), Normal, 5), (Basic(" ~> "), Rotating(7), 0), (Opcode("ldr", 32799), Normal, 10), (Argument(Opaque("r0")), Normal, 0), (Basic(", "), Normal, 0), (Basic("["), Normal, 0), (Argument(Opaque("pc")), Normal, 0), (Basic(", "), Normal, 0), (Basic("#"), Normal, 0), (Argument(Signed(308)), Normal, 0), (Basic("]"), Normal, 0), (Basic(" (->"), Normal, 0), (BranchDest(424), Normal, 0), (Basic(")"), Normal, 0), (Eol, Normal, 0)]
[(Address(112), Normal, 5), (Spacing(4), Normal, 0), (Opcode("ldr", 32799), Normal, 10), (Argument(Opaque("r0")), Normal, 0), (Basic(", "), Normal, 0), (Basic("["), Normal, 0), (Argument(Opaque("r0")), Normal, 0), (Basic(", "), Normal, 0), (Basic("#"), Normal, 0), (Argument(Signed(0)), Normal, 0), (Basic("]"), Normal, 0), (Eol, Normal, 0)]

View File

@ -9,7 +9,6 @@ expression: diff.instruction_rows
address: 0,
size: 2,
opcode: 56,
branch_dest: None,
},
),
kind: None,
@ -23,7 +22,6 @@ expression: diff.instruction_rows
address: 2,
size: 2,
opcode: 74,
branch_dest: None,
},
),
kind: None,
@ -37,7 +35,6 @@ expression: diff.instruction_rows
address: 4,
size: 2,
opcode: 47,
branch_dest: None,
},
),
kind: None,
@ -51,7 +48,6 @@ expression: diff.instruction_rows
address: 6,
size: 2,
opcode: 47,
branch_dest: None,
},
),
kind: None,
@ -65,7 +61,6 @@ expression: diff.instruction_rows
address: 8,
size: 2,
opcode: 47,
branch_dest: None,
},
),
kind: None,
@ -79,7 +74,6 @@ expression: diff.instruction_rows
address: 10,
size: 2,
opcode: 47,
branch_dest: None,
},
),
kind: None,
@ -93,7 +87,6 @@ expression: diff.instruction_rows
address: 12,
size: 2,
opcode: 66,
branch_dest: None,
},
),
kind: None,
@ -107,7 +100,6 @@ expression: diff.instruction_rows
address: 14,
size: 4,
opcode: 19,
branch_dest: None,
},
),
kind: None,
@ -121,7 +113,6 @@ expression: diff.instruction_rows
address: 18,
size: 2,
opcode: 25,
branch_dest: None,
},
),
kind: None,
@ -135,9 +126,6 @@ expression: diff.instruction_rows
address: 20,
size: 2,
opcode: 15,
branch_dest: Some(
212,
),
},
),
kind: None,
@ -156,7 +144,6 @@ expression: diff.instruction_rows
address: 22,
size: 2,
opcode: 38,
branch_dest: None,
},
),
kind: None,
@ -170,7 +157,6 @@ expression: diff.instruction_rows
address: 24,
size: 2,
opcode: 25,
branch_dest: None,
},
),
kind: None,
@ -184,9 +170,6 @@ expression: diff.instruction_rows
address: 26,
size: 2,
opcode: 15,
branch_dest: Some(
48,
),
},
),
kind: None,
@ -205,7 +188,6 @@ expression: diff.instruction_rows
address: 28,
size: 2,
opcode: 34,
branch_dest: None,
},
),
kind: None,
@ -219,7 +201,6 @@ expression: diff.instruction_rows
address: 30,
size: 2,
opcode: 26,
branch_dest: None,
},
),
kind: None,
@ -233,9 +214,6 @@ expression: diff.instruction_rows
address: 32,
size: 2,
opcode: 15,
branch_dest: Some(
94,
),
},
),
kind: None,
@ -254,7 +232,6 @@ expression: diff.instruction_rows
address: 34,
size: 2,
opcode: 35,
branch_dest: None,
},
),
kind: None,
@ -268,7 +245,6 @@ expression: diff.instruction_rows
address: 36,
size: 2,
opcode: 47,
branch_dest: None,
},
),
kind: None,
@ -282,7 +258,6 @@ expression: diff.instruction_rows
address: 38,
size: 2,
opcode: 47,
branch_dest: None,
},
),
kind: None,
@ -296,7 +271,6 @@ expression: diff.instruction_rows
address: 40,
size: 4,
opcode: 19,
branch_dest: None,
},
),
kind: None,
@ -310,7 +284,6 @@ expression: diff.instruction_rows
address: 44,
size: 2,
opcode: 7,
branch_dest: None,
},
),
kind: None,
@ -324,7 +297,6 @@ expression: diff.instruction_rows
address: 46,
size: 2,
opcode: 55,
branch_dest: None,
},
),
kind: None,
@ -338,7 +310,6 @@ expression: diff.instruction_rows
address: 48,
size: 2,
opcode: 47,
branch_dest: None,
},
),
kind: None,
@ -359,7 +330,6 @@ expression: diff.instruction_rows
address: 50,
size: 2,
opcode: 47,
branch_dest: None,
},
),
kind: None,
@ -373,7 +343,6 @@ expression: diff.instruction_rows
address: 52,
size: 4,
opcode: 19,
branch_dest: None,
},
),
kind: None,
@ -387,7 +356,6 @@ expression: diff.instruction_rows
address: 56,
size: 2,
opcode: 25,
branch_dest: None,
},
),
kind: None,
@ -401,9 +369,6 @@ expression: diff.instruction_rows
address: 58,
size: 2,
opcode: 15,
branch_dest: Some(
212,
),
},
),
kind: None,
@ -422,7 +387,6 @@ expression: diff.instruction_rows
address: 60,
size: 2,
opcode: 34,
branch_dest: None,
},
),
kind: None,
@ -436,7 +400,6 @@ expression: diff.instruction_rows
address: 62,
size: 2,
opcode: 33,
branch_dest: None,
},
),
kind: None,
@ -450,7 +413,6 @@ expression: diff.instruction_rows
address: 64,
size: 2,
opcode: 36,
branch_dest: None,
},
),
kind: None,
@ -464,7 +426,6 @@ expression: diff.instruction_rows
address: 66,
size: 2,
opcode: 42,
branch_dest: None,
},
),
kind: None,
@ -478,7 +439,6 @@ expression: diff.instruction_rows
address: 68,
size: 2,
opcode: 44,
branch_dest: None,
},
),
kind: None,
@ -492,9 +452,6 @@ expression: diff.instruction_rows
address: 70,
size: 2,
opcode: 15,
branch_dest: Some(
212,
),
},
),
kind: None,
@ -513,7 +470,6 @@ expression: diff.instruction_rows
address: 72,
size: 2,
opcode: 46,
branch_dest: None,
},
),
kind: None,
@ -527,7 +483,6 @@ expression: diff.instruction_rows
address: 74,
size: 2,
opcode: 17,
branch_dest: None,
},
),
kind: None,
@ -541,7 +496,6 @@ expression: diff.instruction_rows
address: 76,
size: 2,
opcode: 46,
branch_dest: None,
},
),
kind: None,
@ -555,7 +509,6 @@ expression: diff.instruction_rows
address: 78,
size: 2,
opcode: 54,
branch_dest: None,
},
),
kind: None,
@ -569,7 +522,6 @@ expression: diff.instruction_rows
address: 80,
size: 2,
opcode: 67,
branch_dest: None,
},
),
kind: None,
@ -583,7 +535,6 @@ expression: diff.instruction_rows
address: 82,
size: 2,
opcode: 36,
branch_dest: None,
},
),
kind: None,
@ -597,7 +548,6 @@ expression: diff.instruction_rows
address: 84,
size: 2,
opcode: 46,
branch_dest: None,
},
),
kind: None,
@ -611,7 +561,6 @@ expression: diff.instruction_rows
address: 86,
size: 2,
opcode: 7,
branch_dest: None,
},
),
kind: None,
@ -625,7 +574,6 @@ expression: diff.instruction_rows
address: 88,
size: 2,
opcode: 54,
branch_dest: None,
},
),
kind: None,
@ -639,7 +587,6 @@ expression: diff.instruction_rows
address: 90,
size: 2,
opcode: 67,
branch_dest: None,
},
),
kind: None,
@ -653,7 +600,6 @@ expression: diff.instruction_rows
address: 92,
size: 2,
opcode: 55,
branch_dest: None,
},
),
kind: None,
@ -667,7 +613,6 @@ expression: diff.instruction_rows
address: 94,
size: 2,
opcode: 34,
branch_dest: None,
},
),
kind: None,
@ -688,7 +633,6 @@ expression: diff.instruction_rows
address: 96,
size: 2,
opcode: 34,
branch_dest: None,
},
),
kind: None,
@ -702,7 +646,6 @@ expression: diff.instruction_rows
address: 98,
size: 2,
opcode: 4,
branch_dest: None,
},
),
kind: None,
@ -716,7 +659,6 @@ expression: diff.instruction_rows
address: 100,
size: 4,
opcode: 19,
branch_dest: None,
},
),
kind: None,
@ -730,7 +672,6 @@ expression: diff.instruction_rows
address: 104,
size: 2,
opcode: 66,
branch_dest: None,
},
),
kind: None,
@ -744,7 +685,6 @@ expression: diff.instruction_rows
address: 106,
size: 2,
opcode: 47,
branch_dest: None,
},
),
kind: None,
@ -758,7 +698,6 @@ expression: diff.instruction_rows
address: 108,
size: 4,
opcode: 19,
branch_dest: None,
},
),
kind: None,
@ -772,7 +711,6 @@ expression: diff.instruction_rows
address: 112,
size: 2,
opcode: 47,
branch_dest: None,
},
),
kind: None,
@ -786,7 +724,6 @@ expression: diff.instruction_rows
address: 114,
size: 2,
opcode: 6,
branch_dest: None,
},
),
kind: None,
@ -800,7 +737,6 @@ expression: diff.instruction_rows
address: 116,
size: 2,
opcode: 66,
branch_dest: None,
},
),
kind: None,
@ -814,7 +750,6 @@ expression: diff.instruction_rows
address: 118,
size: 2,
opcode: 35,
branch_dest: None,
},
),
kind: None,
@ -828,7 +763,6 @@ expression: diff.instruction_rows
address: 120,
size: 2,
opcode: 47,
branch_dest: None,
},
),
kind: None,
@ -842,7 +776,6 @@ expression: diff.instruction_rows
address: 122,
size: 2,
opcode: 47,
branch_dest: None,
},
),
kind: None,
@ -856,7 +789,6 @@ expression: diff.instruction_rows
address: 124,
size: 2,
opcode: 47,
branch_dest: None,
},
),
kind: None,
@ -870,7 +802,6 @@ expression: diff.instruction_rows
address: 126,
size: 4,
opcode: 19,
branch_dest: None,
},
),
kind: None,
@ -884,7 +815,6 @@ expression: diff.instruction_rows
address: 130,
size: 2,
opcode: 25,
branch_dest: None,
},
),
kind: None,
@ -898,9 +828,6 @@ expression: diff.instruction_rows
address: 132,
size: 2,
opcode: 15,
branch_dest: Some(
168,
),
},
),
kind: None,
@ -919,7 +846,6 @@ expression: diff.instruction_rows
address: 134,
size: 2,
opcode: 47,
branch_dest: None,
},
),
kind: None,
@ -933,7 +859,6 @@ expression: diff.instruction_rows
address: 136,
size: 4,
opcode: 19,
branch_dest: None,
},
),
kind: None,
@ -947,7 +872,6 @@ expression: diff.instruction_rows
address: 140,
size: 2,
opcode: 47,
branch_dest: None,
},
),
kind: None,
@ -961,7 +885,6 @@ expression: diff.instruction_rows
address: 142,
size: 2,
opcode: 25,
branch_dest: None,
},
),
kind: None,
@ -975,9 +898,6 @@ expression: diff.instruction_rows
address: 144,
size: 2,
opcode: 15,
branch_dest: Some(
168,
),
},
),
kind: None,
@ -996,7 +916,6 @@ expression: diff.instruction_rows
address: 146,
size: 2,
opcode: 34,
branch_dest: None,
},
),
kind: None,
@ -1010,7 +929,6 @@ expression: diff.instruction_rows
address: 148,
size: 2,
opcode: 33,
branch_dest: None,
},
),
kind: None,
@ -1024,7 +942,6 @@ expression: diff.instruction_rows
address: 150,
size: 2,
opcode: 36,
branch_dest: None,
},
),
kind: None,
@ -1038,7 +955,6 @@ expression: diff.instruction_rows
address: 152,
size: 2,
opcode: 42,
branch_dest: None,
},
),
kind: None,
@ -1052,7 +968,6 @@ expression: diff.instruction_rows
address: 154,
size: 2,
opcode: 44,
branch_dest: None,
},
),
kind: None,
@ -1066,9 +981,6 @@ expression: diff.instruction_rows
address: 156,
size: 2,
opcode: 15,
branch_dest: Some(
168,
),
},
),
kind: None,
@ -1087,7 +999,6 @@ expression: diff.instruction_rows
address: 158,
size: 2,
opcode: 46,
branch_dest: None,
},
),
kind: None,
@ -1101,7 +1012,6 @@ expression: diff.instruction_rows
address: 160,
size: 2,
opcode: 17,
branch_dest: None,
},
),
kind: None,
@ -1115,7 +1025,6 @@ expression: diff.instruction_rows
address: 162,
size: 2,
opcode: 46,
branch_dest: None,
},
),
kind: None,
@ -1129,7 +1038,6 @@ expression: diff.instruction_rows
address: 164,
size: 2,
opcode: 54,
branch_dest: None,
},
),
kind: None,
@ -1143,7 +1051,6 @@ expression: diff.instruction_rows
address: 166,
size: 2,
opcode: 67,
branch_dest: None,
},
),
kind: None,
@ -1157,7 +1064,6 @@ expression: diff.instruction_rows
address: 168,
size: 2,
opcode: 25,
branch_dest: None,
},
),
kind: None,
@ -1180,9 +1086,6 @@ expression: diff.instruction_rows
address: 170,
size: 2,
opcode: 15,
branch_dest: Some(
200,
),
},
),
kind: None,
@ -1201,7 +1104,6 @@ expression: diff.instruction_rows
address: 172,
size: 2,
opcode: 35,
branch_dest: None,
},
),
kind: None,
@ -1215,7 +1117,6 @@ expression: diff.instruction_rows
address: 174,
size: 2,
opcode: 25,
branch_dest: None,
},
),
kind: None,
@ -1229,9 +1130,6 @@ expression: diff.instruction_rows
address: 176,
size: 2,
opcode: 15,
branch_dest: Some(
200,
),
},
),
kind: None,
@ -1250,7 +1148,6 @@ expression: diff.instruction_rows
address: 178,
size: 2,
opcode: 34,
branch_dest: None,
},
),
kind: None,
@ -1264,7 +1161,6 @@ expression: diff.instruction_rows
address: 180,
size: 2,
opcode: 37,
branch_dest: None,
},
),
kind: None,
@ -1278,7 +1174,6 @@ expression: diff.instruction_rows
address: 182,
size: 2,
opcode: 42,
branch_dest: None,
},
),
kind: None,
@ -1292,7 +1187,6 @@ expression: diff.instruction_rows
address: 184,
size: 2,
opcode: 44,
branch_dest: None,
},
),
kind: None,
@ -1306,9 +1200,6 @@ expression: diff.instruction_rows
address: 186,
size: 2,
opcode: 15,
branch_dest: Some(
200,
),
},
),
kind: None,
@ -1327,7 +1218,6 @@ expression: diff.instruction_rows
address: 188,
size: 2,
opcode: 32,
branch_dest: None,
},
),
kind: None,
@ -1341,7 +1231,6 @@ expression: diff.instruction_rows
address: 190,
size: 2,
opcode: 34,
branch_dest: None,
},
),
kind: None,
@ -1355,7 +1244,6 @@ expression: diff.instruction_rows
address: 192,
size: 2,
opcode: 46,
branch_dest: None,
},
),
kind: None,
@ -1369,7 +1257,6 @@ expression: diff.instruction_rows
address: 194,
size: 2,
opcode: 46,
branch_dest: None,
},
),
kind: None,
@ -1383,7 +1270,6 @@ expression: diff.instruction_rows
address: 196,
size: 4,
opcode: 19,
branch_dest: None,
},
),
kind: None,
@ -1397,7 +1283,6 @@ expression: diff.instruction_rows
address: 200,
size: 2,
opcode: 34,
branch_dest: None,
},
),
kind: None,
@ -1420,7 +1305,6 @@ expression: diff.instruction_rows
address: 202,
size: 2,
opcode: 35,
branch_dest: None,
},
),
kind: None,
@ -1434,7 +1318,6 @@ expression: diff.instruction_rows
address: 204,
size: 2,
opcode: 34,
branch_dest: None,
},
),
kind: None,
@ -1448,7 +1331,6 @@ expression: diff.instruction_rows
address: 206,
size: 2,
opcode: 4,
branch_dest: None,
},
),
kind: None,
@ -1462,7 +1344,6 @@ expression: diff.instruction_rows
address: 208,
size: 4,
opcode: 19,
branch_dest: None,
},
),
kind: None,
@ -1476,7 +1357,6 @@ expression: diff.instruction_rows
address: 212,
size: 2,
opcode: 7,
branch_dest: None,
},
),
kind: None,
@ -1499,7 +1379,6 @@ expression: diff.instruction_rows
address: 214,
size: 2,
opcode: 55,
branch_dest: None,
},
),
kind: None,
@ -1513,7 +1392,6 @@ expression: diff.instruction_rows
address: 216,
size: 4,
opcode: 65535,
branch_dest: None,
},
),
kind: None,
@ -1527,7 +1405,6 @@ expression: diff.instruction_rows
address: 220,
size: 4,
opcode: 65535,
branch_dest: None,
},
),
kind: None,
@ -1541,7 +1418,6 @@ expression: diff.instruction_rows
address: 224,
size: 4,
opcode: 65535,
branch_dest: None,
},
),
kind: None,
@ -1555,7 +1431,6 @@ expression: diff.instruction_rows
address: 228,
size: 4,
opcode: 65535,
branch_dest: None,
},
),
kind: None,
@ -1569,7 +1444,6 @@ expression: diff.instruction_rows
address: 232,
size: 4,
opcode: 65535,
branch_dest: None,
},
),
kind: None,
@ -1583,7 +1457,6 @@ expression: diff.instruction_rows
address: 236,
size: 4,
opcode: 65535,
branch_dest: None,
},
),
kind: None,
@ -1597,7 +1470,6 @@ expression: diff.instruction_rows
address: 240,
size: 4,
opcode: 65535,
branch_dest: None,
},
),
kind: None,

View File

@ -9,7 +9,6 @@ expression: diff.instruction_rows
address: 0,
size: 4,
opcode: 12,
branch_dest: None,
},
),
kind: None,
@ -23,7 +22,6 @@ expression: diff.instruction_rows
address: 4,
size: 4,
opcode: 44,
branch_dest: None,
},
),
kind: None,
@ -37,7 +35,6 @@ expression: diff.instruction_rows
address: 8,
size: 4,
opcode: 44,
branch_dest: None,
},
),
kind: None,
@ -51,7 +48,6 @@ expression: diff.instruction_rows
address: 12,
size: 4,
opcode: 44,
branch_dest: None,
},
),
kind: None,
@ -65,7 +61,6 @@ expression: diff.instruction_rows
address: 16,
size: 4,
opcode: 44,
branch_dest: None,
},
),
kind: None,
@ -79,7 +74,6 @@ expression: diff.instruction_rows
address: 20,
size: 4,
opcode: 2,
branch_dest: None,
},
),
kind: None,
@ -93,7 +87,6 @@ expression: diff.instruction_rows
address: 24,
size: 4,
opcode: 113,
branch_dest: None,
},
),
kind: None,
@ -107,7 +100,6 @@ expression: diff.instruction_rows
address: 28,
size: 4,
opcode: 26,
branch_dest: None,
},
),
kind: None,
@ -121,7 +113,6 @@ expression: diff.instruction_rows
address: 32,
size: 4,
opcode: 20,
branch_dest: None,
},
),
kind: None,
@ -135,7 +126,6 @@ expression: diff.instruction_rows
address: 36,
size: 4,
opcode: 97,
branch_dest: None,
},
),
kind: None,
@ -149,7 +139,6 @@ expression: diff.instruction_rows
address: 40,
size: 4,
opcode: 2,
branch_dest: None,
},
),
kind: None,
@ -163,7 +152,6 @@ expression: diff.instruction_rows
address: 44,
size: 4,
opcode: 12,
branch_dest: None,
},
),
kind: None,
@ -177,7 +165,6 @@ expression: diff.instruction_rows
address: 48,
size: 4,
opcode: 20,
branch_dest: None,
},
),
kind: None,
@ -191,7 +178,6 @@ expression: diff.instruction_rows
address: 52,
size: 4,
opcode: 26,
branch_dest: None,
},
),
kind: None,
@ -205,7 +191,6 @@ expression: diff.instruction_rows
address: 56,
size: 4,
opcode: 2,
branch_dest: None,
},
),
kind: None,
@ -219,7 +204,6 @@ expression: diff.instruction_rows
address: 60,
size: 4,
opcode: 12,
branch_dest: None,
},
),
kind: None,
@ -233,7 +217,6 @@ expression: diff.instruction_rows
address: 64,
size: 4,
opcode: 26,
branch_dest: None,
},
),
kind: None,
@ -247,7 +230,6 @@ expression: diff.instruction_rows
address: 68,
size: 4,
opcode: 97,
branch_dest: None,
},
),
kind: None,
@ -261,7 +243,6 @@ expression: diff.instruction_rows
address: 72,
size: 4,
opcode: 2,
branch_dest: None,
},
),
kind: None,
@ -275,7 +256,6 @@ expression: diff.instruction_rows
address: 76,
size: 4,
opcode: 97,
branch_dest: None,
},
),
kind: None,
@ -289,7 +269,6 @@ expression: diff.instruction_rows
address: 80,
size: 4,
opcode: 2,
branch_dest: None,
},
),
kind: None,
@ -310,7 +289,6 @@ expression: diff.instruction_rows
address: 84,
size: 4,
opcode: 97,
branch_dest: None,
},
),
kind: None,
@ -324,9 +302,6 @@ expression: diff.instruction_rows
address: 88,
size: 4,
opcode: 56,
branch_dest: Some(
80,
),
},
),
kind: None,
@ -345,7 +320,6 @@ expression: diff.instruction_rows
address: 92,
size: 4,
opcode: 113,
branch_dest: None,
},
),
kind: None,
@ -359,7 +333,6 @@ expression: diff.instruction_rows
address: 96,
size: 4,
opcode: 2,
branch_dest: None,
},
),
kind: None,
@ -373,7 +346,6 @@ expression: diff.instruction_rows
address: 100,
size: 4,
opcode: 20,
branch_dest: None,
},
),
kind: None,
@ -387,7 +359,6 @@ expression: diff.instruction_rows
address: 104,
size: 4,
opcode: 2,
branch_dest: None,
},
),
kind: None,
@ -401,7 +372,6 @@ expression: diff.instruction_rows
address: 108,
size: 4,
opcode: 12,
branch_dest: None,
},
),
kind: None,
@ -415,7 +385,6 @@ expression: diff.instruction_rows
address: 112,
size: 4,
opcode: 2,
branch_dest: None,
},
),
kind: None,
@ -429,7 +398,6 @@ expression: diff.instruction_rows
address: 116,
size: 4,
opcode: 16,
branch_dest: None,
},
),
kind: None,
@ -443,7 +411,6 @@ expression: diff.instruction_rows
address: 120,
size: 4,
opcode: 20,
branch_dest: None,
},
),
kind: None,
@ -457,7 +424,6 @@ expression: diff.instruction_rows
address: 124,
size: 4,
opcode: 12,
branch_dest: None,
},
),
kind: None,
@ -471,7 +437,6 @@ expression: diff.instruction_rows
address: 128,
size: 4,
opcode: 2,
branch_dest: None,
},
),
kind: None,
@ -494,7 +459,6 @@ expression: diff.instruction_rows
address: 132,
size: 4,
opcode: 12,
branch_dest: None,
},
),
kind: None,
@ -508,7 +472,6 @@ expression: diff.instruction_rows
address: 136,
size: 4,
opcode: 2,
branch_dest: None,
},
),
kind: None,
@ -522,7 +485,6 @@ expression: diff.instruction_rows
address: 140,
size: 4,
opcode: 113,
branch_dest: None,
},
),
kind: None,
@ -536,9 +498,6 @@ expression: diff.instruction_rows
address: 144,
size: 4,
opcode: 55,
branch_dest: Some(
128,
),
},
),
kind: None,
@ -557,7 +516,6 @@ expression: diff.instruction_rows
address: 148,
size: 4,
opcode: 90,
branch_dest: None,
},
),
kind: None,
@ -571,9 +529,6 @@ expression: diff.instruction_rows
address: 152,
size: 4,
opcode: 3,
branch_dest: Some(
128,
),
},
),
kind: None,
@ -592,7 +547,6 @@ expression: diff.instruction_rows
address: 156,
size: 4,
opcode: 113,
branch_dest: None,
},
),
kind: None,
@ -606,7 +560,6 @@ expression: diff.instruction_rows
address: 160,
size: 4,
opcode: 2,
branch_dest: None,
},
),
kind: None,
@ -620,7 +573,6 @@ expression: diff.instruction_rows
address: 164,
size: 4,
opcode: 60,
branch_dest: None,
},
),
kind: None,
@ -634,7 +586,6 @@ expression: diff.instruction_rows
address: 168,
size: 4,
opcode: 77,
branch_dest: None,
},
),
kind: None,
@ -648,7 +599,6 @@ expression: diff.instruction_rows
address: 172,
size: 4,
opcode: 113,
branch_dest: None,
},
),
kind: None,
@ -662,9 +612,6 @@ expression: diff.instruction_rows
address: 176,
size: 4,
opcode: 54,
branch_dest: Some(
128,
),
},
),
kind: None,
@ -683,7 +630,6 @@ expression: diff.instruction_rows
address: 180,
size: 4,
opcode: 113,
branch_dest: None,
},
),
kind: None,

File diff suppressed because it is too large Load Diff

View File

@ -9,7 +9,6 @@ expression: diff.instruction_rows
address: 0,
size: 4,
opcode: 60,
branch_dest: None,
},
),
kind: None,
@ -23,7 +22,6 @@ expression: diff.instruction_rows
address: 4,
size: 4,
opcode: 38,
branch_dest: None,
},
),
kind: None,
@ -37,9 +35,6 @@ expression: diff.instruction_rows
address: 8,
size: 4,
opcode: 43,
branch_dest: Some(
20,
),
},
),
kind: None,
@ -58,7 +53,6 @@ expression: diff.instruction_rows
address: 12,
size: 4,
opcode: 41,
branch_dest: None,
},
),
kind: None,
@ -72,9 +66,6 @@ expression: diff.instruction_rows
address: 16,
size: 4,
opcode: 45,
branch_dest: Some(
32,
),
},
),
kind: None,
@ -93,7 +84,6 @@ expression: diff.instruction_rows
address: 20,
size: 4,
opcode: 42,
branch_dest: None,
},
),
kind: None,
@ -114,7 +104,6 @@ expression: diff.instruction_rows
address: 24,
size: 4,
opcode: 41,
branch_dest: None,
},
),
kind: None,
@ -128,7 +117,6 @@ expression: diff.instruction_rows
address: 28,
size: 4,
opcode: 94,
branch_dest: None,
},
),
kind: None,
@ -142,7 +130,6 @@ expression: diff.instruction_rows
address: 32,
size: 4,
opcode: 60,
branch_dest: None,
},
),
kind: None,
@ -163,7 +150,6 @@ expression: diff.instruction_rows
address: 36,
size: 4,
opcode: 166,
branch_dest: None,
},
),
kind: None,
@ -177,7 +163,6 @@ expression: diff.instruction_rows
address: 40,
size: 4,
opcode: 38,
branch_dest: None,
},
),
kind: None,
@ -191,9 +176,6 @@ expression: diff.instruction_rows
address: 44,
size: 4,
opcode: 43,
branch_dest: Some(
56,
),
},
),
kind: None,
@ -212,7 +194,6 @@ expression: diff.instruction_rows
address: 48,
size: 4,
opcode: 41,
branch_dest: None,
},
),
kind: None,
@ -226,9 +207,6 @@ expression: diff.instruction_rows
address: 52,
size: 4,
opcode: 45,
branch_dest: Some(
68,
),
},
),
kind: None,
@ -247,7 +225,6 @@ expression: diff.instruction_rows
address: 56,
size: 4,
opcode: 42,
branch_dest: None,
},
),
kind: None,
@ -268,7 +245,6 @@ expression: diff.instruction_rows
address: 60,
size: 4,
opcode: 41,
branch_dest: None,
},
),
kind: None,
@ -282,7 +258,6 @@ expression: diff.instruction_rows
address: 64,
size: 4,
opcode: 94,
branch_dest: None,
},
),
kind: None,
@ -296,7 +271,6 @@ expression: diff.instruction_rows
address: 68,
size: 4,
opcode: 60,
branch_dest: None,
},
),
kind: None,
@ -317,7 +291,6 @@ expression: diff.instruction_rows
address: 72,
size: 4,
opcode: 41,
branch_dest: None,
},
),
kind: None,
@ -331,7 +304,6 @@ expression: diff.instruction_rows
address: 76,
size: 4,
opcode: 38,
branch_dest: None,
},
),
kind: None,
@ -345,7 +317,6 @@ expression: diff.instruction_rows
address: 80,
size: 4,
opcode: 166,
branch_dest: None,
},
),
kind: None,
@ -359,9 +330,6 @@ expression: diff.instruction_rows
address: 84,
size: 4,
opcode: 43,
branch_dest: Some(
96,
),
},
),
kind: None,
@ -380,7 +348,6 @@ expression: diff.instruction_rows
address: 88,
size: 4,
opcode: 41,
branch_dest: None,
},
),
kind: None,
@ -394,9 +361,6 @@ expression: diff.instruction_rows
address: 92,
size: 4,
opcode: 45,
branch_dest: Some(
108,
),
},
),
kind: None,
@ -415,7 +379,6 @@ expression: diff.instruction_rows
address: 96,
size: 4,
opcode: 42,
branch_dest: None,
},
),
kind: None,
@ -436,7 +399,6 @@ expression: diff.instruction_rows
address: 100,
size: 4,
opcode: 41,
branch_dest: None,
},
),
kind: None,
@ -450,7 +412,6 @@ expression: diff.instruction_rows
address: 104,
size: 4,
opcode: 94,
branch_dest: None,
},
),
kind: None,
@ -464,7 +425,6 @@ expression: diff.instruction_rows
address: 108,
size: 4,
opcode: 60,
branch_dest: None,
},
),
kind: None,
@ -485,7 +445,6 @@ expression: diff.instruction_rows
address: 112,
size: 4,
opcode: 41,
branch_dest: None,
},
),
kind: None,
@ -499,7 +458,6 @@ expression: diff.instruction_rows
address: 116,
size: 4,
opcode: 38,
branch_dest: None,
},
),
kind: None,
@ -513,7 +471,6 @@ expression: diff.instruction_rows
address: 120,
size: 4,
opcode: 166,
branch_dest: None,
},
),
kind: None,
@ -527,9 +484,6 @@ expression: diff.instruction_rows
address: 124,
size: 4,
opcode: 43,
branch_dest: Some(
136,
),
},
),
kind: None,
@ -548,7 +502,6 @@ expression: diff.instruction_rows
address: 128,
size: 4,
opcode: 41,
branch_dest: None,
},
),
kind: None,
@ -562,9 +515,6 @@ expression: diff.instruction_rows
address: 132,
size: 4,
opcode: 45,
branch_dest: Some(
148,
),
},
),
kind: None,
@ -583,7 +533,6 @@ expression: diff.instruction_rows
address: 136,
size: 4,
opcode: 42,
branch_dest: None,
},
),
kind: None,
@ -604,7 +553,6 @@ expression: diff.instruction_rows
address: 140,
size: 4,
opcode: 41,
branch_dest: None,
},
),
kind: None,
@ -618,7 +566,6 @@ expression: diff.instruction_rows
address: 144,
size: 4,
opcode: 94,
branch_dest: None,
},
),
kind: None,
@ -632,7 +579,6 @@ expression: diff.instruction_rows
address: 148,
size: 4,
opcode: 41,
branch_dest: None,
},
),
kind: None,
@ -653,7 +599,6 @@ expression: diff.instruction_rows
address: 152,
size: 4,
opcode: 41,
branch_dest: None,
},
),
kind: None,
@ -667,7 +612,6 @@ expression: diff.instruction_rows
address: 156,
size: 4,
opcode: 166,
branch_dest: None,
},
),
kind: None,
@ -681,7 +625,6 @@ expression: diff.instruction_rows
address: 160,
size: 4,
opcode: 42,
branch_dest: None,
},
),
kind: None,
@ -695,7 +638,6 @@ expression: diff.instruction_rows
address: 164,
size: 4,
opcode: 41,
branch_dest: None,
},
),
kind: None,
@ -709,7 +651,6 @@ expression: diff.instruction_rows
address: 168,
size: 4,
opcode: 166,
branch_dest: None,
},
),
kind: None,
@ -723,7 +664,6 @@ expression: diff.instruction_rows
address: 172,
size: 4,
opcode: 41,
branch_dest: None,
},
),
kind: None,
@ -737,7 +677,6 @@ expression: diff.instruction_rows
address: 176,
size: 4,
opcode: 162,
branch_dest: None,
},
),
kind: None,
@ -751,7 +690,6 @@ expression: diff.instruction_rows
address: 180,
size: 4,
opcode: 94,
branch_dest: None,
},
),
kind: None,
@ -765,7 +703,6 @@ expression: diff.instruction_rows
address: 184,
size: 4,
opcode: 66,
branch_dest: None,
},
),
kind: None,
@ -779,9 +716,6 @@ expression: diff.instruction_rows
address: 188,
size: 4,
opcode: 43,
branch_dest: Some(
196,
),
},
),
kind: None,
@ -800,7 +734,6 @@ expression: diff.instruction_rows
address: 192,
size: 4,
opcode: 166,
branch_dest: None,
},
),
kind: None,
@ -814,7 +747,6 @@ expression: diff.instruction_rows
address: 196,
size: 4,
opcode: 163,
branch_dest: None,
},
),
kind: None,
@ -835,7 +767,6 @@ expression: diff.instruction_rows
address: 200,
size: 4,
opcode: 94,
branch_dest: None,
},
),
kind: None,
@ -849,7 +780,6 @@ expression: diff.instruction_rows
address: 204,
size: 4,
opcode: 66,
branch_dest: None,
},
),
kind: None,
@ -863,9 +793,6 @@ expression: diff.instruction_rows
address: 208,
size: 4,
opcode: 43,
branch_dest: Some(
216,
),
},
),
kind: None,
@ -884,7 +811,6 @@ expression: diff.instruction_rows
address: 212,
size: 4,
opcode: 166,
branch_dest: None,
},
),
kind: None,
@ -898,7 +824,6 @@ expression: diff.instruction_rows
address: 216,
size: 4,
opcode: 163,
branch_dest: None,
},
),
kind: None,
@ -919,7 +844,6 @@ expression: diff.instruction_rows
address: 220,
size: 4,
opcode: 94,
branch_dest: None,
},
),
kind: None,
@ -933,7 +857,6 @@ expression: diff.instruction_rows
address: 224,
size: 4,
opcode: 66,
branch_dest: None,
},
),
kind: None,
@ -947,9 +870,6 @@ expression: diff.instruction_rows
address: 228,
size: 4,
opcode: 43,
branch_dest: Some(
236,
),
},
),
kind: None,
@ -968,7 +888,6 @@ expression: diff.instruction_rows
address: 232,
size: 4,
opcode: 166,
branch_dest: None,
},
),
kind: None,
@ -982,7 +901,6 @@ expression: diff.instruction_rows
address: 236,
size: 4,
opcode: 163,
branch_dest: None,
},
),
kind: None,
@ -1003,7 +921,6 @@ expression: diff.instruction_rows
address: 240,
size: 4,
opcode: 94,
branch_dest: None,
},
),
kind: None,
@ -1017,7 +934,6 @@ expression: diff.instruction_rows
address: 244,
size: 4,
opcode: 66,
branch_dest: None,
},
),
kind: None,
@ -1031,9 +947,6 @@ expression: diff.instruction_rows
address: 248,
size: 4,
opcode: 43,
branch_dest: Some(
256,
),
},
),
kind: None,
@ -1052,7 +965,6 @@ expression: diff.instruction_rows
address: 252,
size: 4,
opcode: 166,
branch_dest: None,
},
),
kind: None,
@ -1066,7 +978,6 @@ expression: diff.instruction_rows
address: 256,
size: 4,
opcode: 41,
branch_dest: None,
},
),
kind: None,
@ -1087,7 +998,6 @@ expression: diff.instruction_rows
address: 260,
size: 4,
opcode: 47,
branch_dest: None,
},
),
kind: None,

View File

@ -9,7 +9,6 @@ expression: diff.instruction_rows
address: 0,
size: 1,
opcode: 640,
branch_dest: None,
},
),
kind: None,
@ -23,7 +22,6 @@ expression: diff.instruction_rows
address: 1,
size: 2,
opcode: 414,
branch_dest: None,
},
),
kind: None,
@ -37,7 +35,6 @@ expression: diff.instruction_rows
address: 3,
size: 5,
opcode: 640,
branch_dest: None,
},
),
kind: None,
@ -51,7 +48,6 @@ expression: diff.instruction_rows
address: 8,
size: 5,
opcode: 59,
branch_dest: None,
},
),
kind: None,
@ -65,7 +61,6 @@ expression: diff.instruction_rows
address: 13,
size: 3,
opcode: 7,
branch_dest: None,
},
),
kind: None,
@ -79,7 +74,6 @@ expression: diff.instruction_rows
address: 16,
size: 1,
opcode: 590,
branch_dest: None,
},
),
kind: None,
@ -93,7 +87,6 @@ expression: diff.instruction_rows
address: 17,
size: 1,
opcode: 662,
branch_dest: None,
},
),
kind: None,

View File

@ -9,7 +9,6 @@ expression: diff.instruction_rows
address: 0,
size: 5,
opcode: 414,
branch_dest: None,
},
),
kind: None,
@ -23,7 +22,6 @@ expression: diff.instruction_rows
address: 5,
size: 5,
opcode: 414,
branch_dest: None,
},
),
kind: None,
@ -37,7 +35,6 @@ expression: diff.instruction_rows
address: 10,
size: 1,
opcode: 640,
branch_dest: None,
},
),
kind: None,
@ -51,7 +48,6 @@ expression: diff.instruction_rows
address: 11,
size: 4,
opcode: 740,
branch_dest: None,
},
),
kind: None,
@ -65,7 +61,6 @@ expression: diff.instruction_rows
address: 15,
size: 5,
opcode: 414,
branch_dest: None,
},
),
kind: None,
@ -79,7 +74,6 @@ expression: diff.instruction_rows
address: 20,
size: 5,
opcode: 414,
branch_dest: None,
},
),
kind: None,
@ -93,7 +87,6 @@ expression: diff.instruction_rows
address: 25,
size: 4,
opcode: 448,
branch_dest: None,
},
),
kind: None,
@ -107,7 +100,6 @@ expression: diff.instruction_rows
address: 29,
size: 4,
opcode: 460,
branch_dest: None,
},
),
kind: None,
@ -121,7 +113,6 @@ expression: diff.instruction_rows
address: 33,
size: 5,
opcode: 414,
branch_dest: None,
},
),
kind: None,
@ -135,7 +126,6 @@ expression: diff.instruction_rows
address: 38,
size: 5,
opcode: 414,
branch_dest: None,
},
),
kind: None,
@ -149,7 +139,6 @@ expression: diff.instruction_rows
address: 43,
size: 5,
opcode: 448,
branch_dest: None,
},
),
kind: None,
@ -163,7 +152,6 @@ expression: diff.instruction_rows
address: 48,
size: 5,
opcode: 460,
branch_dest: None,
},
),
kind: None,
@ -177,7 +165,6 @@ expression: diff.instruction_rows
address: 53,
size: 4,
opcode: 11,
branch_dest: None,
},
),
kind: None,
@ -191,7 +178,6 @@ expression: diff.instruction_rows
address: 57,
size: 5,
opcode: 414,
branch_dest: None,
},
),
kind: None,
@ -205,7 +191,6 @@ expression: diff.instruction_rows
address: 62,
size: 5,
opcode: 414,
branch_dest: None,
},
),
kind: None,
@ -219,7 +204,6 @@ expression: diff.instruction_rows
address: 67,
size: 5,
opcode: 448,
branch_dest: None,
},
),
kind: None,
@ -233,7 +217,6 @@ expression: diff.instruction_rows
address: 72,
size: 5,
opcode: 460,
branch_dest: None,
},
),
kind: None,
@ -247,7 +230,6 @@ expression: diff.instruction_rows
address: 77,
size: 4,
opcode: 11,
branch_dest: None,
},
),
kind: None,
@ -261,7 +243,6 @@ expression: diff.instruction_rows
address: 81,
size: 4,
opcode: 7,
branch_dest: None,
},
),
kind: None,
@ -275,7 +256,6 @@ expression: diff.instruction_rows
address: 85,
size: 1,
opcode: 590,
branch_dest: None,
},
),
kind: None,
@ -289,7 +269,6 @@ expression: diff.instruction_rows
address: 86,
size: 1,
opcode: 662,
branch_dest: None,
},
),
kind: None,

View File

@ -42,11 +42,11 @@ expression: obj.sections
name: ".rdata",
address: 0,
size: 0,
kind: Unknown,
kind: Data,
data: SectionData(
0,
),
flags: FlagSet(),
flags: FlagSet(Hidden),
align: Some(
4,
),
@ -59,11 +59,11 @@ expression: obj.sections
name: ".rdata",
address: 0,
size: 0,
kind: Unknown,
kind: Data,
data: SectionData(
0,
),
flags: FlagSet(),
flags: FlagSet(Hidden),
align: Some(
4,
),
@ -76,11 +76,11 @@ expression: obj.sections
name: ".text$mn",
address: 0,
size: 0,
kind: Unknown,
kind: Code,
data: SectionData(
0,
),
flags: FlagSet(),
flags: FlagSet(Hidden),
align: Some(
16,
),
@ -425,11 +425,11 @@ expression: obj.sections
name: ".rdata$r",
address: 0,
size: 0,
kind: Unknown,
kind: Data,
data: SectionData(
0,
),
flags: FlagSet(),
flags: FlagSet(Hidden),
align: Some(
4,
),
@ -442,11 +442,11 @@ expression: obj.sections
name: ".rdata$r",
address: 0,
size: 0,
kind: Unknown,
kind: Data,
data: SectionData(
0,
),
flags: FlagSet(),
flags: FlagSet(Hidden),
align: Some(
4,
),
@ -459,11 +459,11 @@ expression: obj.sections
name: ".data$rs",
address: 0,
size: 0,
kind: Unknown,
kind: Data,
data: SectionData(
0,
),
flags: FlagSet(),
flags: FlagSet(Hidden),
align: Some(
4,
),
@ -476,11 +476,11 @@ expression: obj.sections
name: ".rdata$r",
address: 0,
size: 0,
kind: Unknown,
kind: Data,
data: SectionData(
0,
),
flags: FlagSet(),
flags: FlagSet(Hidden),
align: Some(
4,
),
@ -493,11 +493,11 @@ expression: obj.sections
name: ".rdata$r",
address: 0,
size: 0,
kind: Unknown,
kind: Data,
data: SectionData(
0,
),
flags: FlagSet(),
flags: FlagSet(Hidden),
align: Some(
4,
),
@ -510,11 +510,11 @@ expression: obj.sections
name: ".rdata$r",
address: 0,
size: 0,
kind: Unknown,
kind: Data,
data: SectionData(
0,
),
flags: FlagSet(),
flags: FlagSet(Hidden),
align: Some(
4,
),
@ -527,11 +527,11 @@ expression: obj.sections
name: ".rdata$r",
address: 0,
size: 0,
kind: Unknown,
kind: Data,
data: SectionData(
0,
),
flags: FlagSet(),
flags: FlagSet(Hidden),
align: Some(
4,
),
@ -544,11 +544,11 @@ expression: obj.sections
name: ".data$rs",
address: 0,
size: 0,
kind: Unknown,
kind: Data,
data: SectionData(
0,
),
flags: FlagSet(),
flags: FlagSet(Hidden),
align: Some(
4,
),
@ -561,11 +561,11 @@ expression: obj.sections
name: ".rdata$r",
address: 0,
size: 0,
kind: Unknown,
kind: Data,
data: SectionData(
0,
),
flags: FlagSet(),
flags: FlagSet(Hidden),
align: Some(
4,
),
@ -578,11 +578,11 @@ expression: obj.sections
name: ".rdata$r",
address: 0,
size: 0,
kind: Unknown,
kind: Data,
data: SectionData(
0,
),
flags: FlagSet(),
flags: FlagSet(Hidden),
align: Some(
4,
),
@ -595,11 +595,11 @@ expression: obj.sections
name: ".rdata$r",
address: 0,
size: 0,
kind: Unknown,
kind: Data,
data: SectionData(
0,
),
flags: FlagSet(),
flags: FlagSet(Hidden),
align: Some(
4,
),
@ -612,11 +612,11 @@ expression: obj.sections
name: ".rdata$r",
address: 0,
size: 0,
kind: Unknown,
kind: Data,
data: SectionData(
0,
),
flags: FlagSet(),
flags: FlagSet(Hidden),
align: Some(
4,
),
@ -629,11 +629,11 @@ expression: obj.sections
name: ".text$mn",
address: 0,
size: 0,
kind: Unknown,
kind: Code,
data: SectionData(
0,
),
flags: FlagSet(),
flags: FlagSet(Hidden),
align: Some(
1,
),
@ -646,11 +646,11 @@ expression: obj.sections
name: ".rdata$r",
address: 0,
size: 0,
kind: Unknown,
kind: Data,
data: SectionData(
0,
),
flags: FlagSet(),
flags: FlagSet(Hidden),
align: Some(
4,
),
@ -663,11 +663,11 @@ expression: obj.sections
name: ".text$mn",
address: 0,
size: 0,
kind: Unknown,
kind: Code,
data: SectionData(
0,
),
flags: FlagSet(),
flags: FlagSet(Hidden),
align: Some(
16,
),
@ -680,11 +680,11 @@ expression: obj.sections
name: ".text$mn",
address: 0,
size: 0,
kind: Unknown,
kind: Code,
data: SectionData(
0,
),
flags: FlagSet(),
flags: FlagSet(Hidden),
align: Some(
16,
),
@ -697,11 +697,11 @@ expression: obj.sections
name: ".text$mn",
address: 0,
size: 0,
kind: Unknown,
kind: Code,
data: SectionData(
0,
),
flags: FlagSet(),
flags: FlagSet(Hidden),
align: Some(
16,
),
@ -714,11 +714,11 @@ expression: obj.sections
name: ".text$mn",
address: 0,
size: 0,
kind: Unknown,
kind: Code,
data: SectionData(
0,
),
flags: FlagSet(),
flags: FlagSet(Hidden),
align: Some(
16,
),
@ -731,11 +731,11 @@ expression: obj.sections
name: ".text$mn",
address: 0,
size: 0,
kind: Unknown,
kind: Code,
data: SectionData(
0,
),
flags: FlagSet(),
flags: FlagSet(Hidden),
align: Some(
16,
),
@ -902,11 +902,11 @@ expression: obj.sections
name: ".text$yd",
address: 0,
size: 0,
kind: Unknown,
kind: Code,
data: SectionData(
0,
),
flags: FlagSet(),
flags: FlagSet(Hidden),
align: Some(
16,
),
@ -919,11 +919,11 @@ expression: obj.sections
name: ".rdata",
address: 0,
size: 0,
kind: Unknown,
kind: Data,
data: SectionData(
0,
),
flags: FlagSet(),
flags: FlagSet(Hidden),
align: Some(
4,
),
@ -936,11 +936,11 @@ expression: obj.sections
name: ".rdata",
address: 0,
size: 0,
kind: Unknown,
kind: Data,
data: SectionData(
0,
),
flags: FlagSet(),
flags: FlagSet(Hidden),
align: Some(
4,
),
@ -953,11 +953,11 @@ expression: obj.sections
name: ".data",
address: 0,
size: 0,
kind: Unknown,
kind: Data,
data: SectionData(
0,
),
flags: FlagSet(),
flags: FlagSet(Hidden),
align: Some(
4,
),
@ -970,11 +970,11 @@ expression: obj.sections
name: ".rdata$r",
address: 0,
size: 0,
kind: Unknown,
kind: Data,
data: SectionData(
0,
),
flags: FlagSet(),
flags: FlagSet(Hidden),
align: Some(
4,
),
@ -987,11 +987,11 @@ expression: obj.sections
name: ".rdata$r",
address: 0,
size: 0,
kind: Unknown,
kind: Data,
data: SectionData(
0,
),
flags: FlagSet(),
flags: FlagSet(Hidden),
align: Some(
4,
),

View File

@ -9,7 +9,6 @@ expression: diff.instruction_rows
address: 0,
size: 4,
opcode: 414,
branch_dest: None,
},
),
kind: None,
@ -23,7 +22,6 @@ expression: diff.instruction_rows
address: 4,
size: 1,
opcode: 137,
branch_dest: None,
},
),
kind: None,
@ -37,7 +35,6 @@ expression: diff.instruction_rows
address: 5,
size: 3,
opcode: 93,
branch_dest: None,
},
),
kind: None,
@ -51,9 +48,6 @@ expression: diff.instruction_rows
address: 8,
size: 2,
opcode: 297,
branch_dest: Some(
58,
),
},
),
kind: None,
@ -72,9 +66,6 @@ expression: diff.instruction_rows
address: 10,
size: 7,
opcode: 308,
branch_dest: Some(
60,
),
},
),
kind: None,
@ -93,7 +84,6 @@ expression: diff.instruction_rows
address: 17,
size: 5,
opcode: 414,
branch_dest: None,
},
),
kind: None,
@ -114,7 +104,6 @@ expression: diff.instruction_rows
address: 22,
size: 1,
opcode: 662,
branch_dest: None,
},
),
kind: None,
@ -128,7 +117,6 @@ expression: diff.instruction_rows
address: 23,
size: 5,
opcode: 414,
branch_dest: None,
},
),
kind: None,
@ -149,7 +137,6 @@ expression: diff.instruction_rows
address: 28,
size: 1,
opcode: 662,
branch_dest: None,
},
),
kind: None,
@ -163,7 +150,6 @@ expression: diff.instruction_rows
address: 29,
size: 5,
opcode: 414,
branch_dest: None,
},
),
kind: None,
@ -184,7 +170,6 @@ expression: diff.instruction_rows
address: 34,
size: 1,
opcode: 662,
branch_dest: None,
},
),
kind: None,
@ -198,7 +183,6 @@ expression: diff.instruction_rows
address: 35,
size: 5,
opcode: 414,
branch_dest: None,
},
),
kind: None,
@ -219,7 +203,6 @@ expression: diff.instruction_rows
address: 40,
size: 1,
opcode: 662,
branch_dest: None,
},
),
kind: None,
@ -233,7 +216,6 @@ expression: diff.instruction_rows
address: 41,
size: 5,
opcode: 414,
branch_dest: None,
},
),
kind: None,
@ -254,7 +236,6 @@ expression: diff.instruction_rows
address: 46,
size: 1,
opcode: 662,
branch_dest: None,
},
),
kind: None,
@ -268,7 +249,6 @@ expression: diff.instruction_rows
address: 47,
size: 5,
opcode: 414,
branch_dest: None,
},
),
kind: None,
@ -289,7 +269,6 @@ expression: diff.instruction_rows
address: 52,
size: 1,
opcode: 662,
branch_dest: None,
},
),
kind: None,
@ -303,7 +282,6 @@ expression: diff.instruction_rows
address: 53,
size: 5,
opcode: 414,
branch_dest: None,
},
),
kind: None,
@ -324,7 +302,6 @@ expression: diff.instruction_rows
address: 58,
size: 1,
opcode: 662,
branch_dest: None,
},
),
kind: None,
@ -345,7 +322,6 @@ expression: diff.instruction_rows
address: 59,
size: 1,
opcode: 465,
branch_dest: None,
},
),
kind: None,
@ -359,9 +335,6 @@ expression: diff.instruction_rows
address: 60,
size: 4,
opcode: 65534,
branch_dest: Some(
17,
),
},
),
kind: None,
@ -387,9 +360,6 @@ expression: diff.instruction_rows
address: 64,
size: 4,
opcode: 65534,
branch_dest: Some(
23,
),
},
),
kind: None,
@ -408,9 +378,6 @@ expression: diff.instruction_rows
address: 68,
size: 4,
opcode: 65534,
branch_dest: Some(
29,
),
},
),
kind: None,
@ -429,9 +396,6 @@ expression: diff.instruction_rows
address: 72,
size: 4,
opcode: 65534,
branch_dest: Some(
35,
),
},
),
kind: None,
@ -450,9 +414,6 @@ expression: diff.instruction_rows
address: 76,
size: 4,
opcode: 65534,
branch_dest: Some(
41,
),
},
),
kind: None,
@ -471,9 +432,6 @@ expression: diff.instruction_rows
address: 80,
size: 4,
opcode: 65534,
branch_dest: Some(
47,
),
},
),
kind: None,
@ -492,9 +450,6 @@ expression: diff.instruction_rows
address: 84,
size: 4,
opcode: 65534,
branch_dest: Some(
53,
),
},
),
kind: None,
@ -513,7 +468,6 @@ expression: diff.instruction_rows
address: 88,
size: 1,
opcode: 465,
branch_dest: None,
},
),
kind: None,
@ -527,7 +481,6 @@ expression: diff.instruction_rows
address: 89,
size: 1,
opcode: 465,
branch_dest: None,
},
),
kind: None,
@ -541,7 +494,6 @@ expression: diff.instruction_rows
address: 90,
size: 1,
opcode: 465,
branch_dest: None,
},
),
kind: None,
@ -555,7 +507,6 @@ expression: diff.instruction_rows
address: 91,
size: 1,
opcode: 465,
branch_dest: None,
},
),
kind: None,
@ -569,7 +520,6 @@ expression: diff.instruction_rows
address: 92,
size: 1,
opcode: 465,
branch_dest: None,
},
),
kind: None,
@ -583,7 +533,6 @@ expression: diff.instruction_rows
address: 93,
size: 1,
opcode: 465,
branch_dest: None,
},
),
kind: None,
@ -597,7 +546,6 @@ expression: diff.instruction_rows
address: 94,
size: 1,
opcode: 465,
branch_dest: None,
},
),
kind: None,
@ -611,7 +559,6 @@ expression: diff.instruction_rows
address: 95,
size: 1,
opcode: 465,
branch_dest: None,
},
),
kind: None,

View File

@ -6,7 +6,7 @@ expression: output
[(Address(4), Normal, 5), (Spacing(4), Normal, 0), (Opcode("dec", 137), Normal, 10), (Argument(Opaque("eax")), Normal, 0), (Eol, Normal, 0)]
[(Address(5), Normal, 5), (Spacing(4), Normal, 0), (Opcode("cmp", 93), Normal, 10), (Argument(Opaque("eax")), Normal, 0), (Basic(","), Normal, 0), (Spacing(1), Normal, 0), (Argument(Unsigned(6)), Normal, 0), (Eol, Normal, 0)]
[(Address(8), Normal, 5), (Spacing(4), Normal, 0), (Opcode("ja", 297), Normal, 10), (Argument(Opaque("short")), Normal, 0), (Spacing(1), Normal, 0), (BranchDest(58), Normal, 0), (Basic(" ~>"), Rotating(0), 0), (Eol, Normal, 0)]
[(Address(10), Normal, 5), (Spacing(4), Normal, 0), (Opcode("jmp", 308), Normal, 10), (Argument(Opaque("dword")), Normal, 0), (Spacing(1), Normal, 0), (Argument(Opaque("ptr")), Normal, 0), (Spacing(1), Normal, 0), (Basic("["), Normal, 0), (Argument(Opaque("eax")), Normal, 0), (Argument(Opaque("*")), Normal, 0), (Argument(Signed(4)), Normal, 0), (Argument(Opaque("+")), Normal, 0), (BranchDest(60), Normal, 0), (Basic("]"), Normal, 0), (Basic(" ~>"), Rotating(1), 0), (Eol, Normal, 0)]
[(Address(10), Normal, 5), (Spacing(4), Normal, 0), (Opcode("jmp", 308), Normal, 10), (Argument(Opaque("dword")), Normal, 0), (Spacing(1), Normal, 0), (Argument(Opaque("ptr")), Normal, 0), (Spacing(1), Normal, 0), (Basic("["), Normal, 0), (Argument(Opaque("eax")), Normal, 0), (Argument(Opaque("*")), Normal, 0), (Argument(Signed(4)), Normal, 0), (Argument(Opaque("+")), Normal, 0), (Symbol(Symbol { name: "$L282", demangled_name: None, address: 60, size: 0, kind: Unknown, section: Some(1), flags: FlagSet(Local), align: None, virtual_address: None }), Bright, 0), (Basic("]"), Normal, 0), (Basic(" ~>"), Rotating(1), 0), (Eol, Normal, 0)]
[(Address(17), Normal, 5), (Basic(" ~> "), Rotating(2), 0), (Opcode("mov", 414), Normal, 10), (Argument(Opaque("eax")), Normal, 0), (Basic(","), Normal, 0), (Spacing(1), Normal, 0), (Argument(Unsigned(8)), Normal, 0), (Eol, Normal, 0)]
[(Address(22), Normal, 5), (Spacing(4), Normal, 0), (Opcode("ret", 662), Normal, 10), (Eol, Normal, 0)]
[(Address(23), Normal, 5), (Basic(" ~> "), Rotating(3), 0), (Opcode("mov", 414), Normal, 10), (Argument(Opaque("eax")), Normal, 0), (Basic(","), Normal, 0), (Spacing(1), Normal, 0), (Argument(Unsigned(7)), Normal, 0), (Eol, Normal, 0)]
@ -22,13 +22,13 @@ expression: output
[(Address(53), Normal, 5), (Basic(" ~> "), Rotating(8), 0), (Opcode("mov", 414), Normal, 10), (Argument(Opaque("eax")), Normal, 0), (Basic(","), Normal, 0), (Spacing(1), Normal, 0), (Argument(Unsigned(2)), Normal, 0), (Eol, Normal, 0)]
[(Address(58), Normal, 5), (Basic(" ~> "), Rotating(0), 0), (Opcode("ret", 662), Normal, 10), (Eol, Normal, 0)]
[(Address(59), Normal, 5), (Spacing(4), Normal, 0), (Opcode("nop", 465), Normal, 10), (Eol, Normal, 0)]
[(Address(60), Normal, 5), (Basic(" ~> "), Rotating(1), 0), (Opcode(".dword", 65534), Normal, 10), (BranchDest(17), Normal, 0), (Basic(" ~>"), Rotating(2), 0), (Eol, Normal, 0)]
[(Address(64), Normal, 5), (Spacing(4), Normal, 0), (Opcode(".dword", 65534), Normal, 10), (BranchDest(23), Normal, 0), (Basic(" ~>"), Rotating(3), 0), (Eol, Normal, 0)]
[(Address(68), Normal, 5), (Spacing(4), Normal, 0), (Opcode(".dword", 65534), Normal, 10), (BranchDest(29), Normal, 0), (Basic(" ~>"), Rotating(4), 0), (Eol, Normal, 0)]
[(Address(72), Normal, 5), (Spacing(4), Normal, 0), (Opcode(".dword", 65534), Normal, 10), (BranchDest(35), Normal, 0), (Basic(" ~>"), Rotating(5), 0), (Eol, Normal, 0)]
[(Address(76), Normal, 5), (Spacing(4), Normal, 0), (Opcode(".dword", 65534), Normal, 10), (BranchDest(41), Normal, 0), (Basic(" ~>"), Rotating(6), 0), (Eol, Normal, 0)]
[(Address(80), Normal, 5), (Spacing(4), Normal, 0), (Opcode(".dword", 65534), Normal, 10), (BranchDest(47), Normal, 0), (Basic(" ~>"), Rotating(7), 0), (Eol, Normal, 0)]
[(Address(84), Normal, 5), (Spacing(4), Normal, 0), (Opcode(".dword", 65534), Normal, 10), (BranchDest(53), Normal, 0), (Basic(" ~>"), Rotating(8), 0), (Eol, Normal, 0)]
[(Address(60), Normal, 5), (Basic(" ~> "), Rotating(1), 0), (Opcode(".dword", 65534), Normal, 10), (Symbol(Symbol { name: "$L272", demangled_name: None, address: 17, size: 0, kind: Unknown, section: Some(1), flags: FlagSet(Local), align: None, virtual_address: None }), Bright, 0), (Basic(" ~>"), Rotating(2), 0), (Eol, Normal, 0)]
[(Address(64), Normal, 5), (Spacing(4), Normal, 0), (Opcode(".dword", 65534), Normal, 10), (Symbol(Symbol { name: "$L273", demangled_name: None, address: 23, size: 0, kind: Unknown, section: Some(1), flags: FlagSet(Local), align: None, virtual_address: None }), Bright, 0), (Basic(" ~>"), Rotating(3), 0), (Eol, Normal, 0)]
[(Address(68), Normal, 5), (Spacing(4), Normal, 0), (Opcode(".dword", 65534), Normal, 10), (Symbol(Symbol { name: "$L274", demangled_name: None, address: 29, size: 0, kind: Unknown, section: Some(1), flags: FlagSet(Local), align: None, virtual_address: None }), Bright, 0), (Basic(" ~>"), Rotating(4), 0), (Eol, Normal, 0)]
[(Address(72), Normal, 5), (Spacing(4), Normal, 0), (Opcode(".dword", 65534), Normal, 10), (Symbol(Symbol { name: "$L275", demangled_name: None, address: 35, size: 0, kind: Unknown, section: Some(1), flags: FlagSet(Local), align: None, virtual_address: None }), Bright, 0), (Basic(" ~>"), Rotating(5), 0), (Eol, Normal, 0)]
[(Address(76), Normal, 5), (Spacing(4), Normal, 0), (Opcode(".dword", 65534), Normal, 10), (Symbol(Symbol { name: "$L276", demangled_name: None, address: 41, size: 0, kind: Unknown, section: Some(1), flags: FlagSet(Local), align: None, virtual_address: None }), Bright, 0), (Basic(" ~>"), Rotating(6), 0), (Eol, Normal, 0)]
[(Address(80), Normal, 5), (Spacing(4), Normal, 0), (Opcode(".dword", 65534), Normal, 10), (Symbol(Symbol { name: "$L277", demangled_name: None, address: 47, size: 0, kind: Unknown, section: Some(1), flags: FlagSet(Local), align: None, virtual_address: None }), Bright, 0), (Basic(" ~>"), Rotating(7), 0), (Eol, Normal, 0)]
[(Address(84), Normal, 5), (Spacing(4), Normal, 0), (Opcode(".dword", 65534), Normal, 10), (Symbol(Symbol { name: "$L278", demangled_name: None, address: 53, size: 0, kind: Unknown, section: Some(1), flags: FlagSet(Local), align: None, virtual_address: None }), Bright, 0), (Basic(" ~>"), Rotating(8), 0), (Eol, Normal, 0)]
[(Address(88), Normal, 5), (Spacing(4), Normal, 0), (Opcode("nop", 465), Normal, 10), (Eol, Normal, 0)]
[(Address(89), Normal, 5), (Spacing(4), Normal, 0), (Opcode("nop", 465), Normal, 10), (Eol, Normal, 0)]
[(Address(90), Normal, 5), (Spacing(4), Normal, 0), (Opcode("nop", 465), Normal, 10), (Eol, Normal, 0)]

View File

@ -1,163 +0,0 @@
---
source: objdiff-core/tests/arch_x86.rs
expression: obj
---
Object {
arch: ArchX86 {
arch: X86,
endianness: Little,
},
endianness: Little,
symbols: [
Symbol {
name: "42b830_convertToUppercaseShiftJIS.obj",
demangled_name: None,
address: 0,
size: 0,
kind: Unknown,
section: None,
flags: FlagSet(Local),
align: None,
virtual_address: None,
},
Symbol {
name: "[.text]",
demangled_name: None,
address: 0,
size: 0,
kind: Section,
section: Some(
0,
),
flags: FlagSet(Local),
align: None,
virtual_address: None,
},
Symbol {
name: "LAB_0042b850",
demangled_name: None,
address: 32,
size: 0,
kind: Object,
section: Some(
0,
),
flags: FlagSet(Local),
align: None,
virtual_address: None,
},
Symbol {
name: "LAB_0042b883",
demangled_name: None,
address: 83,
size: 0,
kind: Object,
section: Some(
0,
),
flags: FlagSet(Local),
align: None,
virtual_address: None,
},
Symbol {
name: "LAB_0042b87c",
demangled_name: None,
address: 76,
size: 0,
kind: Object,
section: Some(
0,
),
flags: FlagSet(Local),
align: None,
virtual_address: None,
},
Symbol {
name: "LAB_0042b884",
demangled_name: None,
address: 84,
size: 0,
kind: Object,
section: Some(
0,
),
flags: FlagSet(Local),
align: None,
virtual_address: None,
},
Symbol {
name: "LAB_0042b889",
demangled_name: None,
address: 89,
size: 0,
kind: Object,
section: Some(
0,
),
flags: FlagSet(Local),
align: None,
virtual_address: None,
},
Symbol {
name: "LAB_0042b845",
demangled_name: None,
address: 21,
size: 0,
kind: Object,
section: Some(
0,
),
flags: FlagSet(Local),
align: None,
virtual_address: None,
},
Symbol {
name: "LAB_0042b869",
demangled_name: None,
address: 57,
size: 0,
kind: Object,
section: Some(
0,
),
flags: FlagSet(Local),
align: None,
virtual_address: None,
},
Symbol {
name: "ConvertToUppercaseShiftJIS",
demangled_name: None,
address: 0,
size: 92,
kind: Function,
section: Some(
0,
),
flags: FlagSet(Global | SizeInferred),
align: None,
virtual_address: None,
},
],
sections: [
Section {
id: ".text-0",
name: ".text",
address: 0,
size: 92,
kind: Code,
data: SectionData(
92,
),
flags: FlagSet(),
align: Some(
16,
),
relocations: [],
line_info: {},
virtual_address: None,
},
],
split_meta: None,
path: None,
timestamp: None,
}

View File

@ -46,7 +46,7 @@ rlwinmdec = "1.1"
ron = "0.8"
serde = { version = "1.0", features = ["derive"] }
time = { version = "0.3", features = ["formatting", "local-offset"] }
typed-path = "0.11"
typed-path = "0.10"
winit = { version = "0.30", features = ["wayland-csd-adwaita"] }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }

View File

@ -147,20 +147,14 @@ pub(crate) fn data_row_ui(
cur_addr += diff.len;
} else {
for byte in &diff.data {
let mut byte_text = format!("{byte:02x} ");
let mut byte_color = base_color;
if let Some(reloc_diff) = reloc_diffs
.iter()
.find(|reloc_diff| reloc_diff.range.contains(&cur_addr_actual))
{
if *byte == 0 {
// Display 00 data bytes with a relocation as ?? instead.
byte_text = "?? ".to_string();
}
if reloc_diff.kind != DataDiffKind::None {
if let Some(reloc_diff) = reloc_diffs.iter().find(|reloc_diff| {
reloc_diff.kind != DataDiffKind::None
&& reloc_diff.range.contains(&cur_addr_actual)
}) {
byte_color = get_color_for_diff_kind(reloc_diff.kind, appearance);
}
}
let byte_text = format!("{byte:02x} ");
write_text(byte_text.as_str(), byte_color, &mut job, appearance.code_font.clone());
cur_addr += 1;
cur_addr_actual += 1;

View File

@ -49,9 +49,7 @@ impl<'a> DiffColumnContext<'a> {
let selected_symbol = match view {
View::SymbolDiff => None,
View::FunctionDiff | View::ExtabDiff => match (obj, selected_symbol) {
(Some(obj), Some(s)) => {
obj.0.symbol_by_name(&s.symbol_name).map(SelectedSymbol::Symbol)
}
(Some(obj), Some(s)) => find_symbol(&obj.0, s).map(SelectedSymbol::Symbol),
_ => None,
},
View::DataDiff => match (obj, selected_symbol) {
@ -499,7 +497,6 @@ pub fn diff_view_ui(
(state.current_view, left_ctx.obj, right_ctx.obj, left_ctx.section, right_ctx.section)
{
// Joint diff view
hotkeys::check_scroll_hotkeys(ui, true);
let left_total_bytes =
left_section_diff.data_diff.iter().fold(0usize, |accum, item| accum + item.len);
let right_total_bytes =
@ -782,6 +779,10 @@ fn missing_obj_ui(ui: &mut Ui, appearance: &Appearance) {
});
}
fn find_symbol(obj: &Object, selected_symbol: &SymbolRefByName) -> Option<usize> {
obj.symbols.iter().position(|symbol| symbol.name == selected_symbol.symbol_name)
}
fn find_section(obj: &Object, section_name: &str) -> Option<usize> {
obj.sections.iter().position(|section| section.name == section_name)
}

View File

@ -28,13 +28,13 @@ xxhash-rust = { version = "0.8", default-features = false, features = ["xxh3"] }
[dependencies.objdiff-core]
path = "../objdiff-core"
default-features = false
features = ["arm", "arm64", "mips", "ppc", "superh", "x86", "dwarf"]
features = ["arm", "arm64", "mips", "ppc", "x86", "dwarf"]
[target.'cfg(target_family = "wasm")'.dependencies]
talc = { version = "4.4", default-features = false, features = ["lock_api"] }
[target.'cfg(target_os = "wasi")'.dependencies]
wit-bindgen = { version = "0.42", default-features = false, features = ["macros"] }
wit-bindgen = { version = "0.41", default-features = false, features = ["macros"] }
[build-dependencies]
wit-deps = "0.5"

View File

@ -1,12 +1,12 @@
{
"name": "objdiff-wasm",
"version": "3.0.0-beta.9",
"version": "3.0.0-beta.6",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "objdiff-wasm",
"version": "3.0.0-beta.9",
"version": "3.0.0-beta.6",
"license": "MIT OR Apache-2.0",
"devDependencies": {
"@biomejs/biome": "^1.9.3",

View File

@ -1,6 +1,6 @@
{
"name": "objdiff-wasm",
"version": "3.0.0-beta.9",
"version": "3.0.0-beta.6",
"description": "A local diffing tool for decompilation projects.",
"author": {
"name": "Luke Street",

View File

@ -24,14 +24,14 @@ wit_bindgen::generate!({
use exports::objdiff::core::{
diff::{
DiffConfigBorrow, DiffResult, Guest as GuestDiff, GuestDiffConfig, GuestObject,
GuestObjectDiff, MappingConfig, Object, ObjectBorrow, ObjectDiff, ObjectDiffBorrow,
SymbolFlags, SymbolInfo, SymbolKind, SymbolRef,
GuestObjectDiff, Object, ObjectBorrow, ObjectDiff, ObjectDiffBorrow,
},
display::{
ContextItem, ContextItemCopy, ContextItemNavigate, DiffText, DiffTextColor, DiffTextOpcode,
DiffTextSegment, DiffTextSymbol, DisplayConfig, Guest as GuestDisplay, HoverItem,
HoverItemColor, HoverItemText, InstructionDiffKind, InstructionDiffRow, SectionDisplay,
SymbolDisplay, SymbolFilter, SymbolNavigationKind,
SectionDisplaySymbol, SymbolDisplay, SymbolFilter, SymbolFlags, SymbolKind,
SymbolNavigationKind, SymbolRef,
},
};
@ -59,17 +59,15 @@ impl GuestDiff for Component {
left: Option<ObjectBorrow>,
right: Option<ObjectBorrow>,
diff_config: DiffConfigBorrow,
mapping_config: MappingConfig,
) -> Result<DiffResult, String> {
let diff_config = diff_config.get::<ResourceDiffConfig>().0.borrow();
let mapping_config = diff::MappingConfig::from(mapping_config);
log::debug!("Running diff with config: {:?}", diff_config);
let result = diff::diff_objs(
left.as_ref().map(|o| o.get::<ResourceObject>().0.as_ref()),
right.as_ref().map(|o| o.get::<ResourceObject>().0.as_ref()),
None,
&diff_config,
&mapping_config,
&diff::MappingConfig::default(),
)
.map_err(|e| e.to_string())?;
Ok(DiffResult {
@ -136,47 +134,48 @@ impl GuestDisplay for Component {
name: d.name,
size: d.size,
match_percent: d.match_percent,
symbols: d.symbols.into_iter().map(to_symbol_ref).collect(),
symbols: d
.symbols
.into_iter()
.map(|s| SectionDisplaySymbol {
symbol: s.symbol as SymbolRef,
is_mapping_symbol: s.is_mapping_symbol,
})
.collect(),
})
.collect()
}
fn display_symbol(diff: ObjectDiffBorrow, symbol_ref: SymbolRef) -> SymbolDisplay {
fn display_symbol(
diff: ObjectDiffBorrow,
symbol_display: SectionDisplaySymbol,
) -> SymbolDisplay {
let obj_diff = diff.get::<ResourceObjectDiff>();
let obj = obj_diff.0.as_ref();
let obj_diff = &obj_diff.1;
let symbol_display = from_symbol_ref(symbol_ref);
let Some(symbol) = obj.symbols.get(symbol_display.symbol) else {
return SymbolDisplay {
info: SymbolInfo { name: "<unknown>".to_string(), ..Default::default() },
..Default::default()
};
let symbol_idx = symbol_display.symbol as usize;
let Some(symbol) = obj.symbols.get(symbol_idx) else {
return SymbolDisplay { name: "<unknown>".to_string(), ..Default::default() };
};
let symbol_diff = if symbol_display.is_mapping_symbol {
obj_diff
.mapping_symbols
.iter()
.find(|s| s.symbol_index == symbol_display.symbol)
.find(|s| s.symbol_index == symbol_idx)
.map(|s| &s.symbol_diff)
} else {
obj_diff.symbols.get(symbol_display.symbol)
obj_diff.symbols.get(symbol_idx)
};
SymbolDisplay {
info: SymbolInfo {
id: to_symbol_ref(symbol_display),
name: symbol.name.clone(),
demangled_name: symbol.demangled_name.clone(),
address: symbol.address,
size: symbol.size,
kind: SymbolKind::from(symbol.kind),
section: symbol.section.map(|s| s as u32),
section_name: symbol
.section
.and_then(|s| obj.sections.get(s).map(|sec| sec.name.clone())),
flags: SymbolFlags::from(symbol.flags),
align: symbol.align.map(|a| a.get()),
virtual_address: symbol.virtual_address,
},
target_symbol: symbol_diff.and_then(|sd| sd.target_symbol.map(|s| s as u32)),
match_percent: symbol_diff.and_then(|sd| sd.match_percent),
diff_score: symbol_diff.and_then(|sd| sd.diff_score),
@ -186,22 +185,22 @@ impl GuestDisplay for Component {
fn display_instruction_row(
diff: ObjectDiffBorrow,
symbol_ref: SymbolRef,
symbol_display: SectionDisplaySymbol,
row_index: u32,
diff_config: DiffConfigBorrow,
) -> InstructionDiffRow {
let obj_diff = diff.get::<ResourceObjectDiff>();
let obj = obj_diff.0.as_ref();
let obj_diff = &obj_diff.1;
let symbol_display = from_symbol_ref(symbol_ref);
let symbol_idx = symbol_display.symbol as usize;
let symbol_diff = if symbol_display.is_mapping_symbol {
obj_diff
.mapping_symbols
.iter()
.find(|s| s.symbol_index == symbol_display.symbol)
.find(|s| s.symbol_index == symbol_idx)
.map(|s| &s.symbol_diff)
} else {
obj_diff.symbols.get(symbol_display.symbol)
obj_diff.symbols.get(symbol_idx)
};
let Some(row) = symbol_diff.and_then(|sd| sd.instruction_rows.get(row_index as usize))
else {
@ -209,7 +208,7 @@ impl GuestDisplay for Component {
};
let diff_config = diff_config.get::<ResourceDiffConfig>().0.borrow();
let mut segments = Vec::with_capacity(16);
diff::display::display_row(obj, symbol_display.symbol, row, &diff_config, |segment| {
diff::display::display_row(obj, symbol_idx, row, &diff_config, |segment| {
segments.push(DiffTextSegment::from(segment));
Ok(())
})
@ -217,22 +216,26 @@ impl GuestDisplay for Component {
InstructionDiffRow { segments, diff_kind: InstructionDiffKind::from(row.kind) }
}
fn symbol_context(diff: ObjectDiffBorrow, symbol_ref: SymbolRef) -> Vec<ContextItem> {
fn symbol_context(
diff: ObjectDiffBorrow,
symbol_display: SectionDisplaySymbol,
) -> Vec<ContextItem> {
let obj_diff = diff.get::<ResourceObjectDiff>();
let obj = obj_diff.0.as_ref();
let symbol_display = from_symbol_ref(symbol_ref);
diff::display::symbol_context(obj, symbol_display.symbol as usize)
.into_iter()
.map(|item| ContextItem::from(item))
.collect()
}
fn symbol_hover(diff: ObjectDiffBorrow, symbol_ref: SymbolRef) -> Vec<HoverItem> {
fn symbol_hover(
diff: ObjectDiffBorrow,
symbol_display: SectionDisplaySymbol,
) -> Vec<HoverItem> {
let obj_diff = diff.get::<ResourceObjectDiff>();
let obj = obj_diff.0.as_ref();
let addend = 0; // TODO
let override_color = None; // TODO: colorize replaced/deleted/inserted relocations
let symbol_display = from_symbol_ref(symbol_ref);
diff::display::symbol_hover(obj, symbol_display.symbol as usize, addend, override_color)
.into_iter()
.map(|item| HoverItem::from(item))
@ -241,22 +244,22 @@ impl GuestDisplay for Component {
fn instruction_context(
diff: ObjectDiffBorrow,
symbol_ref: SymbolRef,
symbol_display: SectionDisplaySymbol,
row_index: u32,
diff_config: DiffConfigBorrow,
) -> Vec<ContextItem> {
let obj_diff = diff.get::<ResourceObjectDiff>();
let obj = obj_diff.0.as_ref();
let obj_diff = &obj_diff.1;
let symbol_display = from_symbol_ref(symbol_ref);
let symbol_idx = symbol_display.symbol as usize;
let symbol_diff = if symbol_display.is_mapping_symbol {
obj_diff
.mapping_symbols
.iter()
.find(|s| s.symbol_index == symbol_display.symbol)
.find(|s| s.symbol_index == symbol_idx)
.map(|s| &s.symbol_diff)
} else {
obj_diff.symbols.get(symbol_display.symbol)
obj_diff.symbols.get(symbol_idx)
};
let Some(ins_ref) = symbol_diff
.and_then(|sd| sd.instruction_rows.get(row_index as usize))
@ -265,7 +268,7 @@ impl GuestDisplay for Component {
return Vec::new();
};
let diff_config = diff_config.get::<ResourceDiffConfig>().0.borrow();
let Some(resolved) = obj.resolve_instruction_ref(symbol_display.symbol, ins_ref) else {
let Some(resolved) = obj.resolve_instruction_ref(symbol_idx, ins_ref) else {
return vec![ContextItem::Copy(ContextItemCopy {
value: "Failed to resolve instruction".to_string(),
label: Some("error".to_string()),
@ -288,22 +291,22 @@ impl GuestDisplay for Component {
fn instruction_hover(
diff: ObjectDiffBorrow,
symbol_ref: SymbolRef,
symbol_display: SectionDisplaySymbol,
row_index: u32,
diff_config: DiffConfigBorrow,
) -> Vec<HoverItem> {
let obj_diff = diff.get::<ResourceObjectDiff>();
let obj = obj_diff.0.as_ref();
let obj_diff = &obj_diff.1;
let symbol_display = from_symbol_ref(symbol_ref);
let symbol_idx = symbol_display.symbol as usize;
let symbol_diff = if symbol_display.is_mapping_symbol {
obj_diff
.mapping_symbols
.iter()
.find(|s| s.symbol_index == symbol_display.symbol)
.find(|s| s.symbol_index == symbol_idx)
.map(|s| &s.symbol_diff)
} else {
obj_diff.symbols.get(symbol_display.symbol)
obj_diff.symbols.get(symbol_idx)
};
let Some(ins_ref) = symbol_diff
.and_then(|sd| sd.instruction_rows.get(row_index as usize))
@ -312,7 +315,7 @@ impl GuestDisplay for Component {
return Vec::new();
};
let diff_config = diff_config.get::<ResourceDiffConfig>().0.borrow();
let Some(resolved) = obj.resolve_instruction_ref(symbol_display.symbol, ins_ref) else {
let Some(resolved) = obj.resolve_instruction_ref(symbol_idx, ins_ref) else {
return vec![HoverItem::Text(HoverItemText {
label: "Error".to_string(),
value: "Failed to resolve instruction".to_string(),
@ -494,9 +497,11 @@ impl GuestObject for ResourceObject {
}
impl GuestObjectDiff for ResourceObjectDiff {
fn find_symbol(&self, name: String, section_name: Option<String>) -> Option<SymbolInfo> {
fn find_symbol(&self, name: String, section_name: Option<String>) -> Option<SymbolRef> {
let obj = self.0.as_ref();
let symbol_idx = obj.symbols.iter().position(|s| {
obj.symbols
.iter()
.position(|s| {
s.name == name
&& match section_name.as_deref() {
Some(section_name) => {
@ -504,46 +509,8 @@ impl GuestObjectDiff for ResourceObjectDiff {
}
None => true,
}
})?;
let symbol = obj.symbols.get(symbol_idx)?;
Some(SymbolInfo {
id: symbol_idx as SymbolRef,
name: symbol.name.clone(),
demangled_name: symbol.demangled_name.clone(),
address: symbol.address,
size: symbol.size,
kind: SymbolKind::from(symbol.kind),
section: symbol.section.map(|s| s as u32),
section_name: symbol
.section
.and_then(|s| obj.sections.get(s).map(|sec| sec.name.clone())),
flags: SymbolFlags::from(symbol.flags),
align: symbol.align.map(|a| a.get()),
virtual_address: symbol.virtual_address,
})
}
fn get_symbol(&self, symbol_ref: SymbolRef) -> Option<SymbolInfo> {
let obj = self.0.as_ref();
let symbol_display = from_symbol_ref(symbol_ref);
let Some(symbol) = obj.symbols.get(symbol_display.symbol) else {
return None;
};
Some(SymbolInfo {
id: to_symbol_ref(symbol_display),
name: symbol.name.clone(),
demangled_name: symbol.demangled_name.clone(),
address: symbol.address,
size: symbol.size,
kind: SymbolKind::from(symbol.kind),
section: symbol.section.map(|s| s as u32),
section_name: symbol
.section
.and_then(|s| obj.sections.get(s).map(|sec| sec.name.clone())),
flags: SymbolFlags::from(symbol.flags),
align: symbol.align.map(|a| a.get()),
virtual_address: symbol.virtual_address,
})
.map(|i| i as SymbolRef)
}
}
@ -613,28 +580,18 @@ impl Default for SymbolFlags {
fn default() -> Self { Self::empty() }
}
impl Default for SymbolInfo {
impl Default for SymbolDisplay {
fn default() -> Self {
Self {
id: u32::MAX,
name: Default::default(),
demangled_name: Default::default(),
address: Default::default(),
size: Default::default(),
kind: Default::default(),
section: Default::default(),
section_name: Default::default(),
flags: Default::default(),
align: Default::default(),
virtual_address: Default::default(),
}
}
}
impl Default for SymbolDisplay {
fn default() -> Self {
Self {
info: Default::default(),
target_symbol: Default::default(),
match_percent: Default::default(),
diff_score: Default::default(),
@ -643,30 +600,4 @@ impl Default for SymbolDisplay {
}
}
impl From<MappingConfig> for diff::MappingConfig {
fn from(config: MappingConfig) -> Self {
Self {
mappings: config.mappings.into_iter().collect(),
selecting_left: config.selecting_left,
selecting_right: config.selecting_right,
}
}
}
fn from_symbol_ref(symbol_ref: SymbolRef) -> diff::display::SectionDisplaySymbol {
diff::display::SectionDisplaySymbol {
symbol: (symbol_ref & !(1 << 31)) as usize,
is_mapping_symbol: (symbol_ref & (1 << 31)) != 0,
}
}
fn to_symbol_ref(display_symbol: diff::display::SectionDisplaySymbol) -> SymbolRef {
if display_symbol.is_mapping_symbol {
// Use the highest bit to indicate a mapping symbol
display_symbol.symbol as u32 | (1 << 31)
} else {
display_symbol.symbol as u32
}
}
export!(Component);

View File

@ -24,8 +24,58 @@ interface diff {
hash: func() -> u64;
}
resource object-diff {
find-symbol: func(
name: string,
section-name: option<string>
) -> option<u32>;
}
record diff-result {
left: option<object-diff>,
right: option<object-diff>,
}
run-diff: func(
left: option<borrow<object>>,
right: option<borrow<object>>,
config: borrow<diff-config>,
) -> result<diff-result, string>;
}
interface display {
use diff.{
object,
object-diff,
diff-config
};
type symbol-ref = u32;
record display-config {
show-hidden-symbols: bool,
show-mapped-symbols: bool,
reverse-fn-order: bool,
}
record symbol-filter {
regex: option<string>,
mapping: option<symbol-ref>,
}
record section-display-symbol {
symbol: symbol-ref,
is-mapping-symbol: bool,
}
record section-display {
id: string,
name: string,
size: u64,
match-percent: option<f32>,
symbols: list<section-display-symbol>,
}
enum symbol-kind {
unknown,
function,
@ -44,74 +94,17 @@ interface diff {
ignored,
}
record symbol-info {
id: symbol-ref,
record symbol-display {
name: string,
demangled-name: option<string>,
address: u64,
size: u64,
kind: symbol-kind,
section: option<u32>,
section-name: option<string>,
%flags: symbol-flags,
align: option<u32>,
virtual-address: option<u64>,
}
resource object-diff {
find-symbol: func(
name: string,
section-name: option<string>
) -> option<symbol-info>;
get-symbol: func(
id: u32
) -> option<symbol-info>;
}
record diff-result {
left: option<object-diff>,
right: option<object-diff>,
}
run-diff: func(
left: option<borrow<object>>,
right: option<borrow<object>>,
config: borrow<diff-config>,
mapping: mapping-config,
) -> result<diff-result, string>;
}
interface display {
use diff.{
object,
object-diff,
diff-config,
symbol-info,
symbol-ref
};
record display-config {
show-hidden-symbols: bool,
show-mapped-symbols: bool,
reverse-fn-order: bool,
}
record symbol-filter {
regex: option<string>,
mapping: option<symbol-ref>,
}
record section-display {
id: string,
name: string,
size: u64,
match-percent: option<f32>,
symbols: list<symbol-ref>,
}
record symbol-display {
info: symbol-info,
target-symbol: option<symbol-ref>,
match-percent: option<f32>,
diff-score: option<tuple<u64, u64>>,
@ -239,36 +232,36 @@ interface display {
display-symbol: func(
diff: borrow<object-diff>,
symbol: symbol-ref,
symbol: section-display-symbol,
) -> symbol-display;
display-instruction-row: func(
diff: borrow<object-diff>,
symbol: symbol-ref,
symbol: section-display-symbol,
row-index: u32,
config: borrow<diff-config>,
) -> instruction-diff-row;
symbol-context: func(
diff: borrow<object-diff>,
symbol: symbol-ref,
symbol: section-display-symbol,
) -> list<context-item>;
symbol-hover: func(
diff: borrow<object-diff>,
symbol: symbol-ref,
symbol: section-display-symbol,
) -> list<hover-item>;
instruction-context: func(
diff: borrow<object-diff>,
symbol: symbol-ref,
symbol: section-display-symbol,
row-index: u32,
config: borrow<diff-config>,
) -> list<context-item>;
instruction-hover: func(
diff: borrow<object-diff>,
symbol: symbol-ref,
symbol: section-display-symbol,
row-index: u32,
config: borrow<diff-config>,
) -> list<hover-item>;