mirror of
https://github.com/ShaYmez/pYSFReflector.git
synced 2024-11-24 16:58:46 -05:00
Update YSFReflector
Added checking for invalid characters in gw/src/dst fields
This commit is contained in:
parent
22e9f25864
commit
2737dc1d58
@ -525,12 +525,12 @@ def sanitize_msg(data):
|
|||||||
|
|
||||||
if ((data[0:4] == b"YSFP") and (len(data) == 14)):
|
if ((data[0:4] == b"YSFP") and (len(data) == 14)):
|
||||||
for i in range(10):
|
for i in range(10):
|
||||||
if (bya_msg[i+4] == 0):
|
if ((bya_msg[i+4] < 32) or (bya_msg[i+4] > 126)):
|
||||||
bya_msg[i+4] = 32
|
bya_msg[i+4] = 32
|
||||||
|
|
||||||
if ((data[0:4] == b"YSFD") and (len(data) == 155)):
|
if ((data[0:4] == b"YSFD") and (len(data) == 155)):
|
||||||
for i in range(30):
|
for i in range(30):
|
||||||
if (bya_msg[i+4] == 0):
|
if ((bya_msg[i+4] < 32) or (bya_msg[i+4] > 126)):
|
||||||
bya_msg[i+4] = 32
|
bya_msg[i+4] = 32
|
||||||
|
|
||||||
return(bytes(bya_msg))
|
return(bytes(bya_msg))
|
||||||
@ -870,7 +870,7 @@ def hex_dump(data):
|
|||||||
|
|
||||||
######## main ########
|
######## main ########
|
||||||
|
|
||||||
version = '20210606'
|
version = '20220203'
|
||||||
|
|
||||||
if (len(sys.argv) != 2):
|
if (len(sys.argv) != 2):
|
||||||
print('Invalid Number of Arguments')
|
print('Invalid Number of Arguments')
|
||||||
|
Loading…
Reference in New Issue
Block a user