다형성 코드
by. @j0eun https://github.com/ChoiSG/kr-redteam-playbook/pull/5
개요
예시
int main(void)
{
int foo = 100;
printf("%d\n", foo); // 콘솔에 정수 100 출력
}// RandomSeed 함수 출처: Conti V3.0 랜섬웨어 소스코드
constexpr int RandomSeed(void)
{
return '0' * -40271 + // offset accounting for digits' ANSI offsets
__TIME__[7] * 1 +
__TIME__[6] * 10 +
__TIME__[4] * 60 +
__TIME__[3] * 600 +
__TIME__[1] * 3600 +
__TIME__[0] * 36000;
};
int main(void)
{
int foo = 100;
int bar = RandomSeed();
foo = foo + bar - bar; // (bar - bar)의 결과는 0이므로 foo의 상태는 변화 없음
printf("%d\n", foo); // 콘솔에 정수 100 출력
}

Last updated