Commit a0d0a3c2 authored by wang's avatar wang

加密函数 转 py

parent 4635ef0b
No preview for this file type
...@@ -21,7 +21,7 @@ class PxUtils(): ...@@ -21,7 +21,7 @@ class PxUtils():
fv = self.ie(self.encode(sts), 10) fv = self.ie(self.encode(sts), 10)
print(fv) print(fv)
t3 = self.Ev(fv, len(BasePayload), uuid) t3 = self.Ev(fv, len(BasePayload), uuid)
print(t3) return self.Fa(fv, BasePayload, t3)
def ie(self, t, e): def ie(self, t, e):
n = bytearray() n = bytearray()
for i in range(len(t)): for i in range(len(t)):
...@@ -42,29 +42,44 @@ class PxUtils(): ...@@ -42,29 +42,44 @@ class PxUtils():
a = -1 a = -1
for i in range(len(t)): for i in range(len(t)):
l = math.floor(i / len(r)+ 1) l = math.floor(i / len(r)+ 1)
# print(l)
if i >= len(r): if i >= len(r):
c = i % len(r) c = i % len(r)
else: else:
c = i c = i
u = ord(r[c]) * ord(r[l]) u = ord(r[c]) * ord(r[l])
# print(i, l, c, u)
if u > a: if u > a:
a = u a = u
for f in range(len(t)): for f in range(len(t)):
s = math.floor(f / len(r)) + 1 s = math.floor(f / len(r)) + 1
d = f % len(r) d = f % len(r)
p = ord(r[d]) * ord(r[s]) p = ord(r[d]) * ord(r[s])
# print(f, s, d, p, p > e, wv(p, 0, a, 0, e-1))
if p >= e: if p >= e:
p = wv(p, 0,a,0,e-1) p = wv(p, 0,a,0,e-1)
while p in o: while p in o:
p += 1 p += 1
o.append(p) o.append(p)
sorted(o) o = sorted(o)
return o return o
def Fa(self, t, e, n):
r = ''
o = 0
a = t
for i in range(len(t)):
print(i,o,n[i], n[i] - i - 1, e[o: n[i] - i - 1], a[i], e[o: n[i] - i - 1]+a[i])
r += e[o: n[i]-i-i] + a[i]
o = n[i] - i - 1
print(e[o:])
r += e[o:]
return r
if __name__ == '__main__': if __name__ == '__main__':
p = PxUtils() p = PxUtils()
payload = '[{"t":"PX12095","d":{"PX11645":"https://www.flyfrontier.com/","PX12207":0,"PX12458":"MacIntel","PX11902":0,"PX11560":4769,"PX12248":3600,"PX11385":1700553697276,"PX12280":1700553697286,"PX11496":"31fafcb0-8844-11ee-8d49-97ed9bc8f96f","PX12564":null,"PX12565":-1,"PX11379":false}}]' payload = '[{"t":"PX12095","d":{"PX11645":"https://www.flyfrontier.com/","PX12207":0,"PX12458":"MacIntel","PX11902":0,"PX11560":4769,"PX12248":3600,"PX11385":1700553697276,"PX12280":1700553697286,"PX11496":"31fafcb0-8844-11ee-8d49-97ed9bc8f96f","PX12564":null,"PX12565":-1,"PX11379":false}}]'
uuid = '31fafcb0-8844-11ee-8d49-97ed9bc8f96f' uuid = '31fafcb0-8844-11ee-8d49-97ed9bc8f96f'
p.encode_payload(payload, uuid) print(p.encode_payload(payload, uuid))
\ No newline at end of file \ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment