import capstone, sys
sys.stdout.reconfigure(encoding="utf-8", errors="replace")
data=open(r"C:/git/bt411/content/BTL4OPT.EXE","rb").read()
CODE_VA=0x401000; CODE_RA=0xE00
md=capstone.Cs(capstone.CS_ARCH_X86, capstone.CS_MODE_32)
for start in (0x4bac04,0x4bac08,0x4bac0c,0x4bac10):
    code=data[CODE_RA+(start-CODE_VA):CODE_RA+(start-CODE_VA)+48]
    insns=list(md.disasm(code,start))
    if insns and insns[0].mnemonic=="push" and insns[0].op_str=="ebp":
        print(f"FUNCTION START {start:08x}")
        code=data[CODE_RA+(start-CODE_VA):CODE_RA+(0x4bace6-CODE_VA)]
        for ins in md.disasm(code,start):
            print(f"{ins.address:08x}: {ins.mnemonic} {ins.op_str}")
        break
