nekonomicon on Nostr: 翠星石 Pawlicker 🔧 I'm on FreeBSD 15-CURRENT now. Such C code: #include ...
翠星石 (nprofile…vqps) Pawlicker 🔧 (nprofile…nvyk) I'm on FreeBSD 15-CURRENT now.
Such C code:
#include <sys/syscall.h>
#include <unistd.h>
int _start(void)
{
const char str[] = {'H', 'e', 'l', 'l', 'o', ' ', 'W', 'o', 'r', 'l', 'd', '!', '\n','\0'};
syscall(SYS_write, 1, str, sizeof(str) - 1);
syscall(SYS_exit, 0);
return 0;
}
Such flags:
% gcc13 7.c -fno-ident -m32 -e _start -nodefaultlibs -nostartfiles -lsys -s -static -o 7
% ls -lah 7
928B
if I run strip:
% strip -S --strip-unneeded --remove-section=.note.gnu.gold-version --remove-section=.comment --remove-section=.note --remove-section=.note.gnu.build-id --remove-section=.note.ABI-tag --remove-section=.eh_frame --remove-section=.eh_frame_ptr 7
% ls -lah 7
728B
Similar size I can get on Windows with WriteConsole and ExitProcess winapi functions.
Such C code:
#include <sys/syscall.h>
#include <unistd.h>
int _start(void)
{
const char str[] = {'H', 'e', 'l', 'l', 'o', ' ', 'W', 'o', 'r', 'l', 'd', '!', '\n','\0'};
syscall(SYS_write, 1, str, sizeof(str) - 1);
syscall(SYS_exit, 0);
return 0;
}
Such flags:
% gcc13 7.c -fno-ident -m32 -e _start -nodefaultlibs -nostartfiles -lsys -s -static -o 7
% ls -lah 7
928B
if I run strip:
% strip -S --strip-unneeded --remove-section=.note.gnu.gold-version --remove-section=.comment --remove-section=.note --remove-section=.note.gnu.build-id --remove-section=.note.ABI-tag --remove-section=.eh_frame --remove-section=.eh_frame_ptr 7
% ls -lah 7
728B
Similar size I can get on Windows with WriteConsole and ExitProcess winapi functions.