 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
haha01haha01 Grandmaster Cheater Supreme
Reputation: 0
Joined: 15 Jun 2007 Posts: 1233 Location: http://www.SaviourFagFails.com/
|
Posted: Fri Apr 10, 2009 1:13 pm Post subject: Driver Question |
|
|
I made a simple driver (based on an example code i saw) that prints everything inputted to it (using CreateFile->WriteFile), but i seem to get a BSoD when calling MmGetSystemAddressForMdlSafe(Irp->MdlAddress, NormalPagePriority) to determine the input buffer's address. this is the IRP_MJ_WRITE function (where the BSoD occures) and this is the whole application's code.
anyone know what is the problem or can tell me a different method to read the data sent with WriteFile?
|
|
| Back to top |
|
 |
HomerSexual Grandmaster Cheater Supreme
Reputation: 5
Joined: 03 Feb 2007 Posts: 1657
|
Posted: Fri Apr 10, 2009 8:29 pm Post subject: |
|
|
check Irp->MdlAddress also
| Code: | | if(pIoStackIrp && Irp->MdlAddress) |
_________________
|
|
| Back to top |
|
 |
haha01haha01 Grandmaster Cheater Supreme
Reputation: 0
Joined: 15 Jun 2007 Posts: 1233 Location: http://www.SaviourFagFails.com/
|
Posted: Sat Apr 11, 2009 2:13 am Post subject: |
|
|
| blankrider wrote: |
check Irp->MdlAddress also
| Code: | | if(pIoStackIrp && Irp->MdlAddress) |
| oh, i see...
now it doesnt crash, but every time i call WriteFile it skips it because MdlAddress is null. what should i do to get it to work? im using this code:
| Code: | HANDLE h;
DWORD result;
h = CreateFile(L"\\\\.\\Example",GENERIC_READ | GENERIC_WRITE,0,NULL,OPEN_EXISTING,0,NULL);
WriteFile(h,"Test",sizeof("Test"),&result,NULL);
CloseHandle(h);
|
|
|
| Back to top |
|
 |
HomerSexual Grandmaster Cheater Supreme
Reputation: 5
Joined: 03 Feb 2007 Posts: 1657
|
Posted: Sat Apr 11, 2009 8:13 am Post subject: |
|
|
| haha01haha01 wrote: | | blankrider wrote: |
check Irp->MdlAddress also
| Code: | | if(pIoStackIrp && Irp->MdlAddress) |
| oh, i see...
now it doesnt crash, but every time i call WriteFile it skips it because MdlAddress is null. what should i do to get it to work? im using this code:
| Code: | HANDLE h;
DWORD result;
h = CreateFile(L"\\\\.\\Example",GENERIC_READ | GENERIC_WRITE,0,NULL,OPEN_EXISTING,0,NULL);
WriteFile(h,"Test",sizeof("Test"),&result,NULL);
CloseHandle(h);
|
|
does DeviceCreate's message come up? If it doesn't then it isn't creating the file. Check to see if h is valid. Call getlasterror after CreateFile and after WriteFile.
edit:
Also use
| Code: | | IoCompleteRequest(Irp, IO_NO_INCREMENT); |
Everytime the Irp is used as a parameter to the function
_________________
|
|
| Back to top |
|
 |
haha01haha01 Grandmaster Cheater Supreme
Reputation: 0
Joined: 15 Jun 2007 Posts: 1233 Location: http://www.SaviourFagFails.com/
|
Posted: Sat Apr 11, 2009 11:24 am Post subject: |
|
|
| blankrider wrote: | | haha01haha01 wrote: | | blankrider wrote: |
check Irp->MdlAddress also
| Code: | | if(pIoStackIrp && Irp->MdlAddress) |
| oh, i see...
now it doesnt crash, but every time i call WriteFile it skips it because MdlAddress is null. what should i do to get it to work? im using this code:
| Code: | HANDLE h;
DWORD result;
h = CreateFile(L"\\\\.\\Example",GENERIC_READ | GENERIC_WRITE,0,NULL,OPEN_EXISTING,0,NULL);
WriteFile(h,"Test",sizeof("Test"),&result,NULL);
CloseHandle(h);
|
|
does DeviceCreate's message come up? If it doesn't then it isn't creating the file. Check to see if h is valid. Call getlasterror after CreateFile and after WriteFile.
edit:
Also use
| Code: | | IoCompleteRequest(Irp, IO_NO_INCREMENT); |
Everytime the Irp is used as a parameter to the function |
CreateFile and CloseHandle succeeds, and the handle is valid (around 0x160). also, this happens from the first time Irp is used, so i doubt the problem is the request not completed.
|
|
| Back to top |
|
 |
HomerSexual Grandmaster Cheater Supreme
Reputation: 5
Joined: 03 Feb 2007 Posts: 1657
|
Posted: Sat Apr 11, 2009 5:42 pm Post subject: |
|
|
| haha01haha01 wrote: | | blankrider wrote: | | haha01haha01 wrote: | | blankrider wrote: |
check Irp->MdlAddress also
| Code: | | if(pIoStackIrp && Irp->MdlAddress) |
| oh, i see...
now it doesnt crash, but every time i call WriteFile it skips it because MdlAddress is null. what should i do to get it to work? im using this code:
| Code: | HANDLE h;
DWORD result;
h = CreateFile(L"\\\\.\\Example",GENERIC_READ | GENERIC_WRITE,0,NULL,OPEN_EXISTING,0,NULL);
WriteFile(h,"Test",sizeof("Test"),&result,NULL);
CloseHandle(h);
|
|
does DeviceCreate's message come up? If it doesn't then it isn't creating the file. Check to see if h is valid. Call getlasterror after CreateFile and after WriteFile.
edit:
Also use
| Code: | | IoCompleteRequest(Irp, IO_NO_INCREMENT); |
Everytime the Irp is used as a parameter to the function |
CreateFile and CloseHandle succeeds, and the handle is valid (around 0x160). also, this happens from the first time Irp is used, so i doubt the problem is the request not completed. |
When you call CreateDevice the IRP is being used. Just try it. I really can't find out what the issue is. Upload your current source & other files so i can load it and try it out. Upload them as a rar folder so i can just compile and run
FOUND ERROR:
Tested this and it works
You have to specify the input type. Just put this code in the entry before creating the symbolic link.
| Code: | | pDeviceObject->Flags |= DO_DIRECT_IO; |
_________________
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|