Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issues caused by the reformatting #328

Merged
merged 1 commit into from
Aug 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions LibCpp2IL/Elf/ElfFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,8 @@ public override (ulong pCodeRegistration, ulong pMetadataRegistration) FindCodeA
if (!addSearchBytes.SequenceEqual(instructionBytes.Skip(0x10)))
continue;

//Check last three bytes of third instruction (so skip 9 bytes, read 3) if (!ldrSearchBytes.SequenceEqual(instructionBytes.Skip(9).Take(3)))
//Check last three bytes of third instruction (so skip 9 bytes, read 3)
if (!ldrSearchBytes.SequenceEqual(instructionBytes.Skip(9).Take(3)))
continue;

//Take the 8th byte, which contains our 'x' value, which specifies where the codereg function is.
Expand Down Expand Up @@ -625,7 +626,8 @@ public override (ulong pCodeRegistration, ulong pMetadataRegistration) FindCodeA
var func = MiniArm64Decompiler.ReadFunctionAtRawAddress(this, (uint)initializerPointer, 7);

//Don't accept anything longer than 7 instructions
//I.e. if it doesn't end with a jump we don't want it if (!MiniArm64Decompiler.IsB(func[^1]))
//I.e. if it doesn't end with a jump we don't want it
if (!MiniArm64Decompiler.IsB(func[^1]))
continue;

var registers = MiniArm64Decompiler.GetAddressesLoadedIntoRegisters(func, (ulong) (_globalOffset + initializerPointer), this);
Expand Down Expand Up @@ -750,4 +752,4 @@ public override byte[] GetEntirePrimaryExecutableSection()

return GetRawBinaryContent().SubArray((int)primarySection.RawAddress, (int)primarySection.Size);
}
}
}
Loading