Welcome!

If you’re reading this, you scanned my business card! If you’re just looking for my contact info or projects, please click either of the buttons below! Otherwise, I’d love to explain how the NFC chip you just scanned works and some fun examples of how else that data could be interpreted!

One of my favorite things about computer engineering and computer science is that everything comes back to 1’s and 0’s. All code and data are made up of the same things, just interpreted in different ways. So, why don’t we use the data on the NFC chip in my business card for a bit of fun and experimenting?

Let’s first understand what data we’re working with. NFC chips use the NDEF Record protocol in order to describe to devices what the data should be interpreted as. Since I only have one URL, there’s only one NDEF Record on the chip. This record can further be split down into a header which describes the data, and the payload which is said data. Here is the data in full that is stored on the chip:

01 03 A0 0C 34 03 23 D1 01 1F 55 02 41 75 73 74 
69 6E 54 68 6F 6D 61 73 57 65 62 65 72 2E 63 6F 
6D 2F 6E 66 63 2D 63 61 72 64 FE

These 43 bytes contain all the information needed to tell our mobile devices to read the data as a URL and to open it. The majority of the data is the URL itself, being the ASCII encoding of “AustinThomasWeber.com/nfc-card”.

But what if this data was interpreted as something else? Let’s start off with code- specifically Z80 ASM. This is the assembly language I am most familiar with, thanks to my work on Poké Transporter GB.

ld   bc,A003
inc  c
inc  (hl)
inc  bc
inc  hl
pop  de
ld   bc,551F
ld   (bc),a
ld   b,c
ld   (hl),l
ld   (hl),e
ld   (hl),h
ld   l,c
ld   l,(hl)
ld   d,h
ld   l,b
ld   l,a
ld   l,l
ld   h,c
ld   (hl),e
ld   d,a
ld   h,l
ld   h,d
ld   h,l
ld   (hl),d
ld   l,63
ld   l,a
ld   l,l
cpl  
ld   l,(hl)
ld   h,(hl)
ld   h,e
dec  l
ld   h,e
ld   h,c
ld   (hl),d
ld   h,h
cp   a,00

This code does a whole lot of nothing, although that’s to be expected. Interestingly, it doesn’t inherently crash itself! It certinaly would depend on what the code before and after it does, but this chunk of code itself only moves data in and out of registers… not too bad!

What if I wanted something a bit more fun though? What if we interpreted this data using the same data structure that Pokemon Red and Blue uses?

Our chunk of data becomes a level 100 Rhyhorn with a surprisingly good moveset of Pound, Fury Attack, Thunderbolt, and Karate Chop! Not too shabby if I do say so myself!

Overall, I just find it fun and interesting to interpret data in different ways. As time goes on and I learn about more data structures, I plan on updating this page to include them! Thank you so much for reading all the way through, and I hope you enjoyed.

Sources used in creating this page:

  • https://www.oreilly.com/library/view/beginning-nfc/9781449324094/ch04.html

  • https://izik1.github.io/gbops/

  • https://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9mon_data_structure_(Generation_I)