本文整理汇总了Python中memory.Memory.write_dword方法的典型用法代码示例。如果您正苦于以下问题:Python Memory.write_dword方法的具体用法?Python Memory.write_dword怎么用?Python Memory.write_dword使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类memory.Memory
的用法示例。
在下文中一共展示了Memory.write_dword方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Device
# 需要导入模块: from memory import Memory [as 别名]
# 或者: from memory.Memory import write_dword [as 别名]
#.........这里部分代码省略.........
setattr(self, name, self.block_at(name, offset, t))
self.blocks += [getattr(self, name)]
def map_memory(self):
print "[+] mapping device memory window"
self.mem = Memory(self)
for i in tg3_mem:
self.mem.map_struct(*i)
def reg_dump(self):
for i in range(len(self.reg)):
a = i * 4
if 0 == (a % 0x10):
print
print "0x%04x: " % a,
print "%08x" % self.reg[i],
def reg_save(self):
buf = (c_uint32 * len(self.reg))()
for i in range(len(self.reg)):
buf[i] = self.reg[i]
return buf
def reset(self, cold = None, quick = False, pcie = False):
if cold == None:
cold = not hasattr(self, "drv")
magic = self.mem.read_dword(0xb50)
print "[+] found %08x at offset 0xb50," % magic,
if not cold:
print "writing 0x4b657654"
self.mem.write_dword(0xb50, 0x4b657654)
else:
print "clearing"
self.mem.write_dword(0xb50, 0)
if not cold:
try:
self.nvram.acquire_lock()
except:
print "\n[-] failed to acquire nvram lock"
self.rxcpu.halt()
self.nvram.reset()
self.nvram.acquire_lock()
print "[+] clearing fast boot program counter register,",
print "was %08x" % self.grc.fastboot_pc.word
self.grc.fastboot_pc.word = 0
if not pcie:
if self.grc.misc_config.disable_grc_reset_on_pcie_block == 0:
print "[+] disabling grc reset on pcie block"
self.grc.misc_config.disable_grc_reset_on_pcie_block = 1
if not cold:
if self.grc.misc_config.gphy_keep_power_during_reset == 0:
print "[+] enabling gphy power during reset"
self.grc.misc_config.gphy_keep_power_during_reset = 1
print "[+] resetting core clocks"
self.grc.misc_config.grc_reset = 1
if quick:
self.init()
return