48
"[X] <== BattleTech v5.6.5 GOG Script v3.0 (Read USAGE before activating this)"
FF0000
Auto Assembler Script
{
===========================================
Game Title : BatlleTech
Game Version : 5.6.5 (GOG)
Game Sponsor : Torrent
Process Name : BattleTech.exe
Relevant Info : Unity Engine/64bits/TBS
Script Version: 2.0
CE Version : 6.7
Release date : 16-May-2018
Author : Recifense
History:
30-Apr-2018: First Release
01-May-2018: Added "NO XP Decreasing" (s2.0)
16-May-2018: Added Some Mission Specfic Features (s3.0)
Features:
- God Mode
- Temperature
- Instability
- Funds
- No XP decreasing (new) S2.0
- No One Dies
- Protect the Buildings (s3.0)
- Protect the Vehicles (s3.0)
- Weak Vehicles (s3.0)
- Some Pointers
===========================================
}
//=========================================
// Checking CE version
{$lua}
if(getCEVersion() < 6.7) then
ShowMessage('Sorry. CE version should be 6.7 or above')
end
{$asm}
//=========================================
// Checking Selected Process
{$lua}
if(process == nil) then
ShowMessage('No process was selected')
elseif (process ~= "BattleTech.exe") then
ShowMessage('Warning. Expected Process = BattleTech.exe')
end
{$asm}
//=========================================
// Checking if CE mono features are ON
{$lua}
monoAA_USEMONO(process,false)
{$asm}
//=========================================
// Constants used in the script (that can be changed)
define(ctCE67,(float)6.7)
//=========================================
[ENABLE]
//=========================================
// Definitions
define(LUDO,"BattleTech.exe")
define(MOAD,BattleTech:Mech:ApplyArmorStatDamage+0000)
define(MOSD,BattleTech:Mech:ApplyStructureStatDamage+0000)
define(MOHD,BattleTech:Mech:ApplyHeatDamage+0000)
define(MOSM,BattleTech:Mech:get_LeftTorsoFrontArmor+0008)
define(MOMH,BattleTech:Mech:AddTempHeat+0000)
define(MOMI,BattleTech:Mech:AddInstability+0000)
define(MMHX,BattleTech:Mech:set__heat+0000)
define(MOPF,BattleTech:SimGameState:AddFunds+0000)
define(MOPX,BattleTech:Pilot:SpendExperience+0000)
define(MOAB,BattleTech:Building:DamageBuilding+0000)
define(MOVA,BattleTech:Vehicle:applyArmorStatDamage+0000)
define(MOVS,BattleTech:Vehicle:applyStructureStatDamage+0000)
//=========================================
// Check if script is compatible to this game version
// If false the script will not be loaded
assert(MOAD,55 48 8b ec 56 57 48 81 ec a0 00 00 00)
assert(MOSD,55 48 8b ec 56 57 41 55 41 56 41 57)
assert(MOHD,55 48 8b ec 56 57 41 54 41 55 41 56)
assert(MOSM,48 89 4d f8 48 8b c1 48 8b 40 58 48 8b c8)
assert(MOMH,55 48 8b ec 56 48 83 ec 08 48 8b f1)
assert(MOMI,55 48 8b ec 57 48 83 ec 48 48 8b f9)
assert(MMHX,55 48 8b ec 48 83 ec 10 48 89 4d f8)
assert(MOPF,55 48 8b ec 57 41 56 48 83 ec 20 4c 8b f1)
assert(MOPX,55 48 8b ec 56 57 41 56 41 57 48 83 ec 10)
assert(MOAB,55 48 8b ec 57 41 57 48 81 ec 70 01 00 00 48 8b f9)
assert(MOVA,55 48 8b ec 56 57 48 81 ec a0 00 00 00)
assert(MOVS,55 48 8b ec 53 56 57 41 54 41 55 41 56)
//=========================================
alloc(MyCode,4096,$process)
//=========================================
// Declaration section
label(_MonArmorDamage)
label(_BackMAD)
label(_MonStructureDamage)
label(_BackMSD)
label(_MonHeatDamage)
label(_BackMHD)
label(_MonSelMech)
label(_BackMSM)
label(_MonMechHeat)
label(_BackMMH)
label(_MonMechInst)
label(_BackMMI)
label(_MonMechHeatX)
label(_BackMMX)
label(_MonPlayerFunds)
label(_BackMPF)
label(_MonPilotXP)
label(_BackMPX)
label(_MonAllBuildings)
label(_BackMAB)
label(_MonVehicleArmor)
label(_BackMVA)
label(_MonVehicleStructure)
label(_BackMVS)
label(iEnableGMD)
label(iEnableMMH)
label(iEnableMMI)
label(iEnableMPF)
label(iEnableMPX)
label(iEnableNOD)
label(iEnableMAB)
label(iEnableMPV)
label(iEnableMWF)
label(pMech)
label(pPilot)
label(pGame)
label(pBuild)
label(pMOAD)
label(pMOSD)
label(pMOHD)
label(pMOSM)
label(pMOMH)
label(pMOMI)
label(pMMHX)
label(pMOPF)
label(pMOPX)
label(pMOAB)
label(pMOVA)
label(pMOVS)
label(aLast)
//=========================================
// Registering Symbols
registersymbol(MyCode)
registersymbol(iEnableGMD)
registersymbol(iEnableMMH)
registersymbol(iEnableMMI)
registersymbol(iEnableMPF)
registersymbol(iEnableMPX)
registersymbol(iEnableNOD)
registersymbol(iEnableMAB)
registersymbol(iEnableMPV)
registersymbol(iEnableMWF)
registersymbol(pMech)
registersymbol(pPilot)
registersymbol(pGame)
registersymbol(pBuild)
registersymbol(pMOAD)
registersymbol(pMOSD)
registersymbol(pMOHD)
registersymbol(pMOSM)
registersymbol(pMOMH)
registersymbol(pMOMI)
registersymbol(pMMHX)
registersymbol(pMOPF)
registersymbol(pMOPX)
registersymbol(pMOAB)
registersymbol(pMOVA)
registersymbol(pMOVS)
registersymbol(aLast)
//=========================================
MyCode:
//=========================================
// When applying armor damage
// RCX = Mech
_MonArmorDamage:
mov [aLast],'_MAD'
cmp dword ptr [iEnableNOD],0
jne _MonAD00 // Jump if feature is disabled
mov r11,[rcx+00000090] // Team
test r11,r11
jz _ExitMAD
cmp byte ptr [r11+000000c0],01
jne _MonAD01
cmp dword ptr [iEnableGMD],0
je _MonAD01 // Jump if feature is disabled
_MonAD00:
ret // Avoid routine
//--
_MonAD01:
jmp _ExitMAD
cmp dword ptr [iEnableMWF],0
je _ExitMAD // Jump if feature is disabled
movss [fArmor],xmm2
minss xmm2,[fMinDamage]
_ExitMAD:
push rbp // Original code
mov rbp,rsp // Original code
push rsi // Original code
push rdi // Original code
sub rsp,000000A0 // Original code
mov r11,_BackMAD
jmp r11 // Back to main code
//=========================================
// When applying Structure damage
// RCX = Mech
_MonStructureDamage:
mov [aLast],'_MSD'
cmp dword ptr [iEnableNOD],0
jne _MonSD00 // Jump if feature is disabled
mov r11,[rcx+00000090] // Team
test r11,r11
jz _ExitMSD
cmp byte ptr [r11+000000c0],01
jne _MonSD01
cmp dword ptr [iEnableGMD],0
je _MonSD01 // Jump if feature is disabled
_MonSD00:
ret // Avoid routine
//--
_MonSD01:
jmp _ExitMSD
cmp dword ptr [iEnableMWF],0
je _ExitMSD // Jump if feature is disabled
movss [fStructu],xmm2
minss xmm2,[fMinDamage]
_ExitMSD:
push rbp // Original code
mov rbp,rsp // Original code
push rsi // Original code
push rdi // Original code
push r13 // Original code
push r14 // Original code
push r15 // Original code
mov r11,_BackMSD
jmp r11 // Back to main code
//=========================================
// When applying Heat damage
// RCX = Mech
_MonHeatDamage:
mov [aLast],'_MHD'
cmp dword ptr [iEnableNOD],0
jne _MonHD00 // Jump if feature is disabled
cmp dword ptr [iEnableGMD],0
je _ExitMHD // Jump if feature is disabled
mov r11,[rcx+00000090] // Team
test r11,r11
jz _ExitMHD
cmp byte ptr [r11+000000c0],01
jne _ExitMHD
_MonHD00:
ret // Avoid routine
//--
_ExitMHD:
push rbp // Original code
mov rbp,rsp // Original code
push rsi // Original code
push rdi // Original code
push r12 // Original code
push r13 // Original code
push r14 // Original code
mov r11,_BackMHD
jmp r11 // Back to main code
//=========================================
// When a mech is selected
_MonSelMech:
mov [aLast],'_MST'
mov [pMech],rcx
mov rax,[rcx+00000228]
mov [pPilot],rax
test rax,rax
jz _ExitMSM
cmp dword ptr [iEnableGMD],0
je _ExitMSM // Jump if feature is disabled
mov r11,[rcx+00000090] // Team
test r11,r11
jz _ExitMSM
cmp byte ptr [r11+000000c0],01
jne _ExitMSM
mov r11,[rax+18]
test r11,r11
jz _ExitMSM
mov byte ptr [r11+000000e4],01
_ExitMSM:
mov [rbp-08],rcx // Original code
mov rax,rcx // Original code
mov rax,[rax+58] // Original code
mov rcx,rax // Original code
mov r11,_BackMSM
jmp r11 // Back to main code
//=========================================
// When adding Heat
// RCX = Mech
_MonMechHeat:
mov [aLast],'_MMH'
cmp dword ptr [iEnableMMH],0
je _ExitMMH // Jump if feature is disabled
mov r11,[rcx+00000090] // Team
test r11,r11
jz _ExitMMH
cmp byte ptr [r11+000000c0],01
jne _ExitMMH
mov [rcx+00000280],00000000 // temp_heat = 0
_ExitMMH:
push rbp // Original code
mov rbp,rsp // Original code
push rsi // Original code
sub rsp,08 // Original code
mov rsi,rcx // Original code
mov r11,_BackMMH
jmp r11 // Back to main code
//=========================================
// When adding Instability
// RCX = Mech
_MonMechInst:
mov [aLast],'_MMI'
cmp dword ptr [iEnableMMI],0
je _ExitMMI // Jump if feature is disabled
mov r11,[rcx+00000090] // Team
test r11,r11
jz _ExitMMI
cmp byte ptr [r11+000000c0],01
jne _ExitMMI
xorps xmm1,xmm1
// ret
//--
_ExitMMI:
push rbp // Original code
mov rbp,rsp // Original code
push rdi // Original code
sub rsp,48 // Original code
mov rdi,rcx // Original code
mov r11,_BackMMI
jmp r11 // Back to main code
//=========================================
// When adding Heat
// RCX = Mech, EDX = value
_MonMechHeatX:
mov [aLast],'_MMX'
cmp dword ptr [iEnableMMH],0
je _ExitMMX // Jump if feature is disabled
mov r11,[rcx+00000090] // Team
test r11,r11
jz _ExitMMX
cmp byte ptr [r11+000000c0],01
jne _ExitMMX
xor rdx,rdx // heat = 0
_ExitMMX:
push rbp // Original code
mov rbp,rsp // Original code
sub rsp,10 // Original code
mov [rbp-08],rcx // Original code
mov r11,_BackMMX
jmp r11 // Back to main code
//=========================================
// When adding/Sub-ing Funds
// RCX = SimGame EDX = value
_MonPlayerFunds:
mov [aLast],'_MPF'
mov [pGame],rcx
cmp dword ptr [iEnableMPF],0
je _ExitMPF // Jump if feature is disabled
test edx,edx
js _MonPF00
cmp edx,#1000000
jns _ExitMPF
_MonPF00:
mov edx,#1000000
_ExitMPF:
push rbp // Original code
mov rbp,rsp // Original code
push rdi // Original code
push r14 // Original code
sub rsp,20 // Original code
mov r14,rcx // Original code
mov r11,_BackMPF
jmp r11 // Back to main code
//=========================================
// When Spending XP
// RCX = Pilot R9 = XP2bSpent
_MonPilotXP:
mov [aLast],'_MPX'
mov [pPilot],rcx
cmp dword ptr [iEnableMPX],0
je _ExitMPX // Jump if feature is disabled
xor r9,r9 // xp2Bspent = 0
_ExitMPX:
push rbp // Original code
mov rbp,rsp // Original code
push rsi // Original code
push rdi // Original code
push r14 // Original code
push r15 // Original code
sub rsp,10 // Original code
mov r11,_BackMPX
jmp r11 // Back to main code
//=========================================
// When checking if building is destructible
_MonAllBuildings:
mov [aLast],'_MAB'
mov [pBuild],rcx
cmp dword ptr [iEnableMAB],0
je _ExitMAB // Jump if feature is disabled
ret // Avoid routine
//==
_ExitMAB:
push rbp // Original code
mov rbp,rsp // Original code
push rdi // Original code
push r15 // Original code
sub rsp,00000170 // Original code
mov rdi,rcx // Original code
mov r11,_BackMAB
jmp r11 // Back to main code
//=========================================
// When applying armor damage
// RCX = Vehicle
_MonVehicleArmor:
mov [aLast],'_MVA'
mov [pVehicle],rcx
movss [fArmor],xmm2
cmp dword ptr [iEnableMPV],0
je _MonVA00 // Jump if feature is disabled
ret // Avoid routine
//--
_MonVA00:
cmp dword ptr [iEnableMWF],0
je _ExitMVA // Jump if feature is disabled
maxss xmm2,[fMinDamage]
_ExitMVA:
push rbp // Original code
mov rbp,rsp // Original code
push rsi // Original code
push rdi // Original code
sub rsp,000000A0 // Original code
mov r11,_BackMVA
jmp r11 // Back to main code
//=========================================
// When applying structure damage
// RCX = Vehicle
_MonVehicleStructure:
mov [aLast],'_MVS'
mov [pVehicle],rcx
movss [fStructu],xmm2
cmp dword ptr [iEnableMPV],0
je _MonVS00 // Jump if feature is disabled
ret // Avoid routine
//--
_MonVS00:
cmp dword ptr [iEnableMWF],0
je _ExitMVS // Jump if feature is disabled
maxss xmm2,[fMinDamage]
_ExitMVS:
push rbp // Original code
mov rbp,rsp // Original code
push rbx // Original code
push rsi // Original code
push rdi // Original code
push r12 // Original code
push r13 // Original code
push r14 // Original code
mov r11,_BackMVS
jmp r11 // Back to main code
//=========================================
align 10,'='
//=========================================
db '===============================>'
db 'CE6.7 Script by Recifense 180512'
//=========================================
// Variables
iEnableGMD:
dd 0
iEnableMMH:
dd 0
iEnableMMI:
dd 0
iEnableMPF:
dd 0
iEnableMPX:
dd 0
iEnableNOD:
dd 0
iEnableMAB:
dd 0
iEnableMPV:
dd 0
iEnableMWF:
dd 0
fArmor:
dd 0
fStructu:
dd 0
fMinDamage:
dd (float)670.0
pMech:
dq 0
pPilot:
dq 0
pGame:
dq 0
pBuild:
dq 0
pVehicle:
dq 0
aLast:
db 'CE67'
//=========================================
// Hacking Points
MOAD:
pMOAD:
mov r11,_MonArmorDamage
jmp r11
_BackMAD:
MOSD:
pMOSD:
mov rax,_MonStructureDamage
jmp rax
_BackMSD:
MOHD:
pMOHD:
mov rax,_MonHeatDamage
jmp rax
_BackMHD:
MOSM:
pMOSM:
mov rax,_MonSelMech
jmp rax
nop
nop
_BackMSM:
MOMH:
pMOMH:
mov rax,_MonMechHeat
jmp rax
_BackMMH:
MOMI:
pMOMI:
mov rax,_MonMechInst
jmp rax
_BackMMI:
MMHX:
pMMHX:
mov rax,_MonMechHeatX
jmp rax
_BackMMX:
MOPF:
pMOPF:
mov r11,_MonPlayerFunds
jmp r11
nop
_BackMPF:
MOPX:
pMOPX:
mov r11,_MonPilotXP
jmp r11
nop
_BackMPX:
MOAB:
pMOAB:
mov r11,_MonAllBuildings
jmp r11
nop
nop
nop
nop
_BackMAB:
MOVA:
pMOVA:
mov r11,_MonVehicleArmor
jmp r11
_BackMVA:
MOVS:
pMOVS:
mov r11,_MonVehicleStructure
jmp r11
_BackMVS:
//=========================================
// Script for Restoring Original Codes
[DISABLE]
pMOAD:
db 55 48 8b ec 56 57 48 81 ec a0 00 00 00
pMOSD:
db 55 48 8b ec 56 57 41 55 41 56 41 57
pMOHD:
db 55 48 8b ec 56 57 41 54 41 55 41 56
pMOSM:
db 48 89 4d f8 48 8b c1 48 8b 40 58 48 8b c8
pMOMH:
db 55 48 8b ec 56 48 83 ec 08 48 8b f1
pMOMI:
db 55 48 8b ec 57 48 83 ec 48 48 8b f9
pMMHX:
db 55 48 8b ec 48 83 ec 10 48 89 4d f8
pMOPF:
db 55 48 8b ec 57 41 56 48 83 ec 20 4c 8b f1
pMOPX:
db 55 48 8b ec 56 57 41 56 41 57 48 83 ec 10
pMOAB:
db 55 48 8b ec 57 41 57 48 81 ec 70 01 00 00 48 8b f9
pMOVA:
db 55 48 8b ec 56 57 48 81 ec a0 00 00 00
pMOVS:
db 55 48 8b ec 53 56 57 41 54 41 55 41 56
//=========================================
// Unregistering Symbols
unregistersymbol(MyCode)
unregistersymbol(iEnableGMD)
unregistersymbol(iEnableMMH)
unregistersymbol(iEnableMMI)
unregistersymbol(iEnableMPF)
unregistersymbol(iEnableMPX)
unregistersymbol(iEnableNOD)
unregistersymbol(iEnableMAB)
unregistersymbol(iEnableMPV)
unregistersymbol(iEnableMWF)
unregistersymbol(pMech)
unregistersymbol(pPilot)
unregistersymbol(pGame)
unregistersymbol(pBuild)
unregistersymbol(pMOAD)
unregistersymbol(pMOSD)
unregistersymbol(pMOHD)
unregistersymbol(pMOSM)
unregistersymbol(pMOMH)
unregistersymbol(pMOMI)
unregistersymbol(pMMHX)
unregistersymbol(pMOPF)
unregistersymbol(pMOPX)
unregistersymbol(pMOAB)
unregistersymbol(pMOVA)
unregistersymbol(pMOVS)
unregistersymbol(aLast)
//=========================================
// Turning CE mono features OFF
{$lua}
monopipe.destroy()
monopipe=nil
{$asm}
//=========================================
dealloc(MyCode)
//============= Scripts End ===============
// ****************************************
// NOTES
// ****************************************
{
}
66
"[X] <== God Mode (for Mechs and Pilots)"
C08000
Auto Assembler Script
[enable]
{$LUA}
writeInteger("iEnableGMD",1)
memrec.Color=0x0004000
{$ASM}
[disable]
{$LUA}
writeInteger("iEnableGMD",0)
memrec.Color=0x0c08000
{$ASM}
67
"[X] <== Mechs always Cool (no heat problem)"
C08000
Auto Assembler Script
[enable]
{$LUA}
writeInteger("iEnableMMH",1)
memrec.Color=0x0004000
{$ASM}
[disable]
{$LUA}
writeInteger("iEnableMMH",0)
memrec.Color=0x0c08000
{$ASM}
68
"[X] <== No Instability (Mechs will not fall)"
C08000
Auto Assembler Script
[enable]
{$LUA}
writeInteger("iEnableMMI",1)
memrec.Color=0x0004000
{$ASM}
[disable]
{$LUA}
writeInteger("iEnableMMI",0)
memrec.Color=0x0c08000
{$ASM}
69
"[X] <== Increase Funds when Selling or Buying"
C08000
Auto Assembler Script
[enable]
{$LUA}
writeInteger("iEnableMPF",1)
memrec.Color=0x0004000
{$ASM}
[disable]
{$LUA}
writeInteger("iEnableMPF",0)
memrec.Color=0x0c08000
{$ASM}
229
"[X] <== No XP decreasing (When spending XP)"
C08000
Auto Assembler Script
[enable]
{$LUA}
writeInteger("iEnableMPX",1)
memrec.Color=0x0004000
{$ASM}
[disable]
{$LUA}
writeInteger("iEnableMPX",0)
memrec.Color=0x0c08000
{$ASM}
236
"[X] <== Some Mission Specific Features (s3.0)"
404080
1
230
"[X] <== Protect the Structures "
C08000
Auto Assembler Script
[enable]
{$LUA}
writeInteger("iEnableMAB",1)
memrec.Color=0x0004000
{$ASM}
[disable]
{$LUA}
writeInteger("iEnableMAB",0)
memrec.Color=0x0c08000
{$ASM}
233
"[X] <== Protect the Vehicles "
C08000
Auto Assembler Script
[enable]
{$LUA}
writeInteger("iEnableMPV",1)
memrec.Color=0x0004000
{$ASM}
[disable]
{$LUA}
writeInteger("iEnableMPV",0)
memrec.Color=0x0c08000
{$ASM}
232
"[X] <==Weak Vehicles "
C08000
Auto Assembler Script
[enable]
{$LUA}
writeInteger("iEnableMWF",1)
memrec.Color=0x0004000
{$ASM}
[disable]
{$LUA}
writeInteger("iEnableMWF",0)
memrec.Color=0x0c08000
{$ASM}
71
"[X] <== Valid during Battle (Mech Selected)"
404080
1
72
"Name"
0080FF
String
32
1
0
1
pMech
14
10
20
28
18
50
90
73
"Current Team Morale/Fury (MAX=50/Fury=100) ==>"
0000FF
4 Bytes
pMech
10
20
18
20
28
18
50
90
228
"[X] <== Table/Script Information"
0000FF
Auto Assembler Script
[enable]
define(test,LUDO)
{$LUA}
getMainForm().CommentButton.doClick()
{$ASM}
[disable]
Recifense
20180516
===========================================
Game Title : BatlleTech
Game Version : 5.6.5 (GOG)
Game Sponsor : Torrent
Process Name : BattleTech.exe
Relevant Info : Unity Engine/64bits/TBS
Script Version: 3.0
CE Version : 6.7
Release date : 16-May-2018
Author : Recifense
History:
30-Apr-2018: First Release
01-May-2018: Added "NO XP Decreasing" (s2.0)
16-May-2018: Added Some Mission Specific Features (s3.0)
Features:
- God Mode [1]
- Temperature [2]
- Instability [3]
- Funds [4]
- No XP decreasing [5] (new) S2.0
- Protect the Buildings [6] (new)(s3.0)
- Protect the Vehicles [7] (new)(s3.0)
- Weak Vehicles [8] (new)(s3.0)
- Some Pointers
===========================================
[1] For the player's Mechs and Pilots;
[2] No heat problem for the player's mechs;
[3] No falling for player's mechs;
[4] Funds will be increased by 1000000 at least (*);
[5] XP points will not decrease (*);
[6] Building with armor will not be destroyed (**)
[7] Vehicles will not be destroyed (**)
[8] Vehicles will be destroyed EASILY (One Hit Kill) (**)
(*) Only activate it when needed (keep it disactivated)
(**)These are mission specific features (keep them deactivate). Only activate when needed.
===========================================
[USAGE]
1) Run CE67 or greater;
2) Run Game;
3) Start/Load a new game or a Skirmish match; <==[IMPORTANT]
4) Load the game process "BattleTech.exe" in CE;
5) Load this table and activate the main script;
6) Now Activate the script of each cheat you want to use;
7) Game On;
[NOTE]
- Before closing the game, deactivate the main script or close CE.
[MORALE/FURY]
- Change the value and freeze it at the battle start. [Important] Unfreeze it at the battle end.
===========================================
HOTKEYS:
- None defined;
===========================================
[ADVICE]
When you can,save the game before starting using table/cheat. So you can always come back in case you don't like the result.
===========================================
[INFO]
Tested on Win 10 64bits
===========================================
Cheers!