Results 1 to 6 of 6

Thread: Making a asm rip keygen???

  1. #1
    bik78
    Guest

    Question Making a asm rip keygen???

    Hello all!

    Im trying to understand how to make a ASM rip keygen.

    I've coded a little console app (attached) that initializes a variable to 2, calls a function to double it and outputs the result.

    IDA translates my int Dbl(int x) function to:
    Code:
    .text:00401194 sub_0_401194    proc near               ; CODE XREF: _main+Ep
    .text:00401194 
    .text:00401194 arg_0           = dword ptr  8
    .text:00401194 
    .text:00401194                 push    ebp
    .text:00401195                 mov     ebp, esp
    .text:00401197                 mov     eax, [ebp+arg_0]
    .text:0040119A                 add     eax, eax
    .text:0040119C                 pop     ebp
    .text:0040119D                 retn
    .text:0040119D sub_0_401194    endp
    Now, lets pretend that this function is actually some complicated key-generation algorithm, and I want to rip it for my keygen...

    So I create a function and put the above code in a __asm { } block:
    Code:
    int Genkey(int x)
    {
        __asm
        {
            push    ebp
            mov     ebp, esp
            mov     eax, [ebp+x]
            add     eax, eax
            pop     ebp
            retn
        }
    }
    But it doesnt work, the keygen crashes.
    I've never tried this before, so can someone please tell me what I'm doing wrong and what's the right way to do it?

    Also another question: if a key-generation function includes calls to other functions, whats the proper way to rip it?

    Thanx!
    Attached Files Attached Files
    I promise that I have read the FAQ and tried to use the Search to answer my question.

  2. #2
    this function just takes argument and adds to itself so it is multiplying by two.I guess you can write this simple calculation yourself.
    However, your C translation is wrong.You can't reference passed variables like this.


    mov eax, [ebp+x] change this to
    mov eax, [ebp+8]
    "There is only one road to human greatness: through the school of hard knocks." Albert Einstein

  3. #3
    bik78
    Guest

    Making a asm rip keygen???

    Hmmm... Yeah, I did that but it still wouldnt work.... Then I added
    Code:
    __declspec(naked)
    to the function and now it works....

    Why 8? Length of an integer??? Isnt that 4???
    I promise that I have read the FAQ and tried to use the Search to answer my question.

  4. #4
    stealthFIGHTER
    Guest

    Re: Making a asm rip keygen???

    Originally posted by bik78

    Why 8? Length of an integer??? Isnt that 4???
    Hello,

    because :00401194 arg_0 = dword ptr 8. So if arg_0 = dword ptr 8 you can do this:

    mov eax, [ebp+arg_0] >>> mov eax, [ebp+8]

    Ok?

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

  5. #5
    bik78
    Guest
    Right, thanks!
    I promise that I have read the FAQ and tried to use the Search to answer my question.

  6. #6
    oyang2002
    Guest

    Wink

    Hi!

    I don't think it is a good idea to rip codes from the target.
    (by the way,there is a tool named TMG Ripper Studio which can do it,maybe its current version is 0.03).

    most of time the codes are too much and the codes ripped
    are very complecated! And many data referenced may need
    to be initialized.

    I wrote a tool to export functions from a DLL.At this time it does
    nothing to DLLs which have no export directory.I will modify it
    to add export table for that Dlls and even EXEs! So we can
    exported any functions as we like.

    Maybe it is better to call the functions than rip it:-)
    I promise that I have read the FAQ and tried to use the Search to answer my question.

Similar Threads

  1. Making fun of your...
    By esther in forum Off Topic
    Replies: 0
    Last Post: April 13th, 2014, 09:57
  2. Making a keygen - almost there...
    By ljre24 in forum The Newbie Forum
    Replies: 30
    Last Post: November 20th, 2008, 11:51
  3. Making own compressor...
    By polygon7 in forum Malware Analysis and Unpacking Forum
    Replies: 3
    Last Post: October 17th, 2005, 08:39
  4. Making Dongle (not cracking)
    By minawahib1 in forum Tools of Our Trade (TOT) Messageboard
    Replies: 2
    Last Post: July 17th, 2005, 17:10
  5. Making the change
    By Ryno in forum The Newbie Forum
    Replies: 10
    Last Post: March 14th, 2005, 12:40

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
  •