Final Fantasy Exploit Teaches 32-bit Integer Math

One of the fun things about old video games, besides their obvious nostalgia, is that some of the more popular games have been pried apart and tinkered with for years, leading to a lot of new “development” within the games. This often uncovers some hidden gems that gamers might not have had any knowledge of during the game’s heyday, like this coding oddity found in Final Fantasy 7 that illustrates a lot about how 32-bit processors do math.

The original PlayStation used a 32-bit RISC processor, but the most significant bit could be used for integer signing. This means that if you have an integer that has a value of 2,147,483,647 (01111111111111111111111111111111 in binary) and you add one, the value is suddenly negative 2147483648 because the most significant digit is also an indicator of the integer’s sign. In this situation, the integer is said to “overflow”. In Final Fantasy 7, if you can somehow get a character to deal 262,144 damage in one hit (much less than two billion, due to the way the game does damage calculations), the game has a little bit of a meltdown.

[4-8Productions] had to do a lot of work to show how this glitch can be exploited in the game as well. Usually damage in this game is limited to 9,999 but under certain configurations (admittedly obtained by using other exploits and tools available for FF7 like a savegame editor) two of the characters can deal more damage than this critical value, exposing the 32-bit processor’s weak spot.

Even though integer signing is a pretty basic concept for most of us, the video is definitely worth a watch especially if you’re fans of the classic game. Of course, Final Fantasy 7 isn’t the only classic that has been exploited and reverse-engineered to the extreme. You can use a Super Mario World level to implement a calculator now, too.

Continue reading “Final Fantasy Exploit Teaches 32-bit Integer Math”

Visual Schematic Diffs In KiCAD Help Find Changes

When writing software a key part of the development workflow is looking at changes between files. With version control systems this process can get pretty advanced, letting you see changes between arbitrary files and slices in time. Tooling exists to do this visually in the world of EDA tools but it hasn’t really trickled all the way down to the free hobbyist level yet. But thanks to open and well understood file formats [jean-noël] has written plotgitsch to do it for KiCAD.

In the high(er)-end world of EDA tools like OrCAD and Altium there is a tight integration between the version control system and the design tools, with the VCS is sold as a product to improve the design workflow. But KiCAD doesn’t try to force a version control system on the user so it doesn’t really make sense to bake VCS related tools in directly. You can manage changes in KiCAD projects with git but as [jean-noël] notes reading Git’s textual description of changed X/Y coordinates and paths to library files is much more useful for a computer than for a human. It basically sucks to use. What you really need is a diff tool that can show the user what changed between two versions instead of describe it. And that’s what plotgitsch provides.

plotgitsch’s core function is to generate images of a KiCAD project at arbitrary Git revisions. After that there are two ways to view the output. One is to generate images of each version which can be fed into a generic visual diff tool (UNIX philosophy anyone?). The documentation has an example script to help facilitate setting this up. The other way generates a color coded image in plotgitsch itself and opens it in the user’s viewer of choice. It may not be integrated into the EDA but we’ll take one click visual diffs any day!

Soldering Like It’s 205 BC

Did you ever stop to think how unlikely the discovery of soldering is? It’s hard to imagine what sequence of events led to it; after all, metals heated to just the right temperature while applying an alloy of lead and tin in the right proportions in the presence of a proper fluxing agent doesn’t seem like something that would happen by accident.

Luckily, [Chris] at Clickspring is currently in the business of recreating the tools and technologies that would have been used in ancient times, and he’s made a wonderful video on precision soft soldering the old-fashioned way. The video below is part of a side series he’s been working on while he builds a replica of the Antikythera mechanism, that curious analog astronomical computer of antiquity. Many parts in the mechanism were soldered, and [Chris] explores plausible methods using tools and materials known to have been available at the time the mechanism was constructed (reported by different historians as any time between 205 BC and 70 BC or so). His irons are forged copper blocks, his heat source is a charcoal fire, and his solder is a 60:40 mix of lead and tin, just as we use today. He vividly demonstrates how important both surface prep and flux are, and shows both active and passive fluxes. He settled on rosin for the final joints, which turned out silky smooth and perfect; we suspect it took quite a bit of practice to get the technique down, but as always, [Chris] makes it look easy.

If you’d like to dig a bit deeper into modern techniques, we’ve covered the physics of solder and fluxes in some depth. And if you need more of those sweet, sweet Clickspring videos, we’ve got you covered there as well.

Continue reading “Soldering Like It’s 205 BC”

Super Magnesium: Lighter Than Aluminum, Cheaper Than Carbon Fiber

We think of high tech materials as the purview of the space program, or of high-performance aircraft. But there are other niche applications that foster super materials, for example the world of cycling. Magnesium is one such material as it is strong and light, but it has the annoying property of burning in its pure state. Alloys of magnesium meanwhile generally don’t combust unless they are ground fine or exposed to high temperatures. Allite is introducing a new line known as “super magnesium” which is in reality three distinct alloys that they claim are 30% lighter than aluminum, as well as stronger and stiffer than the equivalent mass of that metal. They also claim the material will melt at 1200F instead of burning. To lend an air of mystique, this material was once only available for defense applications but now is open to everyone.

It’s a material that comes in three grades. AE81 is optimized for welding, ZE62 is better suited for forging, while WE54 is made for casting processes. Those names might sound like made up stock numbers, but they aren’t, as magnesium allows typically have names that indicate the material used to mix with the magnesium. A stands for aluminum, Z is for zirconium zinc, W is for yttrium, and E stands for rare earths. So AE81 is a mix of magnesium, aluminum, and some rare earth material. The numbers indicate the approximate amount of each addition, so AE81 is 8% aluminum and 1% rare earth.

Continue reading “Super Magnesium: Lighter Than Aluminum, Cheaper Than Carbon Fiber”

Robotic Fruit Fly Won’t Eat Your Fruit

The DelFly project has been busy since the last time we checked in on them. The Dutch team started 13 years ago and produced the smallest camera-carrying drone, and an autonomous tiny ornithopter. However, that ornithopter — now five years old — had to use some traditional control surfaces and a tail like an airplane which was decidedly not fruit fly-like. Now they’ve solved those problems and have announced the DelFly Nimble, a 13 inch and 1-ounce ornithopter. You can see the Nimble in the video below.

The close emulation of a real fly means the thing looks distinctly insect-like in flight. The dual wings use Mylar and form an X configuration. They flap about 17 times per second. A fully charged battery  — remember, the whole thing weighs an ounce — lasts five minutes. With an efficient speed of 3 meters per second, the team claims a flight range of over 1 kilometer with a peak speed that can reach  7 meters per second. It can even take a payload, as long as that payload weighs 4 grams or less.

Continue reading “Robotic Fruit Fly Won’t Eat Your Fruit”

Epic Clock Clocks The Unix Epoch

Admit it: when you first heard of the concept of the Unix Epoch, you sat down with a calculator to see when exactly 2³¹-1 seconds would be from midnight UTC on January 1, 1970. Personally, I did that math right around the time my company hired contractors to put “Y2K Suspect” stickers on every piece of equipment that looked like it might have a computer in it, so the fact that the big day would come sometime in 2038 was both comforting and terrifying.

[Forklift] is similarly entranced by the idea of the Unix Epoch and built a clock to display it, at least for the next 20 years or so. Accommodating the eventual maximum value of 2,147,483,647, plus the more practical ISO-8601 format, required a few more digits than the usual clock – sixteen to be exact. The blue seven-segment displays make an impression in the sleek wooden case, about which there is sadly no detail in the build log. But the internals are well documented, and include a GPS module and an RTC. The clock parses the NMEA time string from the satellites and syncs the RTC. There’s a brief video below of the clock in action.

We really like the look of [Forklift]’s clock, and watching the seconds count up to the eventual overflow seems like a fun way to spend the next two decades. It’s not the first Epoch clock we’ve featured, of course, but it’s pretty slick.

Continue reading “Epic Clock Clocks The Unix Epoch”

A Look At Liquid Dielectrics

One evening quite a few years ago, as I was driving through my hometown I saw the telltale flashing lights of the local volunteer fire department ahead. I passed by a side road where all the activity was: a utility pole on fire. I could see smoke and flames shooting from the transformer and I could hear the loud, angry 60 Hz buzzing that sounded like a million hornet nests. As I passed, the transformer exploded and released a cloud of flaming liquid that rained down on the road and lawns underneath. It seemed like a good time to quit rubbernecking and beat it as fast as I could.

I knew at the time that the flaming liquid was transformer oil, but I never really knew what it was for or why it was in there. Oil is just one of many liquid dielectrics that are found in a lot of power distribution equipment, from those transformers on the pole to the big capacitors and switchgear in the local substation. Liquid dielectrics are interesting materials that are worth taking a look at.

Continue reading “A Look At Liquid Dielectrics”