(非官方解,以下内容均互联网收集的信息和个人思路,仅供学习参考)
迷失之门
方法一:
IDA看一下 check函数逻辑
进入到check2函数
R键将ascii码转字符,写出逆向脚本
#include <stdio.h> #include <string.h> int main() { char cmp[] = "FSBBhKfIDirfZlEfVbaShZyKom"; char v16[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; char v10[] = "abcdefghijklmnopqrstuvwxyz"; char v4[] = "0123456789+/-=!#&*()?;:*^%"; char v3[] = "DABBZXQESVFRWNGTHYJUMKIOLPC"; int len = strlen(cmp); int v22; char v1; for (int i = 0; i < len; i++) { for (int j = 32; j < 127; j++) { if (j - v3[i] <= 0) { continue; } else { v22 = j - v3[i]; if (v22 > 25) { if (v22 > 51) { v1 = v4[v22 - 52]; } else { v1 = v10[v22 - 26]; } if (v1 == cmp[i]) { printf("%c", j); break; } } else { if (v16[v22] == cmp[i]) { printf("%c", j); break; } } } } } return 0; } |
方法二:
打开ida 然后shift+F2
enc=''.join([chr(get_wide_byte(0x140001464+i*(0x77-0x64))) for i in range(20)]+[chr(get_wide_byte(0x1400015e0+i*15)) for i in range(7)]) key=[i for i in b"DABBZXQESVFRWNGTHYJUMKIOLPC"] print([i+51 for i in key]) index=[] for i in enc: if i in "ABCDEFGHIJKLMNOPQRSTUVWXYZ": index.append("ABCDEFGHIJKLMNOPQRSTUVWXYZ".index(i)) elif i in "abcdefghijklmnopqrstuvwxyz": index.append("abcdefghijklmnopqrstuvwxyz".index(i)+0x1a) elif i in "0123456789+/-=!#&*()?;:*^%": index.append("0123456789+/-=!#&*()?;:*^%".index(i)+0x34) else: print("wrong") print(index) for i in range(len(index)): print(chr((key[i]+index[i])),end='') |