mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-01 15:48:21 +00:00
Make one more llXorBase64[StringsCorrect] case computable.
When the input string is at most 1 byte (2 base64 characters), the result is computable because the first byte is always zero.
This commit is contained in:
parent
b8985adca9
commit
7c2b76949e
1 changed files with 14 additions and 8 deletions
|
@ -1800,11 +1800,14 @@ def llXorBase64(s, xor):
|
|||
if L2 == 0:
|
||||
# The input xor string starts with zero or one valid Base64 characters.
|
||||
# This produces garbage bytes (the first byte is zero though).
|
||||
# We don't produce a result in this case.
|
||||
raise ELSLCantCompute
|
||||
if L1 > 2:
|
||||
# We don't produce a result in this case.
|
||||
raise ELSLCantCompute
|
||||
L2 = 2
|
||||
xor = u'AA'
|
||||
|
||||
s = b64decode(s + u'='*(-L1 & 3))
|
||||
xor = b64decode(xor + u'='*(-L2 & 3))
|
||||
s = b64decode(s + u'=' * (-L1 & 3))
|
||||
xor = b64decode(xor + u'=' * (-L2 & 3))
|
||||
L2 = len(xor)
|
||||
|
||||
i = 0
|
||||
|
@ -1887,11 +1890,14 @@ def llXorBase64StringsCorrect(s, xor):
|
|||
if L2 == 0:
|
||||
# The input xor string starts with zero or one valid Base64 characters.
|
||||
# This produces garbage bytes (the first byte is zero though).
|
||||
# We don't produce a result in this case.
|
||||
raise ELSLCantCompute
|
||||
if L1 > 2:
|
||||
# We don't produce a result in this case.
|
||||
raise ELSLCantCompute
|
||||
L2 = 2
|
||||
xor = u'AA'
|
||||
|
||||
s = b64decode(s + u'='*(-L1 & 3))
|
||||
xor = b64decode(xor + u'='*(-L2 & 3)) + b'\x00'
|
||||
s = b64decode(s + u'=' * (-L1 & 3))
|
||||
xor = b64decode(xor + u'=' * (-L2 & 3)) + b'\x00'
|
||||
|
||||
i = 0
|
||||
ret = b''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue