Jump to content

anyone have a generator like this?


Recommended Posts

Random Password??

If you check out

MsgBox(0, "RandomStringTest", "5 characters: " & @TAB & RandomString(5) & @CRLF & _
"10 characters: " & @TAB & RandomString(10) & @CRLF & _
"20 characters: " & @TAB & RandomString(20) )


Func RandomString($sLenght)
    Local $Return
    For $x = 1 to $sLenght
        $Return &= Chr(Random(65,90,1))
    Next
    Return $Return
EndFunc
Link to comment
Share on other sites

Random Password??

If you check out

MsgBox(0, "RandomStringTest", "5 characters: " & @TAB & RandomString(5) & @CRLF & _
"10 characters: " & @TAB & RandomString(10) & @CRLF & _
"20 characters: " & @TAB & RandomString(20) )
Func RandomString($sLenght)
    Local $Return
    For $x = 1 to $sLenght
        $Return &= Chr(Random(65,90,1))
    Next
    Return $Return
EndFunc
sorry, was looking for a program like this:

CODE
opt("TrayIconDebug", 1)

$let = "0123456789abcdefghijklmnopqrstuvwxyz"

$file = FileOpen("output.txt", 2)

If $file = -1 Then Exit

For $a = 1 To StringLen($let)

For $b = 1 To StringLen($let)

For $c = 1 To StringLen($let)

$out = StringStripWS(StringMid($let, $a, 1) & StringMid($let, $b, 1) & StringMid($let, $c, 1), 8); & StringMid($let, $d, 1) & StringMid($let, $e, 1) & StringMid($let, $f, 1) & StringMid($let, $g, 1), 8)

If StringLen($out) > 3 Then Exit

FileWriteLine($file, $out)

Next

Next

Next

Func OnAutoItExit()

FileClose($file)

EndFunc ;==>OnAutoItExit

but...I want the user to be able to define the amount of char's the program generates, ie, this is from 3 to 3,

Link to comment
Share on other sites

Use the onliine documentations, and search for the IniRead

Then they can define it from the IniRead, or you could make a GUI and use GuiRead, if you search for them on the online documenation, they will help you alot

Link to comment
Share on other sites

Use the onliine documentations, and search for the IniRead

Then they can define it from the IniRead, or you could make a GUI and use GuiRead, if you search for them on the online documenation, they will help you alot

I made Gui's before, I just cant fathom how to make it work correctly, damn I suck @ this lol

Link to comment
Share on other sites

got msn? add me, I will show u what I mean

diablo_rules78@hotmail.com

bump,

to clear up any confusion, I need a file that will create a .txt file with every character possability (0-9 and A-Z) based on what the user puts in,

1 - 2 would be

0

1

2

3

4

5

6

7

8

9

a

b

c

d

e

f

g

h

i

j

k

l

m

n

o

p

q

r

s

t

u

v

w

x

y

z

00

01

02

03

04

05

06

07

08

09

0a

0b

0c

0d

0e

0f

0g

0h

0i

0j

0k

0l

0m

0n

0o

0p

0q

0r

0s

0t

0u

0v

0w

0x

0y

0z

10

11

12

13

14

15

16

17

18

19

1a

1b

1c

1d

1e

1f

1g

1h

1i

1j

1k

1l

1m

1n

1o

1p

1q

1r

1s

1t

1u

1v

1w

1x

1y

1z

20

21

22

23

24

25

26

27

28

29

2a

2b

2c

2d

2e

2f

2g

2h

2i

2j

2k

2l

2m

2n

2o

2p

2q

2r

2s

2t

2u

2v

2w

2x

2y

2z

30

31

32

33

34

35

36

37

38

39

3a

3b

3c

3d

3e

3f

3g

3h

3i

3j

all the way down to ZZ

Edited by Ch1ldProd1gy
Link to comment
Share on other sites

a GUI based pass maker...

chars (0-9, A-Z), from x to x characters in length

then saves all the possibilities to a .txt file?

can anyone help?

I don't know if you can make use of it or not but I do have a sequental number generator that generates 2 and 3 character length numbers. So it will generate 00 to 999 sequentialy. You could always generate them to an array and then use Random() to get a number. I'm not sure without checking but I suspect that I may have even added 4 Character generation to it. I put that code away when I got to the part where I had to generate 2 and 3 character length alphas (AA to ZZZ).

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

  • Developers

Made this a long time ago and posted it before i believe...

It Generates all posible options and till the lenght specified and dumps it into file test.txt:

$STR = "123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
$MLEN = 2                 ; max length of the output
$CHARS = StringSplit($STR, "")
$FILE = FileOpen("test.txt", 2)
$TOUT = ""
Dim $NTOUT[$MLEN + 1]
$t = TimerInit()
For $X = 1 To $MLEN
    $NTOUT[$X] = Chr(0)
Next
$NTOUT[1] = Chr(0)
; endless loop
$out = ""
While 1
    For $X = 1 To $CHARS[0]
        $out = $out & $TOUT & $CHARS[$X] & @LF
    Next
    $TOUT = ""
    $N2 = 0
    For $X = 1 To $MLEN
        If $X = 1 Then
            $N = Asc($NTOUT[$X]) + 1
        Else
            $N = Asc($NTOUT[$X]) + $N2
        EndIf
        $N2 = 0
        If $N > $CHARS[0] Then
            $N = 1
            $N2 = 1
        EndIf
        $NTOUT[$X] = Chr($N)
        If $N > 0 Then
            $TOUT = $CHARS[$N] & $TOUT
        EndIf
    Next
    If StringLen($TOUT) = $MLEN Then
        ExitLoop
    EndIf
WEnd
FileWriteLine($FILE, $out)
FileClose($FILE)
MsgBox(0, 'time', TimerDiff($t))
Exit
Edited by JdeB

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Made this a long time ago and posted it before i believe...

It Generates all posible options and till the lenght specified and dumps it into file test.txt:

$STR = "123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
$MLEN = 2                 ; max length of the output
$CHARS = StringSplit($STR, "")
$FILE = FileOpen("test.txt", 2)
$TOUT = ""
Dim $NTOUT[$MLEN + 1]
$t = TimerInit()
For $X = 1 To $MLEN
    $NTOUT[$X] = Chr(0)
Next
$NTOUT[1] = Chr(0)
; endless loop
$out = ""
While 1
    For $X = 1 To $CHARS[0]
        $out = $out & $TOUT & $CHARS[$X] & @LF
    Next
    $TOUT = ""
    $N2 = 0
    For $X = 1 To $MLEN
        If $X = 1 Then
            $N = Asc($NTOUT[$X]) + 1
        Else
            $N = Asc($NTOUT[$X]) + $N2
        EndIf
        $N2 = 0
        If $N > $CHARS[0] Then
            $N = 1
            $N2 = 1
        EndIf
        $NTOUT[$X] = Chr($N)
        If $N > 0 Then
            $TOUT = $CHARS[$N] & $TOUT
        EndIf
    Next
    If StringLen($TOUT) = $MLEN Then
        ExitLoop
    EndIf
WEnd
FileWriteLine($FILE, $out)
FileClose($FILE)
MsgBox(0, 'time', TimerDiff($t))
Exit
Actually I think I had seen this once before and I was going to re-visit it when I get back to working on that project. Thanks for posting it again. What my app has to do is query a database using any portion of the possible combinations of license plate numbers and letters to identify a possible vehicle when ony a portion of the plate was obtained. For example if the vehicle is a car then the plate could either be 3 numbers and then 3 letters OR 3 letters and then 3 numbers. If some one says I know that the plate had the letter G and two of the numbers wer 5 and 8 Then I have to pull all possible combibations where the first part contains G and the second part contains 5 and 8 AND the reverse of that.

Then It gets trickier by querying the database and ranking the possibilities by region. 8)

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

  • Developers

how can I make that program generate all possibilities from X Char (user's input) in length, to X Char (user's input) in length?

What have you tried? ... because that is a simple task so a good opportunity to learn ..

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

What have you tried? ... because that is a simple task so a good opportunity to learn ..

I was discussing it with my friend, and the only thing he could come up with was a massive amount of loops, and I read it, and it wouldnt work right anyways lol.

atleast he tried,

I on the other hand, wrote a script, took me 1 hour, and it didnt work, I got frustrated and deleted it, I could only get it to do 3 digits in length, no more, no less lol

would you mind adding me to your msn? I would enjoy a tutor lol (faster replies)

Link to comment
Share on other sites

  • Developers

I was discussing it with my friend, and the only thing he could come up with was a massive amount of loops, and I read it, and it wouldnt work right anyways lol.

atleast he tried,

I on the other hand, wrote a script, took me 1 hour, and it didnt work, I got frustrated and deleted it, I could only get it to do 3 digits in length, no more, no less lol

would you mind adding me to your msn? I would enjoy a tutor lol (faster replies)

The logic for the generation is posted .... all you need is the user interaction ....

Have a look at InputBox() or GUI..()

Edited by JdeB

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

The logic for the generation is posted .... all you need is the user interaction ....

Have a look at InputBox() or GUI..()

by changing

CODE

$MLEN = 1 ; max length of the output

it doesnt create any char's

and by having it set to more than 2, it just sits there

Link to comment
Share on other sites

Actually I think I had seen this once before and I was going to re-visit it when I get back to working on that project. Thanks for posting it again. What my app has to do is query a database using any portion of the possible combinations of license plate numbers and letters to identify a possible vehicle when ony a portion of the plate was obtained. For example if the vehicle is a car then the plate could either be 3 numbers and then 3 letters OR 3 letters and then 3 numbers. If some one says I know that the plate had the letter G and two of the numbers wer 5 and 8 Then I have to pull all possible combibations where the first part contains G and the second part contains 5 and 8 AND the reverse of that.

Then It gets trickier by querying the database and ranking the possibilities by region. 8)

Should be an easy match with regexp against a text file. Unfortunately sql does not support regexp searches ( as fare as I know, correct me if I'm wrong ). But it in the case of license plate numbers it should be achievable against a flat file. I have a project running against 44k words and it is reasonably fast.

@GEOSoft, I don't monitor this thread so PM me if you need further input..:shocked:

Edited by Uten
Link to comment
Share on other sites

not sure if this is what your looking for but here is a program is use to make passwords

Global $random[17],$pass

#include <GuiConstants.au3>
GuiCreate("", 140, 100,-1, -1 , $WS_POPUP,$WS_EX_TOOLWINDOW)
GUiSetBkColor(0x00000)
$Input_2 = GuiCtrlCreateInput("1", 100, 20, 40, 20)
GUICtrlCreateUpdown(-1)
GUICtrlSetLimit(-1,16,1)
$Input_1 = GuiCtrlCreateInput($pass, 0, 20, 100, 20)
GUICtrlCreateLabel("",0,0,140,20,$SS_CENTER ,$GUI_WS_EX_PARENTDRAG)
$Button_2 = GuiCtrlCreateButton("Copy to clipboard", 00, 40, 140, 20)
$Button_3 = GuiCtrlCreateButton("Create password", 0, 60, 140, 20)
$Button_4 = GuiCtrlCreateButton("Exit", 0, 80, 140, 20)
GuiSetState()

do
    $msg = GuiGetMsg()
    if $msg = $Button_2 then ClipPut(GUICtrlRead($Input_1))
    if $msg = $Button_4 then Exit
    if $msg = $Button_3 Then
        passcreate()
        GUICtrlSetData($Input_1,$pass)
    EndIf
until $msg = $GUI_EVENT_CLOSE

func passcreate()
    for $B = 1 to 16
        $random[$B] = ""
    Next
    for $C = 1 to  GUICtrlRead($Input_2)
        if Random(1,3,1) = 1 Then 
            $random[$C] = random(48,57,1)
        Elseif Random(1,3,1) = 2 then
            $random[$C] = random(65,90,1)
        Else
            $random[$C]= random(97,122,1)
        EndIf
    Next
    $pass = chr($random[1]) & chr($random[2]) & chr($random[3]) & chr($random[4]) & chr($random[5]) & chr($random[6]) & chr($random[7]) & chr($random[8]) & chr($random[9]) & chr($random[10]) & chr($random[11]) & chr($random[12]) & chr($random[13]) & chr($random[14]) & chr($random[15]) & chr($random[16])
EndFunc
Edited by Alek

[font="Impact"]Never fear, I is here.[/font]

Link to comment
Share on other sites

not sure if this is what your looking for but here is a program is use to make passwords

Global $random[17],$pass

#include <GuiConstants.au3>
GuiCreate("", 140, 100,-1, -1 , $WS_POPUP,$WS_EX_TOOLWINDOW)
GUiSetBkColor(0x00000)
$Input_2 = GuiCtrlCreateInput("1", 100, 20, 40, 20)
GUICtrlCreateUpdown(-1)
GUICtrlSetLimit(-1,16,1)
$Input_1 = GuiCtrlCreateInput($pass, 0, 20, 100, 20)
GUICtrlCreateLabel("",0,0,140,20,$SS_CENTER ,$GUI_WS_EX_PARENTDRAG)
$Button_2 = GuiCtrlCreateButton("Copy to clipboard", 00, 40, 140, 20)
$Button_3 = GuiCtrlCreateButton("Create password", 0, 60, 140, 20)
$Button_4 = GuiCtrlCreateButton("Exit", 0, 80, 140, 20)
GuiSetState()

do
    $msg = GuiGetMsg()
    if $msg = $Button_2 then ClipPut(GUICtrlRead($Input_1))
    if $msg = $Button_4 then Exit
    if $msg = $Button_3 Then
        passcreate()
        GUICtrlSetData($Input_1,$pass)
    EndIf
until $msg = $GUI_EVENT_CLOSE

func passcreate()
    for $B = 1 to 16
        $random[$B] = ""
    Next
    for $C = 1 to  GUICtrlRead($Input_2)
        if Random(1,3,1) = 1 Then 
            $random[$C] = random(48,57,1)
        Elseif Random(1,3,1) = 2 then
            $random[$C] = random(65,90,1)
        Else
            $random[$C]= random(97,122,1)
        EndIf
    Next
    $pass = chr($random[1]) & chr($random[2]) & chr($random[3]) & chr($random[4]) & chr($random[5]) & chr($random[6]) & chr($random[7]) & chr($random[8]) & chr($random[9]) & chr($random[10]) & chr($random[11]) & chr($random[12]) & chr($random[13]) & chr($random[14]) & chr($random[15]) & chr($random[16])
EndFunc

kind of, but not random, and saved to a file,

the user input is right

accept, a minimum # and a max #,

the file would give EVERY possibility from 0-9 A-z

Link to comment
Share on other sites

kind of, but not random, and saved to a file,

the user input is right

accept, a minimum # and a max #,

the file would give EVERY possibility from 0-9 A-z

:shocked: sounds like you want someone to do your homework?
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...