<?xml version="1.0" encoding="utf-8"?>
<CheatTable CheatEngineTableVersion="45">
  <Files>
    <cemono.lua Encoding="Ascii85">%}.*U,cpsIs_*0LubjI.QX;m=F${0%Wy_MKph:557zPBX!ANu;R2B]2PU^WJ-?ZG3iISbbYx@),fhF;I-{k!^Pk)swWVWm[S?4S7FgcN8naQPKhpTfsXJIYzCl+Y.IgWOo5/:@m2@q?O!fr-s8q]u0*lCrhPlVuNOisQmSSDFcDj=^qgC*.sN$QL+D?oFptRq_t6.(}[B;QAY/Snakm5;:1q*3Oc+(U2X(Uc;n99zYz!!_4w%bw/^Rufd1q$$y:8v#9)05lbsL_LlV?o[0C%bS%ovr7eGRgS#j$NihVswj7!s[mVp(a+Vn(v=b1Y9vI+*C-!im{Dh56*clf7Mc1LGA4XB@PZTr=opn1r:xr4d.%@}n}I.m.adahS;:7#u]fj{;y86W4rqQhI!a5.a=7Jh)w_OF].nFFqG3*dUJFoFhW+AvK_e_C?c@RDYC:oFXucxq,;gL.-KNH[#StC]wdUaX;8z-7wct6vWtSyS6+rR=46]^js%ZkH2qubBV%$-*sL1)5tvNBc-jAYIdJtj}#HF3+R-N$Lh]CD_FeC%)C2P^V)Vu7_YrAz@K$T_l-5nTE/m]x,/u%Pdg$:vd80.O[8wsT91@;O_+R+t@-h!#RKCudX1zB{kurhakRys^twVdnquq9=(qin^Yi,YWRgtU2wk0{_U8)(!$,JezE=kxoz!Sa0Nkui@mA/54,e,/%**Rf@fXQ0BH-e3T1=Am2/rQ(;[lHiV)OE#SbHg$S[b*A(PKaG!1N.YR2@=E%@mAtbG]69HIEjkTjYl/LEN57).:,uJDo;9awuXGzu=e]:h!Ss9+Xs;v3^^Wu:#29NX.PHZ,wYQvqS{rbq+,[$1S4OWjGgE]^;pL!fdtoscMbAy7$OcVbsPGO3ck:i%7kO8fBTUIJ9btzn$=D:SWb+RmOUGuSU^goirG/OgzEto.w-I0$P!8JA0A^!zBT)=FTzv!H,YQBVi$=I)po#Tljwse!.H3wb,o5H/Tm2Wj)I/GtCYz:M*1d.lA4Jv^%[x9?)56{RaNIP2c,9(/+5$0h)]Y4A)B(Y^1+[]]o%z(BkR(;CrYQ!$;5cHG2;MMdxejM2+ZkD96@mk^4uY9Urwbek9dO0#Kx;2!N]QBJ^fJk!@!s:*5vv#,W*XJ5;$/ou8R}CrTaU02+;by}T8G2N*TXg]VB2]JjkTJ5JG_{CK8U#.y06Aa:Yg-oE^9Xd.-Nf!1hf2@[OV$uXXQcJ9InIfHQr,zGShuLjLnFzozfZW6T#.Ej-3iVe+k^H!MvqB0L2AI-*WE!.XN+@8[xt9L$4%35C=)L81?MTUJ6r?7)RI5,%+#hQK?dAz%Kzq/]nXOcL-Gsv]G@D8N?+CrYAx-5E}kl[KcEU:xO)@H[_jfX0*-VRo+my.T*wcxP{cnu9w$g5f@)Sll5rTHFox[6Xa_=#Ja}{t*Fg$ek}[@lRwreNJDQVd5En7ssvyq7$8+hsRHw3KBq,msdYKJicwIsuB6U@GjViVAn?m](ipWzItvZ!rY*NpRG@c{1Srmck63,R84M4Ht7BjziUmq(SVCCvfc]cB+Xx(I3-KV!0Y0%upfkwXhahUuO9kySC//SGbCDd]5^O+r:1L2pw3tGPG07Aq8h7cA49MuJ87^12+L]!aSiq953eP[:BpwFn_LvzoKIz?9L{P{-OHXdI?ThFZ7Tc2L+.2-?wP9?T5RSYXh@Fc=/0)A][_CF?CliV1H8+r8rafUdICl+Nh*qZkjrITlB*=?{!u2!nn)F}_;[Ru6bwblk9N}K@m.(p$fMFLFCb#[aK_LvMDu$H{4A;UAhORtg?_LSIK3w5;s)]u!9rzm06^UKtEn%G9vh0)ebwET=kMlQj#k;TH]xNs7p(Z{#^RY%RC[Z06rA^?_5Pu#X:*aqet(26g-?02XD*]7Oa@iON#hQCf]yXMH7VM/XsLy14gT0^tsvpB(/OBFt!?gf;=e7iS1ff9GTAB[YziZMisMF5quKicHFPfAna^z?(3iG3q@}_ik9z7%tjw^FNeOvu%X$,OrL.@lH#@g14%^dEJ[Q[pMn)Hck@$4BTh{Aa%CZ#kRL;jZ{CTe%JXy6P4SXXOO*dO9_c+pf*qz-Siq*+8HzEc{UjQzl9YwkK;bqte5cI#!5f7fZVy)=2}Yevm5xSsPW6z}{bQ*S4-jo.$]*[copf%i=g]Ol]#ZBx]sMnJ}+6q+$kn39+5VU,Cd4W9pc]SD84#/+JRR1OmOiZIN:OifMR:]m)/n8l,Q0W50eNU#gx(,H]SD[)CfQvq%jc@AR0sSSrV%+UZ{^:W</cemono.lua>
  </Files>
  <CheatEntries>
    <CheatEntry>
      <ID>1</ID>
      <Description>"Enable"</Description>
      <Options moHideChildren="1"/>
      <Color>008000</Color>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>[ENABLE]

{$lua}
if syntaxcheck then return end

if getCEVersion() == nil or getCEVersion() &lt; 7.5 then
   messageDialog('Please update! Its recommended to use Cheat Engine 7.5! (Your Version: '..getCEVersion()..')', mtError, mbOK)
end

--local PROCNAME = 'Unaware in The City.exe'

function checkprocess()
  local msg = ''
  local pname = process:match("(%w+)")
  --pname[0], pname[1] = process:match("(%w+)(.+)") --get first word (and the rest)
  --print(pname[0], pname[1], tostring(pname[0] ~= 'Unaware' and pname[0] ~= 'UiTC'))
  --Check on exe and mono
  if not process or (pname ~= 'Max') then
    msg = 'Either no or wrong process selected. Expected: Max*.exe"'  -- .. PROCNAME
  else if LaunchMonoDataCollector() == 0 then
    msg = 'Process found, but mono could not be launched.'
  end end
  if msg ~= '' then  print(msg) error(1) end
end

function cycleFullCompact(sender,force)
	local state = not(compactmenuitem.Caption == 'Compact View Mode')
	if force~=nil then state = not force end
	compactmenuitem.Caption = state and 'Compact View Mode' or 'Full View Mode'
	getMainForm().Splitter1.Visible = state
	getMainForm().Panel4.Visible    = state
	getMainForm().Panel5.Visible    = state
end

function addCompactMenu()
	if compactmenualreadyexists then return end
	local parent = getMainForm().Menu.Items
	compactmenuitem = createMenuItem(parent)
	parent.add(compactmenuitem)
	compactmenuitem.Caption = 'Compact View Mode'
	compactmenuitem.OnClick = cycleFullCompact
	compactmenualreadyexists = 'yes'
end

function addStructForOffsets()
  local s = findTableFile('cemono.lua').Stream
  local ls = load(readStringLocal(s.Memory,s.Size))
  ls()

  delAllStructures()
  addMonoStructure('','GameplayManager',false)
  addMonoStructure('','GameplayManager',true)
  addMonoStructure('','MaxAttacks',false)
  addMonoStructure('','MaxControllerRevamp',false)
  addMonoStructure('','UI',false)
  addMonoStructure('','textNode',false)
  addMonoStructure('','TextBox',false)
  local gpm = monoStaticF('','GameplayManager') --this gets the starting addr
  if not gpm or (gpm &gt;&gt; 33) &lt;= 0 then print('Error, could not get Field Infos. Some options wont work!') else
    unregisterSymbol("pgpm")
    registerSymbol("pgpm", gpm, false)
  end
end


checkprocess()
addStructForOffsets()
addCompactMenu()
cycleFullCompact(nil,true)

{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end

cycleFullCompact(nil,false)

monopipe.OnTimeout()

delAllStructures()
--removeMrChilds('BaseItems (dont change this one)')
--removeMrChilds('BaseStats (dont change this one)')

deAlloc("pgpm")
unregisterSymbol("pgpm")
{$asm}

</AssemblerScript>
      <CheatEntries>
        <CheatEntry>
          <ID>2</ID>
          <Description>"Disable special attack decrease (one ... script .. to rule 'em all)"</Description>
          <Color>000080</Color>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>{ Game   : Max_The_Elf_DEMO.exe
  Version: 
  Date   : 2024-03-03
  Author : Nironan

  Disables the code to decrease/increase the value of special attack (specialCount and SpecialsUsed)
}

[ENABLE]

//aobscan(aobDisableSpecDecr,8D 00 00 00 48 63 86 90 00 00 00 FF C8 89 86 90 00 00 00)
aobscanregion(aobDisableSpecDecr,UI:decSpecial+10,UI:decSpecial+E0,FF C8 89 86 * * 00 00)
registersymbol(aobDisableSpecDecr)
//no need to alloc because we dont need to execute s.t. we just disable existing code.

aobDisableSpecDecr:
  nop 2 //specialCount-- //nop = no operation meaning it does "nothing" these 2 bytes

//aobscan(aobNoSpecialUse,FF C0 89 86 88 00 00 00 66)
aobscanregion(aobNoSpecialUse,MaxAttacks:Update+BBB,MaxAttacks:Update+CCC,FF C0 89 86 * * 00 00)
registersymbol(aobNoSpecialUse)

aobNoSpecialUse:
  nop 2 //SpecialsUsed++

[DISABLE]

aobDisableSpecDecr:
  db FF C8 //restore original code when script disabled, bytes already seized at aobscanregion
unregistersymbol(aobDisableSpecDecr)

aobNoSpecialUse:
  db FF C0 //db = data byte - sets the following bytes at the addr "aobNoSpecialUse" (see aobscanregion)
unregistersymbol(aobNoSpecialUse)

{
// ORIGINAL CODE - INJECTION POINT: UI:decSpecial+2d

UI:decSpecial+1: 48 8B EC              - mov rbp,rsp
UI:decSpecial+4: 48 83 EC 70           - sub rsp,70
UI:decSpecial+8: 48 89 75 E8           - mov [rbp-18],rsi
UI:decSpecial+c: 48 89 7D F0           - mov [rbp-10],rdi
UI:decSpecial+10: 4C 89 7D F8           - mov [rbp-08],r15
UI:decSpecial+14: 48 8B F1              - mov rsi,rcx
UI:decSpecial+17: 48 63 86 90 00 00 00  - movsxd  rax,dword ptr [rsi+00000090]
UI:decSpecial+1e: 85 C0                 - test eax,eax
UI:decSpecial+20: 0F 8E 8D 00 00 00     - jng UI:decSpecial+b3
UI:decSpecial+26: 48 63 86 90 00 00 00  - movsxd  rax,dword ptr [rsi+00000090]
// ---------- INJECTING HERE ----------
UI:decSpecial+2d: FF C8                 - dec eax
// ---------- DONE INJECTING  ----------
UI:decSpecial+2f: 89 86 90 00 00 00     - mov [rsi+00000090],eax
UI:decSpecial+35: 48 8B 4E 48           - mov rcx,[rsi+48]
UI:decSpecial+39: 48 63 86 90 00 00 00  - movsxd  rax,dword ptr [rsi+00000090]
UI:decSpecial+40: 48 8B F9              - mov rdi,rcx
UI:decSpecial+43: 4C 8B F8              - mov r15,rax
UI:decSpecial+46: 83 39 00              - cmp dword ptr [rcx],00
UI:decSpecial+49: 48 63 49 18           - movsxd  rcx,dword ptr [rcx+18]
UI:decSpecial+4d: 3B C1                 - cmp eax,ecx
UI:decSpecial+4f: 0F 83 70 00 00 00     - jae UI:decSpecial+c5
UI:decSpecial+55: 48 8B 47 10           - mov rax,[rdi+10]
}

{
// ORIGINAL CODE - INJECTION POINT: MaxAttacks:Update+c22

MaxAttacks:Update+beb: F2 0F 5A C9                    - cvtsd2ss xmm1,xmm1
MaxAttacks:Update+bef: 48 8D AD 00 00 00 00           - lea rbp,[rbp+00000000]
MaxAttacks:Update+bf6: 49 BB 30 EA 83 95 10 02 00 00  - mov r11,MaxAttacks:MaxSpecial
MaxAttacks:Update+c00: 41 FF D3                       - call r11
MaxAttacks:Update+c03: 48 8B D0                       - mov rdx,rax
MaxAttacks:Update+c06: 48 8B CE                       - mov rcx,rsi
MaxAttacks:Update+c09: 48 8D 64 24 00                 - lea rsp,[rsp+00]
MaxAttacks:Update+c0e: 49 BB 80 90 D0 98 10 02 00 00  - mov r11,UnityEngine.MonoBehaviour:StartCoroutine
MaxAttacks:Update+c18: 41 FF D3                       - call r11
MaxAttacks:Update+c1b: 48 63 86 88 00 00 00           - movsxd  rax,dword ptr [rsi+00000088]
// ---------- INJECTING HERE ----------
MaxAttacks:Update+c22: FF C0                          - inc eax
// ---------- DONE INJECTING  ----------
MaxAttacks:Update+c24: 89 86 88 00 00 00              - mov [rsi+00000088],eax
MaxAttacks:Update+c2a: 66 0F 57 C0                    - xorpd xmm0,xmm0
MaxAttacks:Update+c2e: F2 0F 5A E8                    - cvtsd2ss xmm5,xmm0
MaxAttacks:Update+c32: F3 0F 11 AE 94 00 00 00        - movss [rsi+00000094],xmm5
MaxAttacks:Update+c3a: C6 86 85 00 00 00 01           - mov byte ptr [rsi+00000085],01
MaxAttacks:Update+c41: 48 8B 75 E8                    - mov rsi,[rbp-18]
MaxAttacks:Update+c45: 48 8B 7D F0                    - mov rdi,[rbp-10]
MaxAttacks:Update+c49: 4C 8B 7D F8                    - mov r15,[rbp-08]
MaxAttacks:Update+c4d: 48 8D 65 00                    - lea rsp,[rbp+00]
MaxAttacks:Update+c51: 5D                             - pop rbp
}
</AssemblerScript>
        </CheatEntry>
        <CheatEntry>
          <ID>3</ID>
          <Description>"Disable corruption changes (enjoy da shows without worries)"</Description>
          <Color>FF80FF</Color>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>{ Game   : Max_The_Elf_DEMO.exe
  Version: 
  Date   : 2024-03-03
  Author : Nironan

  Simply returns when entering the function effectively disabling it.
  Note: this will also disable corr. decrease
}

define(addCor,UI:addCorruption) //just 1 easy changeable entry point

[ENABLE]
assert(addCor,55 48) //assert to check that function exists/not renamed and is rly the start.
                     //note: you want to assert only on enable, cause at disable it will be C3

addCor:
  db C3 //ret - returns to the address from stack the last call pushed

[DISABLE]

addCor:
  db 55

{
// ORIGINAL CODE - INJECTION POINT: UI:addCorruption

22A2409A9AF: 00                             - db 00
// ---------- INJECTING HERE ----------
UI:addCorruption: 55                             - push rbp
// ---------- DONE INJECTING  ----------
UI:addCorruption+1: 48 8B EC                       - mov rbp,rsp

</AssemblerScript>
        </CheatEntry>
        <CheatEntry>
          <ID>4</ID>
          <Description>"No damage / cum incr in fights (meh, advancing in scenes sucks  / NOTE: disables Boss fight)"</Description>
          <Color>804000</Color>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>{ Game   : Max_The_Elf_DEMO.exe
  Version: 
  Date   : 2024-03-03
  Author : Nironan

  Always jump to disable dmg, regardless of KeySuccess
}

//start with a lua function definition, because want to use CE intern functions to get the addr./namings. Its activated at luacall below.
{$lua}
if syntaxcheck then return end

function disableBossMr() --start of function defining the name
  --local mr = getAddressList().getMemoryRecordByDescription("Boss fight") --get addr of a MR
  local mr = getAddressList().getMemoryRecordByID(7) --(script in this case) by name or ID
  if not mr then error(print('MR renamed or wrong ID?')) else --eror handling if addr. could not be found
     mr.Active = false --deactivate the script
end end
{$asm}

[ENABLE]

luacall(disableBossMr()) //needed because if you enable it after boss script you might get stuck (till you disable this)


//aobscan(aobNoCumDmg,0F 8D 3E 01 00 00 48 8B 46)
aobscanregion(aobNoCumDmg,MaxControllerRevamp:ReceiveDamage,MaxControllerRevamp:ReceiveDamage+FF,0F 8D * *  00 00 48)
registersymbol(aobNoCumDmg)

aobNoCumDmg:
  db 90 E9 //nop &amp; jmp - so always jump, not only if not enough KeyStrokes

return:


[DISABLE]

aobNoCumDmg:
  db 0F 8D

unregistersymbol(aobNoCumDmg)

{
// ORIGINAL CODE - INJECTION POINT: MaxControllerRevamp:ReceiveDamage+5e

MaxControllerRevamp:ReceiveDamage+1d: C7 45 D0 00 00 00 00     - mov [rbp-30],00000000
MaxControllerRevamp:ReceiveDamage+24: C7 45 D4 00 00 00 00     - mov [rbp-2C],00000000
MaxControllerRevamp:ReceiveDamage+2b: C7 45 D8 00 00 00 00     - mov [rbp-28],00000000
MaxControllerRevamp:ReceiveDamage+32: C7 45 DC 00 00 00 00     - mov [rbp-24],00000000
MaxControllerRevamp:ReceiveDamage+39: C7 45 E0 00 00 00 00     - mov [rbp-20],00000000
MaxControllerRevamp:ReceiveDamage+40: C7 45 E4 00 00 00 00     - mov [rbp-1C],00000000
MaxControllerRevamp:ReceiveDamage+47: C7 45 E8 00 00 00 00     - mov [rbp-18],00000000
MaxControllerRevamp:ReceiveDamage+4e: 48 63 86 D4 00 00 00     - movsxd  rax,dword ptr [rsi+000000D4]
MaxControllerRevamp:ReceiveDamage+55: 48 63 8E D0 00 00 00     - movsxd  rcx,dword ptr [rsi+000000D0]
MaxControllerRevamp:ReceiveDamage+5c: 3B C1                    - cmp eax,ecx
// ---------- INJECTING HERE ----------
MaxControllerRevamp:ReceiveDamage+5e: 0F 8D 3E 01 00 00        - jnl MaxControllerRevamp:ReceiveDamage+1a2
// ---------- DONE INJECTING  ----------
MaxControllerRevamp:ReceiveDamage+64: 48 8B 46 78              - mov rax,[rsi+78]
MaxControllerRevamp:ReceiveDamage+68: F3 0F 10 86 DC 00 00 00  - movss xmm0,[rsi+000000DC]
MaxControllerRevamp:ReceiveDamage+70: F3 0F 5A C0              - cvtss2sd xmm0,xmm0
MaxControllerRevamp:ReceiveDamage+74: 48 8B C8                 - mov rcx,rax
MaxControllerRevamp:ReceiveDamage+77: 41 B8 01 00 00 00        - mov r8d,00000001
MaxControllerRevamp:ReceiveDamage+7d: F2 0F 10 C8              - movsd xmm1,xmm0
MaxControllerRevamp:ReceiveDamage+81: F2 0F 5A C9              - cvtsd2ss xmm1,xmm1
MaxControllerRevamp:ReceiveDamage+85: 83 38 00                 - cmp dword ptr [rax],00
MaxControllerRevamp:ReceiveDamage+88: 48 8D 64 24 00           - lea rsp,[rsp+00]
MaxControllerRevamp:ReceiveDamage+8d: 90                       - nop 
}
</AssemblerScript>
        </CheatEntry>
        <CheatEntry>
          <ID>5</ID>
          <Description>"SphinxRiddle - Any answer is correct (thinking - bada bad!)"</Description>
          <Color>00AAAA</Color>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>{ Game   : Max_The_Elf_DEMO.exe
  Version: 
  Date   : 2024-03-03
  Author : Nironan

  Sets the check on answer == choice to true, thus pretending its correctly answered
}

[ENABLE]

//aobscan(aobAnswerTrue,40 88 88 D1 00 00 00)
aobscanregion(aobAnswerTrue,TextBox:answerClicked,TextBox:answerClicked+AA,40 88 88 * * 00 00)
alloc(newmem,$100,aobAnswerTrue) //allocales some free memory to use near a given address
registersymbol(aobAnswerTrue)

label(retAnTr)
registersymbol(retAnTr) //define a symbol to get the address of bytes we will restore

newmem:
  //mov rcx,01
  xor ecx,ecx //messing with dword will clean upper bits too in x64
  mov cl,01 //set to true //mov = move into destination from source (meaning 'copy into b from a'' or '8 lower bits of register rcx = 1')

retAnTr:
//  mov [rax+000000D1],cl //original code but offsets might change thus we read dynamically:
  readmem(aobAnswerTrue,7) //readmem reads the memory at given addr. for X bytes length
  jmp return

aobAnswerTrue:
  jmp newmem
  nop 2
return:


[DISABLE]

aobAnswerTrue:
//  db 40 88 88 D1 00 00 00
  readmem(retAnTr,7) //restore dyn. read instruction from retAnTr for 7 bytes length

unregistersymbol(retAnTr)
unregistersymbol(aobAnswerTrue)
dealloc(newmem)

{
// ORIGINAL CODE - INJECTION POINT: TextBox:answerClicked+62

TextBox:answerClicked+3a: 0F 83 55 00 00 00              - jae TextBox:answerClicked+95
TextBox:answerClicked+40: 49 8B 46 10                    - mov rax,[r14+10]
TextBox:answerClicked+44: 49 63 CD                       - movsxd  rcx,r13d
TextBox:answerClicked+47: 48 8D 44 C8 20                 - lea rax,[rax+rcx*8+20]
TextBox:answerClicked+4c: 48 8B 00                       - mov rax,[rax]
TextBox:answerClicked+4f: 48 63 40 2C                    - movsxd  rax,dword ptr [rax+2C]
TextBox:answerClicked+53: 3B 45 D8                       - cmp eax,[rbp-28]
TextBox:answerClicked+56: 40 0F 94 C1                    - sete cl
TextBox:answerClicked+5a: 48 0F B6 C9                    - movzx rcx,cl
TextBox:answerClicked+5e: 48 8B 45 E0                    - mov rax,[rbp-20]
// ---------- INJECTING HERE ----------
TextBox:answerClicked+62: 40 88 88 D1 00 00 00           - mov [rax+000000D1],cl
// ---------- DONE INJECTING  ----------
TextBox:answerClicked+69: C6 87 D0 00 00 00 01           - mov byte ptr [rdi+000000D0],01
TextBox:answerClicked+70: 48 8B CF                       - mov rcx,rdi
TextBox:answerClicked+73: 66 66 90                       - nop 3
TextBox:answerClicked+76: 49 BB 10 B3 88 95 10 02 00 00  - mov r11,TextBox:Advance
TextBox:answerClicked+80: 41 FF D3                       - call r11
TextBox:answerClicked+83: 48 8B 7D E8                    - mov rdi,[rbp-18]
TextBox:answerClicked+87: 4C 8B 6D F0                    - mov r13,[rbp-10]
TextBox:answerClicked+8b: 4C 8B 75 F8                    - mov r14,[rbp-08]
TextBox:answerClicked+8f: 48 8D 65 00                    - lea rsp,[rbp+00]
TextBox:answerClicked+93: 5D                             - pop rbp
}
</AssemblerScript>
        </CheatEntry>
        <CheatEntry>
          <ID>6</ID>
          <Description>"SphinxRiddle - '*' on correct answers (of course i knew them, but ty)"</Description>
          <Color>00AAAA</Color>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>{ Game   : Max_The_Elf_DEMO.exe
  Version:
  Date   : 2024-03-06
  Author : Nironan

  Changes the button for the correct answer
}

[ENABLE]

//aobscan(aobMarkCorrectAnswer,48 20 48 8B 75 F8 48 8D 65 00)
aobscanregion(aobMarkCorrectAnswer,textNode:setAnswers,textNode:setAnswers+88,48 8B * * 48 8D)
alloc(newmem,$100,aobMarkCorrectAnswer)
registersymbol(aobMarkCorrectAnswer)

label(retTB)
registersymbol(retTB)

//textNode:setAnswers+66 (rax/r12=textNode, rbx=List of all Textboxes, rcx=List of c.Node buttons, rsi=1 String of all answers, rdi/r13=List of 2 decisions, r8=1 String/Name?, r10=String=1?, r11=StringBuilder, r14=String with 2 Chars
newmem:
//  cmp byte ptr [rax+textNode.autoLose],01 //was the only difference to normal answers
//  je short retTB
  mov edx, dword ptr [rax+textNode.answer] //get the id of the correct answer
  mov rax, qword ptr [rcx+rdx*8+20] //textnode.buttons.Item[x]
  mov r8d, dword ptr [rax+10] //stringLength
  lea r9 , qword ptr [rax+14] //address of the string to modify
  mov byte ptr [r9+r8d*2-2],'*' //set a byte at the end of the string
retTB:
//  mov rsi,[rbp-08]
//  lea rsp,[rbp+00]
  readmem(aobMarkCorrectAnswer,8)
  jmp return

aobMarkCorrectAnswer:
  jmp newmem
  nop 3
return:


[DISABLE]

aobMarkCorrectAnswer:
//  db 48 8B 75 F8 48 8D 65 00
  readmem(retTB,8)

unregistersymbol(bacStr)
unregistersymbol(retTB)
unregistersymbol(aobMarkCorrectAnswer)
dealloc(newmem)


{$lua
  local sb = getAddressSafe('bacStr')
  local ss = readInteger(ss+16)
  local s = readWideString(address,size)
  --writeWideString()
{$asm}
{
// ORIGINAL CODE - INJECTION POINT: textNode:setAnswers+66

textNode:setAnswers+3a: 0F 86 30 00 00 00              - jbe textNode:setAnswers+70
textNode:setAnswers+40: 66 C7 40 20 7C 00              - mov word ptr [rax+20],007C
textNode:setAnswers+46: 48 8B CE                       - mov rcx,rsi
textNode:setAnswers+49: 83 3E 00                       - cmp dword ptr [rsi],00
textNode:setAnswers+4c: 66 90                          - nop 2
textNode:setAnswers+4e: 49 BB 80 FF 4A 48 AE 02 00 00  - mov r11,System.String:Split
textNode:setAnswers+58: 41 FF D3                       - call r11
textNode:setAnswers+5b: 48 8B C8                       - mov rcx,rax
textNode:setAnswers+5e: 48 8B 45 F0                    - mov rax,[rbp-10]
textNode:setAnswers+62: 48 89 48 20                    - mov [rax+20],rcx
// ---------- INJECTING HERE ----------
textNode:setAnswers+66: 48 8B 75 F8                    - mov rsi,[rbp-08]
textNode:setAnswers+6a: 48 8D 65 00                    - lea rsp,[rbp+00]
// ---------- DONE INJECTING  ----------
textNode:setAnswers+6e: 5D                             - pop rbp
textNode:setAnswers+6f: C3                             - ret
textNode:setAnswers+70: BA 51 00 00 00                 - mov edx,00000051
textNode:setAnswers+75: B9 8C 01 00 00                 - mov ecx,0000018C
textNode:setAnswers+7a: 48 8D 6D 00                    - lea rbp,[rbp+00]
textNode:setAnswers+7e: 49 BB D0 20 53 36 AE 02 00 00  - mov r11,000002AE365320D0
textNode:setAnswers+88: 41 FF D3                       - call r11
2AE46DD941B: 00 00                          - add [rax],al
2AE46DD941D: 00 00                          - add [rax],al
}
</AssemblerScript>
        </CheatEntry>
        <CheatEntry>
          <ID>7</ID>
          <Description>"Boss fight lv4 no corruption (keep on getting raped, yee-haw / NOTE: disables No damage)"</Description>
          <Color>8000FF</Color>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>{ Game   : Max_The_Elf_DEMO.exe
  Version:
  Date   : 2024-03-03
  Author : Nironan

  Disables health loss / corruption in Lvl4 boss fight
}

{$lua}
if syntaxcheck then return end

function disableNoDamMr()
  --local mr = getAddressList().getMemoryRecordByDescription("No damage")
  local mr = getAddressList().getMemoryRecordByID(4)
  if not mr then error(print('MR renamed or wrong ID?')) else
     mr.Active = false
end end
{$asm}

//on asm instuction explanation check "Disable corruption .."
//on lua instuction explanation check "No damage .."

//aobscan(aobIgnoreBossHit,55 48 8B EC 48 83 EC 30 48 89 75 F8 48 8B F1 0F B6 46 38) //Level4BossManager:OnPlayerHit
//aobscan(aobIgnoreBossHit,C3 48 8B EC 48 83 EC 30 48 89 4D) //Level4BossAnimCallbacks:HitPlayer
define(addBossDec,Level4BossAnimCallbacks:HitPlayer)

//aobscan(aobIgnoreBossHit,50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 48 8B EC 48 83 EC 30 48 89 75 F8 48 8B F1 48 8B 4E 30 33 D2 90 49 BB 00) // should be unique
define(addBossInc,MaxAnimationCallbacks:IncrementBossHit)

[ENABLE]

luacall(disableNoDamMr())

assert(addBossDec,55 48)
assert(addBossInc,55 48)

addBossDec:
  db C3
addBossInc:
  db C3

[DISABLE]

addBossDec:
  db 55
addBossInc:
  db 55

{
// ORIGINAL CODE - INJECTION POINT: Level4BossManager:OnPlayerHit

22A27AC852F: 00                 - db 00
// ---------- INJECTING HERE ----------
Level4BossManager:OnPlayerHit: 55                 - push rbp
// ---------- DONE INJECTING  ----------
Level4BossManager:OnPlayerHit+1: 48 8B EC           - mov rbp,rsp
}

{
// ORIGINAL CODE - INJECTION POINT: MaxAnimationCallbacks:IncrementBossHit

2093D33237E: 00 00                          - add [rax],al
// ---------- INJECTING HERE ----------
MaxAnimationCallbacks:IncrementBossHit: 55                             - push rbp
// ---------- DONE INJECTING  ----------
MaxAnimationCallbacks:IncrementBossHit+1: 48 8B EC                       - mov rbp,rsp
}
</AssemblerScript>
        </CheatEntry>
        <CheatEntry>
          <ID>8</ID>
          <Description>"Controling options for max (aka the lame ones)"</Description>
          <Options moHideChildren="1" moDeactivateChildrenAsWell="1"/>
          <Color>01255C</Color>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>{ Game   : Max_The_Elf_DEMO.exe
  Version: 
  Date   : 2024-03-04
  Author : Nironan

  Forced changes on some game intern values. Note: Higher movement has a lua script on disable
}

[ENABLE]



//aobscan(aobMCR,B9 7F 00 00 00 48 8D AD)
aobscanregion(aobMCR,MaxControllerRevamp:Update+40,MaxControllerRevamp:Update+1A0,B9 * * 00 00 48 8D AD)
registersymbol(aobMCR)

alloc(newmem,$1000,aobMCR) //alloc some unified mem

//aobscan(aobGetReqKeys,89 87 D0 00 00 00 48 8B 47)
aobscanregion(aobGetReqKeys,MaxControllerRevamp:SetEnemy+400,MaxControllerRevamp:SetEnemy+700,89 87 * * 00 00 48 8B 47)
registersymbol(aobGetReqKeys)

label(pMCR)
registersymbol(pMCR)
label(retMCR)
registersymbol(retMCR)
label(retReq)
registersymbol(retReq)

//on some asm instuction explanation check "SphinxRiddle .."

newmem+0:
pMCR:
  dq 0 //MaxControllerRevamp
  dd 0 //orig. needed keystrokes
  db 00 00 00 01 //used for byte comparisation to enable features individually
newmem+10:
//----MCR START
startMCR:
  mov qword ptr [pMCR],rcx //save MaxControllerRevamp value start address
  cmp byte ptr [pMCR+C],01 //check if "Higher movement speed" is active
  jne short @f //1
  mov dword ptr [rcx+MaxControllerRevamp.topSpeed],(float)9 //3
  mov dword ptr [rcx+MaxControllerRevamp.topBackSpeed],(float)-9 //-1,5
@@: //1
  cmp byte ptr [pMCR+D],01 //Get Invincible
  jne short @f //2
  mov byte ptr [rcx+MaxControllerRevamp.Invincible],01
  mov dword ptr [rcx+MaxControllerRevamp.invultimer],(float)0
@@: //2
  cmp byte ptr [pMCR+E],01 //Max x keys
  jne short @f //3  retMCR
  mov eax, dword ptr [rcx+MaxControllerRevamp.KeyPresses] //get currently needed KeyPresses
  cmp al, byte ptr [pMCR+F] //why eax and then byte? to clean rcx, but it wont be more than 255 clicks anyway - even if you're a masochist
  jle short @f //3
  mov al, byte ptr [pMCR+F]
  mov dword ptr [rcx+MaxControllerRevamp.KeyPresses],eax

retMCR: //3
  //mov ecx,0000007F
  readmem(aobMCR,5)
  jmp returnMCR
//----MCR END

//----REQ START
newmem+100:
startReq:
  mov dword ptr [pMCR+8],eax

retReq:
  //mov [rdi+000000D0],eax
  mov [rdi+MaxControllerRevamp.KeyPresses],eax
  jmp returnReq
//----REQ END

aobMCR: //----MCR
  jmp startMCR
returnMCR:

aobGetReqKeys:  //----REQ
  jmp startReq
  nop
returnReq:

[DISABLE]

aobMCR:
  //db B9 7F 00 00 00
  readmem(retMCR,5)

aobGetReqKeys:
  //db 89 87 D0 00 00 00
  mov [rdi+MaxControllerRevamp.KeyPresses],eax

unregistersymbol(retReq)
unregistersymbol(retMCR)
unregistersymbol(pMCR)
unregistersymbol(aobMCR)
dealloc(newmem)

{
// ORIGINAL CODE - INJECTION POINT: MaxControllerRevamp:Update+52

MaxControllerRevamp:Update+10: 48 8B F1                       - mov rsi,rcx
MaxControllerRevamp:Update+13: C7 45 C8 00 00 00 00           - mov [rbp-38],00000000
MaxControllerRevamp:Update+1a: C7 45 CC 00 00 00 00           - mov [rbp-34],00000000
MaxControllerRevamp:Update+21: C7 45 D0 00 00 00 00           - mov [rbp-30],00000000
MaxControllerRevamp:Update+28: C7 45 D4 00 00 00 00           - mov [rbp-2C],00000000
MaxControllerRevamp:Update+2f: C7 45 D8 00 00 00 00           - mov [rbp-28],00000000
MaxControllerRevamp:Update+36: C7 45 DC 00 00 00 00           - mov [rbp-24],00000000
MaxControllerRevamp:Update+3d: C7 45 E0 00 00 00 00           - mov [rbp-20],00000000
MaxControllerRevamp:Update+44: C7 45 E4 00 00 00 00           - mov [rbp-1C],00000000
MaxControllerRevamp:Update+4b: C7 45 E8 00 00 00 00           - mov [rbp-18],00000000
// ---------- INJECTING HERE ----------
MaxControllerRevamp:Update+52: B9 7F 00 00 00                 - mov ecx,0000007F
// ---------- DONE INJECTING  ----------
MaxControllerRevamp:Update+57: 48 8D AD 00 00 00 00           - lea rbp,[rbp+00000000]
MaxControllerRevamp:Update+5e: 49 BB 00 6A EF 7C 33 02 00 00  - mov r11,UnityEngine.Input:GetKey
MaxControllerRevamp:Update+68: 41 FF D3                       - call r11
MaxControllerRevamp:Update+6b: 85 C0                          - test eax,eax
MaxControllerRevamp:Update+6d: 0F 84 38 00 00 00              - je MaxControllerRevamp:Update+ab
MaxControllerRevamp:Update+73: B9 63 00 00 00                 - mov ecx,00000063
MaxControllerRevamp:Update+78: 48 8D 64 24 00                 - lea rsp,[rsp+00]
MaxControllerRevamp:Update+7d: 90                             - nop 
MaxControllerRevamp:Update+7e: 49 BB 68 B2 1F 7D 33 02 00 00  - mov r11,000002337D1FB268
MaxControllerRevamp:Update+88: 41 FF D3                       - call r11
}

{
// ORIGINAL CODE - INJECTION POINT: MaxControllerRevamp:SetEnemy+542

MaxControllerRevamp:SetEnemy+51f: 48 63 40 2C                    - movsxd  rax,dword ptr [rax+2C]
MaxControllerRevamp:SetEnemy+523: 48 8B 4F 78                    - mov rcx,[rdi+78]
MaxControllerRevamp:SetEnemy+527: 48 8B D1                       - mov rdx,rcx
MaxControllerRevamp:SetEnemy+52a: 83 3A 00                       - cmp dword ptr [rdx],00
MaxControllerRevamp:SetEnemy+52d: 48 8B 49 28                    - mov rcx,[rcx+28]
MaxControllerRevamp:SetEnemy+531: 48 8B D1                       - mov rdx,rcx
MaxControllerRevamp:SetEnemy+534: 83 3A 00                       - cmp dword ptr [rdx],00
MaxControllerRevamp:SetEnemy+537: 48 63 89 8C 00 00 00           - movsxd  rcx,dword ptr [rcx+0000008C]
MaxControllerRevamp:SetEnemy+53e: D1 E1                          - shl ecx,1
MaxControllerRevamp:SetEnemy+540: 03 C1                          - add eax,ecx
// ---------- INJECTING HERE ----------
MaxControllerRevamp:SetEnemy+542: 89 87 D0 00 00 00              - mov [rdi+000000D0],eax
// ---------- DONE INJECTING  ----------
MaxControllerRevamp:SetEnemy+548: 48 8B 47 58                    - mov rax,[rdi+58]
MaxControllerRevamp:SetEnemy+54c: 48 8B C8                       - mov rcx,rax
MaxControllerRevamp:SetEnemy+54f: 83 38 00                       - cmp dword ptr [rax],00
MaxControllerRevamp:SetEnemy+552: 48 8D 6D 00                    - lea rbp,[rbp+00]
MaxControllerRevamp:SetEnemy+556: 49 BB F0 01 F9 28 DD 02 00 00  - mov r11,UnityEngine.Component:get_transform
MaxControllerRevamp:SetEnemy+560: 41 FF D3                       - call r11
MaxControllerRevamp:SetEnemy+563: 48 8B 4F 70                    - mov rcx,[rdi+70]
MaxControllerRevamp:SetEnemy+567: 48 83 C1 18                    - add rcx,18
MaxControllerRevamp:SetEnemy+56b: 48 63 11                       - movsxd  rdx,dword ptr [rcx]
MaxControllerRevamp:SetEnemy+56e: 89 55 98                       - mov [rbp-68],edx
}
</AssemblerScript>
          <CheatEntries>
            <CheatEntry>
              <ID>15</ID>
              <Description>"Higher movement speed (speed up, like I always do)"</Description>
              <VariableType>Auto Assembler Script</VariableType>
              <AssemblerScript>[ENABLE]

pMCR+C:
  db 01

[DISABLE]

pMCR+C:
  db 00

{$lua}
--resetting on deactivation needs a lua call as you're going to dealloc so any code wont be executed anymore
--there would be options but its easier to only do once here in lua
function resetSpeeds()
  local mcr = readPointer(getAddressSafe('pMCR')) --get addresss and offsets
  local ts = getAddressSafe('MaxControllerRevamp.topSpeed')
  local tbs = getAddressSafe('MaxControllerRevamp.topBackSpeed')

  if not mcr or not ts or not tbs then print('Cant return speeds. Check Structures.') error(1) return end
  if syntaxcheckonly then print('!! Syntax error') error(2) end --check on any errors
  --print(tohex(mcr),tohex(ts),tohex(tbs),readFloat(mcr+ts))
  writeFloat(mcr+ts,3.0) --finally write the values to original value
  writeFloat(mcr+tbs,-1.5)
end

resetSpeeds()
{$asm}

</AssemblerScript>
            </CheatEntry>
            <CheatEntry>
              <ID>16</ID>
              <Description>"Get Invincible (this was simply too much to "handle" / NOTE: max will blink, disable stage end)"</Description>
              <VariableType>Auto Assembler Script</VariableType>
              <AssemblerScript>[ENABLE]

pMCR+D:
  db 01

[DISABLE]

pMCR+D:
  db 00
</AssemblerScript>
            </CheatEntry>
            <CheatEntry>
              <ID>17</ID>
              <Description>"Max x keys needed to get free (was that supposed to be "fun"?)"</Description>
              <VariableType>Auto Assembler Script</VariableType>
              <AssemblerScript>[ENABLE]

pMCR+E:
  db 01

[DISABLE]

pMCR+E:
  db 00
</AssemblerScript>
              <CheatEntries>
                <CheatEntry>
                  <ID>39</ID>
                  <Description>"maximal this much keys needed to get free"</Description>
                  <ShowAsSigned>0</ShowAsSigned>
                  <VariableType>Byte</VariableType>
                  <Address>pMCR+F</Address>
                </CheatEntry>
                <CheatEntry>
                  <ID>40</ID>
                  <Description>"original needed keypresses (refreshes on lvl/enemy)"</Description>
                  <ShowAsSigned>0</ShowAsSigned>
                  <VariableType>4 Bytes</VariableType>
                  <Address>pMCR+8</Address>
                </CheatEntry>
              </CheatEntries>
            </CheatEntry>
          </CheatEntries>
        </CheatEntry>
        <CheatEntry>
          <ID>9</ID>
          <Description>"Freeze timer (slowly going forward "exploring" the game)"</Description>
          <Options moHideChildren="1"/>
          <Color>808080</Color>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>{ Game   : Max_The_Elf_DEMO.exe
  Version: 
  Date   : 2024-03-03
  Author : Nironan

  Gets GM Pointer and set the timer to paused state
}

define(address,GameplayManager:IsGameOver+4)
assert(address,48 B8)

[ENABLE]

//aobscan(aobGetGM,F3 0F 10 46 34 F3 0F 5A C0 48)
aobscanregion(aobGetGM,GameplayManager:Update,GameplayManager:Update+FF,F3 0F 10 46 * * * * * 48)
registersymbol(aobGetGM)

alloc(newmem,$1000,aobGetGM)

label(pGM)
registersymbol(pGM)
label(retGM)
registersymbol(retGM)

newmem:
pGM:
  dq 0
  dq 0
start:
  mov qword ptr [pGM],rsi //save GM ptr
//  mov rcx,qword ptr[rsi+GameplayManager.UIControls] //+28 move UIControls Addr into register
//  mov dword ptr[rcx+UI.corruptionLevel],0 //+8C set corruptionLevel
  mov rcx,qword ptr[address+2] //move GameOver Addr into register
  mov qword ptr [pGM+8],rcx //save GameOver Addr
  mov byte ptr [rcx+2],1 //set timerPaused to true
retGM:
//  movss xmm0,[rsi+34]
  readmem(aobGetGM,5)
  jmp return

aobGetGM:
  jmp start
return:


[DISABLE]

aobGetGM:
  //db F3 0F 10 46 34
  readmem(retGM,5)

unregistersymbol(retGM)
unregistersymbol(pGM)
unregistersymbol(aobGetGM)
dealloc(newmem)

{
// ORIGINAL CODE - INJECTION POINT: GameplayManager:Update+81

GameplayManager:Update+53: F3 0F 5A C0                    - cvtss2sd xmm0,xmm0
GameplayManager:Update+57: F2 0F 11 45 E8                 - movsd [rbp-18],xmm0
GameplayManager:Update+5c: 66 90                          - nop 2
GameplayManager:Update+5e: 49 BB 70 AA D0 98 10 02 00 00  - mov r11,UnityEngine.Time:get_deltaTime
GameplayManager:Update+68: 41 FF D3                       - call r11
GameplayManager:Update+6b: F3 0F 5A C8                    - cvtss2sd xmm1,xmm0
GameplayManager:Update+6f: F2 0F 10 45 E8                 - movsd xmm0,[rbp-18]
GameplayManager:Update+74: F2 0F 58 C1                    - addsd xmm0,xmm1
GameplayManager:Update+78: F2 0F 5A E8                    - cvtsd2ss xmm5,xmm0
GameplayManager:Update+7c: F3 0F 11 6E 34                 - movss [rsi+34],xmm5
// ---------- INJECTING HERE ----------
GameplayManager:Update+81: F3 0F 10 46 34                 - movss xmm0,[rsi+34]
// ---------- DONE INJECTING  ----------
GameplayManager:Update+86: F3 0F 5A C0                    - cvtss2sd xmm0,xmm0
GameplayManager:Update+8a: 48 8B CE                       - mov rcx,rsi
GameplayManager:Update+8d: F2 0F 10 C8                    - movsd xmm1,xmm0
GameplayManager:Update+91: F2 0F 5A C9                    - cvtsd2ss xmm1,xmm1
GameplayManager:Update+95: 90                             - nop
GameplayManager:Update+96: 49 BB 00 5A 83 95 10 02 00 00  - mov r11,GameplayManager:SetTime
GameplayManager:Update+a0: 41 FF D3                       - call r11
GameplayManager:Update+a3: F3 0F 10 46 34                 - movss xmm0,[rsi+34]
GameplayManager:Update+a8: F3 0F 5A C0                    - cvtss2sd xmm0,xmm0
GameplayManager:Update+ac: F3 0F 10 4E 38                 - movss xmm1,[rsi+38]
}
</AssemblerScript>
          <CheatEntries>
            <CheatEntry>
              <ID>20</ID>
              <Description>"(Some pointers you will unlikely need)"</Description>
              <Options moHideChildren="1"/>
              <ShowAsHex>1</ShowAsHex>
              <ShowAsSigned>0</ShowAsSigned>
              <GroupHeader>1</GroupHeader>
              <Address>pgm</Address>
              <Offsets>
                <Offset>0</Offset>
              </Offsets>
              <CheatEntries>
                <CheatEntry>
                  <ID>21</ID>
                  <Description>"time"</Description>
                  <ShowAsSigned>0</ShowAsSigned>
                  <VariableType>Float</VariableType>
                  <Address>+GameplayManager.UIControls</Address>
                  <Offsets>
                    <Offset>UI.time</Offset>
                  </Offsets>
                </CheatEntry>
                <CheatEntry>
                  <ID>22</ID>
                  <Description>"corruptionLevel"</Description>
                  <ShowAsSigned>0</ShowAsSigned>
                  <VariableType>4 Bytes</VariableType>
                  <Address>+GameplayManager.UIControls</Address>
                  <Offsets>
                    <Offset>UI.corruptionLevel</Offset>
                  </Offsets>
                </CheatEntry>
                <CheatEntry>
                  <ID>23</ID>
                  <Description>"transp"</Description>
                  <ShowAsHex>1</ShowAsHex>
                  <ShowAsSigned>0</ShowAsSigned>
                  <VariableType>4 Bytes</VariableType>
                  <Address>+GameplayManager.UIControls</Address>
                  <Offsets>
                    <Offset>UI.transp</Offset>
                  </Offsets>
                </CheatEntry>
                <CheatEntry>
                  <ID>24</ID>
                  <Description>"specialCount"</Description>
                  <ShowAsSigned>0</ShowAsSigned>
                  <VariableType>4 Bytes</VariableType>
                  <Address>+GameplayManager.UIControls</Address>
                  <Offsets>
                    <Offset>UI.specialCount</Offset>
                  </Offsets>
                </CheatEntry>
                <CheatEntry>
                  <ID>25</ID>
                  <Description>"m_levelMaxTime"</Description>
                  <ShowAsSigned>0</ShowAsSigned>
                  <VariableType>Float</VariableType>
                  <Address>+GameplayManager.UIControls</Address>
                  <Offsets>
                    <Offset>UI.m_levelMaxTime</Offset>
                  </Offsets>
                </CheatEntry>
                <CheatEntry>
                  <ID>26</ID>
                  <Description>"surrender"</Description>
                  <ShowAsSigned>0</ShowAsSigned>
                  <VariableType>Byte</VariableType>
                  <Address>+GameplayManager.UIControls</Address>
                  <Offsets>
                    <Offset>UI.surrender</Offset>
                  </Offsets>
                </CheatEntry>
                <CheatEntry>
                  <ID>27</ID>
                  <Description>"m_levelLength"</Description>
                  <ShowAsSigned>0</ShowAsSigned>
                  <VariableType>Float</VariableType>
                  <Address>+GameplayManager.UIControls</Address>
                  <Offsets>
                    <Offset>UI.m_levelLength</Offset>
                  </Offsets>
                </CheatEntry>
                <CheatEntry>
                  <ID>28</ID>
                  <Description>"m_cumAmount"</Description>
                  <ShowAsSigned>0</ShowAsSigned>
                  <VariableType>Float</VariableType>
                  <Address>pgm</Address>
                  <Offsets>
                    <Offset>+GameplayManager.m_cumAmount</Offset>
                  </Offsets>
                </CheatEntry>
                <CheatEntry>
                  <ID>29</ID>
                  <Description>"m_levelTime"</Description>
                  <ShowAsSigned>0</ShowAsSigned>
                  <VariableType>Float</VariableType>
                  <Address>pGM</Address>
                  <Offsets>
                    <Offset>GameplayManager.m_levelTime</Offset>
                  </Offsets>
                </CheatEntry>
                <CheatEntry>
                  <ID>30</ID>
                  <Description>"m_levelMaxTime"</Description>
                  <ShowAsSigned>0</ShowAsSigned>
                  <VariableType>Float</VariableType>
                  <Address>pGM</Address>
                  <Offsets>
                    <Offset>GameplayManager.m_levelMaxTime</Offset>
                  </Offsets>
                </CheatEntry>
                <CheatEntry>
                  <ID>31</ID>
                  <Description>"m_isGameOver"</Description>
                  <ShowAsSigned>0</ShowAsSigned>
                  <VariableType>Byte</VariableType>
                  <Address>pGM+8</Address>
                  <Offsets>
                    <Offset>0</Offset>
                  </Offsets>
                </CheatEntry>
                <CheatEntry>
                  <ID>32</ID>
                  <Description>"m_isPaused"</Description>
                  <ShowAsSigned>0</ShowAsSigned>
                  <VariableType>Byte</VariableType>
                  <Address>pGM+8</Address>
                  <Offsets>
                    <Offset>1</Offset>
                  </Offsets>
                </CheatEntry>
                <CheatEntry>
                  <ID>33</ID>
                  <Description>"m_timerPaused"</Description>
                  <ShowAsSigned>0</ShowAsSigned>
                  <VariableType>Byte</VariableType>
                  <Address>pGM+8</Address>
                  <Offsets>
                    <Offset>2</Offset>
                  </Offsets>
                </CheatEntry>
              </CheatEntries>
            </CheatEntry>
          </CheatEntries>
        </CheatEntry>
        <CheatEntry>
          <ID>10</ID>
          <Description>"Set screen resolution (when taking a break aka pause)"</Description>
          <Options moHideChildren="1"/>
          <Color>808040</Color>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>{ Game   : Max_The_Elf_DEMO.exe
  Version: 
  Date   : 2024-03-06
  Author : Nironan

  Sets resolution and fullscreenMode to values (predefined, changeable)
  by setting calling conventions and calling the function
}

[ENABLE]
{$lua}
--needed to find the right method to be able to correctly set fullscreenMode and preferredRefreshRate, else any would doo
local addr = tohex(findMethodAddrBySignature('UnityEngine','Screen','SetResolution','int,int,UnityEngine.FullScreenMode,int$',false))
unregisterSymbol("SetRes")
registerSymbol("SetRes", addr, false)
{$asm}

//aobscan(aobSetResolution,F0 48 8D 65 00 5D C3 00 00 00 00 00 00 01) //+01
aobscanregion(aobSetResolution,GameplayManager:Pause+A0,GameplayManager:Pause+120,48 8D 65 00 5D C3 00)
alloc(newmem,$100,aobSetResolution)
registersymbol(aobSetResolution)

label(pSR)
registersymbol(pSR)

// looks like rax,rcx,rdx,r8,r9 are free to use, rest is stored anyway

newmem:
pSR:
  dd #1920 //+0 width
  dd #1080 //+4 height
  dd 0     //+8 fullscreenMode - db would be enough but this way "start" starts at clean +10
  dd 0     //+C preferredRefreshRate
start: //preparing x86/64 calling convention
  xor ecx,ecx
  xor edx,edx
  xor r8,r8
  xor r9,r9 //clearing registers, then set then accordingly:
  mov ecx, dword ptr [pSR]
  mov edx, dword ptr [pSR+4]
  mov r8b, byte ptr [pSR+8]
  mov r9b, byte ptr [pSR+C]
//  mov r11,UnityEngine:Screen:SetResolution //see luascript above
  mov r11,SetRes
  call r11 //call a function - this involves saving an address to return to so it will continue here afterwards
code:
  lea rsp,[rbp+00]
  pop rbp
  jmp return

aobSetResolution:
  jmp start
return:


[DISABLE]

aobSetResolution:
  db 48 8D 65 00 5D

unregistersymbol(pSR)
unregistersymbol(aobSetResolution)
dealloc(newmem)

{
// ORIGINAL CODE - INJECTION POINT: GameplayManager:Pause+fc

GameplayManager:Pause+cb: 48 B8 F0 8D 47 D4 BC 01 00 00  - mov rax,000001BCD4478DF0
GameplayManager:Pause+d5: 48 8B 00                       - mov rax,[rax]
GameplayManager:Pause+d8: 48 85 C0                       - test rax,rax
GameplayManager:Pause+db: 0F 84 1B 00 00 00              - je GameplayManager:Pause+fc
GameplayManager:Pause+e1: 48 B8 F0 8D 47 D4 BC 01 00 00  - mov rax,000001BCD4478DF0
GameplayManager:Pause+eb: 48 8B 00                       - mov rax,[rax]
GameplayManager:Pause+ee: 48 8B C8                       - mov rcx,rax
GameplayManager:Pause+f1: 48 89 45 F0                    - mov [rbp-10],rax
GameplayManager:Pause+f5: FF 50 18                       - call qword ptr [rax+18]
GameplayManager:Pause+f8: 48 8B 45 F0                    - mov rax,[rbp-10]
// ---------- INJECTING HERE ----------
GameplayManager:Pause+fc: 48 8D 65 00                    - lea rsp,[rbp+00]
// ---------- DONE INJECTING  ----------
GameplayManager:Pause+100: 5D                             - pop rbp
GameplayManager:Pause+101: C3                             - ret 
1BCDAD98D62: 00 00                          - add [rax],al
1BCDAD98D64: 00 00                          - add [rax],al
1BCDAD98D66: 00 00                          - add [rax],al
1BCDAD98D68: 01 04 02                       - add [rdx+rax],eax
1BCDAD98D6B: 05 04 03 01 50                 - add eax,50010304
1BCDAD98D70: 00 00                          - add [rax],al
1BCDAD98D72: E8 A9 74 A8 F6                 - call 1BCD1820220
1BCDAD98D77: 08 68 85                       - or [rax-7B],ch
}
</AssemblerScript>
          <CheatEntries>
            <CheatEntry>
              <ID>35</ID>
              <Description>"width"</Description>
              <ShowAsSigned>0</ShowAsSigned>
              <VariableType>4 Bytes</VariableType>
              <Address>pSR</Address>
            </CheatEntry>
            <CheatEntry>
              <ID>36</ID>
              <Description>"height"</Description>
              <ShowAsSigned>0</ShowAsSigned>
              <VariableType>4 Bytes</VariableType>
              <Address>pSR+4</Address>
            </CheatEntry>
            <CheatEntry>
              <ID>37</ID>
              <Description>"fullscreenMode"</Description>
              <DropDownList DisplayValueAsItem="1">0:ExclusiveFullScreen
1:FullScreenWindow
2:MaximizedWindow
3:Windowed
</DropDownList>
              <ShowAsSigned>0</ShowAsSigned>
              <VariableType>4 Bytes</VariableType>
              <Address>pSR+8</Address>
            </CheatEntry>
            <CheatEntry>
              <ID>38</ID>
              <Description>"preferredRefreshRate (working?)"</Description>
              <ShowAsSigned>0</ShowAsSigned>
              <VariableType>4 Bytes</VariableType>
              <Address>pSR+C</Address>
            </CheatEntry>
          </CheatEntries>
        </CheatEntry>
      </CheatEntries>
    </CheatEntry>
  </CheatEntries>
  <UserdefinedSymbols>
    <SymbolEntry>
      <Name>SetRes</Name>
      <Address>1EB38D57420</Address>
    </SymbolEntry>
  </UserdefinedSymbols>
  <LuaScript>-- script to try finding the exe file and autoAttach

local sname = ''

for _,v in pairs(getProcesslist()) do --go through process list
  sname = v:match("(%w+)") --get first word of process in loop
  if sname == 'Max' then --check if name matches
    print('attaching to: ',v) --v still hast full process name
    strings_add(getAutoAttachList(), v)
    break
  end
end


</LuaScript>
</CheatTable>
