|
-
Jun 5th, 2004, 05:16 AM
#1
Thread Starter
Hyperactive Member
Help me accomplish this [Resolved]
What i would like to accomplish is the following:
Create a type of bruteforcer if we can call it that that does this...
-Generate a key of 12 Chars. (cant be more or less)
-The key gotta be only characters from A - Z (cant be lowercases or number only from A - Z)
Now here's the hard part...
The result of the sum of ascii of each character in the key gotta be = 384(hex)
So this is a valid key
A = 45, N = 4E, W = 57, K = 4B, Q = 51, M = 4D, M = 4D, L = 4C, I = 49, J = 4A, G = 47, B = 42
(numbers are ascii values :P of each letter)
ok if we sum all those ascii value it will give us 384h and that's what i want but there are more possibilities so i want to make a program that does that i explained 
Well hope you guys understand it so hopefully someone can help me 
Thank you!
Last edited by EJ12N; Jun 9th, 2004 at 02:30 AM.
Born to help others
(If I've been helpful then please rate my post. Thanks)
call me EJ or be slapped! 
-
Jun 5th, 2004, 05:26 AM
#2
This would be the easiest (not the best) way to do this.
You make a text box control array (12 boxes) with indexes
0 to 11.
You then find out the ascii codes for upper case A to Z.
You then make a Do Loop to look something like this:
It puts the ascii character for A in all 12 boxes
Calculate the sum of ascii codes and if it is the right sum
add the combination to a list.
Increment the character in the last box by one.
Calculate the sum and check if it is the right value. if it is add it to the list.
Keep incrementing the chr in the last box until it reaches the max value (letter Z), then increment the value in the second to last box by one and reset the value in the last one to A.
Calculate sum and check it.
etc.
-
Jun 5th, 2004, 05:46 AM
#3
Thread Starter
Hyperactive Member
uhmm well can you please post a coding example of the loop... ? thanks
Born to help others
(If I've been helpful then please rate my post. Thanks)
call me EJ or be slapped! 
-
Jun 8th, 2004, 07:32 PM
#4
Lively Member
ya im actually tring to do this too, just to see if i could do it and im all confused, so far i have 25 variables defined, the code that adds the stuff to the text box and 12 do's all inside each other, and i cant figure out how to get any farther...
-
Jun 8th, 2004, 11:37 PM
#5
Lively Member
wrote this earlier today before i saw this thread. i think i fixed it up nice enough to post 
hope this helps or at least gives you an idea
Notes about the code
Trim is a function that accepts the 10 letters, it just takes off the beginning zeroes that are there because of the nature of this generator. i think you can figure out that part. the toPrint.charNumber is a datatype that holds characters (not sure why i made that , just goin Type crazy cause i just learned how to use them). the message box was just to tell me how much words were written and stuff when the program ended.
Edit hmm sorry about the length of the post, i just wanted to make the loops kind of visual but it does make the post kind of long.
Edit More explanation . The loop control variables start at the value 48 (which is the character 0) and go to the value 122 (which is the character z) and cycles through the combinations. but since the way the ascii codes are setup these loops also include some characters that arent letters or numbers because their ascii values were inbetween the sets of numbers and uppercase/lowercase letters. i havent really thought about fixing this because right now i have bigger fish to fry. although, if you dont need those characters, it would be best to think of a way to get rid of them because it would save loads of time. I dont think im forgetting anything else, but if you have questions just ask.
im not sure if this is the best or most efficient way to approach this, but im just trying to contribute what i can. any constructive critism is very welcome 
VB Code:
For LCV1 = 48 To 122
toPrint.char1 = Chr(LCV1)
For LCV2 = 48 To 122
toPrint.char2 = Chr(LCV2)
For LCV3 = 48 To 122
toPrint.char3 = Chr(LCV3)
For LCV4 = 48 To 122
toPrint.char4 = Chr(LCV4)
For LCV5 = 48 To 122
toPrint.char5 = Chr(LCV5)
For LCV6 = 48 To 122
toPrint.char6 = Chr(LCV6)
For LCV7 = 48 To 122
toPrint.char7 = Chr(LCV7)
For LCV8 = 48 To 122
toPrint.char8 = Chr(LCV8)
For LCV9 = 48 To 122
toPrint.char9 = Chr(LCV9)
For LCV10 = 48 To 122
toPrint.char10 = Chr(LCV10)
printstring = Trim(toPrint.char1, toPrint.char2, toPrint.char3, toPrint.char4, toPrint.char5, toPrint.char6, toPrint.char7, toPrint.char8, toPrint.char9, toPrint.char10)
Print #5, printstring 'printed it to a file, but here is where you would want to do anything that you are
'going to do to the generated words. i just printed them to a file
DoEvents ' not quite sure about this but all i know is it enabled me to stop the program
If Running = False Then 'i had a commandbutton to make Running false to be able to get out of the program
'WriteStartingPos
'MsgBox "Last word written: " & printstring & vbNewLine & vbNewLine & _
'"Duration: " & DateDiff("n", nowDate, Now) _
'& " minutes " & ((DateDiff("s", nowDate, Now)) Mod 60) _
'& " seconds." & vbNewLine & vbNewLine & _
'"Wrote " & countItems & " items."
End
End If
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Last edited by StuartC; Jun 8th, 2004 at 11:56 PM.
-
Jun 8th, 2004, 11:53 PM
#6
Lively Member
I didnt want to edit that post anymore so im making a new one 
Since this program takes a while to run through all the possible combinations (and i mean a freakin long time) you might want to run this in moderation. a way to start up where you were is: 1. when the program is ended ( the if Running conditional ) send a call to a function that writes all the loop control variables to a file ( the LCV then a number variables. ) then 2. whenever the program runs load the values from the file and instead of setting all the LCV variables to 48, set them to the values from the file, that way you can run the program, end it, and pick up later where you left off. the only reason i suggest this is because this program will crank your processor up to 100% constant ( it did mine) and overheating = not good.
once again, hope that helps
-
Jun 9th, 2004, 02:30 AM
#7
Thread Starter
Hyperactive Member
Thanks for your time
Born to help others
(If I've been helpful then please rate my post. Thanks)
call me EJ or be slapped! 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|