Click here to Skip to main content
16,006,709 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Logging WriteProcessMemory calls Pin
Todd Smith9-Aug-02 16:53
Todd Smith9-Aug-02 16:53 
GeneralRe: Logging WriteProcessMemory calls Pin
carrie10-Aug-02 8:27
carrie10-Aug-02 8:27 
GeneralUser breakpoint called from code at 0x77f9f9df Pin
redeemer9-Aug-02 7:36
redeemer9-Aug-02 7:36 
GeneralRe: User breakpoint called from code at 0x77f9f9df Pin
Daniel Lohmann9-Aug-02 9:52
Daniel Lohmann9-Aug-02 9:52 
QuestionEmbed a DLL. Possible? Pin
clintsinger9-Aug-02 7:04
clintsinger9-Aug-02 7:04 
AnswerRe: Embed a DLL. Possible? Pin
Chris Losinger9-Aug-02 7:09
professionalChris Losinger9-Aug-02 7:09 
GeneralRe: Embed a DLL. Possible? Pin
clintsinger9-Aug-02 7:10
clintsinger9-Aug-02 7:10 
GeneralRe: Embed a DLL. Possible? Pin
Chris Losinger9-Aug-02 7:19
professionalChris Losinger9-Aug-02 7:19 
i don't think it's the only way, but it might be the only way without getting into some serious low level stuff.

you could put it in a resource, sure. that would be the most VisualStudio-friendly way. it would take about ten lines of C (plus error checking) to get the DLL out of memory and into a file - no big deal.

or, you could concatenate the DLL onto the end of the EXE, using an external app, with a length DWORD at the very end, so you know how many bytes to extract from the EXE. this method is trickier and might not be worth the effort. the resource method is probably safer.

	// find it
   HRSRC hRsrc = FindResource(hInstance, pName, "DLL");
	if (hRsrc)
	{
		// load it
		HGLOBAL hGlobal = LoadResource(hInstance, hRsrc);

		if (hGlobal)
		{
			// lock it
			BYTE *pDLL = (BYTE *)LockResource(hGlobal);
        
			DWORD dwSize = SizeofResource(hInstance, hRsrc);

... now open a file, and write the dwSize BYTEs starting at pDLL to a file.
			// clean up
			UnlockResource(hGlobal);
			FreeResource(hGlobal);
...

-c


Conservative:
One who admires radicals centuries after they're dead.
-- Leo C. Rosten

GeneralRe: Embed a DLL. Possible? Pin
clintsinger9-Aug-02 7:26
clintsinger9-Aug-02 7:26 
GeneralRe: Embed a DLL. Possible? Pin
Daniel Lohmann9-Aug-02 7:24
Daniel Lohmann9-Aug-02 7:24 
GeneralRe: Embed a DLL. Possible? Pin
clintsinger9-Aug-02 7:25
clintsinger9-Aug-02 7:25 
GeneralRe: Embed a DLL. Possible? Pin
Chris Losinger9-Aug-02 9:03
professionalChris Losinger9-Aug-02 9:03 
GeneralRe: Embed a DLL. Possible? Pin
Daniel Lohmann9-Aug-02 9:42
Daniel Lohmann9-Aug-02 9:42 
AnswerRe: Embed a DLL. Possible? Pin
Gerald Schwab9-Aug-02 9:53
Gerald Schwab9-Aug-02 9:53 
AnswerRe: Embed a DLL. Possible? Pin
Joel Lucsy9-Aug-02 10:21
Joel Lucsy9-Aug-02 10:21 
GeneralRe: Embed a DLL. Possible? - And a free one Pin
Neville Franks9-Aug-02 21:54
Neville Franks9-Aug-02 21:54 
GeneralI would like to know the instruction.... Pin
Ta_Tee4739-Aug-02 6:19
Ta_Tee4739-Aug-02 6:19 
GeneralRe: I would like to know the instruction.... Pin
Chris Losinger9-Aug-02 6:20
professionalChris Losinger9-Aug-02 6:20 
GeneralRe: I would like to know the instruction.... Pin
Ta_Tee4739-Aug-02 17:20
Ta_Tee4739-Aug-02 17:20 
GeneralRe: I would like to know the instruction.... Pin
Chris Losinger9-Aug-02 18:11
professionalChris Losinger9-Aug-02 18:11 
GeneralCan't figure out these compile errors. Pin
redeemer9-Aug-02 5:58
redeemer9-Aug-02 5:58 
GeneralRe: Can't figure out these compile errors. Pin
Daniel Lohmann9-Aug-02 6:07
Daniel Lohmann9-Aug-02 6:07 
GeneralRe: Can't figure out these compile errors. Pin
redeemer9-Aug-02 7:13
redeemer9-Aug-02 7:13 
Questionhow to simulate key stroke to directx application? Pin
David High9-Aug-02 5:59
David High9-Aug-02 5:59 
AnswerRe: how to simulate key stroke to directx application? Pin
Paul M Watt9-Aug-02 21:53
mentorPaul M Watt9-Aug-02 21:53 

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.