I am trying to debug a string LPCWSTR, but I am having a problem while clicking sprintfin the buffer, because it only extracts the first character from the string.
Here is the code:
HANDLE WINAPI hookedCreateFileW(LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) {
char buffer[1024];
sprintf_s(buffer, 1024, "CreateFileW: %s", lpFileName);
OutputDebugString(buffer);
return trueCreateFileW(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwFlagsAndAttributes, dwCreationDisposition, hTemplateFile);
}
For example, I get CreateFileW: Cor CreateFileW: \.
How to paste it into the buffer?
Thank.
Julio source
share