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 Gamehacking
View previous topic :: View next topic  
Author Message
xeratal
Advanced Cheater
Reputation: 1

Joined: 05 Nov 2005
Posts: 93

PostPosted: Sat Apr 16, 2011 11:41 am    Post subject: Array of bytes Reply with quote

I have another general assembly question related to the autoassembler.

To make lots of details very short, I have this array of bytes and I want to be able to edit its contents -

(pseudocode) ->
e.g. "mov [4rd byte in array], 1".

Problem is I don't know how to. Laughing
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Sat Apr 16, 2011 12:08 pm    Post subject: Reply with quote

mov byte [startofarray+3],1
_________________
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
xeratal
Advanced Cheater
Reputation: 1

Joined: 05 Nov 2005
Posts: 93

PostPosted: Sat Apr 16, 2011 5:34 pm    Post subject: Reply with quote

Autoassembler causes crash in game. I think I'm not experienced enough to even attempt to move data into the individual bits.

e.g.
1) Array of bytes address = 00400000
2) 00400000 = [FF] [FF] [FF] [FF].... (some large number amount which seems to be the problem)
---
Part of my code:
mov eax, [00400000] ---> this alone crashes the program
//I don't know whether mov byte[0040000+3],01 would work even if the above line worked, but that's the current problem.

I'm thinking maybe I'm be supposed to use another instruction instead of mov to save addresses of arrays?


Last edited by xeratal on Sat Apr 16, 2011 5:59 pm; edited 3 times in total
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Sat Apr 16, 2011 5:50 pm    Post subject: Reply with quote

00400000 is usually read only memory

add fullaccess(00400000, 4096) to make that region writable

_________________
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
xeratal
Advanced Cheater
Reputation: 1

Joined: 05 Nov 2005
Posts: 93

PostPosted: Sat Apr 16, 2011 5:58 pm    Post subject: Reply with quote

Sorry, bad example on my part...

The exact address of mine was 073EFF94.
It's writable, the only problem comes when the bytes get too large. I tested it myself and it's really the problem; e.g. 073EFF94=[0][0][0][0] wouldn't cause a crash but =[FF][FF][FF][FF] will (actually larger than 4x FF, but anyway...)
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Sun Apr 17, 2011 12:02 pm    Post subject: Reply with quote

are you sure it's an array and not just a 4 byte value ?
_________________
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
xeratal
Advanced Cheater
Reputation: 1

Joined: 05 Nov 2005
Posts: 93

PostPosted: Sun Apr 17, 2011 12:59 pm    Post subject: Reply with quote

I thought of that but mov eax, [xxxxxxxx] doesn't work and I've used that for other 4 byte values before.

I actually assumed all the way before this that it was a 4 byte value because I simply edited the values as an integer before, but after the crash from the autoassembler I viewed it as an array of bytes and found that it was exactly the numbers I was looking at (I found that address by luck but I knew it was what I wanted, even though editing it as a 4 byte was really strange).

So while I can't confirm that it's an array of bytes, it sure looks like it and the crash makes me assume that it is.
-
This is what I mean by it's what I'm looking for.
e.g. there is hp (val B2) and mp values (FA)
The value of that address as an array would be [B2] [FA] whereas viewing it as a 4 byte would be some random integer which represents B2 FA.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Mon Apr 18, 2011 8:06 am    Post subject: Reply with quote

ok, then the value type is just 1 byte
that means the max value is 255 and can not go higher, and the bytes after that belong to other things

_________________
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
xeratal
Advanced Cheater
Reputation: 1

Joined: 05 Nov 2005
Posts: 93

PostPosted: Mon Apr 18, 2011 8:49 am    Post subject: Reply with quote

I was writing 4 paragraphs on why it was definitely not a bunch of 1 bytes, then I realized what I did wrong was that I searched using a 4 byte scan for a 1 byte datatype (I did that in the past and it worked but I guess the game last time was more inefficient and used a 4 byte to store a max of 1 byte...)

All I can say is you're a genius, thanks!!! Very Happy
Back to top
View user's profile Send private message
xeratal
Advanced Cheater
Reputation: 1

Joined: 05 Nov 2005
Posts: 93

PostPosted: Mon Apr 18, 2011 9:46 pm    Post subject: Reply with quote

I got 2 fairly long questions...

1)
-----------------------
Is there any trick to finding pointers for arrays? (Now when I look closer I'm quite sure it's an array of bytes)

I guess I should explain the whole context of what I'm doing.
The numbers I'm searching for belong to the exact bytes of the last packet sent (and also the bytes which will be sent). In effect, it's like doing packet filtering by memory editing. The 2 main bytes which belong to different checksums are stored on the 7th and 8th bits. However, there are no pointer to those bits. I looked all the way back to the start of the "packet", that is at position 0, and found that I could get a pointer from there which works.

My pointer can then go up to the 2nd level but then there are become 9 different pointers all of which work, and I can't seem to reach the 3rd level because all the pointers are seemingly pointing to the value of the address of other 2nd level pointers...

I even used the pointer scanner for first time and it came up with something like over 50,000 addresses... dunno if that is normal...

2)
-----------------------
***TEMP EDIT***
***I think this EAX = something + AX, and AX = AH + AL
***Will do further testing for this part
***Overall still not proficient at assembler, but trying.
Is there any method to mov 1 bytes around?
e.g.
[0736FF5E] = 1 byte (ax = 0736FF5D + 0736FF5E)
[0736FF5F] = 1 byte (ax = 0736FF5F + 0736FF60)
Even if I mov the values of this to the ax instead of eax, it still stores the value of that combined with the value of another address. Is there any way to take store the value from either address properly into the ax, and put it in properly from the ax?


P.S. advanced options -> code list -> right click address -> press "r" (i.e. delete) and cancel (do not delete) seems to hang the code list in ce 6.0.
Found that out as I used to do rightclick + "r" in CE 5.5 to replace with code that does nothing, but in CE 6.0 it's delete.
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