코드 1
#include <stdio.h>
#include <stdlib.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char *argv[]) {
void f1(int);
void f2(int);
void f3(int);
int a=1;
int b=2;
int c=3;
int d[] = {4,5,6};
int *e=&a;
int i;
printf("start\n");
for(i=0;i<=2;i++){
if(i==0){
f1(d[i]);
}else if(i==1){
f2(d[i]);
}else{
f3(d[i]);
}
}
printf("end\n");
return 0;
}
void f1(int i){
printf("f1 = %d\n",i);
}
void f2(int i){
printf("f2 = %d\n",i);
}
void f3(int i){
printf("f3 = %d\n",i);
}
위의 코드 x32dbg에서 돌려보며 흐름을 알아보자.
0 4 8 c순서
코드 2
#include <windows.h>
/* The 'main' function of Win32 GUI programs: this is where execution starts */
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
MessageBox(NULL,"Hello world!","Caption",MB_OK);
return 0;
}
덤프에서 ctrl+G 하고 404008 검색
드래그 우클릭 -바이너리 편집기 -편집
파일- 파일패치- 파일패치(.exe로 저장)
'Forensic' 카테고리의 다른 글
[디지털포렌식] 리버싱 4 (0) | 2022.02.22 |
---|---|
[디지털포렌식] 리버싱 (0) | 2022.02.10 |
[디지털 포렌식] 포렌식 보고서 (0) | 2022.02.10 |
[디지털 포렌식] 파일 분석2 (0) | 2022.02.08 |
[디지털 포렌식] 파일 분석 (0) | 2022.02.03 |