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 


Quick build script

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
Beginner999
Newbie cheater
Reputation: 0

Joined: 27 Jul 2018
Posts: 21

PostPosted: Sat Sep 15, 2018 11:16 am    Post subject: Quick build script Reply with quote

I don't know how to proper asking this question but let me describe the situation.
I want to make a quick build script for a strategy game.
I found the address that whenever I modify it, I can modify the building time.
Now I want to make a script out of it using the 'auto assemble'
Below is what I have in 'auto assemble'
Code:
[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat

 
 
aobscan(INJECT,10 81 38 01 00 00 C4) // should be unique
alloc(newmem,$1000,7FFC493D786A)

label(code)
label(return)

newmem:
mulss al,0.1 //<< problem is here
code:
  adc [rcx+00000138],al
  jmp return

INJECT:
  jmp newmem
  nop
return:
registersymbol(INJECT)

[DISABLE]
//code from here till the end of the code will be used to disable the cheat
INJECT:
  db 10 81 38 01 00 00

unregistersymbol(INJECT)
dealloc(newmem)
{
// ORIGINAL CODE - INJECTION POINT: 7FFC493D786A

7FFC493D7853: 00 00                       -  add [rax],al
7FFC493D7855: 00 00                       -  add [rax],al
7FFC493D7857: 00 B8 47 44 49 FC           -  add [rax-03B6BBB9],bh
7FFC493D785D: 7F 00                       -  jg 7FFC493D785F
7FFC493D785F: 00 48 83                    -  add [rax-7D],cl
7FFC493D7862: EC                          -  in al,dx
7FFC493D7863: 28 C5                       -  sub ch,al
7FFC493D7865: F8                          -  clc
7FFC493D7866: 77 C4                       -  ja 7FFC493D782C
7FFC493D7868: E1 7A                       -  loope 7FFC493D78E4
// ---------- INJECTING HERE ----------
7FFC493D786A: 10 81 38 01 00 00           -  adc [rcx+00000138],al
// ---------- DONE INJECTING  ----------
7FFC493D7870: C4 E1 7A 59 05 1F 00 00 00  -  vmulss xmm0,xmm0,[7FFC493D7898]
7FFC493D7879: C4 E1 7A 59 05 1A 00 00 00  -  vmulss xmm0,xmm0,[7FFC493D789C]
7FFC493D7882: C4 E1 7A 5A C0              -  cvtss2sd xmm0,xmm0,xmm0
7FFC493D7887: E8 94 B4 A2 5E              -  call clr.dll+B2D20
7FFC493D788C: C4 E1 7B 2C C0              -  vcvttsd2si eax,xmm0
7FFC493D7891: 48 83 C4 28                 -  add rsp,28
7FFC493D7895: C3                          -  ret
7FFC493D7896: 00 00                       -  add [rax],al
7FFC493D7898: 33 33                       -  xor esi,[rbx]
7FFC493D789A: B3 3F                       -  mov bl,3F
}

what I usually do is add a multiplication just similar to the line with "problem is here" (CE does not compile that line). May someone show me the proper way to do this?
Back to top
View user's profile Send private message
sbryzl
Master Cheater
Reputation: 6

Joined: 25 Jul 2016
Posts: 252

PostPosted: Sat Sep 15, 2018 2:40 pm    Post subject: Reply with quote

You can't multiply an integer with a float except by using the fpu.

This would accomplish the same thing assuming you want an integer not a float.

Code:

  and ax,ff                // clear high byte of ax
  imul eax,(int)205        // multiply by 205
  shr ax,b                 //divide by 2048
Back to top
View user's profile Send private message
Beginner999
Newbie cheater
Reputation: 0

Joined: 27 Jul 2018
Posts: 21

PostPosted: Sat Sep 15, 2018 3:05 pm    Post subject: Reply with quote

sbryzl wrote:
You can't multiply an integer with a float except by using the fpu.

This would accomplish the same thing assuming you want an integer not a float.

Code:

  and ax,ff                // clear high byte of ax
  imul eax,(int)205        // multiply by 205
  shr ax,b                 //divide by 2048

What should I do if it's a float?
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 137

Joined: 06 Jul 2014
Posts: 4250

PostPosted: Sat Sep 15, 2018 4:49 pm    Post subject: Reply with quote

At that injection point, the code is treating the value like it's an integer, so I'm assuming it's an integer.

You can use div / idiv for integer division. Converting it to and from a float is also an option.

If the value being accessed isn't actually an integer, you've got the wrong injection point and/or the wrong value.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
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