Click here to Skip to main content
15,890,186 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Is there anyone who knows Trojans??? Pin
Ravi Bhavnani15-Mar-05 3:00
professionalRavi Bhavnani15-Mar-05 3:00 
GeneralVS6 and MSDN Pin
quantum6914-Mar-05 13:09
quantum6914-Mar-05 13:09 
GeneralRe: VS6 and MSDN Pin
David Crow15-Mar-05 3:10
David Crow15-Mar-05 3:10 
GeneralRe: VS6 and MSDN Pin
quantum6916-Mar-05 15:14
quantum6916-Mar-05 15:14 
GeneralRead sector Pin
Y_R14-Mar-05 11:54
Y_R14-Mar-05 11:54 
GeneralRe: Read sector Pin
Ravi Bhavnani15-Mar-05 3:02
professionalRavi Bhavnani15-Mar-05 3:02 
GeneralRe: Read sector Pin
Y_R15-Mar-05 9:14
Y_R15-Mar-05 9:14 
Generalwin 32 API virtual memory Pin
mpapeo14-Mar-05 11:53
mpapeo14-Mar-05 11:53 
Please help me with this. I am using VirtualQueryEx() function to get information about regions of pages committed and save this information in a file. Here is part of my code
<br />
PROCESS_INFORMATION pi;       <br />
	STARTUPINFO si;               <br />
	HANDLE hProcess; <br />
	BYTE buf[20000];<br />
	DWORD NumberOfBytesRead = 0;<br />
	DWORD bufsize = sizeof buf;<br />
	DWORD baseaddr = 0;<br />
	DWORD lpAddr = 0;<br />
	PMEMORY_BASIC_INFORMATION lpBuffer = 0;<br />
	DWORD dwLength = 200000;/****/<br />
	DWORD flNewProtect =0;<br />
	PDWORD lpflOldProtect = 0;<br />
	DWORD dwSize =0;<br />
	LPCVOID lpBaseAddress = 0;<br />
	DWORD nSize = 0;<br />
<br />
VirtualQueryEx(<br />
hProcess,    // handle to process<br />
&lpAddr,  // address of region<br />
buf,// address of information buffer<br />
sizeof (MEMORY_BASIC_INFORMATION));// size of buffer<br />
<br />
	VirtualProtectEx(<br />
	hProcess,     // handle to process<br />
	lpAddr,    // address of region of committed pages<br />
	dwSize,        // size of region<br />
	flNewProtect,  // desired access protection<br />
	lpflOldProtect );// address of variable to get old protection<br />
     <br />
	ZeroMemory(buf, sizeof(buf));<br />
if( ReadProcessMemory( hProcess, lpBaseAddress, buf, bufsize, &NumberOfBytesRead ) == FALSE )<br />
	{<br />
	printf("\nProcess ID %d ",pi.dwProcessId);<br />
	printf (" memory read failed (errcode: %d)", GetLastError());<br />
	}<br />
	else<br />
	{<br />
	printf("\nProcess ID %d ",pi.dwProcessId);<br />
	printf("memory read: \n",buf);<br />
        GetLastError());<br />
	}<br />

How do i return this function call, i.e. to return information about pages commited and occupied pages

oam
GeneralLooking to simplify my life Pin
Aggrav8d14-Mar-05 11:30
Aggrav8d14-Mar-05 11:30 
GeneralRe: Looking to simplify my life Pin
bobi_zcl14-Mar-05 14:11
bobi_zcl14-Mar-05 14:11 
GeneralCPropertyPage Wizard Style.. Should be easy.. Pin
RobJones14-Mar-05 11:26
RobJones14-Mar-05 11:26 
GeneralRe: CPropertyPage Wizard Style.. Should be easy.. Pin
Ralph Wetzel14-Mar-05 11:49
Ralph Wetzel14-Mar-05 11:49 
GeneralRe: CPropertyPage Wizard Style.. Should be easy.. Pin
RobJones14-Mar-05 12:14
RobJones14-Mar-05 12:14 
GeneralText color of VS2003 output window Pin
Ravi Bhavnani14-Mar-05 10:46
professionalRavi Bhavnani14-Mar-05 10:46 
Generalvisual c++ .net 2003 Pin
jogodo14-Mar-05 10:00
jogodo14-Mar-05 10:00 
GeneralRe: visual c++ .net 2003 Pin
Christian Graus14-Mar-05 16:29
protectorChristian Graus14-Mar-05 16:29 
GeneralGetting total network traffic Pin
vapz14-Mar-05 9:57
vapz14-Mar-05 9:57 
GeneralBold text in menu Pin
qwert8510314-Mar-05 9:08
qwert8510314-Mar-05 9:08 
GeneralRe: Bold text in menu Pin
Graham Bradshaw14-Mar-05 12:30
Graham Bradshaw14-Mar-05 12:30 
GeneralCreateProcess Questions Pin
kyensen14-Mar-05 8:35
kyensen14-Mar-05 8:35 
GeneralRe: CreateProcess Questions Pin
Peter Weyzen14-Mar-05 8:54
Peter Weyzen14-Mar-05 8:54 
GeneralMessages of parent windows Pin
r3dqu33n14-Mar-05 8:00
r3dqu33n14-Mar-05 8:00 
GeneralRe: Messages of parent windows Pin
namaskaaram14-Mar-05 19:42
namaskaaram14-Mar-05 19:42 
GeneralRe: Messages of parent windows Pin
r3dqu33n15-Mar-05 1:02
r3dqu33n15-Mar-05 1:02 
GeneralRe: Messages of parent windows Pin
namaskaaram15-Mar-05 2:48
namaskaaram15-Mar-05 2:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.