mirror of
https://github.com/0O0o0oOoO00/Alas.git
synced 2026-05-22 08:09:29 +08:00
25 lines
498 B
C
25 lines
498 B
C
|
|
#ifndef CODE_BUFFER_ARM64_H
|
||
|
|
#define CODE_BUFFER_ARM64_H
|
||
|
|
|
||
|
|
#include "MemoryAllocator/CodeBuffer/CodeBufferBase.h"
|
||
|
|
|
||
|
|
typedef int32_t arm64_inst_t;
|
||
|
|
|
||
|
|
class CodeBuffer : public CodeBufferBase {
|
||
|
|
|
||
|
|
public:
|
||
|
|
CodeBuffer() : CodeBufferBase() {
|
||
|
|
}
|
||
|
|
|
||
|
|
public:
|
||
|
|
arm64_inst_t LoadInst(uint32_t offset) {
|
||
|
|
return *reinterpret_cast<int32_t *>(GetBuffer() + offset);
|
||
|
|
}
|
||
|
|
|
||
|
|
void RewriteInst(uint32_t offset, arm64_inst_t instr) {
|
||
|
|
*reinterpret_cast<arm64_inst_t *>(GetBuffer() + offset) = instr;
|
||
|
|
}
|
||
|
|
};
|
||
|
|
|
||
|
|
#endif
|