Thread: Help with code

Results 1 to 6 of 6
  1. #1
    258456's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    ghjghj
    Posts
    1,222
    Reputation
    18
    Thanks
    300
    My Mood
    Relaxed

    Help with code

    Ok, so i downloaded this random crackme program but i have a problem. I can easily crack it by patching the conditional jumps but i don't want to do the "beginner move", lol, i want to know how to find the actual code that handles it.
    here it is:

    Code:
     CPU Disasm
    Address   Hex dump          Command                                  Comments
    00401140  |.  68 00020000   PUSH 200                                 ; /MaxCount = 512.
    00401145  |.  68 D0304000   PUSH OFFSET 004030D0                     ; |String
    0040114A  |.  6A 01         PUSH 1                                   ; |ItemID = 1
    0040114C  |.  FF75 08       PUSH DWORD PTR SS:[ARG.1]                ; |hDialog => [ARG.1]
    0040114F  |.  E8 90010000   CALL <JMP.&USER32.GetDlgItemTextA>       ; \USER32.GetDlgItemTextA
    00401154  |.  68 D0304000   PUSH OFFSET 004030D0                     ; /String
    00401159  |.  E8 B6010000   CALL <JMP.&KERNEL32.lstrlenA>            ; \KERNEL32.lstrlenA
    0040115E  |.  8BD8          MOV EBX,EAX
    00401160  |.  0BC0          OR EAX,EAX
    00401162  |.  75 1C         JNE SHORT 00401180
    00401164  |.  6A 00         PUSH 0                                   ; /Type = MB_OK|MB_DEFBUTTON1|MB_APPLMODAL
    00401166  |.  68 04304000   PUSH OFFSET 00403004                     ; |Caption
    0040116B  |.  68 16304000   PUSH OFFSET 00403016                     ; |Text = "Please enter a value for each field!"
    00401170  |.  6A 00         PUSH 0                                   ; |hOwner = NULL
    00401172  |.  E8 73010000   CALL <JMP.&USER32.MessageBoxA>           ; \USER32.MessageBoxA
    00401177  |.  B8 00000000   MOV EAX,0
    0040117C  |.  C9            LEAVE
    0040117D  |.  C2 1000       RETN 10
    00401180  |>  68 00020000   PUSH 200                                 ; /MaxCount = 512.
    00401185  |.  68 D0324000   PUSH OFFSET 004032D0                     ; |String
    0040118A  |.  6A 02         PUSH 2                                   ; |ItemID = 2
    0040118C  |.  FF75 08       PUSH DWORD PTR SS:[ARG.1]                ; |hDialog => [ARG.1]
    0040118F  |.  E8 50010000   CALL <JMP.&USER32.GetDlgItemTextA>       ; \USER32.GetDlgItemTextA
    00401194  |.  68 D0324000   PUSH OFFSET 004032D0                     ; /String
    00401199  |.  E8 76010000   CALL <JMP.&KERNEL32.lstrlenA>            ; \KERNEL32.lstrlenA
    Now, i know that the first blank which is the username blank the text is stored in... 004030D0

    and the password is stored here... 004032D0

    but when i go there i don't find text or anything just (.). Thanks for you help. I just want to know where i should go from there.

  2. #2
    Void's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Inline.
    Posts
    3,198
    Reputation
    205
    Thanks
    1,445
    My Mood
    Mellow
    From the looks of it, it looks like 004032D0 is just the buffer that's holding what you typed in. Could you add me on MSN, I may be able to help a bit more. \:

    davidm_44@hotmail.com
    gogoogogogo

  3. #3
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    the (.)'s are just 00's, I would guess it's allocated memory that is waiting for your string, but since you never put anything in the textbox there's nothing there.

    EDIT: nvm Void beat me to it >_>...

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  4. #4
    Void's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Inline.
    Posts
    3,198
    Reputation
    205
    Thanks
    1,445
    My Mood
    Mellow
    Quote Originally Posted by why06 View Post
    the (.)'s are just 00's, I would guess it's allocated memory that is waiting for your string, but since you never put anything in the textbox there's nothing there.

    EDIT: nvm Void beat me to it >_>...
    GET THE FK ON MSN

  5. #5
    258456's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    ghjghj
    Posts
    1,222
    Reputation
    18
    Thanks
    300
    My Mood
    Relaxed
    k, i added u void

  6. #6
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    Quote Originally Posted by Void View Post
    GET THE FK ON MSN
    Pffft... fine -__-

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower