HNHacker News
TopNewBestAskShowJobs

etra0

557 karma · joined September 14, 2021

Software Engineer.

Interested in Game Hacking (offline). Rust, C, C++.

For any discussion feel free to contact me at me@etra0.cl

submissionscomments
etra0··on FFmpeg devs boast of another 100x leap thanks to handwritten assembly code
I think this comment should be on the top lol.

I mean, I love ffmpeg, I use it a lot and it's fantastic for my needs, but I've found their public persona often misleading and well, this just confirms my bias.

    > We made a 100x improvement over incredibly unoptimized C by writing heavily specific cpu instructions that the compiler cannot use because we don't allow it!
2x is still an improvement, but way less outstanding as they want it to publicize it because they used assembly.
etra0··on My iPhone 8 Refuses to Die: Now It's a Solar-Powered Vision OCR Server
This reminded me of the guy that built a meme database using iPhone's OCR as well [1].

I find incredible the idea of giving these devices another life. I wonder how hard is to host a sort-of vps on an abandoned android phone these days... I guess as long as you can put ethernet + docker you'd have a very capable device.

[1] https://news.ycombinator.com/item?id=34315782

etra0··on Containerization is a Swift package for running Linux containers on macOS
well, don't forget there's a fully fledged console now too, which by the way, runs games made for windows on linux, with better performance.

And yes, that's bought by the 'average person'.

etra0··on (On | No) Syntactic Support for Error Handling
Yet the problem still has happened on big projects:

https://news.ycombinator.com/item?id=36398874

etra0··on Typing 118 WPM broke my brain in the right ways
I think this is one of the main reasons why I enjoy vim so much, I can type comfortably at a 120wpm with sudden boost to 140wpm sometimes, and combining that with vim-motions makes it a lovely and fun experience!
etra0··on Typing 118 WPM Broke My Brain in the Right Ways
Might be just my preference, but I'd rather train on monkeytype.com. The icon for the space is confusing and the way it consider spelling errors too.
etra0··on GitHub issues is almost the best notebook in the world
I recently went through this effort and I'd say it's worth it. In particular, I've used the "Self-hosted LiveSync" plug-in + docker.io/oleduc/docker-obsidian-livesync-couchdb, and I setup all my infrastructure within a VPN (with Tailscale, this was pain-free).

I knew about using just git, but having Windows, Linux, macOS, iOS and Android, it was just way easier to use this solution instead of fighting with git-like apps for each OS.

etra0··on Giving Software Away for Free
I like doing silly apps, basically just a bunch of SPAs, for either testing something or doing a favor for someone, and (sadly) I agree, the best way of distributing software right now for the vast majority of non-techy people is through the web.

I don't like javascript much, but the option to statically host something for free while solving real problems is... something else.

I know WASM has been here for a long time but last time I tried I still had some issues setting it up (maybe just skill-issues), but I'd like to live in a world where I could do the same stuff but with other languages. Maybe just the UI code in javascript, or at least, that's what I would wish for.

etra0··on Jellyfin as a Spotify alternative
Why does this feel like nagging on projects I do on my free-time for my own?

I'm willing to learn but please try to be less condescending :)

etra0··on Jellyfin as a Spotify alternative
To access them with vanity (sub)domains!
etra0··on Jellyfin as a Spotify alternative
I recently bought a mini pc too and gave the self-host shenanigans a roll. It was definitely worth it.

Using traefik + tailscale + dns challenge with CloudFlare, I was able to self-host and make my services available only through the vpn without loosing HTTPS on all the subdomains. It's lovely!

etra0··on Tailscale Is Pretty Useful
I work +1000km away from home, and I work by shifts, tailscale has helped me a lot on running stuff back at home.

I was even able to stream my games through the tunnel with a (decent enough) latency of 27ms with variance of 2ms.

Admittedly, I could buy a gaming laptop, but I don't want to carry a heavy laptop 4 times a month :P

etra0··on Ask HN: What less-popular systems programming language are you using?
I wish we lived in a world where Crystal dominated over Go, but we're far from being there.

Admittedly, the slowness of the compiler (due to the nature of the language), and lack of better tooling are not helping, but 9 out of 10 times I enjoy way more writing Crystal than Go.

etra0··on Writing a .NET Garbage Collector in C# – Part 1
> This is absolutely incredible work!

Thanks for your kind words!

> How hard was it to get your foot in the door on having code execute on an already running process? Do you do this from a separate process at runtime or is it all modifying the executable before you run it?

All is done at runtime. By nature of how Windows DLL work, they have a DllMain that's executed every time you load a dynamic library into a running process. From there you spawn a thread and you can do pretty much whatever you want within the same memory space of the games. There are multiple ways of injecting a DLL into a running process, and since I only care about offline games, I don't have to fight against any anticheat and stuff so it is pretty straightforward, it is a very interesting topic to read about to be honest!

> I can imagine getting the memory offsets for things like camera transforms being reasonably straight forward with cheat engine

Cheat Engine is an amazing tool, for real. I remember using it when I was a kid to do very rudimentary cheating -- just scanning and changing values; years have passed and one day I opened Cheat Engine again to... skip over an annoying mechanic of a game and I noticed it can do so much more! it has a very good debugger, disassembler, memory view, you can even inject your own assembly code. It was the gateway drug that I needed to get started on everything I do.

> but mutating the values feels a like converting a train from diesel to electric while it's carrying a load

Well, compilers are pretty straightforward (at least, most of the time), it's all about memory layout.

If you have something like

  struct vec {
    float x;
    float y;
    float z;
  };
Once you find the pointer to the objects you need, most certainly they're going to be each one after the other. This looks like obvious knowledge, but at least on my brain I had to build an extra bridge to realize how simple it is :) (of course things can always get complicated but this is the basic gist of it).

And as long as you know your programming language has a stable memory layout, you can map it from your code. I even was able to map some very basic virtual class from C++ within Rust by mapping the virtual tables.

What I enjoy the most, is that I learned a lot about low-level programming, assembly, how OS and compilers work together, while having fun playing games, and developing tools that people can use to create pretty images -- it felt like the outcome was extremely positive and it brings me a lot of joy.

etra0··on Writing a .NET Garbage Collector in C# – Part 1
I'm interested in something that we call "Virtual Photography", which is basically capture beauty within virtual worlds. For that, there are games that include photo modes and some that don't, but it's often that those they do have several limitations (like range, controls, etc).

I mostly do free-cameras, a way to detach the camera from the player to allow different angles that otherwise would be impossible to appreciate.

Lately I did a project to spawn lights on The Witcher 3 [1], to allow 'virtual photographers' to take some amazing portraits [2, 3], I did this by using Rust with a little bit of x86 assembly.

Rust has been neat for this, because despite working on a safety-hazardous territory, the amount of crashes has been minimal because we still have safeguards within the unsafe stuff, but sometimes I just want to not worry about lifetimes.

If you like games, you can check this amazing gallery from the FRAMED community to see the extents the people do to take amazing shots within games engines (and admittedly, external tools like reshade, mods, etc):

https://framedsc.com/HallOfFramed

[1] https://github.com/etra0/litcher

[2] https://framedsc.com/HallOfFramed/?game=The+Witcher+3&title=...

[3] https://framedsc.com/HallOfFramed/?game=The+Witcher+3&title=...

etra0··on Writing a .NET Garbage Collector in C# – Part 1
oh, neat. I recently needed to export some functions from a C# project to be used by C++ code, but at the time I researched it (June 2024), the dllexport project seemed to be frozen (last commit before that date was on 2021).

Thanks to NativeAOT, though, it seems that you can do this kind of stuff without extra dependencies which is great too!

etra0··on Writing a .NET Garbage Collector in C# – Part 1
I'm very much looking up to NativeAOT on C#, being able to compile to native dlls is very attractive to me, as I'd love to do (offline) game modding. I currently use Rust and it works quite well, but it's never too late to wish for a more 'forgiving' language for smaller projects!
etra0··on Linus Torvalds: "If you don’t want to deal with Rust, you get no say on it"
within the thread, H. Peter Anvin argued the same in case you're interested on reading the arguments [1], it's the same thread where greg k-h responded that was posted in here as well [2].

[1] https://lore.kernel.org/rust-for-linux/326CC09B-8565-4443-AC...

[2] https://news.ycombinator.com/item?id=43101204

etra0··on Linus Torvalds: "If you don’t want to deal with Rust, you get no say on it"
I updated the title several times but I ended up just using a (almost) straight quote from the email.
etra0··on Linus Torvalds: "If you don’t want to deal with Rust, you get no say on it"
I'm glad Linus didn't miss that the change was just a user of the DMA code and didn't involve any changes to DMA itself. I think that very important point was overlooked in many of the responses in the original thread.
etra0··on We are the "thin blue line" that is trying to keep the code high quality
> The ones who are responsible and doing the heavy lifting and taking the heat when things break are the often unpaid maintainers.

Only 13.3% of all changesets are from people that are either unemployed or their job is unknown [1].

Even greg k-h said that most of the development is backed by big companies so the argument of 'poor unpaid maintainers' doesn't go too far.

[1] https://lwn.net/Articles/1004998/

etra0··on How to Run DeepSeek R1 671B Locally on a $2000 EPYC Server
it's using a Raspberry Pi with a.... USD$1k gpu, which kinda defeat the purpose of using the RPI in the first place imo.

or well, I guess you save a bit on power usage.

etra0··on Ask HN: Best non-fiction book you read in 2024?
I am a terrible reader and I'm really ashamed of it. I don't know how people can read that many books, I think in my lifetime I've finished at most 4 books? and two of them were technical books.

I think I suffer from aphantasia which may be related to the impossibility of getting hook to anything by reading. I've tried mangas as well and it's a bit easier, but still find hard to really enjoy.

Of course, most of the books I tried are the ones that I had to read in school, but I also tried a few recommendations from friends and the result was the same.

It makes me a bit sad.

etra0··on I Don't Have Spotify
I recently made the switch as well and used spotify_to_tidal [1] which is the free and open-source alternative to what Tidal recommends and it worked pretty fine! it couldn't find some specific tracks and I bet it does a somewhat similar name match as the one Tidal recommends, but at least this one doesn't have a limitation by the number of tracks, in case it's useful to someone else.

[1] https://github.com/spotify2tidal/spotify_to_tidal

etra0··on Using Ghidra and Python to reverse engineer Ecco the Dolphin
I personally learned a lot by messing in Cheat Engine, it is way more capable than I thought, specially because I mostly used it as a kid and never looked back.

It is a great tool to get started with assembly in my opinion because the disassembler is good enough and you can write what they call 'assembly scripts' which provides the foundation on doing memory patches in x86 asm. Then from that you can start writing your own utils to patch the games at your own will.

You can do crazy cheats by patching the game just with Cheat Engine!

etra0··on Mpv – A free, open-source, and cross-platform media player
A fantastic mediaplayer, quite minimalistic and performant; it does what it's supposed to do!

Also has a fantastic commit where the author rants about locales: https://github.com/mpv-player/mpv/commit/1e70e82baa9193f6f02... worth a read for some chuckles.

etra0··on Magic Wormhole: get things from one computer to another, safely
I've been using sharedrop.io which also is open-source [1] and it works quite nice, I particularly like this one because I don't have to install any third-party app on any of the devices.

I think on mac Safari usually doesn't work as well as in Chrome, but I've been able to transfer from Windows to iOS, Windows to macOS and macOS to iOS without installing a thing.

[1] https://github.com/szimek/sharedrop

etra0··on Pin
I am curious about this as well.

The way it's phrased it makes me understand a bit that it could be used within FFI, like if you get a pointer from a extern function that returns a *mut T, I could have better semantics by wrapping it with Pin<&mut T>, but then it says

"Another fact about the pinned typestate is that for most types it is completely irrelevant. If the value of type can never contain any self-references, pinning it is useless"

Mind you I'm very new at FFI but I'd like to understand what are the best ways to wrap them into safe Rust.

etra0··on Review of Linux on Minisforum V3 AMD Ryzen Tablet
That's also my wish. The Asahi project somehow gives me a bit of hope but I remember the authors saying that porting it to an iPad is simply not possible because of some booting mechanisms, and dev'in on a jailbroken device was not its preference, which is understandable.
etra0··on Review of Linux on Minisforum V3 AMD Ryzen Tablet
I have my org's macbook pro, a personal macbook air, and a tablet. I wish the later two could simply be merged. I like how performant and silent the MBA is but there are lots of situation where simply using a tablet is more comfortable, and carrying all three devices is simply not feasible.

The Surface has always been in my eyes but from what I've seen the linux support is not as trivial with newer models.

← PreviousPage 2 of 4Next →