mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
Update SigScanner.cs
- add .rdata so GetStaticAddressFromSignature can resolve offsets in that section
This commit is contained in:
parent
b724b10678
commit
998e1be6f4
1 changed files with 21 additions and 1 deletions
|
|
@ -83,6 +83,21 @@ namespace Dalamud.Game
|
|||
/// </summary>
|
||||
public int DataSectionSize { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the base address of the .rdata section search area.
|
||||
/// </summary>
|
||||
public IntPtr RDataSectionBase => new IntPtr(this.SearchBase.ToInt64() + this.RDataSectionOffset);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the offset of the .rdata section from the base of the module.
|
||||
/// </summary>
|
||||
public long RDataSectionOffset { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the size of the .rdata section.
|
||||
/// </summary>
|
||||
public int RDataSectionSize { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the ProcessModule on which the search is performed.
|
||||
/// </summary>
|
||||
|
|
@ -126,7 +141,8 @@ namespace Dalamud.Game
|
|||
instrAddr = IntPtr.Add(instrAddr, 1);
|
||||
num = Marshal.ReadInt32(instrAddr) + (long)instrAddr + 4 - bAddr;
|
||||
}
|
||||
while (!(num >= this.DataSectionOffset && num <= this.DataSectionOffset + this.DataSectionSize));
|
||||
while (!(num >= this.DataSectionOffset && num <= this.DataSectionOffset + this.DataSectionSize)
|
||||
&& !(num >= this.RDataSectionOffset && num <= this.RDataSectionOffset + this.RDataSectionSize));
|
||||
|
||||
return IntPtr.Add(instrAddr, Marshal.ReadInt32(instrAddr) + 4);
|
||||
}
|
||||
|
|
@ -322,6 +338,10 @@ namespace Dalamud.Game
|
|||
this.DataSectionOffset = Marshal.ReadInt32(sectionCursor, 12);
|
||||
this.DataSectionSize = Marshal.ReadInt32(sectionCursor, 8);
|
||||
break;
|
||||
case 0x61746164722E: // .rdata
|
||||
this.RDataSectionOffset = Marshal.ReadInt32(sectionCursor, 12);
|
||||
this.RDataSectionSize = Marshal.ReadInt32(sectionCursor, 8);
|
||||
break;
|
||||
}
|
||||
|
||||
sectionCursor += 40;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue