QuestionAobscan problem

Posts 1–9 of 9 · Page 1 of 1
Aobscan problem
Hello. Here is my code:
Code:
if(bRadar)
{
unsigned long Protection;
DWORD Radar;

Radar = (DWORD)GetModuleHandleA("client.dll");
DWORD Address = (FindPattern(Radar, 0x0120B56A, (PBYTE)"\xD9\x46\x0C\xD9\x45\xF0\xDE\xD9\xDF\xE0\xF6\xC4\x41" ,"xxxxxxxxxxxxx"));
	
VirtualProtect((void*)Address, 13, PAGE_READWRITE, &Protection);
memcpy((LPVOID)(Address), "\0xC7\0x46\0x0C\0x00\0x00\0x00\0x40\0xD9\0x46\0x0C\0xD9\0x45\0xF0",13);
VirtualProtect((void*)Address, 13, Protection, 0);
	}
But this code crash game. Whats wrong?
This is code i write in DIP.

Code:
HRESULT __stdcall hkDrawIndexedPrimitive(LPDIRECT3DDEVICE9 pDevice, D3DPRIMITIVETYPE Type, INT BaseVertexIndex, UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount)

{ 

if(bRadar)
{
unsigned long Protection;
DWORD Radar;

Radar = (DWORD)GetModuleHandleA("client.dll");
DWORD Address = (FindPattern(Radar, 0x0120B56A, (PBYTE)"\xD9\x46\x0C\xD9\x45\xF0\xDE\xD9\xDF\xE0\xF6\xC4\x41" ,"xxxxxxxxxxxxx"));
	
VirtualProtect((void*)Address, 13, PAGE_READWRITE, &Protection);
memcpy((LPVOID)(Address), "\0xC7\0x46\0x0C\0x00\0x00\0x00\0x40\0xD9\0x46\0x0C\0xD9\0x45\0xF0",13);
VirtualProtect((void*)Address, 13, Protection, 0);
	}

pDevice->GetStreamSource(0, &pStreamData, &pOffsetInBytes, &m_Stride);  
		
	return pDrawIndexedPrimitive(pDevice, Type, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
}
Put an error checker, maybe the scanner didn't find anything. And if you are trying to change an address from a DLL then you can just access the address directly.

*(DWORD*)Address = 12345;
Sorry, iam no understand what i will do.

Maybe
Code:
if(bRadar)
{
unsigned long Protection;
DWORD Radar;
*(DWORD*)Address = 0x0120B56A;
Radar = (DWORD)GetModuleHandleA("client.dll");
DWORD Address = (FindPattern(Radar, 0x0120B56A, (PBYTE)"\xD9\x46\x0C\xD9\x45\xF0\xDE\xD9\xDF\xE0\xF6\xC4\x41" ,"xxxxxxxxxxxxx"));
	
VirtualProtect((void*)Address, 13, PAGE_READWRITE, &Protection);
memcpy((LPVOID)(Address), "\0xC7\0x46\0x0C\0x00\0x00\0x00\0x40\0xD9\0x46\0x0C\0xD9\0x45\0xF0",13);
VirtualProtect((void*)Address, 13, Protection, 0);
	}
Are you writing to a region of code? If so, you need to give it read, write and execute permissions (You're only giving it read\write.) You aren't just changing the permissions for that one section where you are patching bytes, but the entire page in which it resides. You are likely to have at least one thread executing in that memory page (if it is a busy section of the code, like the player class).


If you give me the before & after of the assembly code when patching it, I might be able to help you debug the code patch (if that is indeed the problem. Try the above solution first ofc.)
If you give me the before & after of the assembly code when patching it, I might be able to help you debug the code patch (if that is indeed the problem. Try the above solution first ofc.)
Code crash game
Ok. New code:
Code:
if(Noflash)
{
unsigned long Protection;
DWORD Noflash;

Noflash = (DWORD)GetModuleHandleA("client.dll");
DWORD Address = (FindPattern(Noflash, 0x5b871000, (PBYTE)"\x0F\x84\x00\x00\x00\x00\x8B\x0D\x00\x00\x00\x00\xB0\xFF\x88\x45\xF8\x88\x45\xF9\x88\x45\xFA" ,"xx????xx????xxxxxxxxxxx"));

VirtualProtect((void*)Address, 6, PAGE_READWRITE, &Protection);

memcpy((VOID *)Address, (VOID *)(PBYTE)"\0x0F \0x85 \0xD6 \0x04 \0x00 \0x00",6);

VirtualProtect((void*)Address, 6, Protection, 0);
	}
Before activate No flash cheat - Untitled-3.jpg

After activate No flash cheat - Untitled-2.jpg
Leeching, and cant figure out whats wrong? Go figure..
Posts 1–9 of 9 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?