Guest Dater_ Posted June 28, 2006 Posted June 28, 2006 Hi. I wanna recognize and code keygen.My routine of serial have 2 parts:1_Part: Generate digits (second part of serial)1_Part: Genarate one letter from part1 serial in hexThis is part2 :MOV EAX,ESI ** ===> Move A657C to EAX (A657C is my hex serial)MOV ECX,1A ** ===> Move 1A to ECX (1A is constant) CDQ ** ===> CDQ mean EAX to "EDX:EAX" so "5:A657C" (EDX is 5 and it is constant) IDIV ECX ** ===> Divide ??? by 1AADD EDX,41 ** ===> Add "A"+ 41 = 4B (char K) PUSH EDX ** ===> Push edxSo my problem is with understand CDQ. I readed about it and this mean "Divide EDX by EAX" so "Divide 5 by A657C" - result is 0(ZERO), then next "Divide ??? by 1A" and it is "A" and next add to "A" 41 so it is "4B" in hex and it is char K...So I 5:A657C and result of this divide by 1A ( 0:1A = not work, I try A657C:1A = not work).So wtf is my "???" because this is responsible for "A"?
Ziggy Posted June 28, 2006 Posted June 28, 2006 The "IDIV ECX" is an integer divide of EAX by ECX. After the division, EAX has the quotient with the remainder in EDX. ECX is not changed.The CDQ instruction just prepares for the idiv in this case. After CDQ is executed EDX will be zero.so what's happening here isMOV EAX,ESI ** ===> Move A657C to EAX (A657C is my hex serial)MOV ECX,1A ** ===> Move 1A to ECX (1A is constant) CDQ ** ===> prepare for IDIV - set EDX to 0 IDIV ECX ** ===> Divide EAX by 1A - quotient in EAX put remainder in EDXADD EDX,41 ** ===> Add remainder + 41h - EDX is then an ascii character value PUSH EDX ** ===> Push edxCheck out the opcode descriptions which are in the help files of the MASM package.Hope this helpsZ
Guest Dater_ Posted June 28, 2006 Posted June 28, 2006 Ziggy:DIV ECX ** ===> Divide EAX by 1A - quotient in EAX put remainder in EDXSo that`s mean A657C/1A=665D - where is remainder ?I use Windows Calculator, sorry but where is remainder of result, how to calculate this?
Guest Dater_ Posted June 28, 2006 Posted June 28, 2006 Please give explanation because I dont want code keygen in ASM. So I want do it manually in other language.
bart_ Posted June 28, 2006 Posted June 28, 2006 its in C:signed int rEAX = rESI;rEDX = (rEAX % 0x1A) + 0x41;
Ziggy Posted June 28, 2006 Posted June 28, 2006 Ziggy:DIV ECX ** ===> Divide EAX by 1A - quotient in EAX put remainder in EDXSo that`s mean A657C/1A=665D - where is remainder ?I use Windows Calculator, sorry but where is remainder of result, how to calculate this?Ok windows calculator will give you the quotient but not remainder.But you can use the calculator like thisdivide A657C by 1A - calculator shows quotient of 665Dnow multiply 665D by 1A - calculator gives A6572difference between A657C and A6572 is the remainder = AHope this is clear.Z
Guest Dater_ Posted July 1, 2006 Posted July 1, 2006 (edited) Thanks Ziggy, thanks bart.Now I start coding keygen in Delphi (I learn 2 years ago and must return learn).procedure TForm1.Button1Click(Sender: TObject);beginif Edit1.Text='' thenEdit1.Text:='write name!'else\\ ===> my codeend;end.I post my reconized routine:============================================================#I - SERIAL generating1.) Dtr2.) DTR3.) DTRv344.) DTRv34@@@...(40@)5.) DTRv34@@@...(34@) [40-lenght of DTRv34, 40-6=34] 6.) DTRv34@@@...(34@) read from RIGHT to LEFTDTRv34@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ===>HEX 01.@ 1x40=40 EBX=40+002.@ 2x40=80 EBX=40+8003.@ 3x40=C0 EBX=40+80+C004.@ 4x40=100 EBX=40+80+C0+10005.@ 5x40=140 EBX=40+80+C0+100+14006.@ 6x40=180 EBX=40+80+C0+100+140+18007.@ 7x40=1C0 EBX=40+80+C0+100+140+180+1C008.@ 8x40=200 EBX=40+80+C0+100+140+180+1C0+20009.@ 9x40=240 EBX=40+80+C0+100+140+180+1C0+200+240 = B400A.@ Ax40=280 EBX=40+80+C0+100+140+180+1C0+200+240+280 = DC0 0B.@ Bx40=1E40 EBX=40+80+C0+100+140+180+1C0+200+240+280+1E40 = 2C0 + DC0 =10800C.@ Cx40=300 EBX=40+80+C0+100+140+180+1C0+200+240+280+1E40+300 = 1080 + 300 = 13800D.@ Dx40=340 1380+340=16C00E.@ Ex40=380 16C0+380=1A400F.@ Fx40=3C0 1A40+3C0=1E0010.@ 10x40=400 1E00+400=220011.@ 11x40=440 2200+440=264012.@ 12x40=480 2640+480=2AC013.@ 13x40=4C0 2AC0+4C0=2F8014.@ 14x40=500 2F80+500=348015.@ 15x40=540 3480+540=39C016.@ 16x40=580 39C0+580=3F4017.@ 17x40=5C0 3F40+5C0=450018.@ 18x40=600 4500+600=4B0019.@ 19x40=640 4B00+640=51401A.@ 1Ax40=680 5140+680=57C01B.@ 1Bx40=6C0 57C0+6C0=5E801C.@ 1Cx40=700 5E80+700=65801D.@ 1Dx40=740 6580+740=6CC01E.@ 1Ex40=780 6CC0+780=74401F.@ 1Fx40=7C0 7440+7C0=7C0020.@ 20x40=800 7C00+800=840021.@ 21x40=840 8400+840=8C4022.@ 22x40=880 8C40+880=94C023.4 23x34=71C 94C0+71C=9BDC ===> (4=34h)24.3 24x33=72C 9BDC+72C=A308 ===> (3=33h)25.v 25x76=110E A308+110E=B416 ===> (v=76h)26.R 26x52=C2C B416 +C2C=C042 ===> (R=52h)27.T 27x54=CCC C042+CCC=CD0E ===> (T=54h)28.D 28x44=AA0 CD0E+AA0=D7AE ===> (D=44h)7.) D7AE=55214 decimal8.)55214*12.34=681340,76 decimalcutt 3 last chars and have 681340SERIAL=681340 decimal (A657C in HEX)#II - LETTER generating9.)A657C:1A=RESULT_1-3RESULT_1-3*1A=RESULT_2-3A657C-RESULT_2-3=RESULT_3-3RESULT_3-3+41=HexLetterFinalHexLetterFinal to Char=LetterFinal#III - FINAL generating10.)SetDlgItemText: LetterFinal+"-"+SerialCuttedDecimal============================================================And if anyone could help me with these... Edited July 1, 2006 by Dater_
cektop Posted July 3, 2006 Posted July 3, 2006 I'm not sure I understand your explaination of the algorithm but I guess it'd go something like this.First add @ to the string untill lengths is 40.for i := 1 to 40-Length(name) do name := name + '@';Then reverse itfor i := 1 to 40 do rname[40-i+1] := name;Then sum itsum := 0;for i := 1 to 40 do sum := sum + Ord(rname)*i;Then make part I(p1: Integerp1s: string;)p1 := sum*12.34;p1s := IntToStr(p1);Generate letter(ltr: string)ltr := ' ';ltr[1] := xxx((p1 mod 26) + 41)And finaly generate serialsn = ltr + '-' + p1s;
Guest Dater_ Posted July 4, 2006 Posted July 4, 2006 b4d_s3c70r: thanks but I just discovery Visual Basic and I think I done it in there.
cektop Posted July 5, 2006 Posted July 5, 2006 Stay away from VB. It wont harm you to know VB too but dont start with it. You'll take learning other programming languages harder later (if you plan to learn more). Good luck
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now