File tree Expand file tree Collapse file tree 2 files changed +16
-6
lines changed
Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -436,14 +436,24 @@ def addSYSGadgets(self, section):
436436 gadgets = [] # TODO
437437 elif arch == CS_ARCH_ARM :
438438 if self .__options .thumb or self .__options .rawMode == "thumb" :
439- gadgets = [
440- [br"\x00-\xff]{1}\xef" , 2 , 2 ] # FIXME: svc
441- ]
439+ if arch_endian == CS_MODE_BIG_ENDIAN :
440+ gadgets = [
441+ [br"\xdf[\x00-\xff]" , 2 , 2 ] # svc imm8
442+ ]
443+ else :
444+ gadgets = [
445+ [br"[\x00-\xff]\xdf" , 2 , 2 ] # svc imm8
446+ ]
442447 arch_mode = CS_MODE_THUMB
443448 else :
444- gadgets = [
445- [br"\x00-\xff]{3}\xef" , 4 , 4 ] # FIXME: svc
446- ]
449+ if arch_endian == CS_MODE_BIG_ENDIAN :
450+ gadgets = [
451+ [br"[\x0f\x1f\x2f\x3f\x4f\x5f\x6f\x7f\x8f\x9f\xaf\xbf\xcf\xdf\xef][\x00-\xff]{3}" , 4 , 4 ] # svc{cond} imm24
452+ ]
453+ else :
454+ gadgets = [
455+ [br"[\x00-\xff]{3}[\x0f\x1f\x2f\x3f\x4f\x5f\x6f\x7f\x8f\x9f\xaf\xbf\xcf\xdf\xef]" , 4 , 4 ] # svc{cond} imm24
456+ ]
447457 arch_mode = CS_MODE_ARM
448458 elif arch == CS_ARCH_RISCV :
449459
You can’t perform that action at this time.
0 commit comments