qiling icon indicating copy to clipboard operation
qiling copied to clipboard

Windows vfscanf not implemented: api __stdio_common_vfscanf is not implemented

Open srobertjames opened this issue 4 years ago • 1 comments

Qiling gives vfscanf not implemented errors.

[!]	api __stdio_common_vfscanf is not implemented
[+]	ERROR: unmapped memory access at 0x0
[x]	CPU Context:

Sample Code

# rev.exe is available at https://github.com/utcoalition/utcctf-19/blob/master/rev-hactivate/rev.exe
# Populate qiling_windows_rootfs/x8664_windows/ using dllscollector.bat, then add in whatever missing DLLs it asks for
$ qltool run -f rev.exe --rootfs ~/qiling_windows_rootfs/x8664_windows/  -v debug

Expected behavior vfscanf is a common function and must have an implementation.

Screenshots

[!]	api __stdio_common_vfscanf is not implemented
[+]	ERROR: unmapped memory access at 0x0
[x]	CPU Context:

Additional context I'm new to qiling, and am unclear as to when it emulates an exported function by simply running the DLL, and when it needs a Python implementation of it. It would seem to me that if qiling can provide stdin via Python, it could just use the x86 ops for vfscanf straight from the DLL.

srobertjames avatar Jan 19 '22 03:01 srobertjames

See https://docs.microsoft.com/en-us/previous-versions/dn727675(v=vs.140) that __stdio_common_vfscanf is "used to implement the CRT".

srobertjames avatar Jan 19 '22 03:01 srobertjames

Close for now.

We updated the codebase for Qiling and Unicorn since this issue being posted.

Feel free to try the latest version.

xwings avatar Oct 06 '22 03:10 xwings