flat assembler
Message board for the users of flat assembler.
Index
> Windows > Error with: LOCAL Remember:DWORD Goto page 1, 2 Next |
Author |
|
revolution 26 Aug 2012, 03:15
Show your code. We have no idea what you have done.
|
|||
26 Aug 2012, 03:15 |
|
ikdekker 26 Aug 2012, 03:19
I have done nothing really, it is a hack for a game and I copied it.
this is the code: LOCAL requestShootWeapon:DWORD LOCAL getLocalPlayer:DWORD LOCAL getPlayerWeapons:DWORD ` LOCAL sendEvent:DWORD sendEvent:DWORD invoke GetModuleHandleA,SADD("Entitiesmp.dll") mov ebx,eax invoke GetProcAddress,ebx,SADD("?RequestShootWeapon@CPlayerWeapons@@QAEXMHEPAVCEntity@@J@Z") mov requestShootWeapon,eax invoke GetProcAddress,ebx,SADD("?GetLocalPlayer@CPlayer@@QAEPAV1@XZ") mov getLocalPlayer,eax invoke GetProcAddress,ebx,SADD("?GetPlayerWeapons@CPlayer@@QAEPAVCPlayerWeapons@@XZ") mov getPlayerWeapons,eax call getLocalPlayer mov ecx,eax call getPlayerWeapons mov ecx,eax push 0 push 0 push 0 push 0 push 0 call requestShootWeapons retn hope u can help |
|||
26 Aug 2012, 03:19 |
|
revolution 26 Aug 2012, 03:33
You haven't defined LOCAL in any way. What did you want LOCAL to do?
Usually LOCAL is used only within macros, so unless you defined it for something else outside of a macro then it won't be recognised. BTW: You will also have a problem with the SADD lines. |
|||
26 Aug 2012, 03:33 |
|
ikdekker 26 Aug 2012, 03:46
i dont know, I thought LOCAL would make the SendEvent and such holding a DWORD which later would be called to set the variables. But I am no expert
|
|||
26 Aug 2012, 03:46 |
|
revolution 26 Aug 2012, 04:07
|
|||
26 Aug 2012, 04:07 |
|
sinsi 26 Aug 2012, 04:09
SADD is a masm32 macro, not fasm.
|
|||
26 Aug 2012, 04:09 |
|
ikdekker 26 Aug 2012, 04:30
revolution, I tried that already but didnt work
|
|||
26 Aug 2012, 04:30 |
|
revolution 26 Aug 2012, 05:39
Show us the code that "didn't work".
|
|||
26 Aug 2012, 05:39 |
|
typedef 26 Aug 2012, 15:39
also. Proper code tags please
|
|||
26 Aug 2012, 15:39 |
|
ikdekker 26 Aug 2012, 20:28
So I have changed the code but it now gives an error I didn't expect.
the error is at this line: invoke LoadLibraryA,'entitiesmp.dll' Code: format PE GUI DLL include 'win32ax.inc' section 'hax' code readable executable writeable .code requestShootWeapon dd 0 getLocalPlayer dd 0 getPlayerWeapons dd 0 sendEvent dd 0 invoke LoadLibraryA,'entitiesmp.dll' mov [entities],eax invoke GetProcAddress,[entities],4957 mov [requestShootWeapon],eax invoke GetProcAddress,[entities],3190 mov [getLocalPlayer],eax invoke GetProcAddress,[entities],3251 mov [getPlayerWeapons],eax call getLocalPlayer mov ecx,eax call getPlayerWeapons mov ecx,eax push 0 push 0 push 0 push 0 push 0 call requestShootWeapons retn section 'lzdasd' fixups data readable |
|||
26 Aug 2012, 20:28 |
|
revolution 27 Aug 2012, 10:18
This assembles but I have no idea if it works with your setup:
Code: format PE GUI DLL include 'win32ax.inc' section 'hax' code readable executable writeable .code proc Something locals requestShootWeapon dd ? getLocalPlayer dd ? getPlayerWeapons dd ? sendEvent dd ? entities dd ? endl invoke LoadLibrary,'entitiesmp.dll' mov [entities],eax invoke GetProcAddress,[entities],4957 ;Magic number for what? mov [requestShootWeapon],eax invoke GetProcAddress,[entities],3190 ;Magic number for what? mov [getLocalPlayer],eax invoke GetProcAddress,[entities],3251 ;Magic number for what? mov [getPlayerWeapons],eax call [getLocalPlayer] mov ecx,eax call [getPlayerWeapons] ;does this procedure really take ECX as a parameter? mov ecx,eax stdcall [requestShootWeapon],0,0,0,0,0 ;does this procedure really take ECX as a parameter? ret endp section 'lzdasd' fixups data readable .end Something |
|||
27 Aug 2012, 10:18 |
|
ikdekker 27 Aug 2012, 13:19
That does indeed assemble, but doesn't work in the game.
The game uses the entitiesmp.dll file to(I think) store events. Which are called with the name like this Code: ("?GetPlayerWeapons@CPlayer@@QAEPAVCPlayerWeapons@@XZ") or with the numbers I used in my code. I have attached the exported dll so you can see. Can you help me with that? I also have a working dll, but it changes a different event. Maybe that helps as well? Thanks a lot!
_________________ If the problems too big, give up |
|||||||||||||||||||||||||||||||
27 Aug 2012, 13:19 |
|
ikdekker 28 Aug 2012, 20:16
Can nobody help me out???
|
|||
28 Aug 2012, 20:16 |
|
baldr 31 Aug 2012, 23:53
ikdekker,
How can anybody help when you provide so little information? Is that DLL loaded? How? Is its initialization function called? Does that function return proper value? If your DLL is loaded using LoadLibrary() and its DllMain() returns FALSE when fdwReason == DLL_PROCESS_ATTACH (that means DLL initialization failed), aforementioned LoadLibrary() fails and returns NULL. Attached source looks strange at least. MessageBoxA() requires 4 DWORDs as parameters, with only 3 provided it will use return address to somewhere in Kernel32.DLL as uType parameter value; chances are slim that MessageBoxA() will accept it. |
|||
31 Aug 2012, 23:53 |
|
ikdekker 01 Sep 2012, 01:51
I dont know it uses a bypass/injector to inject dll into process,
it uses initialization somehow. and it is supposed to return a proper value. i think i need a tutorial on fasm first, anybody know one? |
|||
01 Sep 2012, 01:51 |
|
baldr 01 Sep 2012, 05:32
ikdekker wrote: ...it uses a bypass/injector to inject dll into process, There isn't something special in fasm that is related to your problem, I think. |
|||
01 Sep 2012, 05:32 |
|
ikdekker 02 Sep 2012, 10:41
it uses loadlibrary,
but I have added a msg box to it but it doesnt give a pop-up Code: format PE GUI DLL include 'win32ax.inc' section 'hax' code readable executable writeable .code proc Something locals requestShootWeapon dd ? getLocalPlayer dd ? getPlayerWeapons dd ? sendEvent dd ? entities dd ? start: mov eax,0 nop call @f @@: mov eax,[esp] sub eax,6 mov byte [eax],$c3 pop eax ;initialization push 0 call @f db 'injected',0 @@: push 0 call [MessageBoxA] invoke LoadLibrary,'entitiesmp.dll' mov [entities],eax invoke GetProcAddress,[entities],("?RequestShootWeapon@CPlayerWeapons@@QAEXMHEPAVCEntity@@J@Z") ;Magic number for what? mov [requestShootWeapon],eax invoke GetProcAddress,[entities],("?GetLocalPlayer@CPlayer@@QAEPAV1@XZ");Magic number for what? mov [getLocalPlayer],eax invoke GetProcAddress,[entities],("?GetPlayerWeapons@CPlayer@@QAEPAVCPlayerWeapons@@XZ") mov [getPlayerWeapons],eax call [getLocalPlayer] mov ecx,eax call [getPlayerWeapons] ;does this procedure really take ECX as a parameter? mov ecx,eax stdcall [requestShootWeapon],0,0,0,0,0 ;does this procedure really take ECX as a parameter? mov eax, 1 ret endp xor eax,eax retn section 'lzdasd' fixups data readable and im still not sure wether I should use such an address: ("?RequestShootWeapon@CPlayerWeapons@@QAEXMHEPAVCEntity@@J@Z") or like the 6159 |
|||
02 Sep 2012, 10:41 |
|
revolution 02 Sep 2012, 10:50
I wonder if your empty 'hax' section is causing a problem. Try removing the redundant "section 'hax' ..." line.
Also you are missing the .end macro. Are you sure that code is compiling successfully? What happened to the endl? And where is endp? And why the extra retn? Are you really sure that code is compiling successfully? |
|||
02 Sep 2012, 10:50 |
|
ikdekker 02 Sep 2012, 11:04
well,
when I used .end start it gave an error on compiling something like unused statement. I removed endl because I thought that caused the error. extra retn was in other code which I attached earlier. And yes, it compiles |
|||
02 Sep 2012, 11:04 |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.