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
| import binascii
def _rol(val, bits, bit_size): return (val << bits % bit_size) & (2 ** bit_size - 1) | \ ((val & (2 ** bit_size - 1)) >> (bit_size - (bits % bit_size)))
def _ror(val, bits, bit_size): return ((val & (2 ** bit_size - 1)) >> bits % bit_size) | \ (val << (bit_size - (bits % bit_size)) & (2 ** bit_size - 1))
__ROR4__ = lambda val, bits: _ror(val, bits, 32) __ROR8__ = lambda val, bits: _ror(val, bits, 64) __ROL4__ = lambda val, bits: _rol(val, bits, 32) __ROL8__ = lambda val, bits: _rol(val, bits, 64)
def f0(rcx, r9, r8): rcx = ((1 << 64) - rcx - 1) return (rcx, r9, r8)
def f1(rcx, r9, r8): rcx = __ROR8__(rcx, 0x11) return (rcx, r9, r8)
def f2(rcx, r9, r8): rcx = __ROL8__(rcx, 0x17) return (rcx, r9, r8)
def f3(rcx, r9, r8): r8 = ((1 << 64) - r8 - 1) return (rcx, r9, r8)
def f4(rcx, r9, r8): r8 = __ROR8__(r8, 0x11) return (rcx, r9, r8)
def f5(rcx, r9, r8): r8 = __ROL8__(r8, 0x17) return (rcx, r9, r8)
def f6(rcx, r9, r8): r9 = ((1 << 64) - r9 - 1) return (rcx, r9, r8)
def f7(rcx, r9, r8): r9 = __ROR8__(r9, 0x11) return (rcx, r9, r8)
def f8(rcx, r9, r8): r9 = __ROL8__(r9, 0x17) return (rcx, r9, r8)
def f9(rcx, r9, r8): rcx -= r8 rcx &= 0xffffffffffffffff return (rcx, r9, r8)
def f10(rcx, r9, r8): rcx += r8 rcx &= 0xffffffffffffffff return (rcx, r9, r8)
def f11(rcx, r9, r8): rcx ^= r8 return (rcx, r9, r8)
def f12(rcx, r9, r8): r8, rcx = rcx, r8 return (rcx, r9, r8)
def f13(rcx, r9, r8): rcx -= r9 rcx &= 0xffffffffffffffff return (rcx, r9, r8)
def f14(rcx, r9, r8): rcx += r9 rcx &= 0xffffffffffffffff return (rcx, r9, r8)
def f15(rcx, r9, r8): rcx ^= r9 return (rcx, r9, r8)
def f16(rcx, r9, r8): rcx, r9 = r9, rcx return (rcx, r9, r8)
def f17(rcx, r9, r8): r8 -= rcx r8 &= 0xffffffffffffffff return (rcx, r9, r8)
def f18(rcx, r9, r8): r8 += rcx r8 &= 0xffffffffffffffff return (rcx, r9, r8)
def f19(rcx, r9, r8): r8 ^= rcx return (rcx, r9, r8)
def f20(rcx, r9, r8): r8, rcx = rcx, r8 return (rcx, r9, r8)
def f21(rcx, r9, r8): r8 -= r9 r8 &= 0xffffffffffffffff return (rcx, r9, r8)
def f22(rcx, r9, r8): r8 += r9 r8 &= 0xffffffffffffffff return (rcx, r9, r8)
def f23(rcx, r9, r8): r8 ^= r9 return (rcx, r9, r8)
def f24(rcx, r9, r8): r8, r9 = r9, r8 return (rcx, r9, r8)
def f25(rcx, r9, r8): r9 -= rcx r9 &= 0xffffffffffffffff return (rcx, r9, r8)
def f26(rcx, r9, r8): r9 += rcx r9 &= 0xffffffffffffffff return (rcx, r9, r8)
def f27(rcx, r9, r8): r9 ^= rcx return (rcx, r9, r8)
def f28(rcx, r9, r8): r9, rcx = rcx, r9 return (rcx, r9, r8)
def f29(rcx, r9, r8): r9 -= r8 r9 &= 0xffffffffffffffff return (rcx, r9, r8)
def f30(rcx, r9, r8): r9 += r8 r9 &= 0xffffffffffffffff return (rcx, r9, r8)
def f31(rcx, r9, r8): r9 ^= r8 return (rcx, r9, r8)
def f32(rcx, r9, r8): r9, r8 = r8, r9 return (rcx, r9, r8) func = [f0 ,f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, f31, f32]
i = 0 j = 0 dic = {} dic[0] = 0 while True: i += 1 j = 34 * j + 17 - 33 * ((0xF83E0F83E0F83E1 * (34 * j + 17) >> 64) >> 1) dic[i] = j if(i == 130): break
a = 13154447211896390350 b = 13431592849769172675 c = 8204214703590688774
i = 130 j = 32 while True: (a, c, b) = func[dic[i]](a, c, b) if(i == 0): break i-=1
print(a, c, b) print(binascii.unhexlify(hex(a)[2:])[::-1]) print(binascii.unhexlify(hex(b)[2:])[::-1])
|