My blog

Some things I would like to share with the world or simply demonstrate things I accomplish.


2022-11-09 → Styling and reworking some aspects of my website

It might've been since May that I haven't made changes on big aspects of my website such as adding details on the homepage or adding new pages. For example, I added a nice animation on the navigation bar only some days ago (can't remember if it was yesterday, on Monday or Sunday, whatever...), but the bigger edits are coming today.

Recently, some people gave me the idea of making a blog to explain what I'm doing, whether it's to help people or just show what I can do.

2022-11-15 → Dismounting a kettle to repair it

Some people my family knows gave me a particularly old kettle to repair, the first thing I noticed was that its screws needed a triangle-headed screwdriver, something you don't find in a lot of D.I.Y. shops, so I had to unscrew those using a flat screwdriver.

Once the screws were unscrewed and the bottom plate removed, the first thing I thought could possibly be broken was the resistor that heats up. I checked with a multimeter and exactly as I expected from testing it beforehand, it was indeed that resistor.

As I couldn't dismount it further, because it was an old model, the resistor was molded and there was no safe way to do so.

The kettle I had to repair

2022-11-29 → Soldering back a mini-USB-B port

Just like almost all the time, my father always has things to put to the trash, and this time it's something I didn't expect him to throw away : an on-board camera. Seeing how its USB port moved a lot inside, I knew it needed to be soldered again.

Dismounting this camera was way too easy, only a small Phillips screwdriver was needed to unscrew 2 screws outside, 2 behind the battery and optionally 2 on the main board (which I did remove to avoid melting the plastic around the port).

Given the size of my soldering iron, I had to be careful to not touch other electronics near the port so I started with an easier part : the electric ground, as it was on each corner. Following up with the power and data pins behind the port, those were even smaller, I had no other choice than using a hacky technique since the tip of my soldering iron doesn't heat up that much, I pressed those pins with it and surprisingly it worked.

After ensuring I could plug and unplug the cable safely, I had to test it out, it worked just like when my father bought it.

The on-board camera whose USB port needed soldering

2023-02-20 → Experimenting with hardware and software (since mid-January)

It's been quite some time since my last post here, I've been a bit busy since then but I also had time to experiment with things nobody would expect anyone that is not a nerd or a geek to have (such as a PinePhone Pro, for example).

This post is going to be subdivided in multiple sections (an unusual format for me, so feel free to give a feedback about it using one of the various contact information I left in the footer), it's my first time doing so.

Trouble with a brand new PinePhone Pro's modem

After receiving my new PinePhone Pro, I saw it used Phosh as its default shell (mobile environment, if not desktop environment) and wanted to replace it without reflashing the whole device so I hooked up the terminal and installed (almost ?) every necessary package.

Sadly, even after 5 hours of troubleshooting, I couldn't get Plasma Mobile to run properly so I did reflash the device with a development image of Manjaro ARM using Tow-Boot's (or Linux') USB mass storage gadget feature.

Now for the interesting part. While flashing a custom firmware for the modem (which I did by hand because ADB and fastboot always threw permission errors due to missing udev rules or groups on my user account), I forgot to flash the most important part of it : the bootloader. A simple mistake like this one bricked the modem (or at least the bootloader didn't want to boot an unsigned firmware).

After a full day of searching test pads on the phone's mainboard, I felt like an idiot because I didn't look up anything about their locations on the new nano-SIM models, I only had little options left so I decided to be brave and ask online and hopefully someone would know how to reflash a signed firmware on it or even better, flash the custom bootloader.

It didn't take long to figure out how to get the modem back into fastboot mode thanks to a little bit of testing, looking up and help from @biktorgj, the creator of that custom firmware himself. It only required knowing how to configure and use a serial console, along with writing data to it using a script that I wrote especially because entering fastboot using the debug UART of the modem needed a bit of timing.

2023-10-15 → Patching a modded Minecraft launcher to make it allow Linux

Once again, a lot of time has passed. I've been playing various Minecraft games with a friend during last summer, including that big French modded factions server whose staff doesn't like Linux : Paladium.

Back in the beginning of 2021, I made a demo and a tutorial showing how to run their launcher under Linux. The way of doing so wasn't really gamer-friendly (assuming everyone who plays video games is a gamer even though it's not always the case) and became obsolete with some updates, even the launcher's code has been obfuscated since then.

Back in the end of August 2023 and the beginning of September 2023, one of my friends (the same one who I played Paladium with back in 2021) told me "Hey, why don't we play Paladium again ? " (in French since he doesn't speak English, nor does the Paladium staff), and I said "Why not ? " (obviously still in French).

If my memory is correct, the launcher I've made a demo and a tutorial for back in 2021 wasn't able to download any file, like it was so out of date that the URLs it checked didn't exist anymore. Then I downloaded the newest launcher available at the time for Windows (because they still don't have downloads for Linux, even though the Mac one could work), the downloaded file was just an installer that downloads the Java runtime and the actual launcher's .jar file.

After using the launcher with WINE, something in the UI caught my attention, it looked like it was web-based so I did check the files (I would've done that even if nothing drew my attention away) and it wasn't Electron or NW.js (their last launcher's framework) but Java almost from the ground up, executing it worked well but it didn't allow launching any game under Linux, greying out the "Play" button, disabling it and hovering it says "This service isn't allowed under Linux" (obviously not in English).

Now for the technical part ! Don't worry, only a high-level overview of my findings and what I did, nothing too complicated for the average computer tinkerer.

I opened the launcher's .jar file in an archiver and after looking at the folder, there was no sign of any HTML or CSS files but some class names had "CEF" in them so I figured out it could be online or in some other folders. I've gone through all the possible directories in my WINE prefix but still no sign of anything web-related apart from the JCEF runtime's files.

Using the command strings on some classes extracted from the .jar file, I found some very interesting URLs whose pages contained pretty much all of the UI that caught my attention earlier so I decided to have a peek at the scripts if there were any, and surprisingly for me it wasn't obfuscated, only minified. Searching "Linux" in the scripts using Ctrl-F did spit some results including a check whose result is used to restrict access or not.

This check relied on JCEF's method invocation feature, calling a function within the launcher's Java code, this function returns the name of the operating system you're on, then it gets checked by the page's script and the "Play" button gets greyed out, disabled and will say "This service is not allowed under Linux" if it's "linux", else it'll just present that button as normal.

The function-calling message contained "GET_OS", I searched this in the extracted Java classes and found a function (which from the bytecode seemed short) which calls the OS-detection one, checks its return value and returns it as stringified. This is where things start to get even more technical but I'll try to make it understandable.

Thinking how I could modify this behavior without modifying the launcher's files, I remembered that Minecraft itself (or one of the mod loaders available for it, sorry, I don't remember which, please don't hit me) had a dependency on a library called "ASM" and made by ObjectWeb, I searched for it, thinking I could use it in a wrapper but a tutorial in the search results mentioned that we can use it in Java instrumentation, which I didn't even know about.

After reading some documentation and a bit of tutorials on how to use ASM, I thought it was complicated so I tried searching how to use Java instrumentation directly and the very same website I saw the tutorial of had another one with another library called "Javassist" and made by JBoss. The example itself looked easier than the ASM one so I decided to go with this one.

The only things left to do were to code some kind of dynamic function editor, to compile it and to test it. Wondering how the launcher would behave if I made it report "Windows" only when asked by the UI, I looked through the Javassist Javadoc, tried understanding bytecode to find which other functions the one invoked by the UI called, built the program as a Java agent and tested it until I got the function calls right (which wasn't so easy without the human-readable source code of their launcher).

Eventually, all of my work ended up paying off, I managed to make their launcher not deny Linux from launching the game using only a Java agent and without modifying their code. Excited as my friend and myself were, I launched the game, but something was wrong, the terminal in which I started the launcher also had output from the game which did show an error saying LWJGL wasn't found in the native libraries directory, so I checked the command-line argument specifying its location.

This command line argument stated a non-existent subfolder named "1.7.10" inside the folder the libraries were in, I created it, moved them in and launched the game again, hoping the file verification from the launcher would not place them in the wrong folder again and it didn't, Paladium launched successfully, I edited my game settings, joined the server expecting to get banned automatically the second I arrived on it, happily that was not the case.

Looking back at the comments on my YouTube videos about this, I saw some people asked about a bug that got introduced after an update and others requested that I make a tutorial for the next version, but no one asked for the current one since I didn't reply to any comment for a while (I turned away from big companies and their products). I just can't keep this solution for myself, seeing how Linux is growing and some players are being unable to play on their server only because they don't have Windows.

So, I published my "patcher" along with its source code (for people who don't trust me or just want to see how it's made) to my Gitea instance and a demo of it on Odysee and YouTube, I'm even already in the process of making the tutorial at the time of writing this blog article (I started recording some voice clips on 2023-10-17 and am finishing to write this on 2023-10-18 at 1:56 A.M.).

A screenshot of Paladium running on (Arch) Linux.

2024-05-14 → New year, new business

Whew, time flew by and a lot of things have happened, some of which I'll be talking about shortly, just don't expect anything as great as my last writeup.

I don't know whether or not I should be making separate posts for everything that has to be said so I'll just make it a single subdivided post. Without further ado, let's start !

In the realnet's fields

Sorry for this title, I just couldn't find a good one so I had to make it look like a joke, except it isn't because I'm bad at making them.

Most teenagers (just like myself) if not all today use the internet and make friends there, so did I... But there's a catch, one of them had bad intents, not towards me because I helped him a lot of times, not towards anyone he knew, mainly towards people he never actually knew. Now, if you're thinking "why would he do anything to people he doesn't even know ?", let me tell you the reason why : he's got a thirst for money.

You got that right, if he goes phishing (not fishing) and manages to get a real credit card, he'll try to steal some money and launder it so that he can use it somewhat safely, that's what we call "scamming" and "carding". Luckily, he's never tried to scam me, and even if he tried to, I'm not too vulnerable to social engineering attacks despite easily saying "Yes" when it comes to helping people.

So, what happened then ? I forgot to mention that whenever he gets whatever information about someone, even private, either when it's given directly, seen or just heard, he takes it by making a screenshot, recording, you name it. So I've been "friends" with him for almost 2 years until another "scammer" with a more calculated behavior told him I was going to end myself, which wasn't the case, he was simply mad at me for being right about scamming.

Naive as he is, he did believe what that scammer said was true (only because I already had suicidal thoughts back in 2019) and called the emergency medical services who then called me using the phone number I gave him. Combined the fact that picking up unknown phone calls is against my habits and that I had headphones on while listening to music, it was enough for them to believe something really happened so they broke my parent's room's window and came to me asking me "are you fine ?".

I'll spare a lot of details, take this as a warning to always be wary of who you're friends with.

Can you hear me ? Do you hear yourself ? Yes and yes

I bet many people still don't know a lot about what happens in their phones during a phone call. Well, the short answer is "a lot of things", the long one might be too much to write in a single quote. In fact, it depends on the model used, most of the time it's receiving audio, playing it back, recording audio, reducing or suppressing noise and cancelling echo, all of which has to happen in real time.

All this processing has become standard across phone brands, except those making Linux phones (well, blame the distros, not the hardware manufacturer because they're not the ones in control over what runs on their hardware, given it's more open) and it seems I found the tail of a solution, at least I've been experimenting on it with my PinePhone Pro.