I dont know if it is off topic or it is not allowed here.If it is wrong I am sorry.I need a a function to find numbers in given range or mask better..My method is increasing by one and wsprinting it.Is there a any better method for this if for example I want to produce all numbers in the form of ######-###### (# number)

Thanks
Posted on 2001-07-30 16:31:32 by LaptoniC
i usually do something like this :



.data

bfBruteforce db "000000-000000",0

.code

....

_bforceloop: invoke bforcefunction,addr bfBruteforce
cmp eax,SUCCESS
jz _bforcedone

mov ecx,13

@@: inc byte ptr [bfBruteForce+ecx-1]

cmp byte ptr [bfBruteForce+ecx-1],'9'+1
jnz _bforceloop

mov byte ptr [bfBruteForce+ecx-1],'0'

dec ecx ; have we done all letters ?
jz _bforcefoundnothing

cmp ecx,7 ; is it the '-'
jnz @b ; no, we continue

dec ecx ; yes, we go to the number before
jmp @b ; we continue

_bforcedone: ; we found the correct serial

_bforcefoundnothing: ; we found nothing



i haven' t tried the code, but it should work.
if you want to check the hexadecimal numbers, replace :

            cmp byte ptr ,'9'+1

jnz _bforceloop[\CODE]

by :

            cmp byte ptr ,'9'+1

jl _bforceloop
jnz _goletters
mov byte ptr ,'A' ; or 'a'
jmp _bforceloop
_goletters: cmp byte ptr ,'F'+1 ; or 'f'+1
jnz _bforceloop
mov byte ptr ,'0'

dec ecx ; have we done all letters ?
jz _bforcefoundnothing

cmp ecx,7 ; is it the '-'
jnz @b ; no, we continue

dec ecx ; yes, we go to the number before
jmp @b ; we continue
[\CODE]

it should work :grin:
Posted on 2001-07-31 14:00:43 by roy