News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Proxy

Started by Ardy, May 17, 2010, 01:24:07 PM

Previous topic - Next topic

Ardy

Hi,
I am trying to write a proxy for a DLL in MASM32. I have written a simple program that uses the method gethostbyname from ws2_32.dll. In my proxy DLL I have my own method gethostbyname, it first gets a handle to the real ws2_32.dll which I have copied to my test directory and renamed to ws2_32_.dll then it gets the method by using GetProcAddress. I also make sure the call stack is correct, this method has only one parameter which I push to the stack before calling. After the call to this address retrieved from GetProcAddress I receive an exception 0x000006C5, which means acces violation. if I replace de proxy with the original DLL then the program works properly. Please help me for I don't know what I am doing wrong.

clive

Absent you providing any source code to examine, I'd have to guess that you are not providing the parameter correctly.
It could be a random act of randomness. Those happen a lot as well.

rags

Why not just call  the function directly, instead of creating a wrapper dll that calls the function?
God made Man, but the monkey applied the glue -DEVO

BlackVortex

Quote from: rags on May 18, 2010, 01:55:13 AM
Why not just callĀ  the function directly, instead of creating a wrapper dll that calls the function?
He wants to make a proxy dll to monitor/intercept the function that resolves the hostname.

Interesting.  :bg

dedndave

yes - a nice first post   :P