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:
asdkjfd 2021-07-16 04:42:39 +05:30 committed by GitHub
parent 434a698abb
commit 30e863181c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
}
}