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 


Timer / Automatic Change Value.

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Betcha
Expert Cheater
Reputation: 4

Joined: 13 Aug 2015
Posts: 232
Location: Somewhere In Space

PostPosted: Sat Nov 28, 2015 5:05 am    Post subject: Timer / Automatic Change Value. Reply with quote

Hey..
Found Pointer For Car Color in GTA San Andreas ..
When i get into car - by pressing hotkey i can change the car color..
So i wonder how can i make Cheat Engine to do car color change automatically with just active script..?!
To make car like driving rainbow.

This is the script when in Spray Garage changes color,
If i NOP, then it wont change car color..
Or If i write - mov [edi+00000434],2.89999938
it changes car color to that i need..
So i guess it's right place to make that timer for automatically color change?!
Code:
[ENABLE]
aobscanmodule(INJECT,gta_sa.exe,88 87 34 04 00 00 8A)
alloc(newmem,$1000)

label(code)
label(return)

newmem:

code:
  mov [edi+00000434],al
  jmp return

INJECT:
  jmp code
  nop
return:
registersymbol(INJECT)

[DISABLE]
INJECT:
  db 88 87 34 04 00 00

unregistersymbol(INJECT)
dealloc(newmem)
{
// ORIGINAL CODE - INJECTION POINT: "gta_sa.exe"+4B15C

"gta_sa.exe"+4B136: 8A 8F 35 04 00 00     -  mov cl,[edi+00000435]
"gta_sa.exe"+4B13C: 3A 4C 24 1F           -  cmp cl,[esp+1F]
"gta_sa.exe"+4B140: 75 18                 -  jne gta_sa.exe+4B15A
"gta_sa.exe"+4B142: 8A 97 36 04 00 00     -  mov dl,[edi+00000436]
"gta_sa.exe"+4B148: 3A 54 24 1E           -  cmp dl,[esp+1E]
"gta_sa.exe"+4B14C: 75 0C                 -  jne gta_sa.exe+4B15A
"gta_sa.exe"+4B14E: 8A 8F 37 04 00 00     -  mov cl,[edi+00000437]
"gta_sa.exe"+4B154: 3A 4C 24 1D           -  cmp cl,[esp+1D]
"gta_sa.exe"+4B158: 74 02                 -  je gta_sa.exe+4B15C
"gta_sa.exe"+4B15A: B3 01                 -  mov bl,01
// ---------- INJECTING HERE ----------
"gta_sa.exe"+4B15C: 88 87 34 04 00 00     -  mov [edi+00000434],al
// ---------- DONE INJECTING  ----------
"gta_sa.exe"+4B162: 8A 54 24 1F           -  mov dl,[esp+1F]
"gta_sa.exe"+4B166: 88 97 35 04 00 00     -  mov [edi+00000435],dl
"gta_sa.exe"+4B16C: 8A 44 24 1E           -  mov al,[esp+1E]
"gta_sa.exe"+4B170: 88 87 36 04 00 00     -  mov [edi+00000436],al
"gta_sa.exe"+4B176: 8A 4C 24 1D           -  mov cl,[esp+1D]
"gta_sa.exe"+4B17A: 88 8F 37 04 00 00     -  mov [edi+00000437],cl
"gta_sa.exe"+4B180: 6A FF                 -  push -01
"gta_sa.exe"+4B182: 8B CF                 -  mov ecx,edi
"gta_sa.exe"+4B184: E8 77 5A 28 00        -  call gta_sa.exe+2D0C00
"gta_sa.exe"+4B189: 84 DB                 -  test bl,bl
}

Would Be nice if it changes car color every second..
Color values are -

0 // Black
0.3000000119 // dark Blue
0.7000000477 // grey
0.9000000954 // Vanila
1.000000119 // White
2.399999857 // Brown
2.89999938 // Red
3.899998426 // Light Blue
3.399998903 // lilac
4.499998093 // Green
11.00000572 // Yellow
15.40002251 // Pink
15.90002441 // orange
16.40002632 // Light Yellow
22.00004768 // Dark Grey
23.20005226 // light green
23.30005264 // Dark Yellow
..
It's NOT important to make all in script, would be nice just random 2 colors for example in script..

Found Similar requests for help with timer/automatically change.
But They are like - jump if value is 9 to value 1
http://www.cheatengine.org/forum/viewtopic.php?t=568915&sid=5757b166490832206fbabce8d30ef765
http://forum.cheatengine.org/viewtopic.php?p=5462810&sid=e90a0256030c94e792c3f6e7b44d5ff7
In my case value doesn't change, only if i drive into spray garage, or change it manually..

Thank you!
Back to top
View user's profile Send private message
Cake-san
Grandmaster Cheater
Reputation: 8

Joined: 18 Dec 2014
Posts: 541
Location: Semenanjung

PostPosted: Sat Nov 28, 2015 5:48 am    Post subject: Reply with quote

Code:

[ENABLE]
aobscanmodule(INJECT,gta_sa.exe,88 87 34 04 00 00 8A)
alloc(newmem,$10)
label(_color)
registersymbol(_color)

globalalloc(_code,30)
createthread(_code)
label(return)
label(_return)
label(_end)
registersymbol(_end)
label(_check)
registersymbol(_check)
label(_color1)
label(_color2)
label(_color3)

newmem:
push eax
lea eax,[edi+00000434] // copy the address of car's color to eax
mov [_color],eax       // copy eax into _color
pop eax
jmp return
_color:
dd 0

_code:
push eax
mov eax,[_color]
cmp eax,0
je _return
cmp [_check],01
je _color1
cmp [_check],02
je _color2
cmp [_check],03
je _color1
jmp _return

_color1:
mov [_check],02
mov [eax],(float)0
jmp _return

_color2:
mov [_check],03
mov [eax],(float)0.3000000119
jmp _return

_color3:
mov [_check],01
mov [eax],(float)0.7000000477
jmp _return

_return:
pop eax
push #1000
call sleep
cmp [_end],01
jne _code
ret

_check:
dd 01
_end:
dd 0

INJECT:
jmp newmem
nop
return:
registersymbol(INJECT)

[DISABLE]
INJECT:
db 88 87 34 04 00 00
//mov [edi+00000434],al
unregistersymbol(INJECT)
dealloc(newmem)
_end:
dd 01
unregistersymbol(_end)

_________________
...
Back to top
View user's profile Send private message
Betcha
Expert Cheater
Reputation: 4

Joined: 13 Aug 2015
Posts: 232
Location: Somewhere In Space

PostPosted: Sat Nov 28, 2015 6:20 am    Post subject: Reply with quote

Cake-san wrote:


Wow... Surprised Thank you!
It works, but not fully, cause it changes into 2 colors only -
These Two work.
Code:

_color1:
mov [_check],02
mov [eax],(float)0
jmp _return

_color2:
mov [_check],03
mov [eax],(float)0.3000000119
jmp _return


This doesn't work Confused
Code:

_color3:
mov [_check],01
mov [eax],(float)0.7000000477
jmp _return


EDIT:
Now works, found little mistake in script here :
Code:
cmp [_check],01
je _color1
cmp [_check],02
je _color2
cmp [_check],03
je _color3   <------ here Was je _color1
jmp _return


Thank you once again!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine 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