调试篇--第二章动态分析技术

01-OllyDbg调制器

1.1 TraceMe注册机

  • 源代码:
unsigned char Table[8] = {0xC, 0xA, 0x13, 0x9, 0xC, 0xB, 0xA, 0x8}
BOOL GenRegCode(TCHAR *rCode, TCHAR *name, int len)
{
  int i, j;
  unsigned long code=0;
  for (i=3,j=0; i < len; i++, j++){
    if (j > 7) j = 0;
    code += ((BYTE)name[i])*Table[j];
  }
  wsprintf(name, TEXT("%ld"), code);
  if (lstrcmp(rCode, name) == 0) return true;
  else return false;
}
  • python翻译
name = "test"
Table = [12, 10, 19, 9, 12, 11, 10, 8]

code = 0
i = 3
j = 0

while True:
    
    if i < len(name):
        if j > 7:
            j = 0
        code +=(int(ord(name[i]))*Table[j])
        
        i+=1
        j+=1
    else:
        break
print(code)
posted @ 2023-03-20 23:53  Coilin  阅读(25)  评论(0编辑  收藏  举报