keystone
keystone copied to clipboard
Infinite loop on AsmParser::Run using .string, etc. directive
If the .string directive argument is enclosed using ' char, then an infinite loop happens on AsmParser::Run.
- PoC:
from keystone import *
ks = Ks(KS_ARCH_X86, KS_MODE_32)
# good case
CODE = ".string \"test\"; nop;"
encoding, count = ks.asm(CODE)
# bad case
CODE = ".string 'test'; nop;"
encoding, count = ks.asm(CODE)