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 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238
| import struct from itertools import product from tqdm import tqdm
memory = bytearray(1024) memory += bytearray(b"\x90\x0f\x00\x00Success\x00Illegal byte sequence\x00Domain error\x00Result not representable\x00Not a tty\x00Permission denied\x00Operation not permitted\x00No such file or directory\x00No such process\x00File exists\x00Value too large for data type\x00No space left on device\x00Out of memory\x00Resource busy\x00Interrupted system call\x00Resource temporarily unavailable\x00Invalid seek\x00Cross-device link\x00Read-only file system\x00Directory not empty\x00Connection reset by peer\x00Operation timed out\x00Connection refused\x00Host is unreachable\x00Address in use\x00Broken pipe\x00I/O error\x00No such device or address\x00No such device\x00Not a directory\x00Is a directory\x00Text file busy\x00Exec format error\x00Invalid argument\x00Argument list too long\x00Symbolic link loop\x00Filename too long\x00Too many open files in system\x00No file descriptors available\x00Bad file descriptor\x00No child process\x00Bad address\x00File too large\x00Too many links\x00No locks available\x00Resource deadlock would occur\x00State not recoverable\x00Previous owner died\x00Operation canceled\x00Function not implemented\x00No message of desired type\x00Identifier removed\x00Link has been severed\x00Protocol error\x00Bad message\x00Not a socket\x00Destination address required\x00Message too large\x00Protocol wrong type for socket\x00Protocol not available\x00Protocol not supported\x00Not supported\x00Address family not supported by protocol\x00Address not available\x00Network is down\x00Network unreachable\x00Connection reset by network\x00Connection aborted\x00No buffer space available\x00Socket is connected\x00Socket not connected\x00Operation already in progress\x00Operation in progress\x00Stale file handle\x00Quota exceeded\x00Multihop attempted\x00Capabilities insufficient\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00u\x02N\x00\xd6\x01\xe2\x04\xb9\x04\x18\x01\x8e\x05\xed\x02\x16\x04\xf2\x00\x97\x03\x01\x038\x05\xaf\x01\x82\x01O\x03/\x04\x1e\x00\xd4\x05\xa2\x00\x12\x03\x1e\x03\xc2\x01\xde\x03\x08\x00\xac\x05\x00\x01d\x02\xf1\x01e\x054\x02\x8c\x02\xcf\x02-\x03L\x04\xe3\x05\x9f\x02\xf8\x04\x1c\x05\x08\x05\xb1\x02K\x05\x15\x02x\x00R\x02<\x03\xf1\x03\xe4\x00\xc3\x03}\x04\xcc\x00\xaa\x03y\x05$\x02n\x01m\x03\"\x04\xab\x04D\x00\xfb\x01\xae\x00\x83\x03`\x00\xe5\x01\x07\x04\x94\x04^\x04+\x00X\x019\x01\x92\x00\xc2\x05\x9b\x01C\x02F\x01\xf6\x05-+ 0X0x\x00-0X+0X 0X-0x+0x 0x\x00%s\x00nan\x00inf\x00NAN\x00INF\x00.\x00(null)\x00Incorrect flag!\x00Correct flag!\x00Enter flag: \x00Support for formatting long double values is currently disabled.\nTo enable it, add -lc-printscan-long-double to the link command.\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x19\x00\x0b\x00\x19\x19\x19\x00\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x00\x00\x19\x00\n\n\x19\x19\x19\x03\n\x07\x00\x01\x1b\t\x0b\x18\x00\x00\t\x06\x0b\x00\x00\x0b\x00\x06\x19\x00\x00\x00\x19\x19\x19\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x19\x00\x0b\r\x19\x19\x19\x00\r\x00\x00\x02\x00\t\x0e\x00\x00\x00\t\x00\x0e\x00\x00\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x13\x00\x00\x00\x00\x13\x00\x00\x00\x00\t\x0c\x00\x00\x00\x00\x00\x0c\x00\x00\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0f\x00\x00\x00\x04\x0f\x00\x00\x00\x00\t\x10\x00\x00\x00\x00\x00\x10\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11\x00\x00\x00\x00\x11\x00\x00\x00\x00\t\x12\x00\x00\x00\x00\x00\x12\x00\x00\x12\x00\x00\x1a\x00\x00\x00\x1a\x1a\x1a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1a\x00\x00\x00\x1a\x1a\x1a\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x14\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x17\x00\x00\x00\x00\x17\x00\x00\x00\x00\t\x14\x00\x00\x00\x00\x00\x14\x00\x00\x14\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x16\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x15\x00\x00\x00\x00\x15\x00\x00\x00\x00\t\x16\x00\x00\x00\x00\x00\x16\x00\x00\x16\x00\x000123456789ABCDEF\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\xff\xff\xff\xff\xff\xff\xff\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !\"#\xff\xff\xff\xff\xff\xff\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !\"#\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x01\x02\x04\x07\x03\x06\x05\x00\x00\x00\x00\x00\x00\x00\n\x00\x00\x00d\x00\x00\x00\xe8\x03\x00\x00\x10\'\x00\x00\xa0\x86\x01\x00@B\x0f\x00\x80\x96\x98\x00\x00\xe1\xf5\x05\x02\x00\x00\xc0\x03\x00\x00\xc0\x04\x00\x00\xc0\x05\x00\x00\xc0\x06\x00\x00\xc0\x07\x00\x00\xc0\x08\x00\x00\xc0\t\x00\x00\xc0\n\x00\x00\xc0\x0b\x00\x00\xc0\x0c\x00\x00\xc0\r\x00\x00\xc0\x0e\x00\x00\xc0\x0f\x00\x00\xc0\x10\x00\x00\xc0\x11\x00\x00\xc0\x12\x00\x00\xc0\x13\x00\x00\xc0\x14\x00\x00\xc0\x15\x00\x00\xc0\x16\x00\x00\xc0\x17\x00\x00\xc0\x18\x00\x00\xc0\x19\x00\x00\xc0\x1a\x00\x00\xc0\x1b\x00\x00\xc0\x1c\x00\x00\xc0\x1d\x00\x00\xc0\x1e\x00\x00\xc0\x1f\x00\x00\xc0\x00\x00\x00\xb3\x01\x00\x00\xc3\x02\x00\x00\xc3\x03\x00\x00\xc3\x04\x00\x00\xc3\x05\x00\x00\xc3\x06\x00\x00\xc3\x07\x00\x00\xc3\x08\x00\x00\xc3\t\x00\x00\xc3\n\x00\x00\xc3\x0b\x00\x00\xc3\x0c\x00\x00\xc3\r\x00\x00\xd3\x0e\x00\x00\xc3\x0f\x00\x00\xc3\x00\x00\x0c\xbb\x01\x00\x0c\xc3\x02\x00\x0c\xc3\x03\x00\x0c\xc3\x04\x00\x0c\xdb\x00\x00\x00\x00") memory += bytearray(b"\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x04\x00\x00\x00\x88\x13\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x90\x0f\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x04\x00\x00\x00\xb0\x17\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x10\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\xb8\x17\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00J\x04in\xd1;\xabw\x8c6\xb3\xa1\x1b>a(\'\xd0\xdf\'\x04\xa9\x80[\xc0s\x12\xac\xe0\x93\xd0}_w XCG,\xed\x18b\x8d\xc1\x00\xfal\xd8\xd4i\x07(\x12\x1a\xa2^\x8d0B2l$\r\xf4\\\xe8:j\xc6Z\x1b)\x90|@\xbdh\xf2\x1e\xdfzyy\x1bU\x98\xf7\xa9Zs\x05\xce\xef\xb6\xe5\x91u|\xa0C/\xb9e\xf5\xbd\x07\x91MM\xc3=\x8e$\x1b\x18\xc0\xbf53\xb4\xeb\xc4\xd8\xad\x8b\xcci\xd5")
def b2dbe(byte_array): return [int.from_bytes(byte_array[i:i+4], byteorder='big', signed=False) for i in range(0, len(byte_array), 4)]
def b2dle(byte_array): return [int.from_bytes(byte_array[i:i+4], byteorder='little', signed=False) for i in range(0, len(byte_array), 4)]
def load_i64(mem, addr): return struct.unpack('<Q', mem[addr:addr+8])[0]
def store_i64(mem, addr, val): mem[addr:addr+8] = struct.pack('<Q', val)
def load_i32(mem, addr): return struct.unpack('<I', mem[addr:addr+4])[0]
def store_i32(mem, addr, val): mem[addr:addr+4] = struct.pack('<I', val)
def shl_i64(x, k): k = k % 64 return (x << k) & 0xFFFFFFFFFFFFFFFF
def shr_u64(x, k): k = k & 0x3F return (x >> k) & 0xFFFFFFFFFFFFFFFF
def shr_i64(x, k): x = x & 0xFFFFFFFFFFFFFFFF k = k & 0x3F if x >= 0x8000000000000000: x = x - 0x10000000000000000 x = x >> k return x & 0xFFFFFFFFFFFFFFFF
def band_i64(x, y): return (x & y) & 0xFFFFFFFFFFFFFFFF
def bor_i64(x, y): return (x | y) & 0xFFFFFFFFFFFFFFFF
def bxor_i64(x, y): return (x ^ y) & 0xFFFFFFFFFFFFFFFF
def rotl_i64(x, k): x &= 0xFFFFFFFFFFFFFFFF k = k & 0x3F return ((x << k) | (x >> (64 - k))) & 0xFFFFFFFFFFFFFFFF
def rotr_i64(x, k): x &= 0xFFFFFFFFFFFFFFFF k = k & 0x3F return ((x >> k) | (x << (64 - k))) & 0xFFFFFFFFFFFFFFFF
def add_i32(a, b): return (a + b) & 0xFFFFFFFF
loc_4 = load_i64(memory, 4384) loc_5 = struct.unpack('>Q', struct.pack('<Q', loc_4))[0] loc_6 = (load_i64(memory, 4400) * -511) & 0xFFFFFFFFFFFFFFFF loc_7 = (load_i64(memory, 4408) * -511) & 0xFFFFFFFFFFFFFFFF loc_8 = load_i64(memory, 4352) loc_9 = bxor_i64(rotl_i64(loc_8, 39), loc_8) loc_10 = load_i64(memory, 4360) loc_11 = load_i64(memory, 4368) loc_12 = load_i64(memory, 4376) loc_13 = load_i64(memory, 4392) loc_14 = 4416
print(f"loc_4 = 0x{loc_4:016X}") print(f"loc_5 = 0x{loc_5:016X}") print(f"loc_6 = 0x{loc_6:016X}") print(f"loc_7 = 0x{loc_7:016X}") print(f"loc_8 = 0x{loc_8:016X}") print(f"loc_9 = 0x{loc_9:016X}") print(f"loc_10 = 0x{loc_10:016X}") print(f"loc_11 = 0x{loc_11:016X}") print(f"loc_12 = 0x{loc_12:016X}") print(f"loc_13 = 0x{loc_13:016X}")
def case0(loc_4, loc_8, loc_9): loc_16 = band_i64(loc_4, 62) & 0xFFFFFFFFFFFFFFFF loc_17 = bor_i64(loc_16, 1) & 0xFFFFFFFFFFFFFFFF loc_18 = (bxor_i64(rotl_i64(loc_8, (band_i64(shl_i64(-2841402449925361436, loc_16), 36) + 49)), loc_9) + bxor_i64((rotr_i64(shr_u64(4759118972362874166, loc_16), loc_17) - loc_4), -3306012594466711124)) & 0xFFFFFFFFFFFFFFFF loc_17 = rotl_i64((shl_i64(loc_18, bor_i64(band_i64((band_i64(shr_u64(4356822460271002287, loc_16), loc_4) + 28), 62), 1)) + loc_18), bor_i64(band_i64(rotl_i64(-3599654368322586570, loc_17), 14), 1)) & 0xFFFFFFFFFFFFFFFF loc_17 = bxor_i64(shl_i64(loc_17, bor_i64(band_i64(((shr_u64((loc_4 * 742925643253982954), 56) + loc_4) * 47), 62), 1)), loc_17) & 0xFFFFFFFFFFFFFFFF loc_4 = bxor_i64(bxor_i64(rotr_i64(loc_17, bor_i64((shl_i64(-4774275202249070850, loc_16) * loc_4), 1)), rotl_i64(loc_17, 57)), loc_17) & 0xFFFFFFFFFFFFFFFF return loc_4
def case1(loc_4, loc_10): loc_18 = (loc_10 * bor_i64((loc_4 * 180512385711709), 7380094324862376181)) & 0xFFFFFFFFFFFFFFFF loc_16 = band_i64(loc_4, 62) & 0xFFFFFFFFFFFFFFFF loc_17 = bor_i64(loc_16, 1) & 0xFFFFFFFFFFFFFFFF loc_18 = bxor_i64(shr_u64(loc_18, bor_i64(band_i64(rotr_i64((band_i64(shr_u64(1383475029465073410, loc_16), loc_4) - loc_4), loc_17), 62), 1)), loc_18) & 0xFFFFFFFFFFFFFFFF loc_4 = bxor_i64(bxor_i64(rotl_i64(loc_18, bor_i64(shr_u64(((loc_4 * -8341237817759413455) + 5858299301512691920), loc_17), 1)), rotl_i64(loc_18, bor_i64(shr_u64(shl_i64((1003390 - loc_4), loc_17), 15), 1))), loc_18) & 0xFFFFFFFFFFFFFFFF loc_4 = (bor_i64(bor_i64(bor_i64(shl_i64(loc_4, 56), shl_i64(band_i64(loc_4, 65280), 40)), bor_i64(shl_i64(band_i64(loc_4, 16711680), 24), shl_i64(band_i64(loc_4, 4278190080), 8))), bor_i64(bor_i64(band_i64(shr_u64(loc_4, 8), 4278190080), band_i64(shr_u64(loc_4, 24), 16711680)), bor_i64(band_i64(shr_u64(loc_4, 40), 65280), shr_u64(loc_4, 56)))) + band_i64((shl_i64(-6512376135701343602, loc_16) + 9021780107656055508), 4886913136624203210)) & 0xFFFFFFFFFFFFFFFF return loc_4
def case2(loc_4, loc_11): loc_16 = band_i64(loc_4, 62) & 0xFFFFFFFFFFFFFFFF loc_17 = (bxor_i64(bxor_i64(rotr_i64(loc_11, bor_i64(bxor_i64((loc_4 * 52), loc_4), 1)), rotr_i64(loc_11, bxor_i64(shl_i64(1150443877981745306, loc_16), 11))), loc_11) * bor_i64(bxor_i64((shl_i64(-1314727533138742334, loc_16) + loc_4), -1), 1)) & 0xFFFFFFFFFFFFFFFF loc_17 = bxor_i64(bxor_i64(rotl_i64(loc_17, bor_i64(shr_u64(((band_i64(loc_4, 81990) * 48316) + 15360), 11), 1)), rotl_i64(loc_17, 53)), loc_17) & 0xFFFFFFFFFFFFFFFF loc_16 = bxor_i64(bxor_i64(rotl_i64(loc_17, bor_i64(shr_u64((shl_i64(shr_u64(6474080420971629382, loc_16), 11) + 1321443404618737664), 56), 1)), rotl_i64(loc_17, bor_i64((0 - band_i64(loc_4, 14)), 27))), loc_17) & 0xFFFFFFFFFFFFFFFF loc_16 = (loc_16 - shl_i64(loc_16, bor_i64(band_i64((29 - loc_4), 62), 1))) & 0xFFFFFFFFFFFFFFFF loc_4 = bxor_i64(bxor_i64(rotl_i64(loc_16, 63), rotr_i64(loc_16, bor_i64((band_i64((rotr_i64(499867118132017422, bor_i64(loc_4, 1)) - loc_4), loc_4) - loc_4), 1))), loc_16) & 0xFFFFFFFFFFFFFFFF return loc_4
def case3(loc_4, loc_12): loc_16 = band_i64(loc_4, 62) & 0xFFFFFFFFFFFFFFFF loc_17 = bor_i64(loc_16, 1) & 0xFFFFFFFFFFFFFFFF loc_18 = bxor_i64((rotl_i64(loc_12, bor_i64(rotr_i64(rotl_i64(-3680473152504818101, loc_17), loc_17), 1)) + rotl_i64(bxor_i64(band_i64((2924367758 - loc_4), loc_4), -1), 49)), rotl_i64(shr_u64(bor_i64(loc_4, 323389404160168651), loc_17), loc_17)) & 0xFFFFFFFFFFFFFFFF loc_19 = shr_u64(4824063971456177356, loc_16) & 0xFFFFFFFFFFFFFFFF loc_18 = bxor_i64(shr_u64(loc_18, bor_i64(shr_u64(bor_i64(shl_i64(band_i64(loc_19, 1792), 40), shl_i64(band_i64(loc_19, 12582912), 24)), 45), 1)), loc_18) & 0xFFFFFFFFFFFFFFFF loc_18 = bxor_i64(bxor_i64(rotl_i64(loc_18, bor_i64(shr_u64((loc_4 + 565), 5), 1)), rotr_i64(loc_18, bor_i64(shr_u64(shl_i64(-7575533352951092208, loc_16), 56), 1))), loc_18) & 0xFFFFFFFFFFFFFFFF loc_18 = bxor_i64(shl_i64(loc_18, bor_i64(band_i64(loc_4, 46), 17)), loc_18) & 0xFFFFFFFFFFFFFFFF loc_18 = (shl_i64(loc_18, bor_i64(band_i64((bxor_i64(shl_i64(-5156880989505199132, loc_16), -1) * loc_4), 62), 1)) + loc_18) & 0xFFFFFFFFFFFFFFFF loc_4 = (loc_18 - shl_i64(loc_18, bor_i64(band_i64(shl_i64((shr_u64(5172634985249747992, loc_16) - loc_4), loc_17), 62), 1))) & 0xFFFFFFFFFFFFFFFF return loc_4
def case4(loc_4 , loc_5): reg_0 = bxor_i64(rotl_i64(loc_5, bor_i64((loc_4 * 55), 1)), -4619238845427684646) & 0xFFFFFFFFFFFFFFFF loc_4 = bxor_i64((loc_4 + -4616715144965187269), -8569173798327520083) & 0xFFFFFFFFFFFFFFFF loc_4 = ((reg_0 + bor_i64(band_i64(shr_u64(loc_4, 8), 3741319168), bor_i64(bor_i64(shl_i64(loc_4, 56), shl_i64(band_i64(loc_4, 65280), 40)), bor_i64(shl_i64(band_i64(loc_4, 16711680), 24), shl_i64(band_i64(loc_4, 4278190080), 8))))) + 1047094) & 0xFFFFFFFFFFFFFFFF loc_4 = bxor_i64(shl_i64(loc_4, 39), loc_4) & 0xFFFFFFFFFFFFFFFF return loc_4
def case5(loc_4, loc_13): loc_17 = (loc_13 + bxor_i64(loc_4, 36051668767407190)) & 0xFFFFFFFFFFFFFFFF loc_18 = band_i64(loc_4, 62) & 0xFFFFFFFFFFFFFFFF loc_16 = bor_i64(loc_18, 1) & 0xFFFFFFFFFFFFFFFF loc_17 = ((loc_17 - bor_i64(rotl_i64(rotr_i64(-7384894205260299553, loc_16), loc_16), -2299178146027875472)) + shl_i64(loc_17, bor_i64(band_i64(((band_i64(loc_4, 8) * loc_4) + 26), 58), 1))) & 0xFFFFFFFFFFFFFFFF loc_4 = bxor_i64(bxor_i64(loc_17, shl_i64(loc_17, bor_i64(band_i64((shl_i64(shr_i64(-4331792876883399301, loc_18), loc_16) + loc_4), 62), 1))), 5185608289172264064) & 0xFFFFFFFFFFFFFFFF return loc_4
def case6(loc_4, loc_6): loc_16 = band_i64(loc_4, 62) & 0xFFFFFFFFFFFFFFFF loc_17 = bor_i64(loc_16, 1) & 0xFFFFFFFFFFFFFFFF loc_17 = (loc_6 + band_i64(rotr_i64(shr_u64(bor_i64(loc_4, -5056680446052056208), loc_17), loc_17), -7361207612496853418)) & 0xFFFFFFFFFFFFFFFF loc_17 = bxor_i64(bxor_i64(rotr_i64(loc_17, bxor_i64(band_i64(loc_16, (loc_4 + 40)), 13)), rotl_i64(loc_17, bor_i64((bxor_i64((loc_4 + 22), 30) - loc_4), 1))), loc_17) & 0xFFFFFFFFFFFFFFFF loc_4 = (((((-6610288770926234540 - loc_4) * 3123491549520060319) + bxor_i64(loc_17, -1)) + shl_i64((loc_17 + 1), bor_i64(band_i64(bor_i64(shr_u64(2315141858787142786, loc_16), loc_4), 62), 1))) * 8796093022209) & 0xFFFFFFFFFFFFFFFF return loc_4
def case7(loc_4, loc_7): loc_16 = band_i64(loc_4, 62) & 0xFFFFFFFFFFFFFFFF loc_17 = bor_i64(loc_16, 1) & 0xFFFFFFFFFFFFFFFF loc_17 = (loc_7 + band_i64(rotr_i64(shr_u64(bor_i64(loc_4, -5056680446052056208), loc_17), loc_17), -7361207612496853418)) & 0xFFFFFFFFFFFFFFFF loc_17 = bxor_i64(bxor_i64(rotr_i64(loc_17, bxor_i64(band_i64(loc_16, (loc_4 + 40)), 13)), rotl_i64(loc_17, bor_i64((bxor_i64((loc_4 + 22), 30) - loc_4), 1))), loc_17) & 0xFFFFFFFFFFFFFFFF loc_4 = (((((-6610288770926234540 - loc_4) * 3123491549520060319) + bxor_i64(loc_17, -1)) + shl_i64((loc_17 + 1), bor_i64(band_i64(bor_i64(shr_u64(2315141858787142786, loc_16), loc_4), 62), 1))) * 8796093022209) & 0xFFFFFFFFFFFFFFFF return loc_4
def force_brute(): charset = "abcdefghijklmnopqrstuvwxyz0123456789_$!@?<>'" total = len(charset) ** 4 result = "" addr = 4416 print(addr) if case0(b2dle(b"SEKA")[0], loc_8, loc_9) == load_i64(memory, addr): print(b"SEKA".decode()) result += "SEKA" addr = 4424 print(addr) for i in range(32, 127): for j in range(32,127): cand = bytearray(b"I{")+bytearray([i,j]) if case1(b2dle(cand)[0], loc_10) == load_i64(memory, addr): print(cand.decode()) result += cand.decode() addr = 4432 print(addr) target = load_i64(memory, addr) for chars in tqdm(product(charset, repeat=4), total=total, desc="Brute-force", unit="unit"): i, j, k, l = [ord(c) for c in chars] cand = i | (j << 8) | (k << 16) | (l << 24) if case2(cand, loc_11) == target: print(f"{chr(i)}{chr(j)}{chr(k)}{chr(l)}") result += f"{chr(i)}{chr(j)}{chr(k)}{chr(l)}" break addr = 4440 print(addr) target = load_i64(memory, addr) for chars in tqdm(product(charset, repeat=4), total=total, desc="Brute-force", unit="unit"): i, j, k, l = [ord(c) for c in chars] cand = i | (j << 8) | (k << 16) | (l << 24) if case3(cand, loc_12) == target: print(f"{chr(i)}{chr(j)}{chr(k)}{chr(l)}") result += f"{chr(i)}{chr(j)}{chr(k)}{chr(l)}" break addr = 4448 print(addr) target = load_i64(memory, addr) for chars in tqdm(product(charset, repeat=4), total=total, desc="Brute-force", unit="unit"): i, j, k, l = [ord(c) for c in chars] cand = i | (j << 8) | (k << 16) | (l << 24) if case4(cand, loc_5) == target: print(f"{chr(i)}{chr(j)}{chr(k)}{chr(l)}") result += f"{chr(i)}{chr(j)}{chr(k)}{chr(l)}" break addr = 4456 print(addr) target = load_i64(memory, addr) for chars in tqdm(product(charset, repeat=4), total=total, desc="Brute-force", unit="unit"): i, j, k, l = [ord(c) for c in chars] cand = i | (j << 8) | (k << 16) | (l << 24) if case5(cand, loc_13) == target: print(f"{chr(i)}{chr(j)}{chr(k)}{chr(l)}") result += f"{chr(i)}{chr(j)}{chr(k)}{chr(l)}" break addr = 4464 print(addr) target = load_i64(memory, addr) for chars in tqdm(product(charset, repeat=4), total=total, desc="Brute-force", unit="unit"): i, j, k, l = [ord(c) for c in chars] cand = i | (j << 8) | (k << 16) | (l << 24) if case6(cand, loc_6) == target: print(f"{chr(i)}{chr(j)}{chr(k)}{chr(l)}") result += f"{chr(i)}{chr(j)}{chr(k)}{chr(l)}" break addr = 4472 print(addr) target = load_i64(memory, addr) for chars in tqdm(product(charset, repeat=3), total=len(charset)**3, desc="Brute-force", unit="combo"): i, j, k = [ord(c) for c in chars] l = ord("}") cand = i | (j << 8) | (k << 16) | (l << 24) if case7(cand, loc_7) == target: print(f"{chr(i)}{chr(j)}{chr(k)}{chr(l)}") result += f"{chr(i)}{chr(j)}{chr(k)}{chr(l)}" break print() print(result) force_brute()
|