Results 1 to 7 of 7

Thread: Asm function: Hex to Decimal ?

  1. #1

    Asm function: Hex to Decimal ?

    Hi,

    I am working on coding a key gen for Moving Pix now that I understand the algorithm. It is actually my *first* attempt at a Win32 asm program and I am outputting the key in a MessageBox. My keygen is actually working *beautifully* with one small problem...the output to my MessageBox is in hex and the output key needs to be in decimal. I have looked everywhere for some library function that would convert hex to decimal (with no success). I finally decided to write a function myself, but it is still outputting the results of all of my calculations in hex. The GetVolumeInformationA function returns the serial in hex and all I need to be able to do is convert it to decimal. Surely, this can't be very difficult. Are there any functions for this purpose ???

    Thx,
    Clandestiny

  2. #2
    hz
    Guest
    hi,
    As I recall, wsprintf will do it.
    regards
    hz
    I promise that I have read the FAQ and tried to use the Search to answer my question.

  3. #3
    goatass
    Guest
    Here is what I use:

    szKey db 13 dup(?)
    eax = the hex value the program calculated

    invoke dwtoa, eax, ADDR szKey

    and then: invoke SetDlgItemText,hWnd,IDC_KEY,ADDR szKey
    will put the decimal value into a text box.

    goatass
    I promise that I have read the FAQ and tried to use the Search to answer my question.

  4. #4
    ThRaX
    Guest
    dwtoa? what does that do? If that makes an ascii string out of a hex value like i think it does, that would have saved me a LONG time on my keygen...lol
    I promise that I have read the FAQ and tried to use the Search to answer my question.

  5. #5
    goatass
    Guest
    dwtoa = DWord To Ascii (I think)


    goatass
    I promise that I have read the FAQ and tried to use the Search to answer my question.

  6. #6
    ThRaX
    Guest
    Hmmm...goatass, say that the dword was the hex value 4C12A145, right? than wouldnt dwtoa (dword to ascii) simply make the string "4C12A145"? There would have to be some intermediate step to convert 4C12A145 to its dec. equivilant, 1276289349....then, the string "1276289349" would be created...Or does the dwtoa function already cover that? (hex to dec, to the ascii string of the dec value)?
    I promise that I have read the FAQ and tried to use the Search to answer my question.

  7. #7
    hz
    Guest
    hi,
    yes dwtoa does handle the conversion as
    does wsprintf which is more flexible, come on guys, you really should be testing these things out for yourself if you want to learn.

    regards
    hz
    I promise that I have read the FAQ and tried to use the Search to answer my question.

Similar Threads

  1. bad function
    By blowfrank in forum The Newbie Forum
    Replies: 2
    Last Post: December 15th, 2010, 08:10
  2. Start function
    By jackall in forum The Newbie Forum
    Replies: 2
    Last Post: October 22nd, 2010, 10:34
  3. IDA function naming
    By scknight in forum Tools of Our Trade (TOT) Messageboard
    Replies: 3
    Last Post: December 24th, 2008, 21:19
  4. Add a new function to a dll
    By lllaaa in forum The Newbie Forum
    Replies: 0
    Last Post: March 2nd, 2003, 06:36
  5. SI, VB and function in DLL
    By JohnnyBoy in forum Malware Analysis and Unpacking Forum
    Replies: 4
    Last Post: September 13th, 2001, 07:52

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •