Skip to content

Commit

Permalink
python3 scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
jagt committed May 9, 2021
1 parent be9d087 commit d9d4b74
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ build
etc/clumsy.aps
obj_vs
obj_ninja
obj_gmake
2 changes: 1 addition & 1 deletion genie.lua
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ solution('clumsy')
'-Wno-missing-field-initializers',
'--std=c99'
})
objdir('obj_ninja')
objdir('obj_'..MINGW_ACTION)

configuration("vs*")
defines({"_CRT_SECURE_NO_WARNINGS"})
Expand Down
10 changes: 6 additions & 4 deletions scripts/send_udp_nums.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
from time import sleep
from sys import argv, exit

NCAT_EXE = r'C:\Bin\nmap-7.91\ncat'

if __name__ == '__main__':
parser = argparse.ArgumentParser(description='ncat num sender')
parser.add_argument('host', type=str)
Expand All @@ -18,17 +20,17 @@
parser.add_argument('--tcp', help='use tcp instead of udp', action='store_true')
args = parser.parse_args()

cmd = ['ncat', '-u', '-C', args.host, args.port]
cmd = [NCAT_EXE, '-u', '-C', args.host, args.port]
if args.tcp:
cmd.remove('-u')
ncat = subprocess.Popen(cmd, stdin=subprocess.PIPE)

cnt = 1
while True: # send till die
ncat.stdin.write('%s\r\n' % ('-' * (1 + (cnt % 8))))
#ncat.stdin.write('%d\r\n' % (cnt % 100))
ncat.stdin.write( ('%s\r\n' % ('-' * (1 + (cnt % 8)))).encode() )
ncat.stdin.flush()
cnt += 1
print cnt
print(cnt)
if not args.nosleep:
sleep(args.sleep/1000.0)

Expand Down

0 comments on commit d9d4b74

Please sign in to comment.