Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // This file was generated by the Retargetable Decompiler
- // Website: https://retdec.com
- // Copyright (c) 2018 Retargetable Decompiler <info@retdec.com>
- //
- #include <stdint.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <sys/mman.h>
- // ------------------- Function Prototypes --------------------
- void __libc_csu_fini(void);
- int32_t __libc_csu_init(int32_t a1, int32_t a2, int32_t a3);
- int32_t _start(int32_t a1, int32_t a2);
- int main(int argc, char ** argv);
- // --------------------- Global Variables ---------------------
- int32_t g1 = 0; // eax
- int32_t g2 = 0; // edx
- char * g3 = "\xeb\x37\x5b\xec\xe9\xe8\x35\xfb\xb6\x35\xe3\xb2\x3d\x46\xb6\xca\xbc\x55\xee\x34\xbd\x8a\x40\x82\x0a\xcb\xf6\x34\xfd\xbf\x8a\x53\x82\x12\xcb\x81\x34\xfd\xbc\x8a\x74\x82\x39\xcb\x88\x34\xfd\xbd\x8a\x40\x82\x0b\xcb\x93\x34\xfd\xba\x8a\x40\x82\x2c\xcb\x9a\x34\xfd\xbb\x8a\x53\x82\x63\xcb\xa5\x34\xfd\xb8\x8a\x74\x82\x18\xcb\xac\x34\xfd\xb9\x8a\x40\x82\x3a\xcb\xb7\x55\xbe\x06\xbf\xbe\xbe\xbe\x55\xbb\x06\xbe\xbe\xbe\xbe\xe0\xe1\xe5\xe3\x7d\x50\x61\x73\x73\x77\x6f\x72\x64\x3a\x20"; // 0x8048810
- // ------------------------ Functions -------------------------
- // Address range: 0x8048430 - 0x804845f
- int32_t _start(int32_t a1, int32_t a2) {
- int32_t v1;
- int32_t result = __libc_start_main((int32_t * (*)(int32_t, char **, char **))main, v1, (char **)&a1, (void (**)())__libc_csu_init, (void (**)())__libc_csu_fini, (void (**)())g2); // 0x804844c
- g1 = result;
- return result;
- }
- // Address range: 0x8048530 - 0x804878f
- int main(int argc, char ** argv) {
- int32_t str;
- int32_t v1 = &str; // 0x804854f_0
- int32_t v2;
- memcpy((char *)&v2, (char *)&g3, 109);
- memset((char *)&str, 0, 30);
- printf("Password: ");
- int32_t v3 = (int32_t)"%s"; // ecx
- scanf("%s", &str);
- // branch -> 0x8048633
- for (int32_t i = 0; i < 109; i++) {
- // 0x8048633
- int32_t v4;
- char * v5 = (char *)(i - 133 + (int32_t)&v4); // 0x8048639_0
- int32_t v6 = (int32_t)*v5 ^ 190; // 0x8048641
- v3 = v3 & -256 | v6;
- *v5 = (char)v6;
- // continue -> 0x8048633
- }
- char * v7 = mmap(NULL, 109, 7, 34, -1, 0); // 0x80486cc
- memcpy(v7, (char *)&v2, 109);
- g2 = v1;
- int32_t len = strlen((char *)&str); // 0x8048724
- g1 = v1;
- ((int32_t (*)(int32_t, int32_t))v7)(len, v1);
- if (g1 == 0) {
- // 0x8048747
- printf("incorrect!\n");
- // branch -> 0x8048774
- } else {
- // 0x8048760
- printf("correct!\n");
- // branch -> 0x8048774
- }
- // 0x8048774
- return 0;
- }
- // Address range: 0x8048790 - 0x80487ec
- int32_t __libc_csu_init(int32_t a1, int32_t a2, int32_t a3) {
- // 0x8048790
- abort();
- // UNREACHABLE
- }
- // Address range: 0x80487f0 - 0x80487f1
- void __libc_csu_fini(void) {
- // 0x80487f0
- return;
- }
- // --------------- Dynamically Linked Functions ---------------
- // int __libc_start_main(int *(main)(int, char **, char **), int argc, char ** ubp_av, void(* init)(void), void(* fini)(void), void(* rtld_fini)(void), void(* stack_end));
- // void * memcpy(void * restrict dest, const void * restrict src, size_t n);
- // void * memset(void * s, int c, size_t n);
- // void * mmap(void * addr, size_t len, int prot, int flags, int fd, __off_t offset);
- // int printf(const char * restrict format, ...);
- // int scanf(const char * restrict format, ...);
- // size_t strlen(const char * s);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement