Commit c10eabf0 authored by swift_gan's avatar swift_gan Committed by swift_gan

tweak code

parent 0ac2a058
...@@ -42,10 +42,12 @@ include_directories( ...@@ -42,10 +42,12 @@ include_directories(
src/main/cpp/elf src/main/cpp/elf
src/main/cpp/utils src/main/cpp/utils
src/main/cpp/includes src/main/cpp/includes
src/main/cpp/buffer
src/main/cpp/archs/arm64/inst src/main/cpp/archs/arm64/inst
src/main/cpp/archs/arm64/register src/main/cpp/archs/arm64/register
src/main/cpp/archs/arm64/decoder src/main/cpp/archs/arm64/decoder
src/main/cpp/archs/arm64/assembler src/main/cpp/archs/arm64/assembler
src/main/cpp/archs/arm64/relocate
src/main/cpp/archs/arm32/inst src/main/cpp/archs/arm32/inst
src/main/cpp/archs/arm32/register src/main/cpp/archs/arm32/register
) )
......
...@@ -4,17 +4,20 @@ ...@@ -4,17 +4,20 @@
#include "hook.h" #include "hook.h"
#include "../buffer/code_buffer.h" #include "code_buffer.h"
#include "../../../../../hooklib/src/main/cpp/utils/lock.h" #include "lock.h"
using namespace SandHook::Hook; using namespace SandHook::Hook;
using namespace SandHook::Decoder; using namespace SandHook::Decoder;
using namespace SandHook::Asm; using namespace SandHook::Asm;
using namespace SandHook::Assembler; using namespace SandHook::Assembler;
using namespace SandHook::Utils;
#include "assembler_a64.h" #include "assembler_a64.h"
#include "code_relocate_a64.h"
#include "../archs/arm64/relocate/code_relocate_a64.h" #include "../archs/arm64/relocate/code_relocate_a64.h"
AndroidCodeBuffer* backupBuffer = new AndroidCodeBuffer(); AndroidCodeBuffer* backupBuffer = new AndroidCodeBuffer();
void *InlineHookArm64Android::inlineHook(void *origin, void *replace) { void *InlineHookArm64Android::inlineHook(void *origin, void *replace) {
AutoLock lock(hookLock); AutoLock lock(hookLock);
......
...@@ -25,9 +25,15 @@ namespace SandHook { ...@@ -25,9 +25,15 @@ namespace SandHook {
class InlineHookArm64Android : InlineHook { class InlineHookArm64Android : InlineHook {
public: public:
inline InlineHookArm64Android() {
hookLock = new std::mutex();
};
inline ~InlineHookArm64Android() {
delete hookLock;
}
void *inlineHook(void *origin, void *replace) override; void *inlineHook(void *origin, void *replace) override;
protected: protected:
std::mutex* hookLock = new std::mutex(); std::mutex* hookLock;
}; };
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment