This Week In Security:Use-After-Free For Dummies, WiFi Cracking, And PHP-FPM

In a brilliant write-up, [Stephen Tong] brings us his “Use-After-Free for Dummies“. It’s a surprising tale of a vulnerability that really shouldn’t exist, and a walkthrough of how to complete a capture the flag challenge. The vulnerable binary is running on a Raspberry Pi, which turns out to be very important. It’s a multithreaded application that uses lock-free data sharing, through pair of integers readable by multiple threads. Those ints are declared using the volatile keyword, which is a useful way to tell a compiler not to optimize too heavily, as this value may get changed by another thread.

On an x86 machine, this approach works flawlessly, as all the out-of-order execution features are guaranteed to be globally transparent. Put another way, even if thread one can speed up execution by modifying shared memory ahead of time, the CPU will keep the shared memory changes in the proper order. When that shared memory is controlling concurrent access, it’s really important that ordering happens the way you expect it. What was a surprise to me is that the ARM platform does not provide that global memory ordering. While the out-of-order execution will be transparent to the thread making changes, other threads and processes may observe those actions out of order. An example may help:

volatile int value;
volatile int ready;

// Thread 1
value = 123; // (1)
ready = 1; // (2)

// Thread 2
while (!ready); // (3)
print(value); // (4)

Continue reading “This Week In Security:Use-After-Free For Dummies, WiFi Cracking, And PHP-FPM”

Fixing A Broken Game Installer By Sheer Force Of Will

These days, we seldom purchase games on physical media. Even when buying titles from yesteryear, we usually download them from an online service. Some of these older games haven’t been properly ported to their new delivery platform, as [Slortibort] found out. Thus, it was time to dive into the game files and sort the problem out.

The game in question was the Hammers of Fate expansion pack for the base game Heroes of Might and Magic V. [Slortibort’s] partner bought it from Ubisoft, and ran the installer. However, the installer would report that it couldn’t find the original files from the base game, and fail to start.

Fixing the issue was no mean feat, requiring use of the Sexy Installshield Decompiler to dive into the guts of the installer to see what was going wrong. In the end, it came down to some registry key shenanigans, but the route of how [Slortibort] got there is well worth the read.

It’s a fine example of some of the issues around moving games to digital distribution; proper attention must be paid to do it right. Even then, there’s always the risk you’ll lose your games down the track. There are benefits, of course, but there’s always a tradeoff to be made.

A vintage supercomputer with unique dual screen display

VCF East 2021: The Early Evolution Of Personal Computer Graphics

The evolution of computer graphics is something that has been well documented over the years, and it’s a topic that we always enjoy revisiting with our retrocomputing readers. To wit, [Stephen A. Edwards] has put together an impressively detailed presentation that looks back at the computer graphics technology of the 1960s and 70s.

The video, which was presented during VCF East 2021, goes to great lengths in demystifying some of the core concepts of early computer graphics. There’s a lot to unpack here, but naturally, this retrospective first introduces the cathode-ray tube (CRT) display as the ubiquitous technology that supported computer graphics during this time period and beyond. Building from this, the presentation goes on to demonstrate the graphics capabilities of DEC’s PDP-1 minicomputer, and how its striking and surprisingly capable CRT display was the perfect choice for playing Spacewar!

As is made clear in the presentation, the 1960s featured some truly bizarre concepts in regards to cutting edge computer graphics, such as Control Data Corporation’s 6600 mainframe and accompanying vector-based dual-CRT video terminal, which wouldn’t look out of place on the Death Star. Equally strange at the time was IBM’s 2260 video data terminal, which used a ‘sonic delay line’ as a type of rudimentary video memory, using nothing but coiled wire, transducers and sound itself to store character information following a screen refresh.

These types of hacks were later replaced by solid state counterparts during the microcomputer era. The video concludes with a look back at the ‘1977 trinity’ of microcomputers, namely the Apple II, Commodore PET and TRS-80. Each of these microcomputers handled graphics in a slightly different way, and it’s in stark contrast to today’s largely homogenised computer graphics landscape.

There’s a lot more to this great retrospective, so make sure to check out the video below. When you’re finished watching, make sure to check out our other coverage of VCF 2021, including some great examples of computer preservation and TTL-based retrocomputing.

Continue reading “VCF East 2021: The Early Evolution Of Personal Computer Graphics”

Turn A Parking Sensor Into An Anemometer

To measure wind speed and direction, most people turn the traditional cup anemometer and wind vane. Another less-known method is to use an array of ultrasonic transducers, which doesn’t need any moving parts. [Andy] demonstrates building an ultrasonic anemometer using a cheap after-market parking distance sensor kit and an Arduino. Demo video after the break.

Aside from the price, these kits have the added advantage of including waterproof ultrasonic transducers, perfect for an outdoor weather station, and all the required circuitry to drive them. Some circuit surgery is required to remove the existing 8-pin microcontroller and wire in an Arduino Pro Micro and a few passives to take control of the pulse outputs and processing of the received signal to calculate direction and velocity. The ultrasonic transducers are mounted in a circular baseplate pointing up to an “echo plate” mounted on a carbon fiber rod. [Andy]’s latest version also added an ESP8266 Wi-Fi module for connectivity.

One of the challenges of DIY environmental sensors is calibrating them to output reliable absolute values, and this is especially the case for wind speed. You need another anemometer that is known to be accurate or a wind source of a known velocity. A while back we covered [Jianjia Ma]’s ultrasonic anemometer build, where he mounted it on top of his car and went for his drive, but still couldn’t quite get consistent results.

While the lack of moving parts are nice, ultrasonic anemometers are significantly more complex on the software and electronics side, and a DIY cup and vane anemometer is still a viable alternative.

Continue reading “Turn A Parking Sensor Into An Anemometer”

RC Minecraft Boat Patrols The Pool For Treasure

Looking to recreate those relaxing Minecraft fishing sessions in real life, [electrosync] recently set out to 3D print himself a blocky remote controlled boat, complete with a similarly cubic occupant to ride in it. Each element of the build, from the oars to the bobber on the end of the fishing line, has been designed to look as faithful to the source material as possible. In fact, the whole thing is so accurate to the game that it’s almost surreal to see it rowing around the pool.

That said, some of the resemblance is only skin deep. For example the rowing action, though it appears to be properly synchronized to the boat’s movement through the water, is completely for show. A standard propeller and rudder arrangement under the boat provide propulsion and directional control, and [electrosync] notes its actually powerful enough to push the boat very near to its scale top speed from the game, despite the exceptionally poor hydrodynamics of what’s essentially just a rectangle.

A look under the deck.

Speaking of which, [electrosync] even went through the trouble of printing the hull in wood-fill PLA and coating it in polyester resin to make sure it was watertight. Granted he could have just made the boat out of wood in the first place, saving himself the nearly 60 hours it took to print the hull parts, but that would have been cheating.

Beyond the servos and motors that move the boat and the oars, [electrosync] had to give his 3D printed fisherman a considerable amount of dexterity. Servos embedded into the 3D printed parts allow “Steve” to rotate at the hips and raise and lower his arm. With a fishing pole slipped into a hole printed into the hand, he’s able to cast out his magnetic bobber and see whats biting.

We’ve actually seen quite a number of projects that allow virtual objects inside Minecraft to interact with the real world, but comparatively few efforts to recreate objects from the game’s blocky universe, so the change of pace is nice.

Continue reading “RC Minecraft Boat Patrols The Pool For Treasure”

Soil Sensor Shows Flip-Dots Aren’t Just For Signs

Soil sensors are handy things, but while sensing moisture is what they do, how they handle that data is what makes them useful. Ensuring usefulness is what led [Maakbaas] to design and create an ESP32-based soil moisture sensor with wireless connectivity, deep sleep, data logging, and the ability to indicate that the host plant needs watering both visually, and with a push notification to a mobile phone.

A small flip-dot indicator makes a nifty one-dot display that requires no power when idle.

The visual notification part is pretty nifty, because [Maakbaas] uses a small flip-dot indicator made by Alfa-Zeta. This electromechanical indicator works by using two small coils to flip a colored disk between red or green. It uses no power when idle, which is a useful feature for a device that spends most of its time in a power-saving deep sleep. When all is well the indicator is green, but when the plant needs water, the indicator flips to red.

The sensor itself wakes itself up once per hour to take a sensor measurement, which it then stores in a local buffer for uploading to a database every 24 measurements. This reduces the number of times the device needs to power up and connect via WiFi, but if the sensor ever determines that the plant requires water, that gets handled immediately.

The sensor looks great, and a 3D-printed enclosure helps keep it clean while giving the device a bit of personality. Interested in rolling your own sensor? The project also has a page on Hackaday.io and we’ve previously covered in-depth details about how these devices work. Whether you are designing your own solution or using existing hardware, just remember to stay away from cheap probes that aren’t worth their weight in potting soil.

Oscilloscope Clocks: Now In Color!

Ordinarily, when we hear the words “clock” and “oscilloscope” in the same sentence we conjure images of measuring a stable, repeating square wave that acts as the heartbeat of a system. Of course, that’s not the only meaning– there’s a much more fun and less useful one: using an oscilloscope to display the time.

That’s what [Wolfgang Friedrich] set out to do when he cobbled some protoboard, probes, and an FPGA into the Multi Color Oscilloscope Clock. Each digit on the clock is treated like a seven-segment display, made up of three horizontal bars and four vertical bars. The horizontal bars are generated by constant voltage at different levels, and the vertical bars are generated by quickly switching between two voltages. [Wolfgang] decided to use an R-2R resistor ladder DAC to create the appropriate analog signals from the FPGA’s digital outputs. For bonus points, each set of digits (hours, minutes, and seconds) are output concurrently through separate channels, so they can be displayed in different colors on the screen of his four-channel scope (the fourth channel is used for the points between numbers).

Misusing oscilloscopes in the name of fun has become a time-honored tradition– from Tennis for Two back in 1958 (which later became the beloved Pong) to the plethora of analog o-scope clocks we’ve seen, it’s clear that hackers just can’t get enough of the unique vector display style that a scope can provide. We love [Wolfgang]’s idea of using the scope’s channels to create a multi-color display, and we’re left wondering what kind of wacky waveforms we’ll be seeing next.