simple-rev

[src = hackme] simple-rev

题目描述

A little bit harder

WP

直接IDA–>F5,得到:

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
int __cdecl main(int argc, const char **argv, const char **envp)
{
char checking[64]; // [esp+Ch] [ebp-8Ch]
char buffer[64]; // [esp+4Ch] [ebp-4Ch]
int i; // [esp+8Ch] [ebp-Ch]

printf("What is flag? ");
fgets(buffer, 63, stdin);
for ( i = 0; buffer[i]; ++i )
{
if ( buffer[i] == 10 )
{
buffer[i] = 0;
checking[i] = 0;
}
else
{
checking[i] = buffer[i] + 1; //简单的移位,只需要反向移位即可得到flag
}
}
if ( !strcmp(checking, "UIJT.JT.ZPVS.GMBH") )
printf("FLAG{%s}\n", buffer);
else
puts("Try hard.");
return 0;
}

用python解决:

1
2
3
4
5
s = "UIJT.JT.ZPVS.GMBH"
r = ""
for i in s:
r += chr(ord(i) - 1)
print(r)

输出flag。