代码语言
.
CSharp
.
JS
Java
Asp.Net
C
MSSQL
PHP
Css
PLSQL
Python
Shell
EBS
ASP
Perl
ObjC
VB.Net
VBS
MYSQL
GO
Delphi
AS
DB2
Domino
Rails
ActionScript
Scala
代码分类
文件
系统
字符串
数据库
网络相关
图形/GUI
多媒体
算法
游戏
Jquery
Extjs
Android
HTML5
菜单
网页交互
WinForm
控件
企业应用
安全与加密
脚本/批处理
开放平台
其它
【
C
】
监控进程创建
作者:
戏子行者
/ 发布于
2013/3/18
/
695
#include <windows.h> #include <stdio.h> void __declspec(naked) __stdcall jmp_back() { __asm{ int 3 int 3 int 3 int 3 int 3 int 3 int 3 int 3 int 3 int 3 int 3 int 3 int 3 int 3 } } BOOL (WINAPI * Real_CreateProcessInternalW)(HANDLE hToken, LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation, PHANDLE hNewToken); BOOL __stdcall Detour_CreateProcessInternalW(HANDLE hToken, LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation, PHANDLE hNewToken) { PROCESS_INFORMATION pi; BOOL ret; __asm { push hNewToken lea eax,[pi] push eax push lpStartupInfo push lpCurrentDirectory push lpEnvironment push dwCreationFlags push bInheritHandles push lpThreadAttributes push lpProcessAttributes push lpCommandLine push lpApplicationName push hToken call offset jmp_back mov ret,eax } if(ret) { if(lpProcessInformation) { memcpy(lpProcessInformation,&pi,sizeof(PROCESS_INFORMATION)); } printf("HOOK_CreateProcessInternalW try Inject New Process : %d ",pi.dwProcessId); //NewInject(pi.dwProcessId,(LPTHREAD_START_ROUTINE)InjectMain); } return ret; } void SetHook(DWORD pf_Func,DWORD pf_Detour) { DWORD old_protect; DWORD jmp_addr; VirtualProtect((void *)pf_Func,10,PAGE_EXECUTE_READWRITE,&old_protect); VirtualProtect((void *)jmp_back,10,PAGE_EXECUTE_READWRITE,&old_protect); __asm { mov eax,DWORD ptr[pf_Detour] sub eax,DWORD ptr[pf_Func] sub eax,5 mov jmp_addr,eax mov eax,DWORD ptr[pf_Func] mov ecx,offset jmp_back push ebx mov bl,BYTE ptr[eax] //备份原函数的前 5 个字节 mov BYTE ptr[ecx],bl mov ebx,DWORD ptr[eax+1] mov DWORD ptr[ecx+1],ebx mov BYTE ptr[eax],0xE9 inc eax mov ebx,jmp_addr mov DWORD ptr[eax],ebx mov eax,DWORD ptr[pf_Func] add eax,5 mov ebx,offset jmp_back add ebx,5 sub eax,ebx sub eax,5 mov BYTE ptr[ecx+5],0xE9 mov DWORD ptr[ecx+6],eax pop ebx } } int main(int argc, char* argv[]) { STARTUPINFO si={0}; PROCESS_INFORMATION pi; HMODULE hKernel32 = LoadLibraryA("Kernel32.dll"); Real_CreateProcessInternalW =(BOOL (__stdcall *)(HANDLE, LPCWSTR,LPWSTR, LPSECURITY_ATTRIBUTES, LPSECURITY_ATTRIBUTES, BOOL, DWORD, LPVOID, LPCWSTR, LPSTARTUPINFOW, LPPROCESS_INFORMATION, PHANDLE))GetProcAddress(hKernel32,"CreateProcessInternalW"); if(Real_CreateProcessInternalW) { SetHook((DWORD)Real_CreateProcessInternalW,(DWORD)Detour_CreateProcessInternalW); OutputDebugStringA("try Hook CreateProcessInternalW"); } si.cb = sizeof(STARTUPINFO); printf("%d",CreateProcess(NULL,"CMD.EXE",NULL,NULL,FALSE,0,NULL,NULL,&si,&pi)); OutputDebugStringA("Go Out"); return 0; }
试试其它关键字
监控进程
同语言下
.
获取手机通讯录 iOS去除数字以外的所有字符
.
异步加载音乐等资源
.
交通罚单管理系统
.
freemark实现,简单的替换
.
计算斐波那契数列
.
base64解码 包括解码长度
.
图像显示
.
冒泡排序
.
输入十进制数,输出指定进制
.
链式栈
可能有用的
.
C#实现的html内容截取
.
List 切割成几份 工具类
.
SQL查询 多列合并成一行用逗号隔开
.
一行一行读取txt的内容
.
C#动态修改文件夹名称(FSO实现,不移动文件)
.
c# 移动文件或文件夹
.
c#图片添加水印
.
Java PDF转换成图片并输出给前台展示
.
网站后台修改图片尺寸代码
.
处理大图片在缩略图时的展示
戏子行者
贡献的其它代码
(
5
)
.
单词长度水平直方图
.
监控进程创建
.
测试html高亮
.
打印输入各个字符出现的频率的直方图
.
fft快速傅立叶变换
Copyright © 2004 - 2024 dezai.cn. All Rights Reserved
站长博客
粤ICP备13059550号-3