crackcomm Posted November 10, 2009 Share Posted November 10, 2009 Hey, can anyone help me with translate something from C++ to AutoIt ? expandcollapse popupvoid MakeLoginPacket(char* LoginPacket, unsigned long newXTeaKey[4], unsigned int ClientVersion, unsigned int ClientOS, string accname, string accchar, string accpassword, char connectionRequest[5]) { char PacketBuffer[MAXBUFFER]; int accnameLen, acccharLen, accpasswordLen, tempChecksum; TibiaCrypt crypt; PacketBuffer[0] = 0x89; //packet size PacketBuffer[1] = 0x00; PacketBuffer[2] = 0x0A; //game server type memcpy(&PacketBuffer[3], &ClientOS, 2); //OS, 1 = linux, 2 = windows memcpy(&PacketBuffer[5], &ClientVersion, 2); //client version PacketBuffer[7] = 0x00; //white byte, here starts the RSA encryption memcpy(&PacketBuffer[8],&newXTeaKey[0],4); //and add it to the buffer memcpy(&PacketBuffer[12],&newXTeaKey[1],4); memcpy(&PacketBuffer[16],&newXTeaKey[2],4); memcpy(&PacketBuffer[20],&newXTeaKey[3],4); PacketBuffer[24] = 0x00; //player = 0, 1 = GM accnameLen = accname.length(); //account name memcpy(&PacketBuffer[25], &accnameLen, 2); memcpy(&PacketBuffer[27], accname.c_str(), accnameLen); acccharLen = accchar.length(); //chracter name memcpy(&PacketBuffer[27+accnameLen], &acccharLen, 2); memcpy(&PacketBuffer[29+accnameLen], accchar.c_str(), acccharLen); accpasswordLen = accpassword.length(); //account password memcpy(&PacketBuffer[29+accnameLen+acccharLen], &accpasswordLen, 2); memcpy(&PacketBuffer[31+accnameLen+acccharLen], accpassword.c_str(), accpasswordLen); //fill the packet request info memcpy(&PacketBuffer[31+accnameLen+acccharLen+accpasswordLen], &connectionRequest[0], 5); crypt.SetRSAKey((char*)TibiaRSAKey); crypt.RSAEncrypt(&PacketBuffer[7], 128); //crypt the packet with the RSA key memcpy(&LoginPacket[0],&PacketBuffer[0],2); //add the checksum tempChecksum = crypt.adler((uint8_t*)&PacketBuffer[2],133); memcpy(&LoginPacket[2],&tempChecksum,4); memcpy(&LoginPacket[6],&PacketBuffer[2],200); } Link to comment Share on other sites More sharing options...
Developers Jos Posted November 10, 2009 Developers Share Posted November 10, 2009 What do you need this for? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
EndFunc Posted November 10, 2009 Share Posted November 10, 2009 What do you need this for?Yeah, it might be easier to just write new AutoIt code for it. EndFuncAutoIt is the shiznit. I love it. Link to comment Share on other sites More sharing options...
crackcomm Posted November 11, 2009 Author Share Posted November 11, 2009 That's making packets which i will send to server to login my character. (I'm writing game "client" in AutoIt but i dont know c++ to translate this part of code.) Link to comment Share on other sites More sharing options...
Developers Jos Posted November 11, 2009 Developers Share Posted November 11, 2009 Game client? Thought that was supposed to be a human and guess you are referring to a BOT? Anyways ... have fun and come back when you have an Autoit3 question, not a "make a script for me because I do not understand the C++ code I found on the internet." SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
crackcomm Posted November 11, 2009 Author Share Posted November 11, 2009 Nope, not Bot, client. I just want somebody can explain me functions etc. Link to comment Share on other sites More sharing options...
Developers Jos Posted November 11, 2009 Developers Share Posted November 11, 2009 Wrong place to ask that question as stated. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
crackcomm Posted November 11, 2009 Author Share Posted November 11, 2009 Where i should try ? Link to comment Share on other sites More sharing options...
Developers Jos Posted November 11, 2009 Developers Share Posted November 11, 2009 where you found it. This is an AutoIt3 forum! *click* SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Recommended Posts