Closed leepeter2019 closed 3 years ago
UC_ERR_INSN_INVALID normally referring to Unicorn Engine did not support the CPU Instruction.
In this case, you can try to implement __stdio_common_vsprintf_s and check again. If problem exits, we need to wait for new unicorn upgrade.
That bytes that attempted to be executed appear to be a string: base.__stdio_common_vsprintf_s
, so no wonder Unicorn fails to execute them. My guess is that since those two functions were not called, their arguments remained on the stack and Qiling messed up the instruction pointer by "returning" to one of those arguments that happened to be a pointer to the function name (maybe an import lookup..?).
I'll see if I can implement those two functions in the coming days. That shouldn't be too difficult. Would it be possible for you to attach the executable for testing purposes?
@leepeter2019 Can you pull the latest dev branch and test again?
No response. Issue close
*Describe the bug As soon as the emulation begins, it stop with error message Invalid instruction (UC_ERR_INSN_INVALID) when i checked the log, it says '[!] api stdio_common_vsprintf is not implemented', '[!] api stdio_common_vsprintf_s is not implemented'. I think UC_ERR_INSN_INVALID error message is generated because of stdio_common_vsprintf , stdio_common_vsprintf_s. But I added VS dynamic library 'msvcrt.dll' in the dll directory. I don't know why it cannot find correspond api in the dll.
Sample Code
Expected behavior It generates code coverage on target sw
Screenshots