r/cprogramming • u/Xadartt • Oct 09 '26
Calling a function in C without naming it
https://wiro.world/posts/calling-c-func-without-naming-it/
50
Upvotes
r/cprogramming • u/Xadartt • Oct 09 '26
8
u/jsh1138 Oct 09 '26
"Get over here, you!"
7
u/aalmkainzi Oct 09 '26
dlsym(NULL, "func")
And you can construct the string literal without naming it directly
2
u/johnchen902 Oct 13 '26
The following snippets (x86-64, -O) execve without a magic offset:
Explanation:
movl $12780815, %eax(b8 0f 05 c3 00); f+1 starts withsyscall+ret(0f 05 c3).3
u/LeeHide Oct 09 '26
Nice, good writeup!
1
u/srhubb Oct 12 '26
Excellent travels down a rabbit hole, excellent write-up, and clever solution.