Excuse the ads! We need some help to keep our site up.
|
다음과 같은 코드를 이용해 다른 프로세스(디버거,Memory Cheat tool)가 해당 프로세스틑 연결하는 것은 확인 할 수 있습니다.
해당 코드는 아주 기본적이고 일반적인 Anti debugging 코드 입니다.
해당 프로세스가 디버깅 되고 있지 않다면 ptrace()는 0을 반환 하며, 디버깅 되고 있을 경우 0이 아닌 다른 값이 반환됩니다..
즉, 아래 코드를 사용해 디버거 또는 메모리 치트 툴이 게임 프로세스에 연결되어 있는지 확인 할 수 있습니다.
int result = ptrace(PTRACE_TRACEME,0,0,0); if(result != 0){ exit(0); } |
static int value1= 0,value2 = 0, value3 = 0,total = 0; int Util::DivisionValue(int value){ value3 = value1; value1 = getRandomNumber(0 ,value1 + value2 + value); value2 = value3 + value2 + value - value1; return value1 + value2; } int Util::getRandomNumber(int from, int to){ return (int)from + arc4random() % (to-from+1); } |
int Util::XOREncrypt(int value){ srand((unsigned int)time(NULL)); salt = rand()%10; encode = value^salt; return encode; } int Util::XORDecrypt(int encode){ return encode^salt; } |
아래와 같이 메모리에 Score 값이 XOR 연산되어 저장됩니다.
Int *score = new int; ... Delete score; |