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 


Can't Assign Injection.

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

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

PostPosted: Mon Nov 02, 2015 4:05 am    Post subject: Can't Assign Injection. Reply with quote

Hello.
In GTA 3 have one address of money and it's base address.
When press , What writes to this address .. It show's like always results, but in this case, when do code injection can't assign to table, cause of this line -->

originalcode:
add [ebp*4+gta3.exe+54139C],eax

How can i edit this Code, to make any changes and assign it to table..?

This injection is picking up money, from dead body's.. And yeah, i waned to increase the stack drop rate or just amount of the value it picks up.

Code:

[ENABLE]

alloc(newmem,1024)
label(returnhere)
label(originalcode)
label(exit)

newmem:

originalcode:
add [ebp*4+gta3.exe+54139C],eax

exit:
jmp returnhere

"gta3.exe"+3132C:
jmp newmem
nop
nop
returnhere:


[DISABLE]
dealloc(newmem)
"gta3.exe"+3132C:
add [ebp*4+gta3.exe+54139C],eax
//Alt: db 01 04 AD 9C 13 94 00
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: Mon Nov 02, 2015 6:36 am    Post subject: This post has 1 review(s) Reply with quote

ohh.. this problem,
I only have this problem when writing script for 32bit but not 64bit,strange Confused
you can type it like this
Code:

originalcode:
imul ebp,4
add ebp,gta3.exe+54139C
add [ebp],eax

or this
Code:

originalcode:
push edx
mov edx,4
mul edx
mov edx,ebp
add edx,gta3.exe+54139C
add [edx],eax
pop edx

liked what Zanzer replied to my previous post
don't know if I'm typing it right -_-

or you can type it like this
Code:

originalcode:
db 01 04 AD 9C 13 94 00

liked what STN suggest in replying to my previous post

you can change the disassembly output in view setting inside memory viewer.
don't know if it solve your problem Confused

_________________
...


Last edited by Cake-san on Mon Nov 02, 2015 8:19 am; edited 1 time in total
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: Mon Nov 02, 2015 7:42 am    Post subject: Reply with quote

With this

Code:

originalcode:
push edx
mov edx,4
mul edx
mov edx,ebp
add edx,gta3.exe+54139C
add [edx],eax
pop edx


Works if at the end i nop ''add [ebp*4+gta3.exe+54139C],eax'' and replace with ''db 01 04 AD 9C 13 94 00''

Code:

[DISABLE]
dealloc(newmem)
"gta3.exe"+3132C:
db 01 04 AD 9C 13 94 00
//add [ebp*4+gta3.exe+54139C],eax
//Alt: db 01 04 AD 9C 13 94 00


But i don't see how to modify that drop value.. Confused Hmm..

------------------------------------------------------------------

This doesn't work.. if i add it .. in game while pick up money it doesn't count it, like i didn't even picked it up.

Code:

originalcode:
imul ebp,4
add ebp,gta3.exe+54139C
add [ebp],eax
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Mon Nov 02, 2015 7:58 am    Post subject: Reply with quote

It would actually be better if you moved your injection point up two instructions.
Code:
imul ebp,ebp,4F
movzx eax,word ptr [esi+02]
mov eax,#1000 // set the money value; or
add eax,#123  // add to the money value

Otherwise, you'll need to use the following to rewrite the original instruction:
Code:
reassemble("gta3.exe"+3132C)
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: Mon Nov 02, 2015 8:25 am    Post subject: Reply with quote

Zanzer wrote:
It would actually be better if you moved your injection point up two instructions.
Code:
imul ebp,ebp,4F
movzx eax,word ptr [esi+02]
mov eax,#1000 // set the money value; or
add eax,#123  // add to the money value

Otherwise, you'll need to use the following to rewrite the original instruction:
Code:
reassemble("gta3.exe"+3132C)



OHhhh.. I moved two instructions up, did changes, and it works....
Now each money stack comes with 2k bonus.

Maybe there is something i can read/watch about, to not be confused next time with similar problem?
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Mon Nov 02, 2015 8:36 am    Post subject: Reply with quote

You would need to learn assembly language. Smile
Notice the original bytes of the instruction: 01 04 AD 9C 13 94 00
The last 4 tell the computer where to find the address: gta3.exe+3132C
Those bytes are based on the current memory address of the instruction.
So you can't simply copy the bytes because you're changing the location of the instruction.
I'm assuming Cheat Engine couldn't interpret your script because of a little parsing bug.
Back to top
View user's profile Send private message
STN
I post too much
Reputation: 43

Joined: 09 Nov 2005
Posts: 2676

PostPosted: Mon Nov 02, 2015 8:40 am    Post subject: Reply with quote

I don't know why CE has problems calculating complex offsets. Instead of writing (module+offset)"gta3.exe"+3132C, calculate the address of "gta3.exe"+3132C yourself and it should work.

To do that, just go to (CTRL+G in mem viewer) "gta3.exe"+3132C and when there, press CTRL+C and manually select and copy the address from the From field.

Or disable Showing Module Addresses (CTRL+M) and CE should copy the address then.

By the way, like Zanzer said you should use the earlier instructions if you plan to use AOB and make your trainer work for several versions.

_________________
Cheat Requests/Tables- Fearless Cheat Engine
https://fearlessrevolution.com
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: Mon Nov 02, 2015 9:20 am    Post subject: Reply with quote

Thank you Cake-san, Zanzer, STN , For nice replay's.

Really Good information. Smile
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 222

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Mon Nov 02, 2015 12:34 pm    Post subject: Reply with quote

Use double quotation mark around module name:
Code:
add [ebp*4+"gta3.exe"+54139C],eax


CheatEngine's disassembler sometimes forgets it for certain instructions.

So, you have to fix that in ENABLE and DISABLE section.


Like this one:
Code:
[ENABLE]
alloc(newmem,1024)
label(returnhere)

newmem:
mov eax,#10000
add [ebp*4+"gta3.exe"+54139C],eax
jmp returnhere

"gta3.exe"+3132C:
jmp newmem
nop
nop
returnhere:

[DISABLE]
dealloc(newmem)
"gta3.exe"+3132C:
add [ebp*4+"gta3.exe"+54139C],eax

_________________
Back to top
View user's profile Send private message MSN Messenger
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