当前位置: 首页>>代码示例>>Python>>正文


Python Block.next_id方法代码示例

本文整理汇总了Python中block.Block.next_id方法的典型用法代码示例。如果您正苦于以下问题:Python Block.next_id方法的具体用法?Python Block.next_id怎么用?Python Block.next_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在block.Block的用法示例。


在下文中一共展示了Block.next_id方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: make_revrefs

# 需要导入模块: from block import Block [as 别名]
# 或者: from block.Block import next_id [as 别名]
def make_revrefs():
	revrefs = {}
	for id in range(1, Block.next_id()):
		revrefs[id] = []
	for id in range(1, Block.next_id()):
		block = Block.by_id(id)
		if not block.has_return():
			revrefs[block.passthru().id].append(id)
			if block.branch():
				revrefs[block.branch().id].append(id)
	return revrefs
开发者ID:maczniak,项目名称:game_reverse_engineering,代码行数:13,代码来源:code_blocker.py

示例2: split_segments

# 需要导入模块: from block import Block [as 别名]
# 或者: from block.Block import next_id [as 别名]
def split_segments():
	blocks_to_identify = []

	for id in range(1, Block.next_id()):
		block = Block.by_id(id)
		if block.branch():
			blocks_to_identify.append(id)

	#segments, included_in, members = identify_structure(blocks_to_identify)
	return _identify_structure(blocks_to_identify)
开发者ID:maczniak,项目名称:game_reverse_engineering,代码行数:12,代码来源:code_blocker.py

示例3: open

# 需要导入模块: from block import Block [as 别名]
# 或者: from block.Block import next_id [as 别名]
try:
	import pygraphviz
except ImportError:
	DEBUG_GRAPHVIZ = False

f = open('GameMenuRoutine.asm', 'r')
lines = f.readlines()

# part i - split code blocks

code_blocker.split_blocks(lines)
revrefs = code_blocker.make_revrefs()

if 'DEBUG_BLOCK' in globals() and DEBUG_BLOCK:
	for id in range(1, Block.next_id()):
		block = Block.by_id(id)
		print(block.pp())

if 'DEBUG_BLOCK_GRAPHVIZ' in globals() and DEBUG_BLOCK_GRAPHVIZ:
	g = pygraphviz.AGraph()
	
	for id in range(1, Block.next_id()):
		block = Block.by_id(id)
		if block.has_return():
			g.add_node(block.gv())
		else:
			g.add_edge(block.gv(), block.passthru().gv(), dir = 'forward')
		if block.branch():
			g.add_edge(block.gv(), block.branch().gv(), dir = 'forward',
					color = 'blue', style = 'dashed')
开发者ID:maczniak,项目名称:game_reverse_engineering,代码行数:32,代码来源:practice.py


注:本文中的block.Block.next_id方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。