
C/C++
文章平均质量分 59
NightStarSoul
这个作者很懒,什么都没留下…
展开
-
错误集与解决方案
1 . CreateProcess失败返回错误代码998解决方案: STARTUPINFO si;memset(&si,0,sizeof(si));PROCESS_INFORMATION pi;memset(&pi,0,sizeof(pi));原创 2014-05-12 22:16:12 · 693 阅读 · 0 评论 -
获取任意一个程序的输入表
// testPE.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include /************************************************************************//* 函数名:RVAToOffset/* 函数功能:根据RVA计算出磁盘文件偏移/* 函数参数:lpBase:磁盘原创 2014-05-27 14:46:34 · 656 阅读 · 0 评论 -
获取鼠标所在窗体的PID
#include #include using namespace std;DWORD GetPIDFromCursor(void){ POINT CursorPos; //获取当前鼠标的位置 if (!GetCursorPos(&CursorPos)) { cout << "GetCursorPos Error: " << GetLastError() << endl;原创 2014-05-26 19:33:28 · 1461 阅读 · 0 评论 -
编写DLL程序方法(二)
第一步:创建一个动态链接库程序第二步:编写一个测试程序#include "stdafx.h"int add(int a,int b){return a+b;}int sub(int a,int b){return a-b;}BOOL APIENTRY DllMain( HANDLE hModule, DW原创 2014-05-27 21:01:04 · 543 阅读 · 0 评论 -
API HOOK 例子程序(HOOK资源管理器强制关闭进程)
1.创建一个DLL文件 写下如下代码 // dllmain.cpp : 定义 DLL 应用程序的入口点。#include "stdafx.h"#include "stdio.h"PROC oldAddress = (PROC)TerminateProcess;PROC NewAddress = NULL;DWORD * dwAddress = NULL;BOOL My_原创 2014-05-28 14:15:31 · 1879 阅读 · 0 评论 -
编写DLL程序的步骤
第一步:创建一个动态链接库程序第二步:编写一个测试程序#include "stdafx.h"int add(int a,int b){return a+b;}int sub(int a,int b){return a-b;}BOOL APIENTRY DllMain( HANDLE hModule, DW原创 2014-05-27 20:03:19 · 699 阅读 · 0 评论 -
在EXE文件中查找指定字符串
例子程序:// .cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include "iostream"#include "string"using namespace std;int _tmain(int argc, _TCHAR* argv[]){ string str="hello world"; cout<<str<<endl;原创 2014-05-30 15:22:08 · 2303 阅读 · 0 评论