Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Am I writing this try/except section correctly?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
Autem
Expert Cheater
Reputation: 1

Joined: 30 Jan 2023
Posts: 119

PostPosted: Thu May 11, 2023 1:18 am    Post subject: Am I writing this try/except section correctly? Reply with quote

Am I using try/except correctly here?

Code:
define(address,"WWE2K23_x64.exe"+89C436)
define(bytes,C5 F8 2E C1 7A 06)

define(address2,"WWE2K23_x64.exe"+89C470)
define(bytes2,74 76 48 8B 49 28)

[ENABLE]
assert(address,bytes)
alloc(newmem,$10000,"WWE2K23_x64.exe"+89C436)
alloc(adder,4)
alloc(check,4)
label(code)
label(return)

check:
  dd (float)75

adder:
  dd (float)24.9

newmem:
push rax
{$try} // I suspect that something BELOW here sometimes causes a crash/is invalid
 cmp [WWE2K23_x64.exe+3697478],0
 je code
 mov rax,[rcx+28]
 cmp [rax+48B0],8
 jne code
 comiss xmm1, [rcx+3c]
 jb code
 comiss xmm1, dword ptr [check]
 ja code
 addss xmm1, dword ptr [adder]
 jmp code
{$except} // I suspect that something ABOVE here sometimes causes a crash/is invalid
 comiss xmm1, dword ptr [check]  //copied from above because I'm sure it's not the thing causing the error
 ja code //copied from above because I'm sure it's not the thing causing the error
 addss xmm1, dword ptr [adder] //copied from above because I'm sure it's not the thing causing the error

code:
  pop rax
  vucomiss xmm0,xmm1
  jp WWE2K23_x64.exe+89C442
  jmp return

address:
  jmp newmem
  nop
return:

assert(address2,bytes2)

address2:
//  jmp WWE2K23_x64.exe+8999A8
  je WWE2K23_x64.exe+89C4E8

[DISABLE]
address:
  db bytes
  // vucomiss xmm0,xmm1
  // jp WWE2K23_x64.exe+899902

dealloc(newmem)
dealloc(adder)
dealloc(check)

{
// ORIGINAL CODE - INJECTION POINT: WWE2K23_x64.exe+8998F6

WWE2K23_x64.exe+8998CB: 57                       - push rdi
WWE2K23_x64.exe+8998CC: 41 56                    - push r14
WWE2K23_x64.exe+8998CE: 48 81 EC 80 00 00 00     - sub rsp,00000080
WWE2K23_x64.exe+8998D5: C5 F8 29 74 24 70        - vmovaps [rsp+70],xmm6
WWE2K23_x64.exe+8998DB: 48 8B 05 26 97 C6 02     - mov rax,[WWE2K23_x64.exe+3503008]
WWE2K23_x64.exe+8998E2: 48 33 C4                 - xor rax,rsp
WWE2K23_x64.exe+8998E5: 48 89 44 24 68           - mov [rsp+68],rax
WWE2K23_x64.exe+8998EA: 41 0F B6 E8              - movzx ebp,r8b
WWE2K23_x64.exe+8998EE: 48 8B D9                 - mov rbx,rcx
WWE2K23_x64.exe+8998F1: C5 FA 10 41 3C           - vmovss xmm0,[rcx+3C]
// ---------- INJECTING HERE ----------
WWE2K23_x64.exe+8998F6: C5 F8 2E C1              - vucomiss xmm0,xmm1
// ---------- DONE INJECTING  ----------
WWE2K23_x64.exe+8998FA: 7A 06                    - jp WWE2K23_x64.exe+899902
WWE2K23_x64.exe+8998FC: 0F 84 DE 01 00 00        - je WWE2K23_x64.exe+899AE0
WWE2K23_x64.exe+899902: C5 FA 11 49 3C           - vmovss [rcx+3C],xmm1
WWE2K23_x64.exe+899907: 80 79 38 00              - cmp byte ptr [rcx+38],00
WWE2K23_x64.exe+89990B: 74 0A                    - je WWE2K23_x64.exe+899917
WWE2K23_x64.exe+89990D: C5 FA 10 35 87 A3 96 02  - vmovss xmm6,[WWE2K23_x64.exe+3203C9C]
WWE2K23_x64.exe+899915: EB 08                    - jmp WWE2K23_x64.exe+89991F
WWE2K23_x64.exe+899917: 48 8B 41 30              - mov rax,[rcx+30]
WWE2K23_x64.exe+89991B: C5 F2 5E 30              - vdivss xmm6,xmm1,[rax]
WWE2K23_x64.exe+89991F: 48 8B 41 30              - mov rax,[rcx+30]
}
address2:
  db bytes2
  // je WWE2K23_x64.exe+8999A8
  // mov rcx,[rcx+28]


{
// ORIGINAL CODE - INJECTION POINT: WWE2K23_x64.exe+899930

WWE2K23_x64.exe+899907: 80 79 38 00              - cmp byte ptr [rcx+38],00
WWE2K23_x64.exe+89990B: 74 0A                    - je WWE2K23_x64.exe+899917
WWE2K23_x64.exe+89990D: C5 FA 10 35 87 A3 96 02  - vmovss xmm6,[WWE2K23_x64.exe+3203C9C]
WWE2K23_x64.exe+899915: EB 08                    - jmp WWE2K23_x64.exe+89991F
WWE2K23_x64.exe+899917: 48 8B 41 30              - mov rax,[rcx+30]
WWE2K23_x64.exe+89991B: C5 F2 5E 30              - vdivss xmm6,xmm1,[rax]
WWE2K23_x64.exe+89991F: 48 8B 41 30              - mov rax,[rcx+30]
WWE2K23_x64.exe+899923: C5 F8 2F 70 04           - vcomiss xmm6,[rax+04]
WWE2K23_x64.exe+899928: 40 0F 93 C6              - setae sil
WWE2K23_x64.exe+89992C: 40 3A 71 61              - cmp sil,[rcx+61]
// ---------- INJECTING HERE ----------
WWE2K23_x64.exe+899930: 74 76                    - je WWE2K23_x64.exe+8999A8
// ---------- DONE INJECTING  ----------
WWE2K23_x64.exe+899932: 48 8B 49 28              - mov rcx,[rcx+28]
WWE2K23_x64.exe+899936: E8 15 4B E5 FF           - call WWE2K23_x64.exe+6EE450
WWE2K23_x64.exe+89993B: 85 C0                    - test eax,eax
WWE2K23_x64.exe+89993D: 75 69                    - jne WWE2K23_x64.exe+8999A8
WWE2K23_x64.exe+89993F: 48 8B 05 9A D5 F5 02     - mov rax,[WWE2K23_x64.exe+37F6EE0]
WWE2K23_x64.exe+899946: 4C 8B B0 58 01 00 00     - mov r14,[rax+00000158]
WWE2K23_x64.exe+89994D: 41 B8 08 00 00 00        - mov r8d,00000008
WWE2K23_x64.exe+899953: 49 8B 16                 - mov rdx,[r14]
WWE2K23_x64.exe+899956: 41 8D 48 18              - lea ecx,[r8+18]
WWE2K23_x64.exe+89995A: E8 11 77 9D FF           - call WWE2K23_x64.exe+271070
}
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

Joined: 09 May 2003
Posts: 25288
Location: The netherlands

PostPosted: Thu May 11, 2023 2:08 am    Post subject: Reply with quote

seems to be ok

tip: Add a counter to the except routine so you can see how often it executes

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Autem
Expert Cheater
Reputation: 1

Joined: 30 Jan 2023
Posts: 119

PostPosted: Thu May 11, 2023 2:20 am    Post subject: Reply with quote

Dark Byte wrote:
seems to be ok

tip: Add a counter to the except routine so you can see how often it executes


That's a great thought! My suspicions were that it happens about 2 times per day but now I'll actually have hard evidence.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites