Skip to content

Commit

Permalink
add kananlib/bddisasm
Browse files Browse the repository at this point in the history
  • Loading branch information
ThirteenAG committed Jun 20, 2024
1 parent 9fb030d commit 898c533
Show file tree
Hide file tree
Showing 496 changed files with 1,090,881 additions and 0 deletions.
3 changes: 3 additions & 0 deletions kananlib/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build/
test/build
test/kananlib
227 changes: 227 additions & 0 deletions kananlib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,227 @@
# This file is automatically generated from cmake.toml - DO NOT EDIT
# See https://github.com/build-cpp/cmkr for more information

cmake_minimum_required(VERSION 3.15)

if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
message(FATAL_ERROR "In-tree builds are not supported. Run CMake from a separate directory: cmake -B build")
endif()

# Regenerate CMakeLists.txt automatically in the root project
set(CMKR_ROOT_PROJECT OFF)
if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
set(CMKR_ROOT_PROJECT ON)

# Bootstrap cmkr
include(cmkr.cmake OPTIONAL RESULT_VARIABLE CMKR_INCLUDE_RESULT)
if(CMKR_INCLUDE_RESULT)
cmkr()
endif()

# Enable folder support
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
endif()

# Create a configure-time dependency on cmake.toml to improve IDE support
if(CMKR_ROOT_PROJECT)
configure_file(cmake.toml cmake.toml COPYONLY)
endif()

# Options
option(KANANLIB_FETCH_BDDISASM "" OFF)
option(KANANLIB_FETCH_SPDLOG "" OFF)
option(KANANLIB_STANDALONE_BUILD "" OFF)


add_compile_options($<$<CXX_COMPILER_ID:MSVC>:/MP>)

project(kananlib)

if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
# The project is being built standalone
message(STATUS "kananlib: Building standalone")
set(KANANLIB_STANDALONE_BUILD ON)
else()
# The project is being included as part of another project
message(STATUS "kananlib: Building as part of another project")
set(KANANLIB_STANDALONE_BUILD OFF)
endif()

include(FetchContent)

if(KANANLIB_FETCH_BDDISASM OR KANANLIB_STANDALONE_BUILD) # fetch-bddisasm
message(STATUS "Fetching bddisasm (v1.37.0)...")
FetchContent_Declare(bddisasm
GIT_REPOSITORY
"https://github.com/bitdefender/bddisasm"
GIT_TAG
v1.37.0
GIT_SHALLOW
ON
)
FetchContent_MakeAvailable(bddisasm)

endif()
if(KANANLIB_FETCH_SPDLOG OR KANANLIB_STANDALONE_BUILD) # fetch-spdlog
message(STATUS "Fetching spdlog (v1.12.0)...")
FetchContent_Declare(spdlog
GIT_REPOSITORY
"https://github.com/gabime/spdlog"
GIT_TAG
v1.12.0
GIT_SHALLOW
ON
)
FetchContent_MakeAvailable(spdlog)

endif()
# Target kananlib
set(CMKR_TARGET kananlib)
set(kananlib_SOURCES "")

list(APPEND kananlib_SOURCES
"src/Address.cpp"
"src/Config.cpp"
"src/Emulation.cpp"
"src/Input.cpp"
"src/Memory.cpp"
"src/Module.cpp"
"src/Patch.cpp"
"src/Pattern.cpp"
"src/PointerHook.cpp"
"src/RTTI.cpp"
"src/Registry.cpp"
"src/Scan.cpp"
"src/String.cpp"
"src/Thread.cpp"
"src/VtableHook.cpp"
"include/utility/Address.hpp"
"include/utility/Benchmark.hpp"
"include/utility/Config.hpp"
"include/utility/Emulation.hpp"
"include/utility/Input.hpp"
"include/utility/Memory.hpp"
"include/utility/Module.hpp"
"include/utility/Patch.hpp"
"include/utility/Pattern.hpp"
"include/utility/PointerHook.hpp"
"include/utility/RTTI.hpp"
"include/utility/Registry.hpp"
"include/utility/Scan.hpp"
"include/utility/ScopeGuard.hpp"
"include/utility/String.hpp"
"include/utility/Thread.hpp"
"include/utility/VtableHook.hpp"
"include/utility/thirdparty/InstructionSet.hpp"
"include/utility/thirdparty/parallel-util.hpp"
)

list(APPEND kananlib_SOURCES
cmake.toml
)

set(CMKR_SOURCES ${kananlib_SOURCES})
add_library(kananlib STATIC)

if(kananlib_SOURCES)
target_sources(kananlib PRIVATE ${kananlib_SOURCES})
endif()

target_compile_features(kananlib PUBLIC
cxx_std_20
)

target_compile_options(kananlib PUBLIC
"/EHa"
)

target_include_directories(kananlib PUBLIC
include
)

target_link_libraries(kananlib PUBLIC
bddisasm::bddisasm
spdlog::spdlog
shlwapi
)

unset(CMKR_TARGET)
unset(CMKR_SOURCES)

# Target kananlib-nolog
set(CMKR_TARGET kananlib-nolog)
set(kananlib-nolog_SOURCES "")

list(APPEND kananlib-nolog_SOURCES
"src/Address.cpp"
"src/Config.cpp"
"src/Emulation.cpp"
"src/Input.cpp"
"src/Memory.cpp"
"src/Module.cpp"
"src/Patch.cpp"
"src/Pattern.cpp"
"src/PointerHook.cpp"
"src/RTTI.cpp"
"src/Registry.cpp"
"src/Scan.cpp"
"src/String.cpp"
"src/Thread.cpp"
"src/VtableHook.cpp"
"include/utility/Address.hpp"
"include/utility/Benchmark.hpp"
"include/utility/Config.hpp"
"include/utility/Emulation.hpp"
"include/utility/Input.hpp"
"include/utility/Memory.hpp"
"include/utility/Module.hpp"
"include/utility/Patch.hpp"
"include/utility/Pattern.hpp"
"include/utility/PointerHook.hpp"
"include/utility/RTTI.hpp"
"include/utility/Registry.hpp"
"include/utility/Scan.hpp"
"include/utility/ScopeGuard.hpp"
"include/utility/String.hpp"
"include/utility/Thread.hpp"
"include/utility/VtableHook.hpp"
"include/utility/thirdparty/InstructionSet.hpp"
"include/utility/thirdparty/parallel-util.hpp"
)

list(APPEND kananlib-nolog_SOURCES
cmake.toml
)

set(CMKR_SOURCES ${kananlib-nolog_SOURCES})
add_library(kananlib-nolog STATIC)

if(kananlib-nolog_SOURCES)
target_sources(kananlib-nolog PRIVATE ${kananlib-nolog_SOURCES})
endif()

target_compile_features(kananlib-nolog PUBLIC
cxx_std_20
)

target_compile_options(kananlib-nolog PUBLIC
"/EHa"
)

target_include_directories(kananlib-nolog PUBLIC
include
)

target_link_libraries(kananlib-nolog PUBLIC
bddisasm::bddisasm
spdlog::spdlog
shlwapi
)

target_compile_definitions(kananlib-nolog PUBLIC
SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_OFF
)

unset(CMKR_TARGET)
unset(CMKR_SOURCES)

23 changes: 23 additions & 0 deletions kananlib/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Boost Software License - Version 1.0 - August 17th, 2003

Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:

The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
3 changes: 3 additions & 0 deletions kananlib/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# kananlib

General purpose library with a focus on automated reverse engineering tasks
65 changes: 65 additions & 0 deletions kananlib/cmake.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Reference: https://build-cpp.github.io/cmkr/cmake-toml
[project]
name = "kananlib"
cmake-before="""
add_compile_options($<$<CXX_COMPILER_ID:MSVC>:/MP>)
"""
cmake-after="""
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
# The project is being built standalone
message(STATUS "kananlib: Building standalone")
set(KANANLIB_STANDALONE_BUILD ON)
else()
# The project is being included as part of another project
message(STATUS "kananlib: Building as part of another project")
set(KANANLIB_STANDALONE_BUILD OFF)
endif()
"""

[options]
KANANLIB_FETCH_BDDISASM = false
KANANLIB_FETCH_SPDLOG = false
KANANLIB_STANDALONE_BUILD = false

[conditions]
fetch-bddisasm = "KANANLIB_FETCH_BDDISASM OR KANANLIB_STANDALONE_BUILD"
fetch-spdlog = "KANANLIB_FETCH_SPDLOG OR KANANLIB_STANDALONE_BUILD"

[fetch-content.bddisasm]
condition = "fetch-bddisasm"
git = "https://github.com/bitdefender/bddisasm"
tag = "v1.37.0"
shallow = true

[fetch-content.spdlog]
condition = "fetch-spdlog"
git = "https://github.com/gabime/spdlog"
tag = "v1.12.0"
shallow = true

[template.kananlib-template]
type = "static"
sources = ["src/*.cpp", "include/**.hpp"]
include-directories = ["include"]
compile-features = ["cxx_std_20"]
compile-options = ["/EHa"]
link-libraries = [
"bddisasm::bddisasm",
"spdlog::spdlog",
"shlwapi"
]

[target.kananlib]
type = "kananlib-template"

[target.kananlib-nolog]
type = "kananlib-template"
compile-definitions = ["SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_OFF"]

# TODO: define a target for each of your executables/libraries like this:
#[target.myexecutable]
#type = "executable" # static, shared
#sources = ["src/kananlib/*.cpp", "include/kananlib/*.hpp"]
#include-directories = ["include"]
#compile-features = ["cxx_std_11"]
#link-libraries = ["target-or-library"]
Loading

0 comments on commit 898c533

Please sign in to comment.