-
Notifications
You must be signed in to change notification settings - Fork 3
/
xlog_v02.py
121 lines (95 loc) · 2.86 KB
/
xlog_v02.py
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
#!usr/bin/env python
#-*- coding:utf-8 -*-
"""
@price: 1000€
@author: t.me/xtekky
@file: xlog.py
@version: Latest Xlog v 02 - preview
"""
import binascii
import codecs
import ctypes
class Xlog:
def encode(self, data):
# removed from preview
return encoded
def decode(self, data: hex):
# removed from preview
return decoded
def __calculate(self, input, times):
# removed from preview
def __xor(self, x, y):
# removed from preview
return format(
(
int(
response
, 2
)
)
, 'x'
)
def __handle(self, hex):
# removed from preview
def __shift(self, point):
# removed from preview
def __calcrev(self, data, num):
s108 = 0xbfffe920 << 0 & 0xFFFFFFFF
s136 = 0x0
s140 = int(data[0:8], 16) << 0 & 0xFFFFFFFF
s144 = int(data[8:16], 16) << 0 & 0xFFFFFFFF
for i in range(num):
r2 = s108
r6 = s136
r4 = s144
r5 = r6 & 3 & 0xFFFFFFFF
r0 = r4 << 4 & 0xFFFFFFFF
r2 = self.getShifting(r2 + (r5 << 2) & 0xFFFFFFFF)
r0 = ((r0 ^ (self.rshift(r4, 5))) + r4) << 0
r2 = ctypes.c_int((r2 + r6) << 0 ^ 0).value
r0 = r0 ^ r2
s140 = ctypes.c_int((s140 + r0) << 0 ^ 0).value
s136 = ctypes.c_int((s136 - 0x61c88647) << 0 ^ 0).value
r5 = s108
r4 = s140
r2 = s140
r0 = s140
r6 = s136
s = format(self.rshift((r6 >> 0xb), 0), 'b')
if len(s) < 3:
s = "0"
else:
s = s[len(s) - 2:]
r6 = int(s, 2)
r0 = ctypes.c_int(((self.rshift(r2, 5) ^ r0 << 4) + r4) << 0).value
r5 = self.getShifting(r5 + (r6 << 2))
r2 = ctypes.c_int((s136 + r5) << 0 ^ 0).value
r0 = r0 ^ r2
s144 = ctypes.c_int((s144 + r0) << 0 ^ 0).value
str140 = format(self.rshift(s140, 0), 'x')
str144 = format(self.rshift(s144, 0), 'x')
if len(str140) < 8:
count = 8 - len(str140)
for i in range(count):
str140 = "0" + str140
if len(str144) < 8:
count = 8 - len(str144)
for i in range(count):
str144 = "0" + str144
return str140 + str144
def __reverse(self, hex: str):
return hex[6:8] + hex[4:6] + hex[2:4] + hex[0:2]
def __rshift(self, val, n):
return (val % 0x100000000) >> n
def __hxstr(self, num: int):
s = format(num, 'x')
if len(s) < 2:
return '0' + s
return s
def __fch(self, xlog):
xlog = xlog[0:len(xlog) - 21]
fch_str = binascii.crc32(xlog.encode("utf-8"))
fch_str = str(fch_str)
for i in range(len(fch_str), 10):
fch_str = '0' + fch_str
return fch_str