Skip to content

Instantly share code, notes, and snippets.

# -*- coding: utf-8 -*-
"""
Deobscure class name(use debug directives as source name) for PNF Software's JEB2.
"""
# https://www.jianshu.com/p/4387556ea7c9 edit
__author__ = 'Ericli'
from com.pnfsoftware.jeb.client.api import IScript
from com.pnfsoftware.jeb.core import RuntimeProjectUtil
from com.pnfsoftware.jeb.core.units.code import ICodeUnit, ICodeItem
def get_basic_block(addr):
res = None
_func = idaapi.get_func(addr)
for block in idaapi.FlowChart(_func):
if block.startEA >= addr:
return hex(res)[:-1]
else:
res = block.startEA