Results 1 to 7 of 7

Thread: Help me accomplish this [Resolved]

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2003
    Location
    In Front of my computer...
    Posts
    367

    Smile 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!

  2. #2
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989
    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.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2003
    Location
    In Front of my computer...
    Posts
    367
    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!

  4. #4
    Lively Member meander's Avatar
    Join Date
    Jun 2004
    Posts
    121
    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...

  5. #5
    Lively Member
    Join Date
    May 2004
    Posts
    81
    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:
    1. For LCV1 = 48 To 122
    2.     toPrint.char1 = Chr(LCV1)
    3.    
    4.     For LCV2 = 48 To 122
    5.         toPrint.char2 = Chr(LCV2)
    6.        
    7.         For LCV3 = 48 To 122
    8.             toPrint.char3 = Chr(LCV3)
    9.            
    10.             For LCV4 = 48 To 122
    11.                 toPrint.char4 = Chr(LCV4)
    12.                
    13.                 For LCV5 = 48 To 122
    14.                     toPrint.char5 = Chr(LCV5)
    15.                    
    16.                     For LCV6 = 48 To 122
    17.                         toPrint.char6 = Chr(LCV6)
    18.                            
    19.                         For LCV7 = 48 To 122
    20.                             toPrint.char7 = Chr(LCV7)
    21.                            
    22.                             For LCV8 = 48 To 122
    23.                                 toPrint.char8 = Chr(LCV8)
    24.                                
    25.                                 For LCV9 = 48 To 122
    26.                                     toPrint.char9 = Chr(LCV9)
    27.                                    
    28.                                     For LCV10 = 48 To 122
    29.                                     toPrint.char10 = Chr(LCV10)
    30.                                        
    31.                                          
    32.                                         printstring = Trim(toPrint.char1, toPrint.char2, toPrint.char3, toPrint.char4, toPrint.char5, toPrint.char6, toPrint.char7, toPrint.char8, toPrint.char9, toPrint.char10)
    33.                                         Print #5, printstring 'printed it to a file, but here is where you would want to do anything that you are
    34.                                                    'going to do to the generated words. i just printed them to a file
    35.                                        
    36.                                        
    37.                                         DoEvents ' not quite sure about this but all i know is it enabled me to stop the program
    38.                                        
    39.                                         If Running = False Then 'i had a commandbutton to make Running false to be able to get out of the program
    40.                                             'WriteStartingPos
    41.                                             'MsgBox "Last word written: " & printstring & vbNewLine & vbNewLine & _
    42.                                                 '"Duration: " & DateDiff("n", nowDate, Now) _
    43.                                                 '& " minutes " & ((DateDiff("s", nowDate, Now)) Mod 60) _
    44.                                                 '& " seconds." & vbNewLine & vbNewLine & _
    45.                                                 '"Wrote " & countItems & " items."
    46.    
    47.                                                                                                End
    48.                                         End If
    49.                                     Next
    50.                                 Next
    51.                             Next
    52.                         Next
    53.                     Next
    54.                 Next
    55.             Next
    56.         Next
    57.     Next
    58. Next
    Last edited by StuartC; Jun 8th, 2004 at 11:56 PM.

  6. #6
    Lively Member
    Join Date
    May 2004
    Posts
    81
    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

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2003
    Location
    In Front of my computer...
    Posts
    367
    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
  •  



Click Here to Expand Forum to Full Width