能力值:
( LV2,RANK:10 )
|
-
-
2 楼
int WriteMemory_int(HANDLE hDevice, int PID,int Address,int buff,int size)//写内存整数型
{
int port[4];
int bufret;
DWORD dwWrite;
port[0]=PID;
port[1]=Address;
port[2]=buff;
port[3]=size;
DeviceIoControl(hDevice,WRITEPROCESSMEMORY, &port, 16, &bufret, 4, &dwWrite, NULL);
return bufret;
}
case WRITEPROCESSMEMORY://写4字节整数型
{
//显示输入缓冲区数据
int PID = 0, Address = 0,buff ,BYTE_size = 0;
int *InputBuffer = (int*)pIrp->AssociatedIrp.SystemBuffer;
_asm
{
MOV EAX, InputBuffer
MOV EBX, DWORD PTR DS : [EAX]
MOV PID, EBX
MOV EBX, DWORD PTR DS : [EAX + 4]
MOV Address, EBX
MOV EBX, DWORD PTR DS : [EAX + 8]
MOV buff, EBX
MOV EBX, DWORD PTR DS : [EAX + 0xC]
MOV BYTE_size, EBX
}
//操作输出缓冲区
int *OutputBuffer = (int*)pIrp->AssociatedIrp.SystemBuffer;
*OutputBuffer = WriteProcessMemory((VOID*)Address, BYTE_size, &buff, PID);
//设置实际操作输出缓冲区长度
info = 4;
break;
|
能力值:
( LV2,RANK:10 )
|
-
-
3 楼
当初看郁金香驱动教程里面的写法通过内联取出参数。。。一直用到现在不知道还有木有更好的办法
|
能力值:
( LV3,RANK:30 )
|
-
-
4 楼
酱紫的确是可以滴,但是呢我想做到一个函数处理所有的类型读写
就好比系统的函数,直接提供缓冲区,然后在sizeof
有没有更好滴办法呢,
|