MCPcopy Create free account
hub / github.com/qilingframework/qiling / dump_regs

Function dump_regs

examples/windows_trace.py:39–67  ·  view source on GitHub ↗
(ql: Qiling)

Source from the content-addressed store, hash-verified

37
38
39def dump_regs(ql: Qiling):
40 regs = {
41 'eax': ql.arch.regs.eax,
42 'ebx': ql.arch.regs.ebx,
43 'ecx': ql.arch.regs.ecx,
44 'edx': ql.arch.regs.edx,
45 'edi': ql.arch.regs.edi,
46 'esi': ql.arch.regs.esi,
47 'ebp': ql.arch.regs.ebp,
48 'esp': ql.arch.regs.esp
49 }
50
51 if not hasattr(dump_regs, 'regs'):
52 dump_regs.regs = regs
53
54 rtn = ''
55
56 # build string in order
57 for reg in ('eax', 'ebx', 'ecx', 'edx', 'edi', 'esi', 'ebp', 'esp'):
58 val = '{}: {:08X} '.format(reg.upper(), regs[reg])
59
60 if regs[reg] != dump_regs.regs[reg]:
61 rtn += colors.RED + val + colors.ENDC
62 else:
63 rtn += val
64
65 dump_regs.regs = regs
66
67 return rtn
68
69
70def spaced_hex(data):

Callers 1

trace_cbFunction · 0.85

Calls 1

formatMethod · 0.80

Tested by

no test coverage detected