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 


[HELP] How can I move a complete string inside the pointer

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Faloop
How do I cheat?
Reputation: 0

Joined: 07 Jul 2021
Posts: 7
Location: EUA

PostPosted: Fri Sep 16, 2022 8:05 pm    Post subject: [HELP] How can I move a complete string inside the pointer Reply with quote

I'm trying to move the string into the esi pointer but it's only going halfway. "IS U"

Can anyone help Question

Code:

originalcode:
lea eax,[string]
mov eax,[eax]
mov [esi+2A78],eax


exit:
jmp returnhere

string:
db 'IS UNDEFEATED',0

"Swaat.exe"+03A4D:
jmp newmem
nop
returnhere:
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
ParkourPenguin
I post too much
Reputation: 143

Joined: 06 Jul 2014
Posts: 4371

PostPosted: Fri Sep 16, 2022 10:20 pm    Post subject: Reply with quote

eax is a 4 byte register- it only moves 4 bytes at a time.

You're going to be in big trouble if the source string is larger than the destination. (buffer overflow)
If you're absolutely certain it's fine, use strcpy:
Code:
originalcode:
{$ccode gamestr=esi}
char *strcpy( char *restrict dest, const char *restrict src );
extern char string[0];

char *dest = (char *)gamestr + 0x2A78;
const char *src = string;
strcpy(dest, src);
{$asm}
...

_________________
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 programming 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