What is api-ms-XXX
A stub dll acts as a pointer to the actual dll that does the work.
Without the stub:
Your program: I need ReadConsoleW from kernel32.dll
kernel32.dll: I'm here.
Your program works.
-------
With the stub:
Your program: I need ReadConsoleW from ...no, from api-ms-bla-blabla...
OS: Too bad, not found. Maybe it's too old or something.
Your program: Nothing found, I'm out.
Your program breaks.
How to make broken program work again?
Go fix the import table of your broken program. You'll need:
- CFF Explorer VIII - To view and edit import table. Edit the import dll name from
api-xxx-xxx.dll
to the one actually contains the functions to be imported. - ripgrep - To that one. For example:
kernel32.dll
forReadConsoleW
- Dependency Walker - Shows what's missing
Note:
- Backup everything.
- At your own risk.
Tip:
ripgrep
rg -uuu --glob '\*.dll' GetTempFileNameA
I fixed my issue by changing api-ms-win-core-file-l1-2-2.dll
to kernel32.dll
in import table. Use ripgrep to find the right DLL.