Injected DLL need length of function

c++ / delphi package - dll injection and api hooking

Injected DLL need length of function

Postby JuanHuerta » Tue Jun 11, 2019 8:34 pm

Hi everybody

We have a injected dll file into a process and need to calculate a length of a certain function in memory. Can we use madCodeHook for this like we do for injection or something the disasembler make it easy for this? We would like to now how this can be done

~Juan
JuanHuerta
 
Posts: 1
Joined: Tue Jun 11, 2019 7:54 pm

Re: Injected DLL need length of function

Postby iconic » Tue Jun 11, 2019 9:06 pm

If you're using Delphi you can do this:

Code: Select all
uses madDisasm;

dwCodeLen := ParseFunction(pFunc).CodeLen;

Where "pFunc" is the entrypoint of the function you're targeting (i.e> GetProcAddress() returns this for exported functions). If it's not exported you'll need to provide the pointer yourself through other means, of course.

--Iconic
iconic
Site Admin
 
Posts: 880
Joined: Wed Jun 08, 2005 5:08 am


Return to madCodeHook

Who is online

Users browsing this forum: No registered users and 3 guests