Skip to content
This repository has been archived by the owner on Aug 29, 2021. It is now read-only.

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
xhlove committed Jul 30, 2021
1 parent 6785994 commit c0cb3e4
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions wvguesser/mainv2.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
client.connect(('127.0.0.1', port))


def handle_exit():
def handle_exit(signum, frame):
p.kill()


Expand Down Expand Up @@ -54,15 +54,13 @@ def run(hex_session_key: str):
while j < 8:
buf[offset] = j
st = binascii.b2a_hex(bytes(buf)).decode('utf-8')
# print(st)
val = guessInput(st)
# print(val)
sub = int(val[len(val) - bt * 2 - 2:len(val) - bt * 2], 16)
got = (sub >> (offs * 2)) & 3
gtail = val[len(hex_session_key) - bt * 2:len(hex_session_key) + bt * 2]
if got == desired and gtail == destail:
if offset % 16 == 2:
print(val)
# if offset % 16 == 2:
# print(val)
break
j += 1
if j == 8:
Expand All @@ -82,7 +80,7 @@ def run(hex_session_key: str):
else:
offset += 1
print(f'==> time used {time.time() - ts:.2f}s')
print("Output", buf)
# print("Output", buf)
st = binascii.b2a_hex(bytes(buf)).decode('utf-8')
outp = getDeoaep(st)
print(outp)
Expand Down

0 comments on commit c0cb3e4

Please sign in to comment.