Pedantic improvements

This commit is contained in:
Print3M
2025-11-11 16:13:27 +01:00
parent b3902c0515
commit e913ba513f
4 changed files with 49 additions and 17 deletions
+36
View File
@@ -0,0 +1,36 @@
# Project powered by EPIC
This project was built using **EPIC (Extensible Position Independent Code)** — a shellcode development and building toolkit designed for developer experience, predictability, and modularity. _Write code, EPIC will take care of the rest!_
- Repository & Docs: [github.com/Print3M/epic](https://github.com/Print3M/epic)
EPIC is a standalone binary toolkit:
- Latest EPIC Release: [github.com/Print3M/epic/releases/](https://github.com/Print3M/epic/releases/latest)
## Quick Start
Compile your project:
```bash
epic pic-compile project/ -o output/
```
Link and build the payload:
```bash
epic pic-link output/ -o output/ -m hello
```
That's it! You can now take the generated `payload.bin` and inject it into your custom shellcode loader, or simply:
```bash
# Inject PIC payload and compile a simple loader template
epic loader payload.bin -o output/
```
The compiled `loader.exe` is ready to execute.
---
By [Print3M](https://x.com/Print3M_)
+4 -1
View File
@@ -17,8 +17,11 @@
extern void main_pic();
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpedantic"
const char __attribute__((section(".start_addr"))) __pic_start[0] = {};
const char __attribute__((section(".end_addr"))) __pic_end[0] = {};
#pragma GCC diagnostic pop
// This is the entry function of the payload
EPIC_START void __main_pic() {
@@ -29,7 +32,7 @@ EPIC_START void __main_pic() {
// Initializing CPU-based global context
GlobalCtx ctx;
SAVE_GLOBAL(ctx);
SAVE_GLOBAL(&ctx);
// Getting context values
ctx.pic_start = (void*)&__pic_start;
+9 -7
View File
@@ -27,11 +27,13 @@
// CPU-based global variable mechanism. Memory address is stored in a fixed CPU register.
// Usage of this CPU register must be disabled at the compilation level so that our
// "global" pointer is not overwritten.
#define SAVE_GLOBAL(var) __asm__ volatile("mov %0, %%rbx" ::"r"(&var))
#define GET_GLOBAL() \
({ \
void *__ret; \
__asm__ volatile("mov %%rbx, %0" : "=r"(__ret)); \
__ret; \
})
static inline void SAVE_GLOBAL(void *var) {
__asm__ volatile("mov %0, %%rbx" ::"r"(var));
}
static inline void *GET_GLOBAL() {
void *__ret;
__asm__ volatile("mov %%rbx, %0" : "=r"(__ret));
return __ret;
}
-9
View File
@@ -5,15 +5,6 @@ import (
"os"
)
// TODO:
// - Add README in project template
// - EPIC toolkit description
// - EPIC URL
// - EPIC release tab
// - Quick Start
// TODO: Fix code for --strict
// TODO: Check everything once again!
func main() {
cmd.Run()