Rolling My Own
Problem
Solution
$ ./remote Password: a Illegal instruction (core dumped)undefined8 FUN_00100b6a(void) { size_t sVar1; void *__ptr; undefined8 *puVar2; long in_FS_OFFSET; int local_100; int local_fc; int local_e8 [4]; undefined8 local_d8; undefined8 local_d0; undefined8 local_c8; undefined8 local_c0; undefined8 local_b8; undefined8 local_b0; undefined local_a8; char acStack153 [65]; char local_58 [72]; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); setbuf(stdout,(char *)0x0); local_c8 = 0x57456a4d614c7047; local_c0 = 0x6b6d6e6e6a4f5670; local_b8 = 0x367064656c694752; local_b0 = 0x736c787a6563764d; local_a8 = 0; local_e8[0] = 8; local_e8[1] = 2; local_e8[2] = 7; local_e8[3] = 1; memset(acStack153 + 1,0,0x40); memset(local_58,0,0x40); printf("Password: "); fgets(acStack153 + 1,0x40,stdin); sVar1 = strlen(acStack153 + 1); acStack153[sVar1] = '\0'; local_100 = 0; while (local_100 < 4) { strncat(local_58,acStack153 + (long)(local_100 << 2) + 1,4); strncat(local_58,(char *)((long)&local_c8 + (long)(local_100 << 3)),8); local_100 = local_100 + 1; } __ptr = malloc(0x40); sVar1 = strlen(local_58); FUN_00100e3e(__ptr,local_58,sVar1 & 0xffffffff); local_100 = 0; while (local_100 < 4) { local_fc = 0; while (local_fc < 4) { *(undefined *)((long)&local_d8 + (long)(local_fc * 4 + local_100)) = *(undefined *)((long)__ptr + (long)(local_e8[local_fc] + local_fc * 0x10 + local_100)); local_fc = local_fc + 1; } local_100 = local_100 + 1; } puVar2 = (undefined8 *)mmap((void *)0x0,0x10,7,0x22,-1,0); *puVar2 = local_d8; puVar2[1] = local_d0; (*(code *)puVar2)(FUN_0010102b); free(__ptr); if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { /* WARNING: Subroutine does not return */ __stack_chk_fail(); } return 0; }void FUN_00100e3e(long param_1,void *param_2,int param_3) { int iVar1; uint uVar2; int iVar3; long in_FS_OFFSET; void *local_a8; int local_98; int local_94; int local_90; MD5_CTX local_88; uchar local_28 [24]; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); if (param_3 % 0xc == 0) { iVar1 = param_3 / 0xc; } else { iVar1 = param_3 / 0xc + 1; } local_98 = 0; local_a8 = param_2; while (local_98 < iVar1) { local_90 = 0xc; if ((local_98 == iVar1 + -1) && (param_3 % 0xc != 0)) { local_90 = iVar1 % 0xc; } MD5_Init(&local_88); MD5_Update(&local_88,local_a8,(long)local_90); local_a8 = (void *)((long)local_a8 + (long)local_90); MD5_Final(local_28,&local_88); local_94 = 0; while (local_94 < 0x10) { iVar3 = local_98 * 0x10 + local_94; uVar2 = (uint)(iVar3 >> 0x1f) >> 0x1a; *(uchar *)((int)((iVar3 + uVar2 & 0x3f) - uVar2) + param_1) = local_28[local_94]; local_94 = local_94 + 1; } local_98 = local_98 + 1; } if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { /* WARNING: Subroutine does not return */ __stack_chk_fail(); } return; }void FUN_0010102b(long param_1) { FILE *__stream; long in_FS_OFFSET; char local_98 [136]; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); if (param_1 == 0x7b3dc26f1) { __stream = fopen("flag","r"); if (__stream == (FILE *)0x0) { puts("Flag file not found. Contact an admin."); /* WARNING: Subroutine does not return */ exit(1); } fgets(local_98,0x80,__stream); puts(local_98); } else { puts("Hmmmmmm... not quite"); } if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { /* WARNING: Subroutine does not return */ __stack_chk_fail(); } return; }48 89 FE mov rsi, rdi 48 mov?48 89 FE mov rsi, rdi 48 BF F1 26 DC B3 07 movabs rdi, 0x7b3dc26f1 00 00 00 ff D6 call rsi C3 retMD5("????GpLaMjEW") = [__, __, __, __, __, __, __, __, 48, 89, FE, 48, __, __, __, __] MD5("????pVOjnnmk") = [__, __, BF, F1, 26, DC, __, __, __, __, __, __, __, __, __, __] MD5("????RGiledp6") = [__, __, __, __, __, __, __, B3, 07, 00, 00, __, __, __, __, __] MD5("????Mvcezxls") = [__, 00, FF, D6, C3, __, __, __, __, __, __, __, __, __, __, __]
Flag
Last updated