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 on my Memory Engine

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
iPromise
Grandmaster Cheater
Reputation: -1

Joined: 27 Jun 2009
Posts: 529
Location: Canada

PostPosted: Mon Dec 21, 2009 1:34 pm    Post subject: Help on my Memory Engine Reply with quote

So i'm coding a UCE from scratch, and so i'm stuck on converting a int to a byte:

Code:

int demonstration = 1;
BYTE demonstration_2 = (BYTE) demonstration;
ReadByte(0x00400000, demonostration_2);


Once I convert demonstration to a byte, I dont get 1, instead I get something else.

P.S. My Memory Engine is about 70% done, I got my GUI working (i'm coding it in a dll so I gotta use CreateWindowEx() for my forms), and I got my code down, just some major obstacles to finish and i'm done.
Back to top
View user's profile Send private message MSN Messenger
Anden100
Grandmaster Cheater
Reputation: 0

Joined: 20 Apr 2007
Posts: 668

PostPosted: Mon Dec 21, 2009 4:22 pm    Post subject: Re: Help on my Memory Engine Reply with quote

iPromise wrote:
So i'm coding a UCE from scratch, and so i'm stuck on converting a int to a byte:

Code:

int demonstration = 1;
BYTE demonstration_2 = (BYTE) demonstration;
ReadByte(0x00400000, demonostration_2);


Once I convert demonstration to a byte, I dont get 1, instead I get something else.

P.S. My Memory Engine is about 70% done, I got my GUI working (i'm coding it in a dll so I gotta use CreateWindowEx() for my forms), and I got my code down, just some major obstacles to finish and i'm done.


the code posted above does seem to work properly to me Razz, it only bugs if demonstration gets any higher than 255 Razz
Back to top
View user's profile Send private message
iPromise
Grandmaster Cheater
Reputation: -1

Joined: 27 Jun 2009
Posts: 529
Location: Canada

PostPosted: Mon Dec 21, 2009 5:23 pm    Post subject: Reply with quote

Hmm, I dont think so because whenever I do it that way, and compare my address list's results to cheat engine, its wrong, however when I just do plain:

Code:

ReadByte(0x00400000, 1)


Works fine Smile
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: Mon Dec 21, 2009 7:29 pm    Post subject: Reply with quote

show complete code
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Mon Dec 21, 2009 8:41 pm    Post subject: Reply with quote

uh, 2 things come to mind.

1. what your compiler generating? i'd be surprised if it's not just something like:

mov dword ptr [d1], 1
mov al, byte ptr [d1]
mov byte ptr [d2], al


2. that looks like something it would just optimize into a constant anyway.

Code:
int demonstration = 1;
BYTE demonstration_2 = (BYTE) demonstration;


probably goes bye bye in release and just gets treated as a 1.
Back to top
View user's profile Send private message
Anden100
Grandmaster Cheater
Reputation: 0

Joined: 20 Apr 2007
Posts: 668

PostPosted: Tue Dec 22, 2009 5:48 am    Post subject: Reply with quote

would it be possible to do like this?

Code:
int demonstration = 1;
BYTE demonstration_2 = *(BYTE*)&demonstration;
Back to top
View user's profile Send private message
iPromise
Grandmaster Cheater
Reputation: -1

Joined: 27 Jun 2009
Posts: 529
Location: Canada

PostPosted: Tue Dec 22, 2009 11:30 am    Post subject: Reply with quote

@Anden100 I get a access violation when I debug it and try it your way

To everyone else that helped me, I will give you a free copy of my Memory Engine Wink
Back to top
View user's profile Send private message MSN Messenger
Anden100
Grandmaster Cheater
Reputation: 0

Joined: 20 Apr 2007
Posts: 668

PostPosted: Tue Dec 22, 2009 11:46 am    Post subject: Reply with quote

iPromise wrote:
@Anden100 I get a access violation when I debug it and try it your way


???, works completely fine to me, it might help to see some more of your source, to help you then Razz
Back to top
View user's profile Send private message
iPromise
Grandmaster Cheater
Reputation: -1

Joined: 27 Jun 2009
Posts: 529
Location: Canada

PostPosted: Tue Dec 22, 2009 12:18 pm    Post subject: Reply with quote

@Anden100 Add me: [email protected]
Back to top
View user's profile Send private message MSN Messenger
Anden100
Grandmaster Cheater
Reputation: 0

Joined: 20 Apr 2007
Posts: 668

PostPosted: Tue Dec 22, 2009 1:19 pm    Post subject: Reply with quote

iPromise wrote:
@Anden100 Add me: ***@hotmail.com


No MSN -.-, use PM if you like to, but i do not promise that i am able to help you
Back to top
View user's profile Send private message
iPromise
Grandmaster Cheater
Reputation: -1

Joined: 27 Jun 2009
Posts: 529
Location: Canada

PostPosted: Tue Dec 22, 2009 5:28 pm    Post subject: Reply with quote

Got it fixed Wink

It was a internal problem, my method were right but it was something else that caused it NOT to work.
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 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