Reversing/ASM to C

ASM to C with IDA - 026

MarcoKhan 2018. 6. 1. 17:38

C300_026



C300_소스코드



1
2
3
4
5
6
7
8
9
10
11
12
#include <stdio.h> 
 
main()
{
    char i;
    int  j;
    double k;
 
    printf("%d \n"sizeof(i));        // 1
    printf("%d \n"sizeof(j));        // 4
    printf("%d \n"sizeof(k));        // 8    
}
cs




IDA - Layout Graph





IDA - Text View





sizeof 함수를 call 하는 부분이 따로 없다.

또한 지역 변수를 사용하지 않고 바로 push를 이용해 출력한다.



pseudo code - 최종 의사 코드



1
2
3
4
5
6
7
8
#include <stdio.h> 
 
main()
{
    printf(_Foramt, 1);                
    printf(aD_0, 4);
    printf(aD_1, 8);
}
cs