qiling cheatsheet
Qiling is an advanced binary emulation framework. It can emulate various types of archs and can be used to perform advanced operations as well. Below are some of the quick commands which are needed for my tasks.
python module
from qiling import Qiling # import
from qiling.const import QL_VERBOSE
init
code=b"\x90"
ql = Qiling(code=code, archtype='x86', ostype='Linux', verbose=QL_VERBOSE.DISASM)
register
ql.arch.regs.read("EAX") # read register
ql.arch.regs.write("EAX", 0xff) # write register
memory
ql.mem.get_mapinfo() #get memory related information
ql.mem.get_formatted_mapinfo() # same as mapinfo but better
ql.mem.map(0x40300//4096*4096, 4096, info="name")
write to memory
ql.mem.write(1002, b'\x41')
ql.mem.read(1002,1)
start the emulation
ql.run()