As you are quite a good hacker you should have no problem to gather
information. So please tell me the name of these games, where I only
have the .sid files from.
Solution
SID 文件格式
PSID v2 文件头 124 字节,关键字段(大端序):
偏移
大小
字段
说明
0x00
4
Magic
"PSID"
0x04
2
Version
0x0002 = v2
0x08
2
Load addr
0 = 使用 init 地址
0x0A
2
Init addr
初始化入口
0x0C
2
Play addr
播放入口(每帧调用)
0x0E
2
Songs
子曲目数
0x16
32
Name
曲名(NULL 结尾)
0x36
32
Author
作者
0x56
32
Copyright
版权/年份
Python 解析:
1 2 3 4 5 6 7 8 9 10 11
import struct
defparse_sid(path): withopen(path, 'rb') as f: data = f.read() init = struct.unpack('>H', data[10:12])[0] play = struct.unpack('>H', data[12:14])[0] name = data[22:54].split(b'\x00')[0].decode('ascii', errors='replace') author = data[54:86].split(b'\x00')[0].decode('ascii', errors='replace') return {'init': f'${init:04X}', 'play': f'${play:04X}', 'name': name, 'author': author}
sid1: The Last Ninja
1 2 3 4 5 6 7
Magic: PSID v2 Init: $2003, Play: $2000 Songs: 11, Start: 3 Name: "The Last Ninja" Author: "Ben Daglish & Anthony Lees" Copyright: "1987 System 3" Size: 35617 bytes
cookies = {'WC': 'YOUR_WECHALL_COOKIE'} base = 'https://www.wechall.net/en/challenge/impossible/index.php'
# Step 1: request new number r = requests.get(f'{base}?request=new_number', cookies=cookies) csrf = re.search(r'name="gwf3_csrf" value="([^"]+)"', r.text).group(1)
# Step 2: submit wrong answer to leak the correct one r2 = requests.post(base, data={ 'solution': '1', 'solve': 'Submit', 'gwf3_csrf': csrf }, cookies=cookies) correct = re.search(r'Correct would have been "(\d+)"', r2.text).group(1)
defis_prime(n): if n < 2: returnFalse if n == 2: returnTrue if n % 2 == 0: returnFalse for i inrange(3, int(sqrt(n)) + 1, 2): if n % i == 0: returnFalse returnTrue
img = Image.open('op.png') w, h = img.size result = Image.new('RGB', (w, h), (255, 255, 255))
for y inrange(h): for x inrange(w): r, g, b = img.getpixel((x, y)) if is_prime(r): result.putpixel((x, y), (0, 0, 0)) else: result.putpixel((x, y), (255, 255, 255))