Seite 1 von 1

Programm funktioniert nach NSIS nicht mehr

Verfasst: Samstag 14. Mai 2005, 17:47
von globox
Ich hoffe ich störe nicht mit mein vielen Threads, nur bin ich auch in vielen IRC channels die aber ziemlich unbesucht sind.

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 
Python Script

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()
mfg.
globox

Verfasst: Donnerstag 8. September 2005, 14:49
von mitsuhiko
Kriegst du einen Fehler beim Start?
Oder läd es nicht?

Verfasst: Donnerstag 8. September 2005, 16:18
von Leonidas
Geht es dir um eine EXE die in einer Datei ist (also ohne den ganzen Dateizoo der normalerweise zusätzlich nötig ist)? Dies kann py2exe seit version 0.6.1 schon selbst.