4

The Casio FX-991EX calculator has a QR code feature for accessing the current equation from another device. It supports version 3 QR codes for some menus and version 11 for most menus.

For example, using version 11 with this feature for 1+2 in Calculate mode produces a QR code linking here. I have taken a photo of the QR code, shown below, but my camera quality is quite poor. I have also made several edits of the image, also shown below.

Original photo:

Version 11 QR code for '1+2' in 'Calculate' mode

Photo edited to be easier to scan and reference. The changes I made include making it monochrome, rotating it and increasing the contrast.

Photo edited to make it easier to scan and reference

QR code re-created as a pixel image. Keep in mind that, while I spent a few hours producing and double-checking this, there are several errors. However, it scans correctly, so it should be close enough to compare with.

Manual recreation of the QR code as a pixel image

Re-creation color-coded to indicate primary features of the QR code:

Color-coded recreation of the QR code

I am wanting to reverse-engineer these QR codes so that I can calculate an equation to produce a QR code with a specific image in order to display this image on the calculator. I'm aware that I won't be able to control lots of the QR code's pixels, but theoretically I'd be able to at the very least brute-force the closest QR code to a given image.

I've found that the QR code uses 0 error correction and a mask pattern of 4. I've used a Python QR code library to produce a QR code using these same settings (code and result shown below).

from qrcode import QRCode
link = 'http://wes.casio.com/math/index.php?q=I-235F+U-000A00673394+M-C10000AD00+S-001410110000100E1010B00035DE+R-0300000000000000010000000000000000000000+E-31A632'
qr = QRCode(version=11,error_correction=0,mask_pattern=4)
qr.add_data(link)
qr.print_ascii(invert=True)

QR code generated using the same settings in Python

However, it is clearly different to the original QR code. I produced a difference map between the generated and original QR code:

Difference map between the generated and original QR code

As you can see, all the format and version info is identical and they link to the same URL, but the actual data is completely different. Even the encoding type, ECI type and length are the same. So where do I go from here? What could be causing such a difference between the two codes?

hopperelec
  • 41
  • 6
  • Hi and welcome to RE.SE. Unfortunately the image quality is so poor that none of the software I tried on the photo would even recognize a QR code. – 0xC0000022L Nov 17 '22 at 07:49
  • @0xC0000022L That's strange, it seems to work on my phone and on this website, I've not tried anything else though – hopperelec Nov 17 '22 at 11:08
  • I managed it after playing around with resolution ("blowing it up" a bit) and contrast. – 0xC0000022L Nov 17 '22 at 17:16
  • 1
    @hopperelec: what are your efforts in reverse engineering it? Did you identify the finder patterns? Did you find the separators? Did you find the timing patterns? Did you find the alignment patterns? Did you find the version info regions? Did you find the format info? RE is a lot of work and I expect you to do a big part of this - at least the obvious and easy stuff. E.g. redraw the picture (manually, if needed) in a nice B/W single pixel per pixel image and e.g. color the stuff that you can identify – Thomas Weller Nov 17 '22 at 17:24
  • @ThomasWeller I did make sure the finder, timing and alignment patterns were present, but I was just doing this by eye, not using color coding as you suggested in your answer. Version info and format info I described in the OP. 'Redrawing the picture' was sort of what I was talking about here 'I thought about obtaining the raw data ... and there's no way I'm doing it manually' – hopperelec Nov 17 '22 at 20:36
  • I can't tell if you're asking what I meant by that or if you're proposing that as a solution. The problem is that I don't know what factors can affect the body of a QR code other than the formatting info and how the data is encoded, and I've already tried brute-forcing different encodings – hopperelec Nov 17 '22 at 20:40

0 Answers0