HGAME 2023 week1 wp

test_your_IDA

打开就能看到

hgame{te5t_y0ur_IDA}

easyenc

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
v8 = [0] * 10
v8[0] = 0x9FDFF04
v8[1] = 0xB0F301
v8[2] = 0xADF00500
v8[3] = 0x5170607
v8[4] = 0x17FD17EB
v8[5] = 0x1EE01EA
v8[6] = 0xFA05B1EA
v8[7] = 0xAC170108
v8[8] = 0xFDEA01EC
v8[9] = 0x60705F0

for i in range(10):
for j in range(4):
print(hex(v8[i] & 0xff), end=',')
v8[i] = v8[i] >> 8
print(hex(-7 & 0xff))

enc = [0x4, 0xff, 0xfd, 0x9, 0x1, 0xf3, 0xb0, 0x0, 0x0, 0x5, 0xf0, 0xad, 0x7, 0x6, 0x17, 0x5, 0xeb, 0x17, 0xfd, 0x17,
0xea, 0x1, 0xee, 0x1, 0xea, 0xb1, 0x5, 0xfa, 0x8, 0x1, 0x17, 0xac, 0xec, 0x1, 0xea, 0xfd, 0xf0, 0x5, 0x7, 0x6,
0xf9]
for i in enc:
print(chr(((i + 86) & 0xff) ^ 0x32),end='')

hgame{4ddit1on_is_a_rever5ible_0peration}

a_cup_of_tea

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
#include <iostream>

void decrypt(unsigned long* EntryData)
{
unsigned long Mup = EntryData[0];
unsigned long Mdown = EntryData[1];

unsigned long sum = 0;
unsigned long delta = 0x543210DD;
int n=32;
for (int i = 0; i < n; ++i) {
sum -= delta;
}
for(int i=0;i<n;i++){
Mdown -= ((Mup + 0x3456789) << 4) ^ (Mup + sum) ^ ((Mup >> 5) + 0x45678901);
Mup -= ((Mdown << 4) + 0x12345678) ^ (Mdown + sum) ^ ((Mdown >> 5) + 0x23456789);
sum += delta;
}
EntryData[0] = Mup;
EntryData[1] = Mdown;
}
int main() {
unsigned long Buf2[8];
Buf2[0] = 0x2E63829D;
Buf2[1] = 0xC14E400F;
Buf2[2] = 0x73495F40;
Buf2[3] = 0x765F345F;
Buf2[4] = 0x5F797265;
Buf2[5] = 0x6C613368;
Buf2[6] = 0x5F796874;
Buf2[7] = 0x6E317264;
decrypt(&Buf2[0]);

for (int i = 0; i < 8; ++i) {
for (int j = 0; j < 4; ++j) {
printf("%c",(char)(Buf2[i]&0xff));
Buf2[i] >>= 8;
}
}
std::cout<<(char)0x6B<<(char)0x7;
return 0;
}

hgame{Te@_Is_4_very_h3althy_dr1nk}

乐死,和我犯一样的错

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
#include <iostream>
#include <Windows.h>
#include <cstring>

using namespace std;

int main(){
unsigned long flag[] = {
0x2E63829D, 0xC14E400F, 0x9B39BFB9, 0x5A1F8B14,
0x61886DDE, 0x6565C6CF, 0x9F064F64, 0x236A43F6
};
for(int x = 0; x < 4; x++) {
unsigned long x1 = flag[2*x];
unsigned long x2 = flag[2*x+1];
unsigned long v4 = 0;
for(int i = 0; i < 32; i++) v4 -= 0x543210DD;
for(int i = 0; i < 32; i++) {
x2 -= (v4 + x1) ^ ((x1 >> 5) + 0x45678901) ^ (16 * (x1 + 0x3456789));
x1 -= (v4 + x2) ^ (16 * x2 + 0x12345678) ^ ((x2 >> 5) + 0x23456789);
v4 += 0x543210DD;
}

for(int i = 0; i < 4; i++) {
printf("%c", x1&0xff);
x1 = x1 >> 8;
}

for(int i = 0; i < 4; i++) {
printf("%c", x2&0xff);
x2 = x2 >> 8;
}
}
printf("%c%c", 0x6B, 0x7D);
return 0;
}

hgame{Tea_15_4_v3ry_h3a1thy_drlnk}

easyasm

hgame{welc0me_t0_re_wor1d!}

1
2
3
4
enc = [0x5b, 0x54, 0x52, 0x5e, 0x56, 0x48, 0x44, 0x56, 0x5f, 0x50, 0x3, 0x5e, 0x56, 0x6c, 0x47, 0x3, 0x6c, 0x41, 0x56,
0x6c, 0x44, 0x5c, 0x41, 0x2, 0x57, 0x12, 0x4e]
for i in enc:
print(chr(i ^ 0x33), end='')

encode

hgame{encode_is_easy_for_a_reverse_engineer}

1
2
3
4
enc = [0x00000008, 0x00000006, 0x00000007, 0x00000006, 0x00000001, 0x00000006, 0x0000000D, 0x00000006, 0x00000005, 0x00000006, 0x0000000B, 0x00000007, 0x00000005, 0x00000006, 0x0000000E, 0x00000006, 0x00000003, 0x00000006, 0x0000000F, 0x00000006, 0x00000004, 0x00000006, 0x00000005, 0x00000006, 0x0000000F, 0x00000005, 0x00000009, 0x00000006, 0x00000003, 0x00000007, 0x0000000F, 0x00000005, 0x00000005, 0x00000006, 0x00000001, 0x00000006, 0x00000003, 0x00000007, 0x00000009, 0x00000007, 0x0000000F, 0x00000005, 0x00000006, 0x00000006, 0x0000000F, 0x00000006, 0x00000002, 0x00000007, 0x0000000F, 0x00000005, 0x00000001, 0x00000006, 0x0000000F, 0x00000005, 0x00000002, 0x00000007, 0x00000005, 0x00000006, 0x00000006, 0x00000007, 0x00000005, 0x00000006, 0x00000002, 0x00000007, 0x00000003, 0x00000007, 0x00000005, 0x00000006, 0x0000000F, 0x00000005, 0x00000005, 0x00000006, 0x0000000E, 0x00000006, 0x00000007, 0x00000006, 0x00000009, 0x00000006, 0x0000000E, 0x00000006, 0x00000005, 0x00000006, 0x00000005, 0x00000006, 0x00000002, 0x00000007, 0x0000000D, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000]
for i in range(0,100,2):
a = enc[i] | enc[i+1] << 4
print(chr(a),end='')