Episode 0x06
Tools:
file * : to get information on all files in the directory
strings license_1 : to find all strings in a file
hexdump -C license_1 : to get the hex format of a file
objdump : to display information from object files
strace : to trace system calls and signals
ltrace : to trace library calls
Hopper Disassembler : alternative to ida pro
radare2 : Advanced commandline hexadecimal editor, disassembler and debugger
source code: license_1.c
#include <string.h>
#include <stdio.h>
int main(int argc, char *argv[]) {
if(argc==2) {
printf("Checking License: %s\n", argv[1]);
if(strcmp(argv[1], "AAAA-Z10N-42-OK")==0) {
printf("Access Granted!\n");
} else {
printf("WRONG!\n");
}
} else {
printf("Usage: <key>\n");
}
return 0;
}
$ gcc -o licence_1 licence_1.c
$ vim licence_1
$ hexdump -C license_1
$ objdump -x license_1 | less
$ strings license_1
$ strace ./license_1 AAAA
$ ltrace ./license_1 AAAA