100 lines
2.8 KiB
C++
100 lines
2.8 KiB
C++
#pragma once
|
||
|
||
#define SHA256_DIGEST_LENGTH 32
|
||
|
||
#include <windows.h>
|
||
#include <stdio.h>
|
||
#include <tchar.h>
|
||
#include <wtypes.h>
|
||
#include <strsafe.h>
|
||
#include <process.h>
|
||
#include <atlstr.h>
|
||
#include <list>
|
||
#include <WINDEF.H>
|
||
#include <wtypes.h>
|
||
#include <string>
|
||
#include <algorithm>
|
||
#include <io.h>
|
||
#include <fcntl.h>
|
||
#include <shlobj.h>
|
||
#include <string>
|
||
#include <tchar.h>
|
||
#include <iostream>
|
||
#include <sysinfoapi.h>
|
||
#include <Iphlpapi.h>
|
||
using namespace std;
|
||
#pragma comment(lib, "Iphlpapi.lib")
|
||
#pragma comment(lib, "ws2_32.lib")
|
||
#pragma comment(lib, "Netapi32.lib")
|
||
|
||
|
||
DWORD convert_utf8_to_unicode_string(
|
||
__out std::wstring& unicode,
|
||
__in const char* utf8,
|
||
__in const size_t utf8_size
|
||
);
|
||
|
||
DWORD convert_utf8_to_unicode_pointer(
|
||
__out wchar_t ** unicode,
|
||
__in const char* utf8,
|
||
__in const size_t utf8_size
|
||
);
|
||
DWORD convert_unicode_to_utf8_string(
|
||
__out std::string& utf8,
|
||
__in const wchar_t* unicode,
|
||
__in const size_t unicode_size
|
||
);
|
||
|
||
DWORD convert_unicode_to_ansi_string(
|
||
__out std::string& ansi,
|
||
__in const wchar_t* unicode,
|
||
__in const size_t unicode_size
|
||
);
|
||
|
||
DWORD convert_ansi_to_unicode_string(
|
||
__out std::wstring& unicode,
|
||
__in const char* ansi,
|
||
__in const size_t ansi_size
|
||
);
|
||
|
||
DWORD convert_utf8_to_ansi_pointer(string& utf8_to_ansi);
|
||
DWORD convert_ansi_to_utf8_pointer(string& ansi_to_utf8);
|
||
DWORD GetTime();
|
||
|
||
DWORD GetParentID(DWORD p_ID);
|
||
BOOL IsWin8OSAbove();
|
||
BOOL IsWow64();
|
||
BOOL IsWinVistaOSAbove();
|
||
BOOL WINAPI NtNameToDosNameW(LPWSTR dosName, SIZE_T size, LPWSTR ntName);
|
||
|
||
BOOL UtilExistRegKey(HKEY root, const wchar_t* key);
|
||
wstring UtilGetRegValue(HKEY root, const wchar_t* key, const wchar_t* name);
|
||
wstring UtilGetUserWindowID();
|
||
std::wstring UtilGetIP();
|
||
std::wstring UtilGetMac();
|
||
BOOL UtilGetIPMac(wstring& strIP, wstring& strMac);
|
||
bool CreateNestedDirectories(const std::wstring& path);
|
||
BOOL UtilRunProcessNoWait(const wchar_t* path, bool wait);
|
||
DWORD UtilCreateProcessAsModal(LPCWSTR szCommandLine);
|
||
bool UtilTerminateProcessByName(const std::wstring& processName, uint32_t pid);
|
||
std::string UtilGetCurrentTimestampISO8601(tm& tm_info);
|
||
HWND FindMainWindow(DWORD dwProcessId);
|
||
|
||
std::wstring ToLower(const std::wstring& str);
|
||
std::wstring ToUpper(const std::wstring& str);
|
||
|
||
std::string ToLowerA(const std::string& str);
|
||
std::string ToUpperA(const std::string& str);
|
||
void ReplaceAll(std::wstring& message, const std::wstring& pattern, const std::wstring& replace);
|
||
|
||
|
||
// <20><><EFBFBD>ڿ<EFBFBD> <20><><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD> n<><6E><EFBFBD><EFBFBD>)
|
||
bool StartsWith(const std::wstring& str, const std::wstring& prefix);
|
||
// <20><><EFBFBD>ڿ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||
bool Contains(const std::wstring& str, const std::wstring& substr);
|
||
// <20><><EFBFBD>ڿ<EFBFBD> <20><><EFBFBD><EFBFBD>
|
||
std::wstring operator+(const std::wstring& a, const char* b);
|
||
// <20>¿<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD> Trim <20>Լ<EFBFBD>
|
||
std::wstring Trim(const std::wstring& str);
|
||
std::wstring UtilGenerateRandomString(int length);
|
||
wstring UtilGetCommandLineArgment1(); |