mirror of https://github.com/bats3c/shad0w
fixed possible writing wchar to char issue
https://stackoverflow.com/questions/21223774/problems-with-wchar-t-sprintf https://wiki.sei.cmu.edu/confluence/display/c/STR38-C.+Do+not+confuse+narrow+and+wide+character+strings+and+functions Either use GetCurrentDirectoryA or GetCurrentDirectoryW, i think the second one is more generic solution. But BeaconCallbackC2's parameter is LPCSTR buffer, i changed to first one.
This commit is contained in:
parent
434a698abb
commit
30e863181c
|
@ -1,13 +1,9 @@
|
|||
#include <stdio.h>
|
||||
#include <windows.h>
|
||||
|
||||
char* getdir()
|
||||
{
|
||||
TCHAR NPath[MAX_PATH];
|
||||
char* getdir(){
|
||||
|
||||
char* text = (char*)malloc(MAX_PATH + 1);
|
||||
GetCurrentDirectory(MAX_PATH, NPath);
|
||||
|
||||
sprintf(text, "%s", NPath);
|
||||
|
||||
GetCurrentDirectoryA(MAX_PATH, text);
|
||||
return text;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue