4 ms·
This is badass, thanks for sharing @carride. In celebration that it's Friday, I'm going to test it out right now. In case the author happens to see this and c
by metadat 4y ago
This is badass, thanks for sharing @carride. In celebration that it's Friday, I'm going to test it out right now.
In case the author happens to see this and can respond, how did you figure all of this out? Would really enjoy a deep dive covering your process. This is brilliant.
I also wonder if it could be extended to Nim, Zig, or any other less-straightforward hookable languages [than C/C++].
Edit: Apologies, maybe this is not that interesting of a wonderment. I did a little research and both Nim and Zig interface with libc.
I'm not yet clear on whether node.js or Deno use libc, if any fellow HNers know please leave a reply! If they don't use libc, they could be interesting targets.
- aviramha 4y agoThanks for the kind words. One of the authors here :) Actually this blog post started from a Twitter thread (that I forgot to link in the post https://twitter.com/Aviramyh/status/1544964265961979905 https://twitter.com/Aviramyh/status/1544964265961979905) - if you have any more questions, feel free to ask. We didn't want to go "too low level" so the common dev would enjoy this :) regarding extending, probably possible - I think it'd be easier with Zig (no weird stacks AFAIK) but we don't need it as they probably just use libc like most languages. P.S would love hearing your thoughts about mirrord
- infiniteregrets 4y agoHey, seems like node uses libuv and in fact we did a blogpost on it! https://metalbear.co/blog/mirrord-internals-hooking-libc-functions-in-rust-and-fixing-bugs/ https://metalbear.co/blog/mirrord-internals-hooking-libc-fun...
- generichuman 4y ago> Edit: Apologies, maybe this is not that interesting of a wonderment. I did a little research and both Nim and Zig interface with libc. Zig does not depend on libc on Linux, for example: https://github.com/ziglang/zig/blob/master/lib/std/os/linux.zig#L391 https://github.com/ziglang/zig/blob/master/lib/std/os/linux.... You can choose to link libc though.