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

How to implment a correct Aob Scan with reload.memory & reload.memory.SigScan ? #10

Closed
MichaelVanHouHei opened this issue Nov 10, 2024 · 1 comment

Comments

@MichaelVanHouHei
Copy link

I wanted to implement aob scan to a remote process by reload lib , is there any example code that I can tried to implement?
my steps is using OpenProcess GET handle->GET Regions by VirtualQueryEx Look for writtable | excutable -> Save Region base address and size -> using reloaded.Memory.SigScan to get the offset -> region BaseAddress + offset

@Sewer56
Copy link
Member

Sewer56 commented Nov 10, 2024

You seem to be pretty much there.

Read in the regions you obtained VirtualQueryEx using Reloaded.Memory, like the way it is done here.

var externalProcess = new ExternalMemory(process);
var data = externalProcess.ReadRaw((nuint)(nint)module.BaseAddress, module.ModuleMemorySize);
_gcHandle = GCHandle.Alloc(data, GCHandleType.Pinned);
_dataPtr = (byte*)_gcHandle.Value.AddrOfPinnedObject();
_dataLength = data.Length;

And pass the pointer and length to the constructor as needed.

Just be aware, length is limited to 2GiB; I built this thing to originally scan code in EXE files only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants