EIS2017

Author Avatar
Xzhah 11月 04, 2017
  • 在其它设备中阅读本文章

EIS2017 两道逆向

* ReverseMe

核心函数是sub_403CC0
1.png
这块数据是后面check时要用到的

我们输入的字符串首先会进行一个循环左移
2.png
然后与sub_401460的返回值进行异或
3.png
sub_401460就是把我们前面的数据进行下列处理
4.png
然后最后要求,处理后的字符串与下列数据相等
5.png

* 代码如下

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
a=[0x31,0x41,0x32,0x46,0x39,0x34,0x33,0x43,0x34,0x44,0x38,0x43,0x35,0x42,0x36,0x45,0x41,0x33,0x43,0x39,0x42,0x43,0x41,0x44,0x37,0x45,0x0]
number=[0xf,0x87,0x62,0x14,0x1,0xc6,0xf0,0x21,0x30,0x11,0x50,0xd0,0x82,0x23,0xae,0x23,0xee,0xa9,0xb4,0x52,0x78,0x57,0xc,0x86,0x8b]
flag=''
def subn(a,i):
v2=a[i]
v3=a[i+1]
if(v2>57):
v2=v2-55
v4=v2&0xf
v5=(v3-55)&0xf
if(v3<=57):
v5=v3&0xf
return v5|16*v4
for i in range(0,25):
print(number[i]^subn(a,i))

将得到的数字进行循环右移

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// EIS-re1.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include<iostream>
using namespace std;
int main()
{
int b[] = { 21,
37,
77,
237,
149,
133,
204,
229,
125,
201,
220,
21,
217,
149,
192,
201,
77,
149,
125,
201,
196,
157,
161,
81,
245, };
for (int i = 0;i <= 24;i++) {
int *a = &b[i];
_asm {
push ebp
push edi
push esi
push ebx
mov eax, a
mov edx, [eax]
ror dl, 2
mov[eax], dl
pop ebx
pop esi
pop edi
pop ebp
}
char r = *a;
cout <<r;
}
return 0;
}

* flag

6.png

* IgniteMe

这个很简单。。我直接上图和代码。
7.png
sub_4013c0就是先与0x55异或再加72

1
2
3
4
5
6
7
8
9
num=[0x0d,0x13,0x17,0x11,0x2,0x1,0x20,0x1d,0xc,0x2,0x19,0x2f,0x17,0x2b,0x24,0x1f,0x1e,0x16,0x9,0xf,0x15,0x27,0x13,0x26]
charr="GONDPHyGjPEKruv{{pj]X@rF"
flag=''
for i in range(24):
a=num[i]^ord(charr[i])
a=a-72
a=a^0x55
flag=flag+chr(a)
print (flag.lower())

* flag

8.png