-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDisplay.hpp
More file actions
52 lines (44 loc) · 1.58 KB
/
Display.hpp
File metadata and controls
52 lines (44 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#pragma once
#include "disassembler.h"
#include "breakpoint.hpp"
#include <windows.h>
#include <utility>
#include <stdio.h>
#include <string>
#include <list>
#include <map>
using std::list;
using std::map;
/* Standard error macro for reporting API errors */
#define PERR(bSuccess, api){if(!(bSuccess)) printf("%s:Error %lu from %s \
on line %d\n", __FILE__, GetLastError(), api, __LINE__);}
void Prompt();
void DisplayHelp();
void DisplayNInstruction(int nbInstr,DWORD address, PROCESS_INFORMATION &pi,Disassembler &disassembler, const map<DWORD,BYTE> &mapbp, const std::pair<DWORD,BYTE> &pairbp);
std::string GetLastErrorAsString();
void DisplayData(std::string command, std::string s_address, size_t size, PROCESS_INFORMATION &pi);
list<DWORD> getvalueregister(DWORD registre, PROCESS_INFORMATION &pi);
bool DisplayReg(std::string reg, CONTEXT &lcContext, PROCESS_INFORMATION &pi, Disassembler &d);
void DisplayAllReg(CONTEXT &lcContext, PROCESS_INFORMATION &pi, Disassembler &d);
enum Color{
BLACK = 0,
RED = FOREGROUND_RED,
BLUE = FOREGROUND_BLUE,
GREEN = FOREGROUND_GREEN,
YELLOW = FOREGROUND_RED | FOREGROUND_GREEN,
MAGENTA = FOREGROUND_RED | FOREGROUND_BLUE,
CYAN = FOREGROUND_GREEN | FOREGROUND_BLUE,
WHITE = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE
};
class ColorChanger{
public:
static bool Init();
static void SetColor(Color color, bool intens = false);
static void Reset();
static void cls();
private:
static HANDLE hStdout;
static WORD wOldColor;
static bool valid;
static CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
};