Naja hier mal zu meinen Problem.
Also ich habe hier mein Portscanner Script und das habe ich mit py2exe compiliert. Das Programm funktioniert nach py2exe (als exe natürlich) wunderbar.
So nun jage ich es mit diesem Script durch NSIS, und das Programm macht garnichtsmehr.
NSIS Script
Code: Alles auswählen
!define py2exeOutputDir 'D:\Coding\Python\dist'
!define exe 'port.exe'
!define compressor 'lzma' ;one of 'zlib', 'bzip2', 'lzma'
!define icon 'D:\Coding\Python\dist\icon.ico'
!ifdef compressor
SetCompressor ${compressor}
!else
SetCompress Off
!endif
Name ${exe}
OutFile ${exe}
SilentInstall silent
!ifdef icon
Icon ${icon}
!endif
Section
InitPluginsDir
SetOutPath '$PLUGINSDIR'
File /r '${py2exeOutputDir}\*.*'
SetOutPath '$EXEDIR' ; uncomment this line to start the exe in the PLUGINSDIR
nsExec::Exec $PLUGINSDIR\${exe}
SectionEnd
Code: Alles auswählen
"""
GloBoX - Simple Portscanner
"""
import sys
import time
from socket import *
usage = '''
GloBoX - Simple Portscanner
----------------
usage: port [host] [startport] [stopport]
''' % sys.argv[0]
gbx = '''
GloBoX - Simple Portscanner
---------------
'''
def pscan(host, startport, stopport):
stopport_ = int(stopport)
startport_ = int(startport)
print '[-] Beginning scan on %s' % host
for currport in range(startport_, stopport_+1):
try:
sock = socket(AF_INET, SOCK_STREAM)
sock.settimeout(2)
sock.connect((host, currport))
sock.shutdown(SHUT_RDWR)
except Exception, e:
print '[-] Port: %s; Closed! (%s)' % (currport, e)
else:
print '[-] Port: %s; Open!' % currport
print '[-] Scanned from %s to %s on %s' % (startport, stopport, host)
def start():
args = sys.argv[1:]
if len(args) == 3:
print gbx
pscan(sys.argv[1], sys.argv[2], sys.argv[3])
else:
print usage
if __name__ == '__main__':
start()
globox