Jump to content
Tuts 4 You

[c++]Problem with convert EAX


Recommended Posts

Hi all!

I try to do the keygen: "2. Keygenning tut KeyGenMe_#1_cLoNeTrOnE TeAm FOFF"

from the link :



There was a moment which register EAX equal to : 00000275 (in my case).[its just take the string "baruch" and conclude every char]

And then was check : if(EAX == 00000275).


Now in my C++ program ,i have integer called "sum" which equal to 275.


The question is how i convert that number? I mean ,i need 00000275 not 275,so 

how i convert from "integer look" to "register look"?


of course i can do very long way :

1.check the length of sum==3

2.do loop from 0 to 5 and fill with zero(char[] or char*)

3.do one more loop from 0 to 3 and fill with : 2,7,5.


It looks to me there is a "easy" way to do it and not so long...


i sorry for my english:( 


Link to comment

Mmm...no guys,its not what i meant to.

I know already what is hexadecimal.

I use c++ not c,so printf not realy helpul.

I will try to explain myself better:

In that keygen for the string "baruch" the serial is


I did array of chars lets call him "pass",now im in state :


I have integer "sum" which equal to 275.

Now i search an algorithm which will take the 275 which stored in "sum" and paste him in "pass" so after the algorithm "pass" will look like this: "GA-00000275".

if you have that problem,which commands in c++ you will use?what is your algorithm to do that??

i said before how i did it,but it looks to me too long and complex for so simple task...:(

Link to comment

int EAX = 275;

std::string CppString;

char Dest[30];

sprintf(Dest, "GA-00000%d", EAX);

CppString = Dest;

cout << CppString << "\r\n";

OK i guess this is more cpp but I prefer above way

std::string itoa(int Integer)


stringstream ss;

ss << Integer;

return ss.str();


std::string Prefix = "-GA-00000";

int Sum = 275;

std::string Final = Prefix + itoa(Sum);

cout << Final << "\r\n";

Edited by simple
Link to comment

simple-thank you for your help!


Its a keygen,if you enter another name the serial may look "00123456"....

So i realy sorry i spent your time,im not good in explanation in english....

So thank you guys for trying to help me ;(

Link to comment

the sum 0x275 or 00000275 comes from the name chars added together. b+a+r+u+c+h = 0x275.


by using sprintf(serial, "GA-%08x-", EAX); the output you are looking for is in the variable "serial".

  • Like 1
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...