Log in

View Full Version : Reprogramming a passcode generator


peterg70
December 6th, 2001, 07:24
Guys

I have located a generate password code function but i want to be able to enter from AAAAA to ZZZZZ as the input (this normally comes from a dialog input) and collect the keys generated. I have managed to locate the routine that is called and where the input and output go but what sort of routine do i need to generate all the combinations

As example the following code illustrates

Mov EDI,004029283 (This moves the dialog string into memory)

Some tests to ensure string is not blank etc.

call 004003000

when it return from this i want to save out to file the first code and another memory address as well. Then increase the memory address to the next possible code and continue to do this until all codes done. Then close the output file.

I know this is possible but what is needed is the question

peterg70
December 8th, 2001, 04:54
Okay i have made this solution into blank area of code and called the routine

Can someone make it more elegant without using registers or stack

Quote:

00408520 INC BYTE PTR DS:[40A57A]
00408526 CMP BYTE PTR DS:[40A57A],5A
0040852D JLE MASTER-K.004036F1
00408533 INC BYTE PTR DS:[40A579]
00408539 MOV BYTE PTR DS:[40A57A],41
00408540 CMP BYTE PTR DS:[40A579],5A
00408547 JLE MASTER-K.004036F1
0040854D INC BYTE PTR DS:[40A578]
00408553 MOV BYTE PTR DS:[40A579],41
0040855A CMP BYTE PTR DS:[40A578],5A
00408561 JLE MASTER-K.004036F1
00408567 INC BYTE PTR DS:[40A577]
0040856D MOV BYTE PTR DS:[40A578],41
00408574 CMP BYTE PTR DS:[40A577],5A
0040857B JLE MASTER-K.004036F1
00408581 INC BYTE PTR DS:[40A576]
00408587 MOV BYTE PTR DS:[40A577],41
0040858E CMP BYTE PTR DS:[40A576],5A
00408595 JLE MASTER-K.004036F1
0040859B INC BYTE PTR DS:[40A575]
004085A1 MOV BYTE PTR DS:[40A576],41
004085A8 CMP BYTE PTR DS:[40A577],5A
004085AF JLE MASTER-K.004036F1
004085B5 INC BYTE PTR DS:[40A574]
004085BB MOV BYTE PTR DS:[40A575],41
004085C2 CMP BYTE PTR DS:[40A574],5A
004085C9 JLE MASTER-K.004036F1

DakienDX
December 9th, 2001, 08:29
Hello peterg70 !

In ASM you can do nearly nothing without registers and stack. Your code is the only possible without registers. But I would suggest to invent an own number system having 26 values for each digit. So you increment the counter number by one, divide it by 26, take the remainder and add 41h (= 'A') to it and store it. Repeat this until the initial number is 0 (same as converting a number to decimal, only divide by 26 and not by 10). This method makes all strings like A..Z, AA..ZZ, AAA..ZZZ, AAAA..ZZZZ, ... If you don't like this, you must set the start value for the counter to 26+26^2+26^3+... until you've reached the desired value.