Click here to Skip to main content
16,005,120 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralWorking with MS Word Pin
Zero_divide_111-Mar-05 20:44
Zero_divide_111-Mar-05 20:44 
Generaldiference between C++ and VC++ Pin
Anonymous11-Mar-05 19:42
Anonymous11-Mar-05 19:42 
GeneralRe: diference between C++ and VC++ Pin
Zero_divide_111-Mar-05 20:26
Zero_divide_111-Mar-05 20:26 
GeneralRe: diference between C++ and VC++ Pin
markkuk12-Mar-05 0:45
markkuk12-Mar-05 0:45 
GeneralRe: diference between C++ and VC++ Pin
deldeep12-Mar-05 2:59
deldeep12-Mar-05 2:59 
GeneralRe: diference between C++ and VC++ Pin
John R. Shaw12-Mar-05 13:46
John R. Shaw12-Mar-05 13:46 
GeneralaHelp with SSL through anuthenticating proxy in WinInet Pin
Nickmatic11-Mar-05 14:50
Nickmatic11-Mar-05 14:50 
Generalcritical error Pin
mpapeo11-Mar-05 13:00
mpapeo11-Mar-05 13:00 
Why do i get a critical error here in this code. I want to read succesive pages in a process memory

<br />
int main(int argc, char **argv[]) <br />
{<br />
	PROCESS_INFORMATION pi;       /* filled in by CreateProcess */<br />
	STARTUPINFO si;               /* startup info for the new process*/<br />
	HANDLE hProcess; <br />
	BYTE buf[200000];							DWORD bufsize = sizeof buf;<br />
	DWORD baseaddr = 0;<br />
	LPCVOID lpAddress = 0;<br />
	PMEMORY_BASIC_INFORMATION lpBuffer = 0;<br />
	DWORD dwLength = 0;<br />
	DWORD flNewProtect =0;<br />
	PDWORD lpflOldProtect = 0;<br />
	DWORD dwSize =0;<br />
	LPCVOID lpBaseAddress = 0;<br />
	DWORD nSize = 0;<br />
	DWORD buff = 0;<br />
	LPDWORD lpNumberOfBytesRead = sizeof buf;<br />
	if (argc !=2)<br />
	{<br />
	printf("Error in the input line, Usage: Inputfile");<br />
	exit(0);<br />
	}<br />
//menu();<br />
<br />
	printf("Process %d  creates a child process\n",GetCurrentProcessId());//print out our process ID<br />
	GetStartupInfo(&si);<br />
<br />
  // Call CreateProcess, telling it to run an exe file<br />
CreateProcess(NULL,/* lpApplicationName */<br />
        argv[1],/* lpCommandLine  assumes to use curent process directory*/	NULL,	/* lpsaProcess */<br />
		NULL,	/* lpsaThread */<br />
		FALSE,	/* bInheritHandles */        CREATE_NEW_CONSOLE,     /* dwCreationFlags */<br />
		NULL,	/* lpEnvironment */<br />
                NULL,	/* lpCurDir */<br />
                &si,	/* lpStartupInfo */<br />
		&pi	/* lpProcInfo */<br />
		);<br />
 hProcess = pi.hProcess; <br />
  printf("New Process ID: %d ",pi.dwProcessId);<br />
  printf("has started \n");<br />
<br />
	VirtualQueryEx(<br />
	hProcess,    // handle to process<br />
	lpAddress,  // address of region<br />
	lpBuffer,// address of information buffer<br />
	dwLength,// size of buffer<br />
	GetLastError()<br />
	);<br />
	//*to avoid crashing<br />
	VirtualProtectEx(<br />
	hProcess,     // handle to process<br />
	lpAddress,    // 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, nSize, bufsize, buff ) == FALSE )<br />
	{<br />
	printf("\nProcess ID %d ",pi.dwProcessId);<br />
	printf (" memory read failed (errcode: %d)", GetLastError());<br />
		printf("\nmemory read: \n",&buf);<br />
	}<br />
	else<br />
	{<br />
		printf("\nProcess ID %d ",pi.dwProcessId);<br />
		printf("memory read: \n",buf);<br />
	}<br />
return (0);<br />
}<br />


oam
GeneralRe: critical error Pin
John R. Shaw12-Mar-05 14:17
John R. Shaw12-Mar-05 14:17 
GeneralRe: critical error Pin
mpapeo13-Mar-05 11:16
mpapeo13-Mar-05 11:16 
GeneralRe: critical error Pin
John R. Shaw15-Mar-05 10:23
John R. Shaw15-Mar-05 10:23 
QuestionHow to check wheter a specified path is a dir? Pin
Member 1219625211-Mar-05 12:32
Member 1219625211-Mar-05 12:32 
AnswerRe: How to check wheter a specified path is a dir? Pin
PJ Arends11-Mar-05 12:41
professionalPJ Arends11-Mar-05 12:41 
AnswerRe: How to check wheter a specified path is a dir? Pin
Ravi Bhavnani11-Mar-05 14:42
professionalRavi Bhavnani11-Mar-05 14:42 
AnswerRe: How to check wheter a specified path is a dir? Pin
Michael Dunn11-Mar-05 15:15
sitebuilderMichael Dunn11-Mar-05 15:15 
GeneralGetting rights for OpenSCManager Pin
bepperso11-Mar-05 11:02
bepperso11-Mar-05 11:02 
Generaldisplay a html page which is in memory Pin
includeh1011-Mar-05 10:31
includeh1011-Mar-05 10:31 
GeneralRe: display a html page which is in memory Pin
Ravi Bhavnani11-Mar-05 10:55
professionalRavi Bhavnani11-Mar-05 10:55 
Generalmemory allocation in dll Pin
NMiceli11-Mar-05 8:59
NMiceli11-Mar-05 8:59 
GeneralRe: memory allocation in dll Pin
Chris Losinger11-Mar-05 9:43
professionalChris Losinger11-Mar-05 9:43 
GeneralRe: memory allocation in dll Pin
NMiceli11-Mar-05 10:30
NMiceli11-Mar-05 10:30 
GeneralRe: memory allocation in dll Pin
cmk11-Mar-05 15:56
cmk11-Mar-05 15:56 
GeneralRe: memory allocation in dll Pin
Anonymous11-Mar-05 16:10
Anonymous11-Mar-05 16:10 
GeneralRe: memory allocation in dll Pin
cmk11-Mar-05 17:13
cmk11-Mar-05 17:13 
QuestionIs there a easy to move focus among controls using arrow key? Pin
transoft11-Mar-05 7:51
transoft11-Mar-05 7:51 

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.