Ejemplo n.º 1
0
def dryrun_iw3mp():
    from EHF.libs import ehfprocess
    ph = ehfprocess.ProcessHelper()
    ph.findWindowByClass("CoD4")
    ph.openProcess()
    ms = scanner.MemoryScanner(ph.hProcess, 0x00401000, 0x00700000,
                               "EHF.applications.COD4.config.PatternFinderRepo")
    ms.run()
    print ms.valuesToString()
    from EHF.applications.COD4 import datastruct
    refDefInstance = datastruct.RefDef()
    ms._rpm(ms.values["CG"]+0x492c8, refDefInstance, datastruct.sizeof(refDefInstance))
    print "0x%X"%(ms.values["CG"]+0x492c8), refDefInstance.width, refDefInstance.height
Ejemplo n.º 2
0
def dryrun_iw3mp():
    from EHF.libs import ehfprocess
    ph = ehfprocess.ProcessHelper()
    ph.findWindowByClass("CoD4")
    ph.openProcess()
    ms = scanner.MemoryScanner(
        ph.hProcess, 0x00401000, 0x00700000,
        "EHF.applications.COD4.config.PatternFinderRepo")
    ms.run()
    print ms.valuesToString()
    from EHF.applications.COD4 import datastruct
    refDefInstance = datastruct.RefDef()
    ms._rpm(ms.values["CG"] + 0x492c8, refDefInstance,
            datastruct.sizeof(refDefInstance))
    print "0x%X" % (ms.values["CG"] +
                    0x492c8), refDefInstance.width, refDefInstance.height
Ejemplo n.º 3
0
    def _run(self):
        """
        delayed init and then -
        do the reading!!

        example:
        refDefInstance = datastruct.RefDef()
        ms._rpm(ms.values["CG"]+0x492c8, refDefInstance, datastruct.sizeof(refDefInstance))
        print "0x%X"%(ms.values["CG"]+0x492c8), refDefInstance.width, refDefInstance.height
    
         "refdef_width"   :  0,
         "refdef_height"  :  0,
         "fov_x"          :  0.0,
         "fov_y"          :  0.0,
         "viewOrigin"     :  (0.0, 0.0, 0.0),
         "viewAxis"       :  (0.0, 0.0, 0.0),
         "viewAngle"      :  (0.0, 0.0, 0.0),
         "players"        : [Player() for i in range(datastruct.PLAYERMAX)],
         "clientInfos"    : [ClientInfo() for i in range(datastruct.PLAYERMAX)]
         
        """
        self.delayedInit()
        
        _vars = self._appAttr["AppInfo"].vars
        mr = self._appAttr["MemoryReader"]
        mr._rpm(self.refDefAddress,      self.refDef, datastruct.sizeof(self.refDef))
        mr._rpm(self.cgAddress,          self.cg,     datastruct.sizeof(self.cg))
        mr._rpm(self.cgsAddress,         self.cgs,    datastruct.sizeof(self.cgs))
        mr._rpm(self.entityArrayAddress,     self.entityArray,     datastruct.sizeof(self.entityArray))
        mr._rpm(self.clientInfoArrayAddress, self.clientInfoArray, datastruct.sizeof(self.clientInfoArray))
        mr._rpm(self.isInGameAddress,    self.isInGame, datastruct.sizeof(self.isInGame))
        
        _vars["refdef_width"] = self.refDef.width
        _vars["refdef_height"] = self.refDef.height
        _vars["fov_x"] = self.refDef.fov_x
        _vars["fov_y"] = self.refDef.fov_y
        _vars["viewOrigin"] = self.refDef.viewOrigin
        _vars["viewAxis"] = self.refDef.viewAxis
        _vars["viewAngle"] = self.refDef.refDefViewAngles
        
        for i in range(datastruct.PLAYERMAX):
            _vars["players"][i].setValueFromEnCl(self.entityArray.arr[i], self.clientInfoArray.arr[i])
        
        _vars["myPlayer"] = _vars["players"][0]
        _vars["myTeam"] = _vars["myPlayer"].team