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
|
l = [0x0000000a,0x00000004,0x00000010,0x00000008,0x00000003,0x00000005,0x00000001,0x00000004,0x00000020,0x00000008,0x00000005,0x00000003,0x00000001,0x00000003,0x00000002,0x00000008,0x0000000b,0x00000001,0x0000000c,0x00000008,0x00000004,0x00000004,0x00000001,0x00000005,0x00000003,0x00000008,0x00000003,0x00000021,0x00000001,0x0000000b,0x00000008,0x0000000b,0x00000001,0x00000004,0x00000009,0x00000008,0x00000003,0x00000020,0x00000001,0x00000002,0x00000051,0x00000008,0x00000004,0x00000024,0x00000001,0x0000000c,0x00000008,0x0000000b,0x00000001,0x00000005,0x00000002,0x00000008,0x00000002,0x00000025,0x00000001,0x00000002,0x00000036,0x00000008,0x00000004,0x00000041,0x00000001,0x00000002,0x00000020,0x00000008,0x00000005,0x00000001,0x00000001,0x00000005,0x00000003,0x00000008,0x00000002,0x00000025,0x00000001,0x00000004,0x00000009,0x00000008,0x00000003,0x00000020,0x00000001,0x00000002,0x00000041,0x00000008,0x0000000c,0x00000001,0x00000007,0x00000022,0x00000007,0x0000003f,0x00000007,0x00000034,0x00000007,0x00000032,0x00000007,0x00000072,0x00000007,0x00000033,0x00000007,0x00000018,0x00000007,0xffffffa7,0x00000007,0x00000031,0x00000007,0xfffffff1,0x00000007,0x00000028,0x00000007,0xffffff84,0x00000007,0xffffffc1,0x00000007,0x0000001e,0x00000007,0x0000007a]
cur_eip = 0 v5 = 0 v6 = 0 v7 = 0 v8 = 0
while cur_eip < len(l):
if l[cur_eip] == 1: print(f"flag[{v6}] = temp\n") cur_eip += 1 v6 += 1 v8 += 1 elif l[cur_eip] == 2: print(f"temp = buff[{v8}] + {l[cur_eip+1].to_bytes(4, 'little')[0]}") cur_eip += 2
elif l[cur_eip] == 3: print(f"temp = buff[{v8}] - {l[cur_eip+1].to_bytes(4, 'little')[0]}") cur_eip += 2 elif l[cur_eip] == 4: print(f"temp = buff[{v8}] ^ {l[cur_eip+1].to_bytes(4, 'little')[0]}") cur_eip += 2 elif l[cur_eip] == 5: print(f"temp = buff[{v8}] * {l[cur_eip+1].to_bytes(4, 'little')[0]}") cur_eip += 2 elif l[cur_eip] == 6: print("nop") cur_eip += 1 elif l[cur_eip] == 7: print(f"flag[{v7}] = {hex(l[cur_eip+1].to_bytes(4, 'little')[0])}") cur_eip += 2 v7 += 1 elif l[cur_eip] == 8: print(f"buff[{v5}] = temp") cur_eip += 1 v5 += 1 elif l[cur_eip] == 10: print("read flag") cur_eip += 1 elif l[cur_eip] == 11: print(f"temp = buff[{v8}]-1") cur_eip += 1 elif l[cur_eip] == 12: print(f"temp = buff[{v8}]+1") cur_eip += 1 else: print("解析失败")
|