Jump to content
Tuts 4 You

Loading proc from a dll


ShadowRayz

Recommended Posts

Posted

Didn't see fit to put it in Reversing, its more of coding i think...

Well, i try to load a .DLL and, to load one of it's processes...i wrote a test cpp code just to check that the proc name really does exist and it was added to the .DEF and all...everything's fine...it returns a handle to the DLL and the Process, as you can see here.

3465mc0.gif

but when i get to the GetProcAddress in olly with code i wrote in the cave, it fails and gives me LastErr = ERROR_MOD_NOT_FOUND.

xbk58k.gif

what have i done wrong? :(

thanks.

Posted

Looks like you are pushing the address of the module i.e. offset hDLL when you should be pushing dword ptr [hDLL] or in your case

PUSH 40C500 ; "Init"

PUSH 40C530 ; hDLL

Call GetProcAddress

PUSH 40C500 ; "Init"

PUSH DWORD PTR [40C530] ; hDLL

Call GetProcAddress

Doc

Posted

Ow, how silly of me...thank you :lol:

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...