Log in

View Full Version : Key- GeneRaToR HELP!!!!


Zkhan13
June 7th, 2003, 05:13
Key- GeneRaToR HELP??


I am trying to make a Key-Generator, though I am not an expert in Reverse Engineering..
Here, I am playing around with some dummy programs, which I found from web…
I found a Routine, which POSSIBLY makes the right Serial from our given Text…Here it Is..

lstrcmp is called Here………
…………………………………………………………………….
--------- EAX, 0000001
:401309 MOV EDX,[403038] -> Here our Given Text is Stored.
:40130F MOV DL,[EAX,403037] -> Takes the first Character…?
:401315 AND EDX, 00000FF -> WHAT IS THIS…???
:40131B MOV EBX,EDX
:….31D IMUL EBX,EDX ->Multiplying each other & store in EBX
…...320 ADD ESI,EBX ->
… ..322 MOV EBX, EDX
……324 SAR EBX,1 -> What is this SAR ????
……326 ADD ESI,EBX ->
……328 SUB ESI,EDX
……32A INC EAX ->Increment EAX by 1
……32B DEC ECX -> Decrement ECX by 1
……32C JNZ 401309-> Loop until (EAX or EDX) is Non Zero.??

Whether the comments I made it were Right ones? And also, those SAR, & when AND with a number, how it is coded in a C++ programme. I know little bit C++(Not experienced.).But I never coded in C++, by studying an ASM instructions…So please help me …B’cze in ASM Those ESI stands for STACK relative work.. Is there any use of this in C++ code for a Key-Generator?. Any kind of information, that would harness my ‘Understanding’ about ‘Keygenerator ‘ will be appreciated..

Or please give me some URLs, which speaks the same.
“How to code in C++, by studying Assembly instructions”-

I will also try myself and will return, if any thing found useful for us.

Thanx In Advance

evlncrn8
June 7th, 2003, 05:39
401315 AND EDX, 00000FF -> WHAT IS THIS…???

makes edx 000000xx ie: strips it to a byte (dl) where xx = number

324 SAR EBX,1 -> What is this SAR ????

shift right 1 place (multiply by 2)


Those ESI stands for STACK relative work

wrong.. esi is just another register usually used as a pointer

i suggest you use google, search for "helppc21", download it and install it and use the asm reference to learn the asm commands
its an old tool but still very useful

MOV EDX,[403038] ; load pointer to serial
MOV DL,[EAX,403037] ; load character
AND EDX, 00000FF ; strip register to 8 bit component (dl)
MOV EBX,EDX ; store edx in ebx
IMUL EBX,EDX ; -> Multiplying each other & store in EBX
ADD ESI,EBX ; add value to esi
MOV EBX, EDX ; store value
SAR EBX,1 ; multiply ebx by 2
ADD ESI,EBX ; add value to esi
SUB ESI,EDX ; sub edx from esi
INC EAX ; advance pointer
DEC ECX ; -> Decrement ECX by 1
JNZ 401309 ; repeat until ecx is zero

ZaiRoN
June 7th, 2003, 05:50
Hi,
Quote:
and EDX, 000000FFh
this instruction performs a logical and between edx and FFh; this and is used to leave only Text's char inside edx. Infact:
Code:
:401309 MOV EDX,[403038] ; suppose: edx=404000, and Text is "example"
:40130F MOV DL,[EAX,403037] ; dl=65h ("e" but edx=00404065
:401315 AND EDX, 00000FF ; edx=00000065, only the char from Text

Quote:
SAR EBX,1
SAR: Shift Arithmetis Right, shifts ebx by 1 bit. It's used to do a signed division, in your case its a signed division by 2. evlncrn8, division and not multiply :-)

Quote:
DEC ECX ; Decrement ECX by 1
JNZ 401309 ; Loop until (EAX or EDX) is Non Zero.??
There is a little error. The cycle is repeated ecx times and I suppose ecx is the length of your Text.
DEC instruction can modify Zero Flag. When ecx is>1 the dec instruction does not set ZeroFlag and you will jump at 401309; otherwise, if ecx=1, dec instruction sets ZeroFlag to 1 and you won't jump.

evlncrn8: sorry me. I repeated what you has just told, I have not noticed your last added comments.

ZaiRoN

evlncrn8
June 7th, 2003, 06:51
/me cant tell his right from his left

JMI
June 7th, 2003, 13:30
It's easy. The LEFT is the one on the OTHER side.

Regards.