 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
Buggy Advanced Cheater
Reputation: 0
Joined: 04 Jan 2008 Posts: 72 Location: Republic of Korea (South Korea)
|
Posted: Wed Apr 16, 2008 6:40 am Post subject: How to access to Physical Drive |
|
|
In Windows NT, it supports the symbolic link called \\.\PhysicalDriveN.
The source under this text is C source that accesses to Physical Drive easily.
This code get first Physical Drive's 0th sector in 4 bytes and prints it in hexademical.
| Code: | #include <stdio.h>
#include <windows.h>
int main(int argc, char **argv)
{
HANDLE hDevice = NULL;
UCHAR MBRFirstBytes[4] = {0};
DWORD Dummy = 0;
hDevice = CreateFile("\\\\.\\PhysicalDrive0",
GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
0,
NULL);
if(hDevice != INVALID_HANDLE_VALUE)
{
printf("First 4-bytes of MBR (PhysicalDrive0, in hex): \n");
ReadFile(hDevice, MBRFirstBytes, 4, &Dummy, NULL);
printf("%02X %02X %02X %02X\n", MBRFirstBytes[0], MBRFirstBytes[1], MBRFirstBytes[2], MBRFirstBytes[3]);
CloseHandle(hDevice);
}
return 0;
}</windows.h></stdio.h> |
_________________
[img]
<a><img></a>[/img]
iroo sooo hooooot |
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
|
| Back to top |
|
 |
Noz3001 I'm a spammer
Reputation: 26
Joined: 29 May 2006 Posts: 6220 Location: /dev/null
|
Posted: Wed Apr 16, 2008 12:11 pm Post subject: |
|
|
| Wiccaan wrote: | | Code: | | }</windows.h></stdio.h> |
Lol not sure why you have that in there, but C/C++ isn't like HTML  |
Haha, that's what I was wondering. I even googles it to make sure it wasn't something i'd missed. |
|
| Back to top |
|
 |
--Pillboi-- Grandmaster Cheater Supreme
Reputation: 0
Joined: 06 Mar 2007 Posts: 1383 Location: I don't understand the question. Is this a 1 to 10 thing?
|
Posted: Wed Apr 16, 2008 12:18 pm Post subject: |
|
|
I've seen that before somewhere, can't remember where though. Maybe another one of his programs?
Also, give credits: http://vbdream.tistory.com/category/Win32%20API _________________
Enter darkness, leave the light, Here be nightmare, here be fright...
Earth and Water, Fire and Air. Prepare to meet a creature rare.
Enter now if you dare, Enter now the dragon's lair. |
|
| 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
|
|