mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
Support IDA sigs that are based off of the first CALL instruction for a function.
This commit is contained in:
parent
042320718b
commit
95e2bc14f2
1 changed files with 15 additions and 0 deletions
|
|
@ -155,10 +155,25 @@ namespace Dalamud.Game {
|
|||
|
||||
if (IsCopy)
|
||||
scanRet = new IntPtr(scanRet.ToInt64() - this.moduleCopyOffset);
|
||||
|
||||
if (Marshal.ReadByte(scanRet) == 0xE8)
|
||||
return ReadCallSig(scanRet);
|
||||
|
||||
return scanRet;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper for ScanText to get the correct address for
|
||||
/// IDA sigs that mark the first CALL location.
|
||||
/// </summary>
|
||||
/// <param name="sigLocation">The address the CALL sig resolved to.</param>
|
||||
/// <returns>The real offset of the signature.</returns>
|
||||
private IntPtr ReadCallSig(IntPtr SigLocation)
|
||||
{
|
||||
int jumpOffset = Marshal.ReadInt32(IntPtr.Add(SigLocation, 1));
|
||||
return IntPtr.Add(SigLocation, 5 + jumpOffset);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Scan for a byte signature in the .data section.
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue