mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-24 21:51:49 +01:00
Merge 647e2b3c0f into bef50438f5
This commit is contained in:
commit
a022ffb10f
1 changed files with 9 additions and 5 deletions
|
|
@ -288,15 +288,14 @@ public class SigScanner : IDisposable, ISigScanner
|
||||||
|
|
||||||
var scanRet = Scan(this.TextSectionBase, this.TextSectionSize, signature);
|
var scanRet = Scan(this.TextSectionBase, this.TextSectionSize, signature);
|
||||||
|
|
||||||
if (this.IsCopy)
|
|
||||||
scanRet = new IntPtr(scanRet.ToInt64() - this.moduleCopyOffset);
|
|
||||||
|
|
||||||
var insnByte = Marshal.ReadByte(scanRet);
|
var insnByte = Marshal.ReadByte(scanRet);
|
||||||
|
|
||||||
|
var baseAddress = this.IsCopy ? this.moduleCopyOffset + this.Module.BaseAddress : this.Module.BaseAddress;
|
||||||
|
|
||||||
if (insnByte == 0xE8 || insnByte == 0xE9)
|
if (insnByte == 0xE8 || insnByte == 0xE9)
|
||||||
{
|
{
|
||||||
scanRet = ReadJmpCallSig(scanRet);
|
scanRet = ReadJmpCallSig(scanRet);
|
||||||
var rel = scanRet - this.Module.BaseAddress;
|
var rel = scanRet - baseAddress;
|
||||||
if (rel < 0 || rel >= this.TextSectionSize)
|
if (rel < 0 || rel >= this.TextSectionSize)
|
||||||
{
|
{
|
||||||
throw new KeyNotFoundException(
|
throw new KeyNotFoundException(
|
||||||
|
|
@ -304,6 +303,11 @@ public class SigScanner : IDisposable, ISigScanner
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.IsCopy)
|
||||||
|
{
|
||||||
|
scanRet = scanRet - this.moduleCopyOffset;
|
||||||
|
}
|
||||||
|
|
||||||
// If this is below the module, there's bound to be a problem with the sig/resolution... Let's not save it
|
// If this is below the module, there's bound to be a problem with the sig/resolution... Let's not save it
|
||||||
// TODO: THIS IS A HACK! FIX THE ROOT CAUSE!
|
// TODO: THIS IS A HACK! FIX THE ROOT CAUSE!
|
||||||
if (this.textCache != null && scanRet.ToInt64() >= this.Module.BaseAddress.ToInt64())
|
if (this.textCache != null && scanRet.ToInt64() >= this.Module.BaseAddress.ToInt64())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue