Skip to content

Instantly share code, notes, and snippets.

@vazrupe
Created October 17, 2018 10:10
Show Gist options
  • Save vazrupe/3e4fd3218813e0d968a6b2163fb58f7c to your computer and use it in GitHub Desktop.
Save vazrupe/3e4fd3218813e0d968a6b2163fb58f7c to your computer and use it in GitHub Desktop.
C 디컴파일 코드 with snowman
void fun_1800024af() {
goto sqrt;
}
void TA_Test2(int32_t* rcx) {
int32_t* rbx2;
int32_t* rsi3;
int32_t* rdi4;
int32_t* rsi5;
struct s14* rsi6;
int32_t* v7;
int32_t* rsi8;
*reinterpret_cast<int32_t*>(&rbx2) = 1;
*reinterpret_cast<int32_t*>(reinterpret_cast<int64_t>(&rbx2) + 4) = 0;
if (reinterpret_cast<uint64_t>(rcx) < 1) {
addr_180001110_2:
return;
} else {
__asm__("movaps [rsp+0x20], xmm6");
*rcx = *rsi3;
rdi4 = rcx + 1;
rsi5 = &rsi6->f4;
if (reinterpret_cast<uint64_t>(rcx) >= 8)
goto addr_18000109e_7;
}
addr_1800010e0_8:
if (reinterpret_cast<uint64_t>(rbx2) <= reinterpret_cast<uint64_t>(rdi4)) {
do {
__asm__("xorps xmm0, xmm0");
__asm__("cvtsi2sd xmm0, rbx");
if (reinterpret_cast<int64_t>(rbx2) < reinterpret_cast<int64_t>(0)) {
__asm__("addsd xmm0, xmm6");
}
fun_1800024af();
rbx2 = reinterpret_cast<int32_t*>(reinterpret_cast<uint64_t>(rbx2) + 1);
*rdi4 = *rsi5;
++rdi4;
++rsi5;
} while (reinterpret_cast<uint64_t>(rbx2) <= reinterpret_cast<uint64_t>(rdi4));
}
__asm__("movaps xmm6, [rsp+0x20]");
goto addr_180001110_2;
addr_18000109e_7:
v7 = rsi5;
rsi8 = reinterpret_cast<int32_t*>(reinterpret_cast<uint64_t>(rcx) + 0xfffffffffffffff9);
do {
__asm__("xorps xmm0, xmm0");
__asm__("cvtsi2sd xmm0, rax");
if (reinterpret_cast<int64_t>(reinterpret_cast<uint64_t>(rbx2) + 7) < reinterpret_cast<int64_t>(0)) {
__asm__("addsd xmm0, xmm6");
}
fun_1800024af();
rbx2 = rbx2 + 2;
*rdi4 = *rsi8;
++rdi4;
++rsi8;
} while (reinterpret_cast<uint64_t>(rbx2) <= reinterpret_cast<uint64_t>(rsi8));
rsi5 = v7;
goto addr_1800010e0_8;
}
void TA_Test3(uint64_t rcx) {
uint64_t rax2;
uint64_t rdx3;
int32_t* rdi4;
int32_t* rsi5;
struct s15* rdi6;
struct s16* rdi7;
struct s17* rsi8;
struct s18* rsi9;
struct s19* rdi10;
struct s20* rsi11;
struct s21* rdi12;
struct s22* rsi13;
struct s23* rdi14;
struct s24* rsi15;
struct s25* rdi16;
struct s26* rsi17;
struct s27* rdi18;
struct s28* rsi19;
int32_t* rdi20;
int32_t* rsi21;
int64_t rcx22;
uint64_t r8_23;
*reinterpret_cast<int32_t*>(&rax2) = 1;
*reinterpret_cast<int32_t*>(reinterpret_cast<int64_t>(&rax2) + 4) = 0;
rdx3 = rcx;
if (rcx < 1) {
addr_1800012a1_2:
return;
} else {
__asm__("movaps [rsp+0x60], xmm6");
*rdi4 = *rsi5;
rdi6 = reinterpret_cast<struct s15*>(&rdi7->f4);
rsi8 = reinterpret_cast<struct s17*>(&rsi9->f4);
__asm__("movaps [rsp+0x50], xmm7");
rdi6->f0 = rsi8->f0;
rdi10 = reinterpret_cast<struct s19*>(&rdi6->f4);
rsi11 = reinterpret_cast<struct s20*>(&rsi8->f4);
__asm__("movaps [rsp+0x40], xmm8");
rdi10->f0 = rsi11->f0;
rdi12 = reinterpret_cast<struct s21*>(&rdi10->f4);
rsi13 = reinterpret_cast<struct s22*>(&rsi11->f4);
__asm__("movaps [rsp+0x30], xmm9");
rdi12->f0 = rsi13->f0;
rdi14 = reinterpret_cast<struct s23*>(&rdi12->f4);
rsi15 = reinterpret_cast<struct s24*>(&rsi13->f4);
__asm__("movaps [rsp+0x20], xmm10");
rdi14->f0 = rsi15->f0;
rdi16 = reinterpret_cast<struct s25*>(&rdi14->f4);
rsi17 = reinterpret_cast<struct s26*>(&rsi15->f4);
__asm__("movaps [rsp+0x10], xmm11");
rdi16->f0 = rsi17->f0;
rdi18 = reinterpret_cast<struct s27*>(&rdi16->f4);
rsi19 = reinterpret_cast<struct s28*>(&rsi17->f4);
__asm__("movaps [rsp], xmm12");
rdi18->f0 = rsi19->f0;
rdi20 = &rdi18->f4;
rsi21 = &rsi19->f4;
if (rcx >= 8)
goto addr_18000119f_25;
}
addr_180001214_26:
if (rax2 <= rdx3) {
do {
__asm__("xorps xmm3, xmm3");
__asm__("cvtsi2sd xmm3, rax");
if (reinterpret_cast<int64_t>(rax2) < reinterpret_cast<int64_t>(0)) {
__asm__("addsd xmm3, xmm6");
}
__asm__("movaps xmm0, xmm3");
__asm__("movaps xmm2, xmm3");
__asm__("subsd xmm0, xmm11");
__asm__("movaps xmm1, xmm3");
__asm__("addsd xmm2, xmm8");
++rax2;
__asm__("addsd xmm1, xmm7");
__asm__("mulsd xmm2, xmm0");
__asm__("movaps xmm0, xmm3");
__asm__("subsd xmm0, xmm10");
__asm__("mulsd xmm1, xmm0");
__asm__("movaps xmm0, xmm3");
__asm__("subsd xmm0, xmm12");
__asm__("addsd xmm3, xmm9");
__asm__("addsd xmm2, xmm1");
__asm__("mulsd xmm0, xmm3");
__asm__("addsd xmm2, xmm0");
*rdi20 = *rsi21;
++rdi20;
++rsi21;
} while (rax2 <= rdx3);
}
__asm__("movaps xmm11, [rsp+0x10]");
__asm__("movaps xmm10, [rsp+0x20]");
__asm__("movaps xmm9, [rsp+0x30]");
__asm__("movaps xmm8, [rsp+0x40]");
__asm__("movaps xmm7, [rsp+0x50]");
__asm__("movaps xmm6, [rsp+0x60]");
__asm__("movaps xmm12, [rsp]");
goto addr_1800012a1_2;
addr_18000119f_25:
*reinterpret_cast<int32_t*>(&rcx22) = 8;
*reinterpret_cast<int32_t*>(reinterpret_cast<int64_t>(&rcx22) + 4) = 0;
r8_23 = rdx3 >> 3;
rax2 = r8_23 * 8 + 1;
do {
__asm__("xorps xmm5, xmm5");
__asm__("cvtsi2sd xmm5, rcx");
if (rcx22 < 0) {
__asm__("addsd xmm5, xmm6");
}
__asm__("movaps xmm4, xmm5");
__asm__("movaps xmm1, xmm5");
__asm__("movaps xmm0, xmm5");
__asm__("addsd xmm4, xmm7");
__asm__("movaps xmm2, xmm5");
__asm__("addsd xmm1, xmm8");
__asm__("subsd xmm2, xmm11");
__asm__("movaps xmm3, xmm5");
__asm__("subsd xmm0, xmm10");
rcx22 = rcx22 + 8;
__asm__("addsd xmm3, xmm9");
__asm__("subsd xmm5, xmm12");
__asm__("mulsd xmm2, xmm1");
__asm__("mulsd xmm0, xmm4");
__asm__("mulsd xmm5, xmm3");
__asm__("addsd xmm2, xmm0");
__asm__("addsd xmm2, xmm5");
*rdi20 = *rsi21;
++rdi20;
++rsi21;
--r8_23;
} while (r8_23);
goto addr_180001214_26;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment