Skip to content

This Repository is a collection of different ethical hacking tools and malware's for penetration testing and research purpose written in python, ruby, rust, c++, go and c.

498 B
Raw Blame
#include "stdafx.h"
#include "utils.h"
#include "windefs.h"

#include <string>

LPSTR utils_getLastErrorStr(DWORD dwErrCode) {
	LPTSTR errorText = NULL;

	FormatMessage(
		FORMAT_MESSAGE_FROM_SYSTEM
		| FORMAT_MESSAGE_ALLOCATE_BUFFER
		| FORMAT_MESSAGE_IGNORE_INSERTS,
		NULL,
		dwErrCode,
		MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
		(LPTSTR)&errorText,
		0,
		NULL);
	return errorText;
}

void utils_debugOutputErrCode(DWORD dwErrCode) {
	OutputDebugStringA(utils_getLastErrorStr(dwErrCode));
}