Jump to content
Tuts 4 You

Noob Keygen Coding Problem :(


Rumour

Recommended Posts

Posted

Chars from 3 input strings are XOR'ed in loop for make serial

Before loop again: AL contains part of serial. This is format to string in calls (see below for code)

This string is same as hex value in AL

Example: values for AL 42 3D 58 6C 19 44 75 5A make serial: 423D586C1944755A

How write serial in serialbox???

I try all day with SetDlgItemText, wsprintf, SetWindowTextA, SetDlgItemInt

Not is possible??? I go throw PC out of window

For complete, here is important from end of reg code:

		xor esi,esi
@@:
mov cl,byte ptr ds:[esi+edx] ; char from string1
mov dl,byte ptr ds:[esi+eax] ; char from string2
mov al,byte ptr ds:[esi+ebx] ; char from string3
xor al,dl
xor al,cl;next, AL format in string (example: AL == 3B --> format in string "3B") movsx ecx,al
push ecx
push dump_00501c50
push edx
call #2818_?Format@CString@@QAAXPBDZZ ;<= prepare value in ECX (AL)
push eax
call #939_??YCString@@QAEABV0@ABV0@@Z ;<= output hex value as string
inc esi
cmp esi,8
jl @b

Loop is 8 time. Serial is always 8 bytes --> 16 digit

Someone help with code for write hex values in AL in serial box as serial string.

Posted (edited)

Try this code - I haven't tested it but should be ok


.data hexformat db '%02X',0
tempstring dd 0
genedserial db 32 dup(0).codemov byte ptr ds:[genedserial], 0 ; clear serial string
xor esi,esi
@@:
mov cl,byte ptr ds:[esi+edx] ; char from string1
mov dl,byte ptr ds:[esi+eax] ; char from string2
mov al,byte ptr ds:[esi+ebx] ; char from string3
xor al,dl
xor al,cl;next, AL format in string (example: AL == 3B --> format in string "3B") movsx ecx,al ;push ecx
;push dump_00501c50
;push edx
;call #2818_?Format@CString@@QAAXPBDZZ ;<= prepare value in ECX (AL)
;push eax
;call #939_??YCString@@QAEABV0@ABV0@@Z ;<= output hex value as stringpush esi
invoke wsprintf, addr tempstring, addr hexformat, ecx ; print the hex value to tempstring
invoke lstrcat, addr genedserial, addr tempstring ; concatenate tempstr with serial
pop esi inc esi
cmp esi,8
jl @b

Then use SetDlgItemText or SetWindowTextA (depending on the type of dialog box) to output "genedserial" to the dialog box.

BTW - what's the target?

cheers

Z

Edited by Ziggy
Posted

Thank Ziggy. It work good.

hexformat db '%02X',0
I not know this. I try with %d and %ls and %lh and all from api help file but %02X not in api help file. Not work!

Thank again.

Target is MP3 Recorder 1.11

Posted

"%x" is for hex as "%s" is for string etc... are you sure thats not ducmented?

Posted
"%x" is for hex as "%s" is for string etc... are you sure thats not ducmented?

Perhaps is documented but I not find.

I look in api help file and find with wsprintf:

c	A single character. 
C A single character.
d A signed decimal integer argument. This sequence is equivalent to the i sequence.
hc, hC A single character. The wsprintf function ignores character arguments with a numeric value of zero.
hs, hS A string. This sequence is always interpreted as type LPSTR
i A signed decimal integer. This sequence is equivalent to the d sequence.
lc, lC A single character. The wsprintf function ignores character arguments with a numeric value of zero.
ld A long signed decimal integer. This sequence is equivalent to the li sequence.
li A long signed decimal integer. This sequence is equivalent to the ld sequence.
ls, lS A string. This sequence is always interpreted as type LPWSTR
lu A long unsigned integer.
lx, lX A long unsigned hexadecimal integer in lowercase or uppercase.
s A string.
S A string.
u An unsigned integer argument.
x, X An unsigned hexadecimal integer in lowercase or uppercase.

No 02X is mention!

I find another way: make 2 variabel from AL by split hex in 2 digits and add 30h if digit <Ah or add 37h if digit >9. Next concatenate in genedserial. Next use usual invoke SetDlgItemText,hWnd,IDC_SERIAL,addr genedserial. By this is difficult and ugly and long. Ziggy way is great and easy.

Thank for help. PC not throw out of window (yet)

Posted

I think the format descriptors are described in the winapi help but you really need to play with them to understand how they all work.

In this case '%02X' means

% - start format descriptor

0 - insert leading zeros if necessary

2 - length of the digit string. If the number is less than 2 places the '0' above means there will be a leading 0 inserted

X - uppercase hexadecimal characters. x means lower case.

your PC should be safer now :)

cheers

Z

Posted

lol ... ty Ziggy ... i was wondering about the "0"

*

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...