Click here to Skip to main content
15,896,154 members
Articles / Programming Languages / C++

Performing a hex dump of another process's memory

Rate me:
Please Sign up or sign in to vote.
4.61/5 (27 votes)
6 Sep 20035 min read 232.3K   9.7K   85  
An article on examining process memory
/*
 Program Name: TCHexWindow.h
 Programmer: Timothy Carpenter, 
	(c) Copyright 2003 San Diego
 Description: C++ Windows Interface class.
 Platform: Win XP Home VisualC++ 6.0, Pentium
*/
// TCHexWindow.h: interface for the TCHexWindow class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_TCHEXWINDOW_H__A2B1688B_52A9_4839_9A32_39FB0FC9908B__INCLUDED_)
#define AFX_TCHEXWINDOW_H__A2B1688B_52A9_4839_9A32_39FB0FC9908B__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define STRICT
#include <windows.h>
#include "TCHScroll.h"
#include "TCVScroll.h"

class TCHexWindow  
{
private:
	TCHScroll	m_hScroll;
	TCVScroll	m_vScroll;
	HFONT m_hFont;
	int m_fontx, m_fonty, m_fontnl;
    int	m_ClientWidth;
    int	m_ClientHeight;
	int m_ClientLines;
	int m_iDisplayChars;
public:
	char szClassName[50];
	char szWinTitle[50];
	HINSTANCE	m_hInst;
	HWND		m_hWnd;
	TCHAR	m_MemBuffer[100*500];
	HANDLE m_hProcess;
	MEMORY_BASIC_INFORMATION	mbi;
public:
	void LoadMem(DWORD dwOffset);
	TCHexWindow();
	virtual ~TCHexWindow();
	BOOL Register(HINSTANCE hInst);
	void Init(HANDLE hProcess, MEMORY_BASIC_INFORMATION	*pmbi);
	HWND Create(HINSTANCE hInst, int nCmdShow);
	LRESULT CALLBACK WndProc(
		HWND hWindow, UINT Message,
		WPARAM wParam, LPARAM lParam
	);
	LRESULT	wmCommand(HWND hWindow, WPARAM wParam, LPARAM lParam);
	LRESULT wmCreate(HWND hWindow);
	LRESULT wmSize(HWND hWnd, LPARAM lParam);
	LRESULT wmDestroy(HWND hWindow);
	LRESULT wmPaint(HWND hWindow);
	void SetupFont(HWND hWnd);
};

extern TCHexWindow gHexWindow;

#endif // !defined(AFX_TCHEXWINDOW_H__A2B1688B_52A9_4839_9A32_39FB0FC9908B__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions