mirror of
https://github.com/0O0o0oOoO00/Alas.git
synced 2026-05-23 08:49:29 +08:00
add: migrate source code of luahook
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user