MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / load_zero_page_16

Method load_zero_page_16

python/examples/nes.py:375–389  ·  view source on GitHub ↗
(il:LowLevelILFunction, value:ExpressionIndex)

Source from the content-addressed store, hash-verified

373
374 @staticmethod
375 def load_zero_page_16(il:LowLevelILFunction, value:ExpressionIndex) -> ExpressionIndex:
376 instr = LowLevelILInstruction.create(il, value)
377 if isinstance(instr, LowLevelILConst):
378 if instr.constant == 0xff:
379 lo = il.zero_extend(2, il.load(1, il.const_pointer(2, 0xff)))
380 hi = il.shift_left(2, il.zero_extend(2, il.load(1, il.const_pointer(2, 0))), il.const(2, 8))
381 return il.or_expr(2, lo, hi)
382 return il.load(2, il.const_pointer(2, instr.constant))
383 il.append(il.set_reg(1, LLIL_TEMP(0), value))
384 expr = il.reg(1, LLIL_TEMP(0))
385 lo_addr = expr
386 hi_addr = il.add(1, expr, il.const(1, 1))
387 lo = il.zero_extend(2, il.load(1, lo_addr))
388 hi = il.shift_left(2, il.zero_extend(2, il.load(1, hi_addr)), il.const(2, 8))
389 return il.or_expr(2, lo, hi)
390
391 @staticmethod
392 def indirect_load(il:LowLevelILFunction, value:int) -> ExpressionIndex:

Callers 1

M6502Class · 0.80

Calls 12

LLIL_TEMPFunction · 0.90
createMethod · 0.45
zero_extendMethod · 0.45
loadMethod · 0.45
const_pointerMethod · 0.45
shift_leftMethod · 0.45
constMethod · 0.45
or_exprMethod · 0.45
appendMethod · 0.45
set_regMethod · 0.45
regMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected