开启辅助访问 切换到宽版

精易论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

用微信号发送消息登录论坛

新人指南 邀请好友注册 - 我关注人的新帖 教你赚取精币 - 每日签到


求职/招聘- 论坛接单- 开发者大厅

论坛版规 总版规 - 建议/投诉 - 应聘版主 - 精华帖总集 积分说明 - 禁言标准 - 有奖举报

查看: 1365|回复: 7
打印 上一主题 下一主题
收起左侧

[易语言] 有木有大牛帮翻译一下呢。转换成E的

[复制链接]
结帖率:44% (4/9)
跳转到指定楼层
楼主
发表于 2013-10-8 14:18:24 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式   广西壮族自治区柳州市
5精币
// ProtectXDlg.cpp : implementation file
//

#include "stdafx.h"
#include "ProtectX.h"
#include "ProtectXDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About

class CAboutDlg : public CDialog
{
public:
CAboutDlg();

// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA

// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL

// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};

CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}

void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CProtectXDlg dialog

CProtectXDlg::CProtectXDlg(CWnd* pParent /*=NULL*/)
: CDialog(CProtectXDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CProtectXDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}

void CProtectXDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CProtectXDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CProtectXDlg, CDialog)
//{{AFX_MSG_MAP(CProtectXDlg)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_WM_TIMER()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CProtectXDlg message handlers

BOOL CProtectXDlg::OnInitDialog()
{
CDialog::OnInitDialog();

// Add "About..." menu item to system menu.

// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);

CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}

// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
typedef int (__stdcall *Func_RtlAdjustPrivilege)(int, bool, bool, int*);


//装载DLL
HMODULE hModule = ::LoadLibrary("NTDLL.DLL");
if(hModule == NULL)
{
MessageBox("LoadLibrary error");
return 0;
}

//得到导出函数的地址
Func_RtlAdjustPrivilege RtlAdjustPrivilege = (Func_RtlAdjustPrivilege)GetProcAddress(hModule, "RtlAdjustPrivilege");
if(RtlAdjustPrivilege == NULL)
{
MessageBox("GetProcAddress error");
return 0;
}
int nEn;
RtlAdjustPrivilege(20, 1, 0, &nEn);
SetTimer(1,1000,NULL);
return TRUE; // return TRUE unless you set the focus to a control
}

void CProtectXDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
else
{
CDialog::OnSysCommand(nID, lParam);
}
}

// If you add a minimize button to your dialog, you will need the code below
// to draw the icon. For MFC applications using the document/view model,
// this is automatically done for you by the framework.

void CProtectXDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting

SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);

// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;

// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}
}

// The system calls this to obtain the cursor to display while the user drags
// the minimized window.
HKEY hKey;
HCURSOR CProtectXDlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}


void CProtectXDlg::OnTimer(UINT nIDEvent)
{
// TODO: Add your message handler code here and/or call default

HWND hWnd;
hWnd = ::FindWindow("heyohi",NULL);
if (hWnd==0)
{
return;
}
DWORD dwProcessID;
HANDLE hProcess;
HMODULE hMod;
int lApiSend;
DWORD CurByte=0;
GetWindowThreadProcessId(hWnd,&dwProcessID);
hProcess = OpenProcess(PROCESS_ALL_ACCESS,NULL,dwProcessID);
if (hProcess==0)
{
return;
}
hMod = LoadLibrary("ws2_32.dll");
lApiSend = (int)GetProcAddress(hMod,"send");
ReadProcessMemory(hProcess,(LPVOID)lApiSend,&CurByte,2,NULL);
if (CurByte!=0xFF8B)
{

MessageBox("1!");
return;

}

char szSysDir[255]={0};
GetSystemDirectory(szSysDir,255);
strcat(szSysDir,"\\ESPI11.dll");

if(::GetFileAttributes(szSysDir)!=-1)
{

MessageBox("2!");
return;
}

HKEY hKey;
int Result= ::RegOpenKeyEx(HKEY_LOCAL_MACHINE,"SYSTEM\\CurrentControlSet\\Services\\WinSock2\\ESPI11",0,KEY_READ,&hKey);
if(Result==ERROR_SUCCESS)
{
AfxMessageBox("3!");
return;
}

::RegCloseKey(hKey);
HKEY hKkey;

DWORD Lenit=65535;
DWORD dwType=REG_BINARY;
Result= ::RegOpenKeyEx(HKEY_LOCAL_MACHINE,"SYSTEM\\CurrentControlSet\\Services\\WinSock2\\Parameters\\Protocol_Catalog9\\Catalog_Entries\\000000000001",0,KEY_ALL_ACCESS,&hKkey);
if(Result==ERROR_SUCCESS)
{

if (::RegQueryValueEx(hKkey,"PackedCatalogItem",0,&dwType,NULL,&Lenit)==ERROR_SUCCESS)
{
BYTE *pbuf = new BYTE[Lenit];
::RegQueryValueEx(hKkey,"PackedCatalogItem",0,0,(BYTE*)pbuf,&Lenit);

if (strcmp("%SystemRoot%\\system32\\mswsock.dll",(char*)pbuf)!=0)
{
AfxMessageBox("4!");
return;
}

delete pbuf;

}

}
RegCloseKey(hKkey);

CDialog::OnTimer(nIDEvent);
}


回答提醒:如果本帖被关闭无法回复,您有更好的答案帮助楼主解决,请发表至 源码区 可获得加分喔。
友情提醒:本版被采纳的主题可在 申请荣誉值 页面申请荣誉值,获得 1点 荣誉值,荣誉值可兑换荣誉会员、终身vip用户组。
快捷通道:申请荣誉值无答案申请取消悬赏投诉有答案未采纳为最佳
头像被屏蔽
结帖率:88% (106/121)
沙发
发表于 2013-10-8 14:24:24 | 只看该作者   广东省湛江市
= =,这么长还是白菜价
回复

使用道具 举报

结帖率:44% (4/9)
板凳
 楼主| 发表于 2013-10-8 14:30:08 | 只看该作者   广西壮族自治区柳州市
Cramps 发表于 2013-10-8 14:24
= =,这么长还是白菜价

有实力的跟帖,RMB。
回复

使用道具 举报

地板
发表于 2013-10-8 16:45:59 | 只看该作者   广东省湛江市
这个是大神可以解决的
回复

使用道具 举报

结帖率:44% (4/9)
地下
 楼主| 发表于 2013-10-8 16:51:34 | 只看该作者   广西壮族自治区柳州市
月光族 发表于 2013-10-8 16:45
这个是大神可以解决的

你是不是传说中的大神,。

点评

不是大神到深更半夜才出来的   广东省湛江市  发表于 2013-10-8 16:52
回复

使用道具 举报

结帖率:14% (1/7)
6
发表于 2013-10-8 17:26:53 | 只看该作者   河南省洛阳市
可惜没学好C语言
回复

使用道具 举报

结帖率:44% (4/9)
7
 楼主| 发表于 2013-10-9 19:43:29 | 只看该作者   广西壮族自治区柳州市
自己转换好了。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则 致发广告者

发布主题 收藏帖子 返回列表

sitemap| 易语言源码| 易语言教程| 易语言论坛| 易语言模块| 手机版| 广告投放| 精易论坛
拒绝任何人以任何形式在本论坛发表与中华人民共和国法律相抵触的言论,本站内容均为会员发表,并不代表精易立场!
论坛帖子内容仅用于技术交流学习和研究的目的,严禁用于非法目的,否则造成一切后果自负!如帖子内容侵害到你的权益,请联系我们!
防范网络诈骗,远离网络犯罪 违法和不良信息举报QQ: 793400750,邮箱:[email protected]
网站简介:精易论坛成立于2009年,是一个程序设计学习交流技术论坛,隶属于揭阳市揭东区精易科技有限公司所有。
Powered by Discuz! X3.4 揭阳市揭东区精易科技有限公司 ( 粤ICP备12094385号-1) 粤公网安备 44522102000125 增值电信业务经营许可证 粤B2-20192173

快速回复 返回顶部 返回列表