ShellForge is a Python program that builds shellcodes from C. It is inspired from Stealth's Hellkit.
ShellForge has some wrapper functions around system calls. A C program that uses these system calls will use the wrapped one instead of original libc calls.
To generate a shellcode, ShellForge uses gcc to convert the C program into assembler, from there it modifies it a bit, compiles it, extracts the code, encodes it to avoid NULL bytes, and finally add a decoder at the beginning.