Download src/BabukRansomwareSourceCode-main/windows/Babyk/debug.cpp from PatoFlamejanteTV/MalwareSource: direct link, hf CLI and curl.
- Browser
- Download file 934 Bytes
-
https://huggingface.co/datasets/PatoFlamejanteTV/MalwareSource/resolve/main/src/BabukRansomwareSourceCode-main/windows/Babyk/debug.cpp
- Command line
-
hf download hf://datasets/PatoFlamejanteTV/MalwareSource/src/BabukRansomwareSourceCode-main/windows/Babyk/debug.cpp
-
curl -L -o debug.cpp https://huggingface.co/datasets/PatoFlamejanteTV/MalwareSource/resolve/main/src/BabukRansomwareSourceCode-main/windows/Babyk/debug.cpp
934 Bytes
| static HANDLE h_log_file = 0; | |
| static CRITICAL_SECTION critSection; | |
| void _dbg_initialize(WCHAR* logFile) { | |
| InitializeCriticalSection(&critSection); | |
| h_log_file = CreateFileW(logFile, GENERIC_WRITE, FILE_SHARE_READ, 0, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); | |
| } | |
| void _dbg_report(LPCSTR message, LPCSTR target, DWORD error) { | |
| CHAR err[20]; | |
| DWORD dw; | |
| EnterCriticalSection(&critSection); | |
| wsprintfA(err, "%lu", error); | |
| WriteFile(h_log_file, message, lstrlenA(message), &dw, 0); | |
| WriteFile(h_log_file, ", Error Code: ", 14, &dw, 0); | |
| WriteFile(h_log_file, err, lstrlenA(err), &dw, 0); | |
| WriteFile(h_log_file, " -> ", 4, &dw, 0); | |
| WriteFile(h_log_file, target, lstrlenA(target), &dw, 0); | |
| WriteFile(h_log_file, "\r\n", 2, &dw, 0); | |
| LeaveCriticalSection(&critSection); | |
| } | |
| void _dbg_uninitialize() { | |
| DeleteCriticalSection(&critSection); | |
| CloseHandle(h_log_file); | |
| } |