File tree Expand file tree Collapse file tree
python/icicle/Ghidra/Processors/x86/data/languages Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2728,7 +2728,8 @@ enterFrames: low5 is low5 { tmp:1 = low5; export tmp; }
27282728# as a NOP. We treat it as a NOP as well.
27292729:FSETPM is vexMode=0 & byte=0xdb; byte=0xe4 { } # 80287 set protected mode
27302730
2731- :HLT is vexMode=0 & byte=0xf4 { goto inst_start; }
2731+ define pcodeop hlt;
2732+ :HLT is vexMode=0 & byte=0xf4 { hlt(); }
27322733
27332734:IDIV rm8 is vexMode=0 & byte=0xf6; rm8 & reg_opcode=7 ... { rm8ext:2 = sext(rm8);
27342735 local quotient = AX s/ rm8ext; # DE exception if quotient doesn't fit in AL
Original file line number Diff line number Diff line change 1+ from icicle import *
2+
3+ def hlt ():
4+ vm = Icicle ("x86_64" , jit = False , tracing = True )
5+ page = 0x10000
6+ vm .mem_map (page , 0x1000 , MemoryProtection .ExecuteRead )
7+ vm .mem_write (page , b"\xF4 \xEB \xFE " )
8+ vm .reg_write ("rip" , page )
9+ status = vm .step (1000 )
10+ print (status , vm .exception_code )
11+ print (hex (vm .reg_read ("rip" )))
12+
13+ def main ():
14+ hlt ()
15+
16+ if __name__ == "__main__" :
17+ main ()
You can’t perform that action at this time.
0 commit comments