Click here to Skip to main content
15,887,596 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: to call GlobalAlloc Pin
toxcct26-Mar-07 23:21
toxcct26-Mar-07 23:21 
GeneralRe: to call GlobalAlloc Pin
zon_cpp27-Mar-07 0:03
zon_cpp27-Mar-07 0:03 
GeneralRe: to call GlobalAlloc Pin
toxcct27-Mar-07 0:12
toxcct27-Mar-07 0:12 
QuestionRe: to call GlobalAlloc Pin
zon_cpp27-Mar-07 0:27
zon_cpp27-Mar-07 0:27 
AnswerRe: to call GlobalAlloc Pin
toxcct27-Mar-07 0:33
toxcct27-Mar-07 0:33 
GeneralRe: to call GlobalAlloc [modified] Pin
zon_cpp27-Mar-07 1:11
zon_cpp27-Mar-07 1:11 
GeneralRe: to call GlobalAlloc Pin
toxcct27-Mar-07 2:02
toxcct27-Mar-07 2:02 
GeneralRe: to call GlobalAlloc Pin
zon_cpp27-Mar-07 2:38
zon_cpp27-Mar-07 2:38 
For example: i call EnumProcesses function in endless loop (in thread),
first parameter of this function is a Pointer to an array that receives the list of process identifiers.

i call GlobalAlloc function to allocate memory with 1024 bytes or more for size (befor endless loop), then i send pointer to this memory (return value of GlobalAlloc) to EnumProcesses function :

__asm<br />
	{<br />
	mov		ecx, 4096	// = 1024*4<br />
	push		ecx<br />
	push		GMEM_FIXED<br />
	call		GlobalAlloc			// calling address of this function<br />
	mov		dword ptr[ebp + 0x48], eax	// ebp + 0x48 address of a dword in exe<br />
<br />
EndlessLoop:<br />
<br />
	lea		ecx,dword ptr[ebp + 0x49] 	// ebp + 0x48 address of a dword in exe<br />
	push		ecx<br />
	mov		ecx, 4096<br />
	push		ecx<br />
	mov		edx,[ebp + 0x48]<br />
	push		edx<br />
	call		EnumProcesses 			// calling address of this function<br />
<br />
	// and other code<br />
<br />
<br />
<br />
	jmp EndlessLoop<br />
<br />
	}<br />


i add a code section to an exe. this section creates thread white endless loop. all of this codes should be assembly language

Zo.Naderi-Iran

GeneralRe: to call GlobalAlloc Pin
toxcct27-Mar-07 2:42
toxcct27-Mar-07 2:42 
GeneralRe: to call GlobalAlloc Pin
zon_cpp27-Mar-07 2:46
zon_cpp27-Mar-07 2:46 
GeneralRe: to call GlobalAlloc Pin
_808627-Mar-07 3:28
_808627-Mar-07 3:28 
GeneralRe: to call GlobalAlloc Pin
toxcct27-Mar-07 3:44
toxcct27-Mar-07 3:44 
QuestionRe: to call GlobalAlloc Pin
Mark Salsbery27-Mar-07 7:25
Mark Salsbery27-Mar-07 7:25 
GeneralRe: to call GlobalAlloc Pin
David Crow27-Mar-07 2:57
David Crow27-Mar-07 2:57 
GeneralRe: to call GlobalAlloc Pin
zon_cpp27-Mar-07 20:25
zon_cpp27-Mar-07 20:25 
GeneralRe: to call GlobalAlloc Pin
David Crow28-Mar-07 2:06
David Crow28-Mar-07 2:06 
QuestionUsed without being defined .... Pin
Programm3r26-Mar-07 23:08
Programm3r26-Mar-07 23:08 
AnswerRe: Used without being defined .... Pin
toxcct26-Mar-07 23:10
toxcct26-Mar-07 23:10 
GeneralRe: Used without being defined .... Pin
Programm3r26-Mar-07 23:18
Programm3r26-Mar-07 23:18 
GeneralRe: Used without being defined .... Pin
_808627-Mar-07 0:20
_808627-Mar-07 0:20 
AnswerRe: Used without being defined .... Pin
prasad_som26-Mar-07 23:10
prasad_som26-Mar-07 23:10 
AnswerRe: Used without being defined .... Pin
Programm3r26-Mar-07 23:14
Programm3r26-Mar-07 23:14 
QuestionRe: Used without being defined .... Pin
prasad_som26-Mar-07 23:19
prasad_som26-Mar-07 23:19 
AnswerRe: Used without being defined .... Pin
Programm3r26-Mar-07 23:27
Programm3r26-Mar-07 23:27 
GeneralRe: Used without being defined .... Pin
prasad_som26-Mar-07 23:32
prasad_som26-Mar-07 23:32 

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.