A small script that allow to multiply the resources gain for credit, metal and crystal.
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<CheatTable>
<CheatEntries>
<CheatEntry>
<ID>330635</ID>
<Description>"Resource Gain Multiplier"</Description>
<Options moHideChildren="1" moDeactivateChildrenAsWell="1"/>
<LastState/>
<Color>FFFF00</Color>
<VariableType>Auto Assembler Script</VariableType>
<AssemblerScript>{ Game : sins2.exe
Version:
Date : 2024-08-17
Author : acecel
This script does blah blah blah
}
[ENABLE]
aobscanmodule(aob_res_update,sins2.exe,F3 0F 11 44 8E 08) // should be unique
alloc(newmem,$1000,aob_res_update)
alloc(pCredit,$8)
alloc(pMetal,$8)
alloc(pCrystal,$8)
registersymbol(pCredit)
registersymbol(pMetal)
registersymbol(pCrystal)
pCredit:
dd 0
pMetal:
dd 0
pCrystal:
dd 0
alloc(mulCredit,$8)
alloc(mulMetal,$8)
alloc(mulCrystal,$8)
registersymbol(mulCredit)
registersymbol(mulMetal)
registersymbol(mulCrystal)
mulCredit:
dd (float)2.0 // Change Default Multiplier Here
mulMetal:
dd (float)2.0 // Change Default Multiplier Here
mulCrystal:
dd (float)2.0 // Change Default Multiplier Here
label(saveCredit)
label(saveMetal)
label(saveCrystal)
label(multCredit)
label(multMetal)
label(multCrystal)
label(code)
label(return)
newmem:
cmp rcx,00
je saveCredit
cmp rcx,01
je saveMetal
cmp rcx,02
je saveCrystal
jmp code
saveCredit:
cmp [pCredit],0
jne multCredit
push rdx
lea rdx,[rsi+rcx*4+08]
mov [pCredit],rdx
pop rdx
jmp multCredit
saveMetal:
cmp [pMetal],0
jne multMetal
push rdx
lea rdx,[rsi+rcx*4+08]
mov [pMetal],rdx
pop rdx
jmp multMetal
saveCrystal:
cmp [pCrystal],0
jne multCrystal
push rdx
lea rdx,[rsi+rcx*4+08]
mov [pCrystal],rdx
pop rdx
jmp multCrystal
multCredit:
cmp rcx,00
jne code
movss xmm1,xmm0
subss xmm1,[rsi+rcx*4+08]
mulss xmm1,[mulCredit]
movss xmm0,[rsi+rcx*4+08]
addss xmm0,xmm1
jmp code
multMetal:
cmp rcx,01
jne code
movss xmm1,xmm0
subss xmm1,[rsi+rcx*4+08]
mulss xmm1,[mulMetal]
movss xmm0,[rsi+rcx*4+08]
addss xmm0,xmm1
jmp code
multCrystal:
cmp rcx,02
jne code
movss xmm1,xmm0
subss xmm1,[rsi+rcx*4+08]
mulss xmm1,[mulCrystal]
movss xmm0,[rsi+rcx*4+08]
addss xmm0,xmm1
jmp code
code:
movss [rsi+rcx*4+08],xmm0
jmp return
aob_res_update:
jmp newmem
nop
return:
registersymbol(aob_res_update)
[DISABLE]
aob_res_update:
db F3 0F 11 44 8E 08
unregistersymbol(*)
dealloc(*)
{
// ORIGINAL CODE - INJECTION POINT: sins2.exe.text+85AD07
sins2.exe.text+85ACDA: E8 A1 0B 00 00 - call sins2.exe.text+85B880
sins2.exe.text+85ACDF: 33 DB - xor ebx,ebx
sins2.exe.text+85ACE1: 8B CB - mov ecx,ebx
sins2.exe.text+85ACE3: 48 83 F9 03 - cmp rcx,03
sins2.exe.text+85ACE7: 0F 83 81 01 00 00 - jae sins2.exe.text+85AE6E
sins2.exe.text+85ACED: 41 0F 28 F0 - movaps xmm6,xmm8
sins2.exe.text+85ACF1: F3 0F 59 B4 8C B0 00 00 00 - mulss xmm6,[rsp+rcx*4+000000B0]
sins2.exe.text+85ACFA: 0F 28 C6 - movaps xmm0,xmm6
sins2.exe.text+85ACFD: F3 0F 58 44 8E 08 - addss xmm0,[rsi+rcx*4+08]
sins2.exe.text+85AD03: F3 0F 5F C7 - maxss xmm0,xmm7
// ---------- INJECTING HERE ----------
sins2.exe.text+85AD07: F3 0F 11 44 8E 08 - movss [rsi+rcx*4+08],xmm0
// ---------- DONE INJECTING ----------
sins2.exe.text+85AD0D: 48 8B 3E - mov rdi,[rsi]
sins2.exe.text+85AD10: 85 DB - test ebx,ebx
sins2.exe.text+85AD12: 74 30 - je sins2.exe.text+85AD44
sins2.exe.text+85AD14: 83 E9 01 - sub ecx,01
sins2.exe.text+85AD17: 0F 84 81 00 00 00 - je sins2.exe.text+85AD9E
sins2.exe.text+85AD1D: 83 E9 01 - sub ecx,01
sins2.exe.text+85AD20: 74 75 - je sins2.exe.text+85AD97
sins2.exe.text+85AD22: 83 F9 01 - cmp ecx,01
sins2.exe.text+85AD25: 75 1D - jne sins2.exe.text+85AD44
sins2.exe.text+85AD27: 4C 8D 05 5E A4 52 00 - lea r8,[sins2.exe.rdata+4318C]
}
</AssemblerScript>
<CheatEntries>
<CheatEntry>
<ID>330636</ID>
<Description>"Activate/Reactivate after loading a save"</Description>
<LastState Value="" RealAddress="00000000"/>
<Color>008080</Color>
<GroupHeader>1</GroupHeader>
</CheatEntry>
<CheatEntry>
<ID>330637</ID>
<Description>"Credit"</Description>
<ShowAsSigned>0</ShowAsSigned>
<VariableType>Float</VariableType>
<Address>mulCredit</Address>
</CheatEntry>
<CheatEntry>
<ID>330638</ID>
<Description>"Metal"</Description>
<ShowAsSigned>0</ShowAsSigned>
<VariableType>Float</VariableType>
<Address>mulMetal</Address>
</CheatEntry>
<CheatEntry>
<ID>330639</ID>
<Description>"Crystal"</Description>
<ShowAsSigned>0</ShowAsSigned>
<VariableType>Float</VariableType>
<Address>mulCrystal</Address>
</CheatEntry>
</CheatEntries>
</CheatEntry>
</CheatEntries>
</CheatTable>