Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CS1: Feqture Req -- Sen1ExecutablePatches.cs for free camera based on CheatEngine patch #120

Open
clort81 opened this issue May 29, 2023 · 2 comments

Comments

@clort81
Copy link

clort81 commented May 29, 2023

Someone made a CD1 v1.6 CheatEngine patch enabling several interesting engine features, notably free camera and other helpful engine tweaks.
Is it possible to RE the in-memory patch to the .exe?
Patch attached.

<CheatTable CheatEngineTableVersion="42">
  <CheatEntries>
    <CheatEntry>
      <ID>1</ID>
      <Description>"Force Pause Animation (Enable first, F5 pause / F6 unpause)"</Description>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>[ENABLE]

aobscanmodule(gamepause_aob,ed8.exe,80 3D BE D7 C3 00 00 75) // should be unique
alloc(newmem,$1000, gamepause_aob)
registersymbol(gamepause_aob)
registersymbol(freeze)

label(toggleon)
label(toggleoff)
label(compcode)
label(code)
label(freeze)
label(return)

newmem:

toggleon:
  pushad
  push 74 //VK_F5
  call GetAsyncKeyState

  test ax,8001
  popad
  jz toggleoff
  mov [freeze],#1
  jmp compcode

toggleoff:
  pushad
  push 75 //VK_F6
  call GetAsyncKeyState
  test ax,8001
  popad
  jz compcode
  mov [freeze],#0

compcode:
  cmp [freeze],#0
  je code
  //jmp ed8.exe+41E11 // Full Pause including sound and frozen camera
  //jmp ed8.exe+41DF5 // Full Pause excluding sound, including frozen camera
  jmp ed8.exe+41DDE // Full Puase excluding sound and frozen camera

code:
  cmp byte ptr [ed8.exe+83D7BE],00
  jmp return

freeze:
  dd #0

gamepause_aob:
  jmp newmem
  nop 2
return:

[DISABLE]

gamepause_aob:
  db 80 3D BE D7 C3 00 00

unregistersymbol(gamepause_aob)
unregistersymbol(freeze)
dealloc(newmem)

{
// ORIGINAL CODE - INJECTION POINT: ed8.exe+41D56
// Injection at +41D56 instead of +41D50 to maintain
// compatibility with Sen Patcher

ed8.exe+41D40: 55                    - push ebp
ed8.exe+41D41: 8B EC                 - mov ebp,esp
ed8.exe+41D43: 51                    - push ecx
ed8.exe+41D44: 56                    - push esi
ed8.exe+41D45: 8B F1                 - mov esi,ecx

etc...

CS1-Free_Camera.zip

@AdmiralCurtiss
Copy link
Owner

I would assume it's possible, yes, but I'm probably not going to invest the effort since I don't particularly care about having this feature accessible without CheatEngine. If someone else wants to implement it, be my guest I suppose. Though you should also talk with the author of the script if they're okay with having this in here.

@eArmada8
Copy link

eArmada8 commented Jun 2, 2024

I am the author of the CS1 script (which I learned to write by deconstructing Cyber's CS4 script). You are welcome to any modifications in that script, or my CS2/CS3/Reverie/etc scripts, they are here.

Having said that, I agree with @AdmiralCurtiss that SenPatcher may not be the correct place for these. For the modifications that require the CE Lua engine, incorporation into SenPatcher may prove impossible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants