I don't have the controller, but I just read that
"LeftTrigger: Left trigger (integer ranging from 0 to 255)"
so that means it returns 0 when not pressed I think..
if so, I assume this should work too?
Code: Select all
[ENABLE]
{$lua}
if not getAddressSafe('flgHotkeyLuaThread') then
allocateSharedMemory('flgHotkeyLuaThread', 1)
registerSymbol('flgHotkeyLuaThread')
end
writeBytes('flgHotkeyLuaThread', 0)
local function hotkeyLuaThread(thread)
local addr = getAddress('flgHotkeyLuaThread')
while RunHotkeyLuaThread do
local xcs = getXBox360ControllerState()
writeBytes(addr, xcs.LeftTrigger)
end
dealloc('flgHotkeyLuaThread')
unregisterSymbol('flgHotkeyLuaThread')
thread.terminate()
end
----------------------------------
if syntaxcheck then return end
RunHotkeyLuaThread = true
createThread(hotkeyLuaThread)
{$asm}
//code from here to '[DISABLE]' will be used to enable the cheat
define(weaponchargeleveldefault,#8000)
aobscanmodule(staminaAndWeaponChargeWriteAOB,Secret_of_Mana.exe,8B 80 ** ** ** ** 89 ** ** ** ** ** ** 8B ** ** 8B ** ** FF)
registersymbol(staminaAndWeaponChargeWriteAOB)
label(dWeaponChargeLevel)
registersymbol(dWeaponChargeLevel)
alloc(newmem,2048)
label(returnhere)
label(originalcode_weaponchargemod)
registersymbol(originalcode_weaponchargemod)
label(exit)
newmem: //this is allocated memory, you have read,write,execute access
//place your code here
//cmp edi,#1000
//jle @f
//cmp byte ptr [flgHotkeyLuaThread],1
//jne @f
push ebx
mov bl,[flgHotkeyLuaThread]
test bl,bl
pop ebx
jz @f
cmp edi,[dWeaponChargeLevel]
jge @f
mov edi,[dWeaponChargeLevel]
originalcode_weaponchargemod:
readmem(staminaAndWeaponChargeWriteAOB+6,7)
//mov [eax+esi+00000124],edi
exit:
jmp returnhere
///
dWeaponChargeLevel:
dd weaponchargeleveldefault
///
staminaAndWeaponChargeWriteAOB+6: //"Secret_of_Mana.exe"+179892:
jmp newmem
nop
nop
returnhere:
///*****************************************///
aobscanmodule(playerActionWritesAOB,Secret_of_Mana.exe,8B ** ** ** ** ** 89 ** ** ** ** ** ** 8B ** ** ** ** ** ** ** ** ** 59 5E 8B E5 5D C3)
registersymbol(playerActionWritesAOB)
alloc(newmem2,2048)
label(returnhere2)
label(originalcode2_weaponchargemod)
registersymbol(originalcode2_weaponchargemod)
label(exit2)
newmem2: //this is allocated memory, you have read,write,execute access
//place your code here
/*
cmp ecx,3
jl @f
cmp ecx,4
jge @f
*/
push ebx
mov ebx,[controllingFlagReadAOB+2]
cmp dword ptr [esi+ebx],0
pop ebx
jne @f
cmp ecx,3
jne @f
//cmp byte ptr [flgHotkeyLuaThread],1
//jne @f
push ebx
mov bl,[flgHotkeyLuaThread]
test bl,bl
pop ebx
jz @f
xor ecx,ecx
originalcode2_weaponchargemod:
readmem(playerActionWritesAOB+6,7)
//mov [edx+eax+00000188],ecx
exit2:
jmp returnhere2
///
playerActionWritesAOB+6: //"Secret_of_Mana.exe"+10A10C:
jmp newmem2
nop
nop
returnhere2:
[DISABLE]
{$lua}
if syntaxcheck then return end
RunHotkeyLuaThread = false
{$asm}
//code from here till the end of the code will be used to disable the cheat
dealloc(newmem)
staminaAndWeaponChargeWriteAOB+6: //"Secret_of_Mana.exe"+179892:
readmem(originalcode_weaponchargemod,7)
//db 89 BC 30 24 01 00 00
//Alt: mov [eax+esi+00000124],edi
unregistersymbol(originalcode_weaponchargemod)
unregistersymbol(dWeaponChargeLevel)
///*****************************************///
dealloc(newmem2)
playerActionWritesAOB+6: //"Secret_of_Mana.exe"+10A10C:
readmem(originalcode2_weaponchargemod,7)
//db 89 8C 02 88 01 00 00
//Alt: mov [edx+eax+00000188],ecx
unregistersymbol(originalcode2_weaponchargemod)