netgenie-srv: Added base64 encode/decode functions to match the c versions.
This commit is contained in:
parent
bb0ba68bbc
commit
3c595ff619
2
NetGuard
2
NetGuard
@ -1 +1 @@
|
||||
Subproject commit dec7cce32ff6942c18c3454291204bca42e7cbca
|
||||
Subproject commit 7db7f0785dd8d70e8caea243fd1409c80346cf17
|
@ -2,6 +2,7 @@ import asyncio
|
||||
import threading
|
||||
from scapy.all import *
|
||||
import argparse
|
||||
import base64
|
||||
|
||||
DEBUG=False
|
||||
|
||||
@ -139,6 +140,19 @@ def connectIO(inaddr='127.0.0.1', inport=8001, outaddr='127.0.0.1', outport=8002
|
||||
return insock, outsock
|
||||
|
||||
|
||||
def base64_decode_with_plus(data):
|
||||
data = data.rstrip('+')
|
||||
padding = 4 - len(data) % 4
|
||||
data += '=' * padding
|
||||
return base64.b64decode(data)
|
||||
|
||||
def base64_encode_with_plus(data):
|
||||
encoded_data = base64.b64encode(data).rstrip(b'=')
|
||||
padding = (4 - len(encoded_data) % 4) % 4
|
||||
encoded_data += b'+' * padding
|
||||
return encoded_data.decode('ascii')
|
||||
|
||||
|
||||
def parseArgs():
|
||||
args = argparse.ArgumentParser()
|
||||
# The bridge ip and port
|
||||
|
Loading…
x
Reference in New Issue
Block a user