1 unstable release
0.0.1 | Mar 31, 2024 |
---|
#79 in #code-generation
73KB
1.5K
SLoC
A libary to generate x86-64Bit machine code
Error: Jit dosn't work
Example
use CodeGenLib::{Builder, ArtifactError};
pub fn main() -> Result<(), ArtifactError>{
let mut builder = Builder::new();
builder.add_function("call")
.call("callme")
.ret_int(5);
builder.build("test.o")?;
Ok(())
}
Documentation
Check out our documentation on https://docs.rs/CodeGenLib
Copyright
Copyright (C) 2024 Cr0a3
(!) Uses the faerie crate (https://crates.io/crates/faerie)
lib.rs
:
CodeGenLib is a rust libary to generate x86-64Bit machine code (like llvm)
Example
use CodeGenLib::{Builder, ArtifactError}
pub fn main() -> Result<(), ArtifactError> {
let mut builder = Builder::new();
builder.add_function("call")
.call("callme")
.ret_int(1);
builder.build("test.o")?;
Ok(())
}
The examples would make a elf file with a function named call wich just calls a function named callme and then returns a 1
Dependencies
~3.5MB
~62K SLoC