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 


32bit to 64bit C++

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
jackyyll
Expert Cheater
Reputation: 0

Joined: 28 Jan 2008
Posts: 143
Location: here

PostPosted: Fri Jun 26, 2009 11:00 am    Post subject: 32bit to 64bit C++ Reply with quote

Well, i coded my shit for 32bit and now i'm trying to compile it on a 64bit linux system and i'm getting some errors:

Code:

Utilities.cpp: In function ‘void encrypt_password(char*, char*)’:
Utilities.cpp:98: error: cast from ‘unsigned char*’ to ‘int’ loses precision
Utilities.cpp:98: error: cast from ‘unsigned char*’ to ‘int’ loses precision




How do i fix this? :S
Back to top
View user's profile Send private message AIM Address MSN Messenger
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Fri Jun 26, 2009 12:11 pm    Post subject: Reply with quote

I think there should be a compile parameter to be less string, and to handle it just as a warning.

anyhow, what is the code at line 98 ?
int xxx;
unsigned char *c;
...c gets set...

xxx=c;

if so, try explicitly telling the compiler you WANT to do it:
xxx=(int)c;

_________________
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
jackyyll
Expert Cheater
Reputation: 0

Joined: 28 Jan 2008
Posts: 143
Location: here

PostPosted: Fri Jun 26, 2009 3:23 pm    Post subject: Reply with quote

Code:
void encrypt_password( char *outbuffer, char *password )
{
    unsigned char buffer[] = {
        0x00, 0x5D, 0x1E, 0xEE, 0xFF, 0xFF, 0xFF, 0xFF, 0xE4, 0x55, 0xA5, 0x71, 0x00, 0x00, 0x00, 0x00
    };
   
    memcpy( ( void * )buffer, ( void * )password, ( strlen( password ) + 1 ) );
   
    _encrypt_password( (int)rc5_cipher, (int)buffer, 16 );
   
    memcpy( ( void * )outbuffer, ( void * )buffer, 16 );
}


That' the function that throws the error.
Back to top
View user's profile Send private message AIM Address MSN Messenger
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Fri Jun 26, 2009 4:22 pm    Post subject: Reply with quote

Not sure what the function declaration of _encrypt_password is but try:
_encrypt_password( (unsigned long long)rc5_cipher, (unsigned long long)buffer, 16 );

_________________
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
Jani
Grandmaster Cheater
Reputation: 2

Joined: 29 Dec 2006
Posts: 804

PostPosted: Sun Jun 28, 2009 9:12 am    Post subject: Reply with quote

Dark Byte wrote:
Not sure what the function declaration of _encrypt_password
I'd assume they're pointers(?):
Code:
_encrypt_password( (void*)rc5_cipher, (void*)buffer, 16 );
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