MemoryAccessor 1
A command-line front-end for exploring virtual memory of a linux process by accessing /proc/PID/mem file.
Loading...
Searching...
No Matches
hexviewer.h
Go to the documentation of this file.
1// MemoryAccessor - A tool for accessing /proc/PID/mem
2// Copyright (C) 2024 zloymish
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program. If not, see <https://www.gnu.org/licenses/>.
16
24#ifndef MEMORYACCESSOR_SRC_HEXVIEWER_H_
25#define MEMORYACCESSOR_SRC_HEXVIEWER_H_
26
27#include <ostream>
28
36class HexViewer {
37public:
38 void PrintHex(std::ostream *stream_p, const char *s, size_t size, size_t addr,
39 bool show_hex = false) const noexcept;
40
41private:
42 uint32_t base_width_{
43 8};
45};
46
47#endif // MEMORYACCESSOR_SRC_HEXVIEWER_H_
A class for printing data in a readable format.
Definition hexviewer.h:36
void PrintHex(std::ostream *stream_p, const char *s, size_t size, size_t addr, bool show_hex=false) const noexcept
Print data in readable format.
Definition hexviewer.cc:52