mirror of
https://github.com/encounter/decomp-toolkit.git
synced 2025-06-14 10:33:45 +00:00
Some ProDG improvements (#101)
This commit is contained in:
parent
88d0e6b789
commit
20e877c9ec
@ -26,7 +26,25 @@ fn split_ctors_dtors(obj: &mut ObjInfo, start: SectionAddress, end: SectionAddre
|
|||||||
let mut current_address = start;
|
let mut current_address = start;
|
||||||
let mut referenced_symbols = vec![];
|
let mut referenced_symbols = vec![];
|
||||||
|
|
||||||
|
// ProDG ctor list can start with -1
|
||||||
|
if matches!(read_u32(ctors_section, current_address.address), Some(0xFFFFFFFF)) {
|
||||||
|
current_address += 4;
|
||||||
|
}
|
||||||
|
|
||||||
while current_address < end {
|
while current_address < end {
|
||||||
|
// ProDG hack when the end address is not known
|
||||||
|
if matches!(read_u32(ctors_section, current_address.address), Some(0)) {
|
||||||
|
while current_address < end {
|
||||||
|
ensure!(
|
||||||
|
matches!(read_u32(ctors_section, current_address.address), Some(0)),
|
||||||
|
"{} data detected at {:#010X} after null pointer",
|
||||||
|
ctors_section.name,
|
||||||
|
current_address,
|
||||||
|
);
|
||||||
|
current_address += 4;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
let function_addr = read_address(obj, ctors_section, current_address.address)?;
|
let function_addr = read_address(obj, ctors_section, current_address.address)?;
|
||||||
log::debug!("Found {} entry: {:#010X}", ctors_section.name, function_addr);
|
log::debug!("Found {} entry: {:#010X}", ctors_section.name, function_addr);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user