0

I'm trying to learn a bit about how bar codes store data during my holiday for fun. I'm using the PDF417 bar code type and I've been successful with decoding some of the text data. But when I get to the image data, I have trouble with recognising what is part of the image and what is not. I need help with identifying where an image starts, as I read that is the most important part.

When i convert the Byte Array to ASCII I get this:

?6???D?R?K4?MLO4?M4?M4????A??
?0?"Y??#???&@???????j??1"??Q???K?Ch???????!? o???':.???\00=e?Z>?m??^?dv?Z`?&?w.?u?J?F?
)?7?`h??;???X(B?l?4???p?f[???A???
???zG,?????'O??5A?|???W????2?Q??x
ot*?}/t
?_????\00?Ki\lT????`???b???????????
(?b??? ?+2X?q??V
??|??f?*?_?????"??0?z?Zuw???1?????cM???Y(???a??O??-??q?G1?]9???3H????*J?]?(0??;????xY?*??QF1???H?
@`\00 "?@?[?M??????????\00\00??}??}<i?UQf????????vI$?\00\00\00AAXUT?X?\00\00

When I convert the Byte Array to Base64 I get this:

AgQGCArTNvTrr0TTUhigSzTTTUwUTzTTTTTTTTTIf+OFpEGwwQsLnDCnIlmxDOcjq6vyJkDOkZvhDMDa
r2r36TEi0vBR+v0F60vuQ2jr/Nf67bzrIZAgb6+j3ic6LqqEjwA9GWX9Wj6pbdaVXvtkdrcQWmDJJqx3
LuF1jkqmRqc=

CBAYICjZYgWtmb0gqCsyWNZxyZVWCq7tfKW1ZvYqgV+kGr/soJMinpoLIDDIerpadXcejfzOMdz
e9sDUY02ti4dZFREopvC2YcSUT4yCLZ8RhnGDRzEZkV05wh2QrDMVSIKWvZAqShftXY8oHj
CICNU70uMU9Ix4AQVZAR/EKvg=

ECAwQFBHCQRbCoRBoXoHJxiyDBMFxI+8HBh4YgUUUQZ4gAz6W1qJJMBcinUsqOIvkjIYl+Q
DVn5iIxpGIThPyHEctfh8Hfk/Cde9WlyNlRvIYafrKN2fRrN2E4ggrUIzcjiAa0zHruEAOB5ZecV5pY
ALEA8JohxRRjGNmbRIEIE=

IEBgACAi9UD6W+ZNq3/uqAIF7r7ThaisuQAAwhC1fb+vDxd9HjxpAYFVUWa54IQVEKiqqIrEBn
ZJJJAAAAABFUFBWFVUiFioAAA=

This is the Byte Data from all byte Array:

WI ú ÈBú(@ 0̶Ӌ/$tÓC¥Ç<óQHÍ4ÓMC4ÓJk§TÓ6ôë¯DÓR K4ÓMLO4ÓM4ÓM4Èã…¤A°Á
œ0§"Y±ç#««ò&@Α›áÀÚ¯j÷é1"ÒðQúýëKîChëü×úí¼ë! o¯£Þ':.ª„
=eýZ>©mÖ•^ûdv·Z`É&¬w.áuŽJ¦F§)¥7ã`h¸½;µ‡‘X(B¥lì4žÁµpÈf[êù„A’¦¸
•ÝþzG,½áÊø 'Oã¨5A|·ÄíWœ‘»§2ÆQ³Üx
ot*´}/t
ñ_ººÊÙ ¸Ki\lTÚ«¯Æ`Öš™bóÙ?ÓýÜàìŠÌÕ (Ùb­™½ ¨+2XÖqÉ•V
®í|¥µfö*_¤¿ì “"žš

0ÈzºZuwüÎ1ÜÞöÀÔcM­‹‡Y(¦ð¶aÄ”OŒ‚-Ÿ†qƒG1‘]9 ¬3H‚–½*Jí](0ˆÕ;ÒãôŒxYÄ*ø 0@PG[
„A¡z'²Ä¼xbQx€ú[Z‰$À\Šu,¨â/’2—äV~b#F!8OÈqµø|ù?  ×½Z\•Èa§ë(ÝŸF³vˆ ­B3r8€kLÇ®á
8YyÅy¥€
¢QF1™´H @`  "õ@ú[æM«î¨î¾Ó…¨¬¹   µ}¿¯}<iUQf¹à„¨ª¨ŠÄvI$   AAXUTˆX

I was told there is definitely an image in here. How would I go about finding this? It's possible to decode it again. Also, what type of image format would hold this? It's black and white, very small and is about 580 bytes long, I guessed a monochromatic bitmap format.

Djinnes
  • 17
  • 1
  • 7
  • Most image formats use "magic bytes" at the start of the file. If I was you I would try and find those first. – Luke Joshua Park Apr 12 '17 at 22:11
  • Oh, that sounds like a pretty good thing to look for. Thanks! I would be looking for that once I convert it to ASCII right? – Djinnes Apr 12 '17 at 22:14
  • Don't convert the bytes to ASCII. Do all your comparisons as bytes. – President James K. Polk Apr 12 '17 at 22:48
  • That make sense, should I look for the header byte dad of popular image formats in the unformatted byte data? – Djinnes Apr 12 '17 at 22:52
  • Please clarify exactly how/where you got this data - it currently unclear. – Mark Setchell Apr 12 '17 at 23:00
  • I scan a PDF417 bar code of my student card, then it gives out this information which somehow contains an image. – Djinnes Apr 12 '17 at 23:02
  • What device is the scanner? How do you scan it? How is the scanner connected? – Mark Setchell Apr 12 '17 at 23:05
  • Does the scan appear in a file? On a console? In a cell phone? – Mark Setchell Apr 12 '17 at 23:07
  • I scan it using my phone, the PDF417 app, I get the first part correct which is just my name and student number separated by question marks. After that it's all this data which I presume contains the image. It gives you a big byte array, which I process in java and convert to readable format. – Djinnes Apr 12 '17 at 23:14
  • Mmmm.. the base64 version is the only useful one by the way. The likeliest image identifiers to see would be `GIF89` meaning `GIF`, `MM` or `II` meaning `TIFF`, `P1` thru `P6` meaning `NetPBM`, `FF D8 FF` meaning `JPEG` or `PNG` meaning `PNG`. But I see none of those - so you would have to ask the developer. – Mark Setchell Apr 13 '17 at 11:38

0 Answers0