bik78
May 11th, 2002, 15:21
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:
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:
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!
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!