• Welcome to Valhalla Legends Archive.
 

Exception warning while using DLL injection

Started by thetempest, December 01, 2003, 02:31 PM

Previous topic - Next topic

thetempest

Hi,

When i try to call my function (that is located in a DLL) from Starcraft.  SC crashes and i get an exception warning.  saying that the thread tried to read or write to a virtual address for which it doesn't have the right access too.

the function that i'm calling is only designed to store a register into one of the DLL's global variables.  however, it's not even able to call this function from sc without crashing.

now, just for fun i created a test moduel that worked fine, it called the function and everything and i'm using LoadLibraryA in both SC and my test moduel.  SO i know the DLL is valid and the functions are correct.

Now, i think the problem is that in the ASM code, it shows that it's just calling address 0x00A0010F.  but when a dll is called it usally says, "dllnamehere.00a0010F".  So i think it's trying to call that address from within sc and NOT my dll.

how could i fix this?

Thanks



any ideas?
TheTempest

Kp

My guess is that you didn't do the memory patch correctly, so it is adding the wrong amount to eip.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

Etheran


thetempest

i fixed the problem, it wasn't a bad jmp, i'm using calls.  Which aren't related to EIP in my experience.

anyways, what i was doing was getting the functions address using GetProcAddress().  however, the problem was that SC had about 25 DLL's loaded into memory so the address kept chaning.

finaly i just wrote a simple function to output the addresses of the functions i needed from within starcraft via fstream.h

works great now

thx

Adron

Quote from: thetempest on December 01, 2003, 07:15 PM
i fixed the problem, it wasn't a bad jmp, i'm using calls.  Which aren't related to EIP in my experience.

Calls like jumps are mostly relative to EIP. Calls to absolute addresses happen when calling through a pointer - like calling functions imported from a DLL.