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 


Array of bytes

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

Joined: 26 Jan 2010
Posts: 24

PostPosted: Sat Sep 17, 2011 7:57 am    Post subject: Array of bytes Reply with quote

Hi, does anyone know how to add an array of bytes in a script. At the moment I'm adding them with the mov command, many mov's, if the array is long. Is there a better way?
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Sat Sep 17, 2011 5:51 pm    Post subject: Reply with quote

Care to show us what you are trying to do? Saying 'script' in general can mean so many different languages as well so we can't really help you unless you give us more information.
_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
unknown_k
Expert Cheater
Reputation: 5

Joined: 24 May 2011
Posts: 211

PostPosted: Sat Sep 17, 2011 8:39 pm    Post subject: Reply with quote

Wiccaan wrote:
Care to show us what you are trying to do? Saying 'script' in general can mean so many different languages as well so we can't really help you unless you give us more information.

Yeah, I second this. Show us some example script or yours.

Unless you mean this
Code:
newmem:
db 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF
Back to top
View user's profile Send private message
rfreeman
Newbie cheater
Reputation: 0

Joined: 26 Jan 2010
Posts: 24

PostPosted: Sat Sep 24, 2011 3:59 am    Post subject: Reply with quote

Sorry, I mean add an array of bytes (on condition) in assembler in a code cave. E.g.

newmem:
cmp ebx,ecx
jne here
//add array of bytes to memory address
mov [eax],48F42400
mov [eax+4],497F3A8B
mov [eax+8],76209853
//is there a command that saves me adding the array with multiple mov commands?
here:

Thanks in advance
Back to top
View user's profile Send private message
Innovation
Grandmaster Cheater
Reputation: 12

Joined: 14 Aug 2008
Posts: 617

PostPosted: Sat Sep 24, 2011 1:42 pm    Post subject: Reply with quote

You may want to look into SIMD (Single Instruction, Multiple Data) instruction sets such as MMX and SSE. For this case, see the MOVUPS instruction.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Sat Sep 24, 2011 2:35 pm    Post subject: Reply with quote

and if you don't care about speed but just want some easy to read and understand code:
Code:

mov esi,addressofaob
mov edi,eax
mov ecx,aobsize
rep movsb

you can speed it up by doing a rep movsw/movsd and divide ecx by 2 or 4 respectively and add the last (3 at most) bytes manually

_________________
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
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Sun Sep 25, 2011 8:10 am    Post subject: Reply with quote

honestly, you shouldn't be caring about that
Back to top
View user's profile Send private message
rfreeman
Newbie cheater
Reputation: 0

Joined: 26 Jan 2010
Posts: 24

PostPosted: Sun Sep 25, 2011 1:47 pm    Post subject: Reply with quote

Thanks for all your help
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