Skip to content

Instantly share code, notes, and snippets.

@sedflix
Created February 26, 2017 08:47
Show Gist options
  • Save sedflix/f87b573ac1ae570060a32d27ab75a00a to your computer and use it in GitHub Desktop.
Save sedflix/f87b573ac1ae570060a32d27ab75a00a to your computer and use it in GitHub Desktop.
int64_t __gmon_start__ = 0;
void fun_400520();
void _init() {
int64_t rax1;
rax1 = __gmon_start__;
if (rax1) {
fun_400520();
}
return;
}
void fun_400520() {
goto __gmon_start__;
}
int64_t __libc_start_main = 0x4004f6;
void fun_4004f0(int64_t rdi, int64_t rsi, void* rdx, int64_t rcx, int64_t r8, int64_t r9, void** a7, int64_t a8) {
goto __libc_start_main;
}
int64_t deregister_tm_clones() {
int64_t rax1;
rax1 = 7;
if (1 || (*reinterpret_cast<int32_t*>(&rax1) = 0, *reinterpret_cast<int32_t*>(reinterpret_cast<int64_t>(&rax1) + 4) = 0, 1)) {
return rax1;
} else {
goto 0;
}
}
int64_t puts = 0x4004d6;
void fun_4004d0(int64_t rdi) {
goto puts;
}
int64_t malloc = 0x400506;
int64_t fun_400500(int64_t rdi) {
goto malloc;
}
int64_t __stack_chk_fail = 0x4004e6;
int64_t fun_4004e0(int64_t rdi) {
goto __stack_chk_fail;
}
int64_t atoi = 0x400516;
uint32_t fun_400510(int64_t rdi) {
goto atoi;
}
void fun_4003c4() {
signed char* rax1;
signed char* rax2;
signed char al3;
int32_t* rax4;
signed char al5;
signed char* rax6;
signed char* rax7;
*rax1 = reinterpret_cast<signed char>(*rax2 + al3);
*reinterpret_cast<signed char*>(&rax4) = reinterpret_cast<signed char>(al5 + *rax6);
*reinterpret_cast<int32_t*>(&rax7) = *reinterpret_cast<int32_t*>(&rax4) + *rax4;
*reinterpret_cast<int32_t*>(reinterpret_cast<int64_t>(&rax7) + 4) = 0;
*reinterpret_cast<signed char*>(&rax7) = reinterpret_cast<signed char>(*reinterpret_cast<signed char*>(&rax7) + *rax7);
*rax7 = reinterpret_cast<signed char>(*rax7 + *reinterpret_cast<signed char*>(&rax7));
}
int64_t main(int32_t edi, int64_t* rsi);
void __libc_csu_init(int32_t edi, int64_t rsi, int64_t rdx);
void __libc_csu_fini();
void _start() {
void* rsp1;
int64_t rdx2;
int64_t rax3;
rsp1 = reinterpret_cast<void*>(reinterpret_cast<int64_t>(__zero_stack_offset()) + 8);
fun_4004f0(main, __return_address(), rsp1, __libc_csu_init, __libc_csu_fini, rdx2, (reinterpret_cast<uint64_t>(rsp1) & 0xfffffffffffffff0) - 8 - 8, rax3);
__asm__("hlt ");
}
void _fini() {
return;
}
void fun_4005d5() {
int64_t v1;
goto v1;
}
int64_t __JCR_END__ = 0;
void atoi();
void frame_dummy() {
int1_t zf1;
zf1 = __JCR_END__ == 0;
if (!(zf1 || 1)) {
atoi();
}
if (1)
goto 0x4005d8;
if (1)
goto 0x4005d8;
goto 0;
}
uint64_t g28;
int64_t main(int32_t edi, int64_t* rsi) {
int64_t* v3;
uint64_t rax4;
uint64_t v5;
int64_t rax6;
uint64_t rsi7;
int32_t v8;
int64_t rdi9;
uint32_t eax10;
int64_t rax11;
int64_t v12;
int32_t v13;
int64_t rdi14;
uint32_t eax15;
uint32_t eax16;
v3 = rsi;
rax4 = g28;
v5 = rax4;
if (edi != 23) {
addr_0x4007ec_2:
fun_4004d0(":(");
*reinterpret_cast<int32_t*>(&rax6) = 0;
*reinterpret_cast<int32_t*>(reinterpret_cast<int64_t>(&rax6) + 4) = 0;
rsi7 = v5 ^ g28;
if (rsi7) {
rax6 = fun_4004e0(":(");
}
} else {
v8 = 0;
while (v8 <= 21) {
rdi9 = v3[v8 + 1];
eax10 = fun_400510(rdi9);
if (eax10 != 22)
goto addr_0x4007eb_7;
++v8;
}
goto addr_0x400757_9;
}
return rax6;
addr_0x400757_9:
fun_4004d0(":)");
rax11 = fun_400500(23);
v12 = rax11;
v13 = 0;
while (v13 <= 21) {
rdi14 = v3[v13 + 1];
eax15 = fun_400510(rdi14);
eax16 = static_cast<uint32_t>(*reinterpret_cast<unsigned char*>(reinterpret_cast<int64_t>("TheKeyIsSomethingInterestingAsFcuk") + v13)) ^ eax15;
*reinterpret_cast<signed char*>(v13 + v12) = *reinterpret_cast<signed char*>(&eax16);
++v13;
}
fun_4004d0(v12);
goto addr_0x4007ec_2;
addr_0x4007eb_7:
goto addr_0x4007ec_2;
}
void __libc_csu_init(int32_t edi, int64_t rsi, int64_t rdx) {
int32_t r15d4;
int64_t r14_5;
int64_t r13_6;
int64_t rbx7;
int64_t rdi8;
r15d4 = edi;
r14_5 = rsi;
r13_6 = rdx;
_init();
if (!0) {
*reinterpret_cast<int32_t*>(&rbx7) = 0;
*reinterpret_cast<int32_t*>(reinterpret_cast<int64_t>(&rbx7) + 4) = 0;
do {
*reinterpret_cast<int32_t*>(&rdi8) = r15d4;
*reinterpret_cast<int32_t*>(reinterpret_cast<int64_t>(&rdi8) + 4) = 0;
*reinterpret_cast<int64_t*>(0x600e10 + rbx7 * 8)(rdi8, r14_5, r13_6);
++rbx7;
} while (rbx7 != 1);
}
return;
}
void __libc_csu_fini() {
return;
}
int64_t g601010 = 0;
void fun_4004f6() {
goto g601010;
}
signed char __TMC_END__ = 0;
int64_t __do_global_dtors_aux() {
int1_t zf1;
int64_t rax2;
zf1 = __TMC_END__ == 0;
if (zf1) {
rax2 = deregister_tm_clones();
__TMC_END__ = 1;
}
return rax2;
}
void fun_4004d6() {
goto 0x4004c0;
}
void fun_400506() {
goto 0x4004c0;
}
void fun_4004e6() {
goto 0x4004c0;
}
void fun_400516() {
goto 0x4004c0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment