Skip to content

Commit

Permalink
add config.h & remove intermidle file
Browse files Browse the repository at this point in the history
  • Loading branch information
liuyx committed Apr 2, 2017
1 parent 690080d commit c98276d
Show file tree
Hide file tree
Showing 8 changed files with 348 additions and 77 deletions.
54 changes: 0 additions & 54 deletions CMakeCache.txt

This file was deleted.

1 change: 0 additions & 1 deletion CMakeFiles/cmake.check_cache

This file was deleted.

7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
cmake_minimum_required(VERSION 3.6)
project(c__11)
cmake_minimum_required(VERSION 2.8)
project(hooker-test)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "-std=c++11")

set(SOURCE_FILES main.cpp Hooker.cpp Hooker.h HookerFactory.cpp HookerFactory.h HookerX64.cpp HookerX64.h HookerX86.cpp HookerX86.h HookerArm.cpp HookerArm.h HookerThumb.cpp HookerThumb.h)
add_executable(c__11 ${SOURCE_FILES})
add_executable(hooker-test ${SOURCE_FILES})
10 changes: 6 additions & 4 deletions HookerFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
// Created by lamoliu on 2017/4/1.
//

#include <utility>
#include <memory>
#include <mutex>
#include "HookerFactory.h"
#include "HookerX64.h"
#include "config.h"

std::unique_ptr<hooker::HookerFactory> hooker::HookerFactory::getInstance() {
static std::unique_ptr<hooker::HookerFactory> sInstance;
Expand All @@ -20,11 +22,11 @@ std::unique_ptr<hooker::Hooker> hooker::HookerFactory::getHooker() {
#ifdef __x86_64__
return std::unique_ptr<hooker::Hooker>(std::move(new hooker::HookerX64));
#elif defined(__i386__)
return std::unique_ptr<hooker::Hooker>(std::move(new HookerX86));
return std::unique_ptr<hooker::Hooker>(std::move(new hooker::HookerX86));
#elif defined(__arm__)
return std::unique_ptr<hooker::Hooker>(std::move(new HookerArm));
return std::unique_ptr<hooker::Hooker>(std::move(new hooker::HookerArm));
#elif defined(__thumb__)
return std::unique_ptr<hooker::Hooker>(std::move(new HookerThumb));
return std::unique_ptr<hooker::Hooker>(std::move(new hooker::HookerThumb));
#else
throw std::string("unsupported hook architecture");
#endif
Expand Down
5 changes: 1 addition & 4 deletions HookerFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ namespace hooker {
class HookerFactory {
public:
static std::unique_ptr<HookerFactory> getInstance();
Hooker* getHooker();
HookerFactory(const HookerFactory&) = delete;
HookerFactory&operator=(const HookerFactory&) = delete;
~HookerFactory() = default;
std::unique_ptr<Hooker> getHooker();
private:
explicit HookerFactory(){}
};
Expand Down
Loading

0 comments on commit c98276d

Please sign in to comment.