summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorspacehen <root@spacehen.io>2022-12-30 12:05:55 +0200
committerDylan Muller <dylan.muller@corigine.com>2023-09-07 11:54:25 +0200
commit0142fb19905808101878148ca188161f016eba5e (patch)
treeced6edf7fd130190394a2f997c87536b5ee6a8dc /README.md
downloadcdl86-0142fb19905808101878148ca188161f016eba5e.tar.gz
cdl86-0142fb19905808101878148ca188161f016eba5e.zip
CDL: Compact Detour Library
Initial commit for the CDL x86_64 detour library.
Diffstat (limited to 'README.md')
-rw-r--r--README.md35
1 files changed, 35 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..225452d
--- /dev/null
+++ b/README.md
@@ -0,0 +1,35 @@
+# cdl86
+
+cdl86 - Compact Detour Library 86
+
+# Abstract
+cdl86 is a simple cross platform detours library written in C for Linux and Windows.
+
+It allows for the interception of x86 and x86_64 C/C++ functions in memory.
+
+[https://journal.lunar.sh/2022/linux-detours.html](https://journal.lunar.sh/2022/linux-detours.html)
+
+The library currently supports two types of function hooks:
+* JMP patch - patches origin function with a JMP to detour.
+* INT3 patch - places software breakpoint (SWBP) at origin address. Handles control flow to detour.
+
+This project makes use of an internal x86 instruction length disassembly engine.
+
+# API
+```C
+struct cdl_jmp_patch cdl_jmp_attach(void **target, void *detour);
+struct cdl_swbp_patch cdl_swbp_attach(void **target, void *detour);
+void cdl_jmp_detach(struct cdl_jmp_patch *jmp_patch);
+void cdl_swbp_detach(struct cdl_swbp_patch *swbp_patch);
+void cdl_jmp_dbg(struct cdl_jmp_patch *jmp_patch);
+void cdl_swbp_dbg(struct cdl_swbp_patch *swbp_patch);
+```
+The API is documented in more detail in the corresponding header and source
+files.
+
+# Info
+**cdl.c** - C source file for CDL. <br>
+**cdl.h** - CDL header file to include.
+
+Folders:
+* **/tests** - CDL test suite. Run `make all`.