Please visit my static GitHub Page: https://jyang772.github.io!
I recently purchased this TEMPer USB Thermometer on Amazon. The seller advertises compatibility with all OSes, with provided APIs and drivers. Unfortunately, that’s not true. The CD-ROM only contains a .MSI for Windows.
I sure as heck wasn’t going to wait around to buy another USB thermometer from a different manufacturer. I was going to, in the words of Matt Damon, “science the shit out of this”.
While I was googling around, I found out that someone had taken the time to write a userspace driver, using libusb. Great! Why, I can just use usbmon to sniff USB traffic instead of booting into an instance of Windows.
Here is the result of 24 hours spent reading the USB specifications, and some kernel programming. The code needs some cleaning up, but it works.
Started this mini-project a year ago. A simple graphical interface for controlling fan speeds on the ThinkPad W530.
It’s quite simple to use, allowing for auto or manual control of the speed.
In console mode, the program will automatically give control of fan speed back to the computer after the program exits if the user chose to turn off the fans. This is to prevent overheating.
This is teh story of how Royal Caribbean should rethink their IT security. lel. Prepare for some atrocious grammar. Engineer just don Kare.
First day on the cruise, Guandi97 and I were forbidden from bringing our laptops. This was a family vacation they said, no laptops! Doesn’t matter, Guandi97 don’t give a shit. MacBook Prestige level 9001 appears out of nowhere. Engie was blocked from bringing his powerhouse W530. Too bad, Raspberry Pi to the rescue. If you can’t bring it…build it.
Even before everyone had gotten on the ship, we were already set up for launch at the onboard Starbucks. Attempting to get some “Free Internet”.
Because of the lack of time and knowledge, we had decided to hit their Internet Cafes first. Scout out some vulnerabilities and attempt to access the internet through the Ethernet ports. Unfortunately, we were met with login paywalls again and again. This needed to be dealt with! But not before we fudged up their desktops. IT Department can’t stop us! hueh hueh huehcopter incoming.
All of the desktops were lockdown hard. But we did find that some old tricks still worked. Including systemCMD.COM and Windows + R shortcut key. We were able to launch Paint. Havoc ensued. We still can’t believe people believed our shit paint job. “IT Working. Do not use.” Might sound legit. But…lenny face? lolwut.
These signs stayed up for at least 3 days.
*Backgrounds courtesy of Guandi97’s OP Paint skills
Compared to an actual sign found aboard the same ship. Lol.
We even attempted to create our own IT badges. But once we saw the real IT guy, who actually wore a uniform with a legit looking badge, we threw ours out. For obvious reasons.
We managed to get “free internet” heuh heuh
That’s not to say we didn’t have any trouble along the way. Several times we had to instigate operational room lockdown. Too many a times, random bystanders would walk into the room. Two people even had the galls to ask us if we were “hacking”. Dafuq, monica. At one point, we even had to go on full red alert, abort mission and run around the cabin corridors like SHTF.
Much of the technical is documented here: https://github.com/Jyang772/MacSpoof
The script was created afterwards, borne out of extreme laziness.
- Ethernet ports are unprotected. You can access the printer control station from any port conveniently labeled with the IP range 10.0.0.0…
- No one batted an eye when we took out a Raspberry Pi and started exploring their network at the Starbucks. Cables everywhere, screen flashing with text, looking like l33t haxxors. Even though we got plently of looks on the airplane to Florida.
- Need to plug in an HDMI port to stateroom TV? Just unhook the HDMI cable used by Ship TV and plug in your own device. No need to call IT for an adapter or use a universal remote to bypass the menu lock.
- There’s so much to explore on the ship, particularly with IT.
- IT guy works in card room on deck 14 of Oasis of the Seas. Broken mesh panel allowed us to access one of the desktop’s towers and plug in a Fedora live usb. “Prepare thy anus” was announced. IT guy didn’t even notice, probably on Reddit or Imgur.
- Woman next to us didn’t understand the one device logged in only plan she purchased. ( ͡° ͜ʖ ͡°)
- wpa_cli reassociate doesn’t seem to work properly for protected networks. Doesn’t matter, “royal-wifi” is unprotected anyway.
- Computers in Internet Cafe are pretty locked down. Nah..
- black hat stuff.
- Once we had access to Google, it was game over GG. Ship’s IT security stood no chance against our Google Fu.IT Guy works
Finally finished this weekend challenge. Well, technically it was finished two weeks ago, I just managed to fix most of the bugs yesterday. There are two modes, Win By 1 and Win By 3. Essentially, you can play against the AI until someone wins one grid, or three grids in a row.
Win By 1 – AI uses a combination of Minimax and Alpha-Beta pruning
Win By 3 – AI uses a Monte Carlo simulation
The UI sucks, as always. I am just bad at creating GUIs.
The source code is available on Github.
I am still intrigued by the use of malloc() and “placement new” to create objects on the heap in C++. This allows you to construct an object at a particular location in memory. Basically memory that has already been allocated.
Malloc() only allocates the requested amount of memory and returns a pointer to it. Whereas,
mallac() with a call to the object’s constructor which initializes the object. In order to use
malloc() with a class, you would have to explicitly call the objects constructor. As well as explicitly calling the object’s destructor!!!
Please do not use placement new unless you really need to place an object in a specific part of memory.
Unturned is a sandbox multiplayer game much like Minecraft. It was recently Greenlit on Steam, and gained a huge amount of popularity in the following few days. The game currently saves player data in the registry (on Windows). Which I thought was a bit strange. Turns out, the developer used PlayerPrefs from Unity.
The key value needs to be converted into Windows-1252 encoded bytes, then decoded as if it were encoded in UTF-8. Each character’s unicode will then need to have ’32’ subtracted from it. Then we mod every character by 255, such that we get an ASCII character. You can read more about the encoding/decoding process here.
On Macs, save data is actually stored in a .plist file. Which can be parsed, and only need to be decoded as if it were UTF-8 encoded. Here is a prototype application which parses the .plist file and displays the decoded ‘inventory_’ value. We can then edit this string to give the player any item, ammo, etc.
Coded in C/C++
The source code has been released on Github. To be honest, this is something I probably won’t be maintaining anymore.
Was bored. Rewrote Qt calculator example with new ‘engine’ and the ability to define expressions with parenthesis. Will probably add more features for the lawlz. Nuff said.
Ultron, an automatic homework fetcher/parser. I started working on this to reinforce what I learned using Qt. Too bad I don’t have access to my Moodle account anymore, time to add new features.
All of my GUIs look simple and plain. That will be something I will work on when I have time. Learning Qt is pretty fun :)