-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconvert.h
37 lines (22 loc) · 889 Bytes
/
convert.h
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
#ifndef CONVERTER_CONVERT_H
#define CONVERTER_CONVERT_H
#include <map>
#include <string>
#include <set>
#include "const.h"
#include "struct.h"
bool isReg(std::string &arg);
bool isReg64(std::string ®);
std::string convertReg(const std::string ®);
std::string getAppropriateTemp1Reg(std::string &arg);
std::string getAppropriateTemp2Reg(std::string &arg);
enum InstrType {
PROLOGUE, EPILOGUE, ADD, SUB, CMP, CALL, MOV, JMP, JMPCOND
};
InstrType getInstrType(cs_insn instr);
std::vector<std::string> convertOp(cs_insn instr, int instrIndex, std::map<int, int> &jumps);
CodeWithReloc convertOpWithReloc(cs_insn instr);
std::map<int, int> getArmJumps(Assembly &code, std::map<int, size_t> &relocIndexes);
std::set<int> getCallIndexes(Assembly &code);
std::map<int, size_t> getRelocIndexes(Assembly &code, std::vector<Elf64_Rela> &relocs);
#endif //CONVERTER_CONVERT_H