forked from MaidsShadowClub/triton_krackme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutils.hpp
43 lines (37 loc) · 1.8 KB
/
utils.hpp
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
#ifndef KRACKME_UTILS_H
#define KRACKME_UTILS_H
#include <triton/context.hpp>
using namespace triton;
#define debug_printf(format, ...) \
{ \
if (DEBUG) \
std::printf("\x1b[31m" format "\x1b[0m", __VA_ARGS__); \
}
#define debug_puts(str) \
{ \
if (DEBUG) \
std::puts("\x1b[31m" str "\x1b[0m"); \
}
#define triton_printf(format, ...) \
{ \
std::printf("\x1b[33m" format "\x1b[0m", __VA_ARGS__); \
}
#define triton_puts(str) \
{ \
std::puts("\x1b[33m" str "\x1b[0m"); \
}
uint64 getStack(int number);
void setStack(int number, const uint64 value);
arch::Register getArgReg(int number);
uint64 getArg(int number);
void setArg(int number, const uint64 value);
uint64 getGpr(const std::string &name);
void setGpr(const std::string &name, const uint64 value);
arch::register_e getGprId(const std::string &name);
uint64 allocate(uint8 *buf, uint64 size);
std::string toHex(uint64 ptr, uint32 size);
std::string readAsciiString(uint64 ptr, uint64 len);
std::string readUtf8String(uint64 ptr, uint64 len);
uint64 lenString(uint64 ptr);
uint64 printfArgAmount(std::string format);
#endif