Skip to content

Latest commit

 

History

History
79 lines (53 loc) · 1.62 KB

README.md

File metadata and controls

79 lines (53 loc) · 1.62 KB

KittyMemoryEx Android Example

This is an Android executable example.

Requires C++11 or above.
Android API 21 or above for keystone linking.

See how to use KittyMemoryEx in example.cpp.

Clone:

git clone --recursive https://github.com/MJx0/KittyMemoryEx.git

How to build:

NDK Build:

  • In your Android.mk somewhere at top, define:
KITTYMEMORYEX_PATH = path/to/KittyMemoryEx
KITTYMEMORYEX_SRC = $(wildcard $(KITTYMEMORYEX_PATH)/*.cpp)
  • Inlcude Keystone static lib:
include $(CLEAR_VARS)
LOCAL_MODULE    := Keystone
LOCAL_SRC_FILES := $(KITTYMEMORYEX_PATH)/Deps/Keystone/libs-android/$(TARGET_ARCH_ABI)/libkeystone.a
include $(PREBUILT_STATIC_LIBRARY)
  • Add KittyMemoryEx source files:
LOCAL_SRC_FILES := example.cpp $(KITTYMEMORYEX_SRC)
  • Finally add keystone static lib:
LOCAL_STATIC_LIBRARIES := Keystone

You can check example here Android.mk.

CMake Build:

  • In your CMakeLists.txt somewhere at top, define:
set(KITTYMEMORYEX_PATH path/to/KittyMemoryEx)
file(GLOB KITTYMEMORYEX_SRC ${KITTYMEMORYEX_PATH}/*.cpp)
  • Inlcude Keystone static lib:
set(KEYSTONE_LIB ${KITTYMEMORYEX_PATH}/Deps/Keystone/libs-android/${CMAKE_ANDROID_ARCH_ABI}/libkeystone.a)
  • Add KittyMemoryEx source files:
add_library(YourProjectName SHARED example.cpp ${KITTYMEMORYEX_SRC})
  • Finally add keystone static lib:
target_link_libraries(YourProjectName ${KEYSTONE_LIB})
## or
link_libraries(${KEYSTONE_LIB})

You can check example here CMakeLists.txt.