summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordmlunar <root@lunar.sh>2026-06-20 19:05:41 +0200
committerdmlunar <root@lunar.sh>2026-06-20 19:05:41 +0200
commit0b290914492c3eca7a0432be2ea2f0c8f5d71408 (patch)
tree46accdf61822e83be9f81284b1b24ddff4f371d5
parent866cf2e673e0dc77071a4e111c47cc9199cfe948 (diff)
downloadcdl86-0b290914492c3eca7a0432be2ea2f0c8f5d71408.tar.gz
cdl86-0b290914492c3eca7a0432be2ea2f0c8f5d71408.zip
cdl86: project updates
-rw-r--r--.gitignore3
-rw-r--r--README.md6
-rw-r--r--premake5.lua57
-rw-r--r--tests/basic_jmp.c2
-rw-r--r--tests/basic_swbp.c2
5 files changed, 68 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index 79b8925..674c256 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,5 @@
basic_jmp
basic_swbp
+.vscode
+bin/
+build/ \ No newline at end of file
diff --git a/README.md b/README.md
index cb6cc81..42f9104 100644
--- a/README.md
+++ b/README.md
@@ -32,6 +32,12 @@ Handles `control flow` to `detour`
> Note: This project makes use of an internal `x86` instruction length disassembly engine.
+# Build
+
+Both `Makefile` and `premake5` build targets are supported.
+
+For `premake5` simply run `premake5 vs2022` in the project root directory.
+
# API
```
struct cdl_jmp_patch cdl_jmp_attach(void **target, void *detour);
diff --git a/premake5.lua b/premake5.lua
new file mode 100644
index 0000000..982aad2
--- /dev/null
+++ b/premake5.lua
@@ -0,0 +1,57 @@
+workspace "cdl86"
+ configurations { "Debug", "Release" }
+ architecture "x86_64"
+ location "build"
+
+ symbols "On"
+ optimize "Off"
+
+ flags {
+ "NoIncrementalLink",
+ "NoRuntimeChecks"
+ }
+
+ filter "configurations:*"
+ buildoptions {
+ "/RTC-",
+ "/Ob0",
+ "/Oy-"
+ }
+
+ linkoptions {
+ "/OPT:NOICF"
+ }
+
+ filter {}
+
+project "basic_jmp"
+ kind "ConsoleApp"
+ language "C"
+
+ targetdir ("bin/%{cfg.buildcfg}")
+
+ files {
+ "cdl.c",
+ "cdl.h",
+ "tests/basic_jmp.c"
+ }
+
+ includedirs {
+ "."
+ }
+
+project "basic_swbp"
+ kind "ConsoleApp"
+ language "C"
+
+ targetdir ("bin/%{cfg.buildcfg}")
+
+ files {
+ "cdl.c",
+ "cdl.h",
+ "tests/basic_swbp.c"
+ }
+
+ includedirs {
+ "."
+ }
diff --git a/tests/basic_jmp.c b/tests/basic_jmp.c
index c3bd599..51bd912 100644
--- a/tests/basic_jmp.c
+++ b/tests/basic_jmp.c
@@ -60,7 +60,7 @@ int main(
__in void
)
{
- struct cdl_jmp_patch jmp_patch = {};
+ struct cdl_jmp_patch jmp_patch = {0};
addo = (add_t*)add;
printf("Before attach: \n");
diff --git a/tests/basic_swbp.c b/tests/basic_swbp.c
index f379cd6..0a92370 100644
--- a/tests/basic_swbp.c
+++ b/tests/basic_swbp.c
@@ -60,7 +60,7 @@ int main(
__in void
)
{
- struct cdl_swbp_patch swbp_patch = {};
+ struct cdl_swbp_patch swbp_patch = {0};
addo = (add_t*)add;
printf("Before attach: \n");