Esempio n. 1
0
    def run(self):
        try:
            pid, stdior = mexec(
                self.data, self.argv,
                self.redirect_stdio, True
            )
        except:
            return False

        self.pid = pid
        self.stdin, self.stdout, self.stderr = stdior

        if not self.redirect_stdio:
            return True

        if self.no_stdin:
            self.stdin.close()
            self.stdin = None

        if self.no_stdor:
            self.stdout.close()
            self.stdout = None
            self.stderr.close()
            self.stderr = None

        return True
Esempio n. 2
0
    def execute(self, complete_cb, write_cb=True):
        ''' Execute process '''

        if complete_cb:
            self.complete_cb = nowait(complete_cb)

        if write_cb and write_cb is not True:
            self.write_cb = nowait(write_cb)
            self.terminate = True

        try:
            hProcess, pStdin, pStdout = mexec(self.cmdline, self.raw_pe,
                                              write_cb is not None,
                                              self.hidden, self.dupHandle)
        except Exception, e:
            self.write_cb('[!] memexec failed: {}\n'.format(e))
            return False
Esempio n. 3
0
    def run(self):
        pid, stdior = mexec(
            self.data, self.argv,
            self.redirect_stdio, True
        )

        self.pid = pid
        self.stdin, self.stdout, self.stderr = stdior

        if self.no_stdin:
            self.stdin.close()
            self.stdin = None

        if self.no_stdor:
            self.stdout.close()
            self.stdout = None
            self.stderr.close()
            self.stderr = None