Gude,
habe hier einen kleinen internen Cheat für das wunderbare alte Lego Star Wars Spiel für euch. Der Cheat ist aus einer spontanten Wette mit meinem Prof entstanden, daher entschuldige ich mich jetzt schon mal für sämtliche bad practices und Nichtoptimierung des Masm code. Ging nur darum, wer schneller fertig ist mit dem Cheat.
Könnt ihr einfach als Dll kompilieren und dann ins Spiel injecten. Mit NUMPAD0 fügt ihr euch Coins/ Bricks hinzu und mit der ENDE Taste beendet sich der Cheat.
Hier eine kleine Preview:

Und nun hier der Code:
Der kleine Cheat bekommt ebenfalls seine Repo auf meinem GitHub Account, eventuell wird er sogar demnächst nochmal geupdated. 
Vielen Dank fürs Lesen, habt einen schönen Tag und kümmert euch ein bisschen hier um die Sektion.
Einen schönen Start in die Woche wünsche ich euch!
Grüße, calb.
habe hier einen kleinen internen Cheat für das wunderbare alte Lego Star Wars Spiel für euch. Der Cheat ist aus einer spontanten Wette mit meinem Prof entstanden, daher entschuldige ich mich jetzt schon mal für sämtliche bad practices und Nichtoptimierung des Masm code. Ging nur darum, wer schneller fertig ist mit dem Cheat.
Könnt ihr einfach als Dll kompilieren und dann ins Spiel injecten. Mit NUMPAD0 fügt ihr euch Coins/ Bricks hinzu und mit der ENDE Taste beendet sich der Cheat.
Hier eine kleine Preview:

Und nun hier der Code:
Code:
include C:\masm32_x86\include\masm32rt.inc
.const
szWelcomeText db 'Ready to use - have fun!', 0
szWelcomeCaption db 'LEGO: Star Wars 3: The Clone Wars - internal cheat by cragson', 0
szGoodByeText db 'Goodbye! :)', 0
szGoodByeCaption db '< / 3', 0
szImageName db 'LEGOCloneWars.exe', 0
off_money_ptr dd 0BB4CB8h ; size: dword
.data?
i32_image_base dd ?
.code
EntryPoint proc hInstDll : dword, ul_reason_for_call : dword , lpReserved : dword
mov eax, ul_reason_for_call
cmp eax, DLL_PROCESS_ATTACH
je process_attach
mov eax, ul_reason_for_call
cmp eax, DLL_PROCESS_DETACH
je process_detach
mov eax, 0
ret 12
process_attach:
; pop the welcome message
push MB_OK
push offset szWelcomeCaption
push offset szWelcomeText
push 0
call MessageBoxA
retrieve_image_base:
; needed here because I don't want cpu overheat
push 1
call Sleep
; edx will contain the image base of LEGOCloneWars.exe
push offset szImageName
call GetModuleHandleA
cmp eax, 0
jz retrieve_image_base
; got a valid handle to the image
; move the valid handle into our "global" variable
mov dword ptr [ i32_image_base ], eax
usage_loop:
push 1
call Sleep
; check here if numpad0 was pressed, if so add coins
push VK_NUMPAD0
call GetAsyncKeyState
test eax, 08000h
jnz key_pressed
; clear eax for further usage
xor eax, eax
; check here if the exit key was pressed
push VK_END
call GetAsyncKeyState
test eax, 08000h
jne exit_key_pressed
; jmp back to the usage loop
jmp usage_loop
exit_key_pressed:
; pop the goodbye message
push MB_OK
push offset szGoodByeCaption
push offset szGoodByeText
push 0
call MessageBoxA
; jmp back to detaching the loaded dll
jmp process_detach
key_pressed:
; cpu i like you
push 1
call Sleep
; get the money ptr offset
xor eax, eax
mov eax, i32_image_base
add eax, off_money_ptr
; check here if the address is valid
cmp eax, 0
; if not just jump back to the usage loop and prevent a crash
jz usage_loop
; now try to deref the pointer here
mov eax, dword ptr [ eax ]
cmp eax, 0
; if the pointer is invalid, just jump back to the usage loop and prevent a crash
jz usage_loop
; add the bricks/coins to the score
add dword ptr [ eax ], 0AFFEh
; prevent spamming
push 250
call Sleep
jmp usage_loop
process_detach:
push 1
push hInstDll
call FreeLibraryAndExitThread
EntryPoint endp
end EntryPoint
Vielen Dank fürs Lesen, habt einen schönen Tag und kümmert euch ein bisschen hier um die Sektion.
Einen schönen Start in die Woche wünsche ich euch!
Grüße, calb.