逆向_logmein

64位ida打开文件。

在functions window找到main函数。双击。

 

 

 F5。转换为C语言。

 

 

 需要特别注意的是:/在c语言中表示转义。而\在python中表示转义。

python版解法:

v8 = ":\"AL_RT^L*.?+6/46"
v7 = 28537194573619560
print(hex(v7))  # 0x65626d61726168
vv7 = [0x68, 0x61, 0x72, 0x61, 0x6d, 0x62, 0x65]  # 在内存中,数据以小字节序存储,所以与打印的hex(v7)相反
v6 = 7
v3 = len(v8)
for i in range(0, v3):
    print(chr((vv7[i % v6] ^ ord(v8[i]))), end='')
View Code

C++版解法:

#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <wtypes.h>
using namespace std;
int main(int argc, char* argv[]) {

    char s[32] = "";
    char v8[] = ":\"AL_RT^L*.?+6/46";
    long long v7 = 28537194573619560LL;
    int v6 = 7;
    int v3 = strlen(v8);
    for (int i = 0; i < strlen(v8); i++) {
        s[i] = (char)(*((BYTE*)&v7 + i % v6) ^ v8[i]);
    }
    cout << s;
    return 0;
}
View Code

 

posted @ 2020-04-08 22:14  Flag{Just_For_Fun}  阅读(170)  评论(0)    收藏  举报