# Path: Peach/xmlrpc.py
# NOT_FOUND = 8001
# FAILURE = 8002
#     NOT_FOUND = 8001
#     FAILURE = 8002
# def withRequest(f):
#     def __init__(self, resource, *args):
#     def run(self, *args):
#     def __init__(self, allowNone=False, useDateTime=False):
#     def __setattr__(self, name, value):
#     def putSubHandler(self, prefix, handler):
#     def getSubHandler(self, prefix):
#     def getSubHandlerPrefixes(self):
#     def render_POST(self, request):
#     def _cbRender(self, result, request, responseFailed=None):
#     def _ebRender(self, failure):
#     def lookupProcedure(self, procedurePath):
#     def listProcedures(self):
# class NoSuchFunction(Fault):
# class Handler:
# class XMLRPC(resource.Resource):


import os
import re
import sys
import time
import uuid
import socket
import atexit
import logging
import subprocess
    import win32process
    import win32con
    import cPickle as pickle
    import pickle
    from urlparse import urlparse
    from urllib.parse import urlparse
    from xmlrpclib import ServerProxy
    from xmlrpclib import Error
    from xmlrpc.client import ServerProxy
    from xmlrpc.client import Error
from Peach import xmlrpc
from twisted.web import server
from Peach.Publishers import *
from Peach.Engine.common import *
from Peach.Utilities.common import *
from Peach.Agent import *
        from twisted.internet import reactor
        self.imports = None


class Agent(object):
    """A remote or local Agent that listens on a named pipe.
    Each agent can only be connected to by a single Peach Fuzzer.
    """

    def __init__(self, password=None, port=9000):
        """
        Creates and Agent instance and attempts to connect to the AgentMaster.
        If connection works the Client Hello message is sent.

        @type	password: string
        @param	password: Password to use
        """

        agent = AgentXmlRpc()
        agent._password = password
        agent._monitors = []
        agent._publishers = {}
        agent._id = None
        reactor.listenTCP(port, server.Site(agent))
        if agent._password is not None:
            print("\n[Agent] Listening on [%s] with password [%s]\n" % (port, agent._password))
        else:
            print("\n[Agent] Listening on [%s] with no password\n" % port)
        reactor.run()



# Path: Peach/xmlrpc.py
# NOT_FOUND = 8001
# FAILURE = 8002
#     NOT_FOUND = 8001
#     FAILURE = 8002
# def withRequest(f):
#     def __init__(self, resource, *args):
#     def run(self, *args):
#     def __init__(self, allowNone=False, useDateTime=False):
#     def __setattr__(self, name, value):
#     def putSubHandler(self, prefix, handler):
#     def getSubHandler(self, prefix):
#     def getSubHandlerPrefixes(self):
#     def render_POST(self, request):
#     def _cbRender(self, result, request, responseFailed=None):
#     def _ebRender(self, failure):
#     def lookupProcedure(self, procedurePath):
#     def listProcedures(self):
# class NoSuchFunction(Fault):
# class Handler:
# class XMLRPC(resource.Resource):


# Path: Peach/agent.py
import os
import re
import sys
import time
import uuid
import socket
import atexit
import logging
import subprocess
    import win32process
    import win32con
    import cPickle as pickle
    import pickle
    from urlparse import urlparse
    from urllib.parse import urlparse
    from xmlrpclib import ServerProxy
    from xmlrpclib import Error
    from xmlrpc.client import ServerProxy
    from xmlrpc.client import Error
from Peach import xmlrpc
from twisted.web import server
from Peach.Publishers import *
from Peach.Engine.common import *
from Peach.Utilities.common import *
from Peach.Agent import *
        from twisted.internet import reactor

        self.imports = None


class Agent(object):
    """A remote or local Agent that listens on a named pipe.
    Each agent can only be connected to by a single Peach Fuzzer.
    """

    def __init__(self, password=None, port=9000):
        """
        Creates and Agent instance and attempts to connect to the AgentMaster.
        If connection works the Client Hello message is sent.

        @type	password: string
        @param	password: Password to use
        """

        agent = AgentXmlRpc()
        agent._password = password
        agent._monitors = []
        agent._publishers = {}
        agent._id = None
        reactor.listenTCP(port, server.Site(agent))
        if agent._password is not None:
            print("\n[Agent] Listening on [%s] with password [%s]\n" % (port, agent._password))
        else:
            print("\n[Agent] Listening on [%s] with no password\n" % port)
        reactor.run()



class AgentXmlRpc(xmlrpc.XMLRPC):