Main Menu
Main Page
Forums
New pages
Recent changes
Random page
Help

Glitches
Arbitrary code execution
Pokémon cloning
Pomeg glitch and Glitzer Popping
Tweaking and voiding
Glitches by generation
Glitch categories

References/Resources
Databases
Disassembly projects
The Big HEX List
Pokémon cheat codes
Pokémon glitch terminology
Useful tools
More

Affiliates
Legendary Star Blob 2 (Hakuda) (日本語/Japanese)
Pokémon Speedruns wiki (English)
PRAMA Initiative (Français/French)
MissingNo. Glitch City (Italiano/Italian)
Become an affiliate!

Technical
Site source code

Search Wiki

 

Search Forums

 

Author Topic: Putting arbitrary data into a BMP  (Read 5245 times)

0 Members and 1 Guest are viewing this topic.

Evie the Mother Hen ☽ ❤

  • Head Administrator
  • *****
  • Offline Offline
  • Gender: Female
  • I love My Melody. 🦋 ✿
    • View Profile
Putting arbitrary data into a BMP
« on: November 22, 2014, 04:54:49 pm »
I was bored and wondered what would happen if I put 'random' data into a BMP.

Starting offsets of color for pixel data:

24 bit BMP: $36
256 color BMP: $436

I haven't played with other types of BMPs yet.
 
The colours seem to be placed in the Bitmap bottom-up, so if you write data starting from $36 but don't finish writing the data, then the section of the image near the top won't be corrupted (like in my Pocket Monsters Midori image below)

Post your results here if you're interested. I suggest that you shouldn't send the image unchanged if it contains ROM data though; convert it into a PNG and re-size it first to obfuscate the data.

Pocket Monsters Midori (24-bit BMP):


First 50,000 primes encoded in ANSI with no spaces (256 color BMP):


Download original.
« Last Edit: November 22, 2014, 04:57:22 pm by Torchickens »

✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿
Here have some free flowers on every post :)
✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿



(Images © Sanrio, Nintendo, Pokémon, HAL Laboratory)

✿ Hi, I'm Evie. Transgender woman but spiritually doesn't believe 'male'/'female' needs to be defined; lives more stereotypically like a woman/I'm a 'girly' nerd who discovered herself. Call me whichever pronouns you like. :)

Feel free to contact me here about anything regarding the site.

Forgiveness. I feel that the more people pray to our greatest source/God/mathematical equality for world peace, the more and more it manifests into reality (until our next spiritual death).

Thank you Nyapon for this lovely artwork. :3

xparasite9

  • *technically* the first to discover the foundations of the Move 0x00 ACE glitch but this was at a time (mid-aughties) no-one even thought about ACE
  • Oldbie
  • *
  • Offline Offline
  • FALCON...PAAAAUUUUNNNNNCH!
    • View Profile
Re: Putting arbitrary data into a BMP
« Reply #1 on: January 13, 2015, 05:44:08 pm »
heh. reminds me of some of the mini-projects I did. especially regarding the PBM image format. that stuff is really fun.

so is loading up files as raw audio in audacity. you'd be surprised at how some windows DLLs sound.

Evie the Mother Hen ☽ ❤

  • Head Administrator
  • *****
  • Offline Offline
  • Gender: Female
  • I love My Melody. 🦋 ✿
    • View Profile
Re: Putting arbitrary data into a BMP
« Reply #2 on: January 13, 2015, 06:32:09 pm »
Cool.

Loading files as raw audio sounds fun. I've watched a few videos from somebody named furrtek called "Sound of ROMs" where they played ROMs as audio, such as this one, and the results are pretty interesting. I asked them how to do it long ago and they sent me a message, but I forgot the details and I don't know if Youtube still has my message stored from that long ago.

I didn't know you could play files that aren't audio as audio in Audacity. How do you do it without the "Error Importing": "Audacity did not recognize the type of the file" message?

✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿
Here have some free flowers on every post :)
✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿



(Images © Sanrio, Nintendo, Pokémon, HAL Laboratory)

✿ Hi, I'm Evie. Transgender woman but spiritually doesn't believe 'male'/'female' needs to be defined; lives more stereotypically like a woman/I'm a 'girly' nerd who discovered herself. Call me whichever pronouns you like. :)

Feel free to contact me here about anything regarding the site.

Forgiveness. I feel that the more people pray to our greatest source/God/mathematical equality for world peace, the more and more it manifests into reality (until our next spiritual death).

Thank you Nyapon for this lovely artwork. :3

SatoMew

  • Member+
  • *
  • Offline Offline
  • Gender: Female
    • View Profile
Re: Putting arbitrary data into a BMP
« Reply #3 on: February 16, 2015, 05:50:48 pm »
Loading files as raw audio sounds fun. I've watched a few videos from somebody named furrtek called "Sound of ROMs" where they played ROMs as audio, such as this one, and the results are pretty interesting. I asked them how to do it long ago and they sent me a message, but I forgot the details and I don't know if Youtube still has my message stored from that long ago.

I'm afraid not :( Google canned the old YouTube messaging system in December 2014.

blahpy

  • Yeah! Pomeg Berry!
  • Member+
  • *
  • Offline Offline
  • Gender: Female
    • View Profile
Re: Putting arbitrary data into a BMP
« Reply #4 on: February 16, 2015, 06:02:01 pm »
Vaguely related, you can do some pretty cool things with JPG and PNG files using commenting, such as making a file that opens correctly as both an HTML page and an image.  Here is a nice example: http://lcamtuf.coredump.cx/squirrel/

SatoMew

  • Member+
  • *
  • Offline Offline
  • Gender: Female
    • View Profile
Re: Putting arbitrary data into a BMP
« Reply #5 on: February 16, 2015, 06:20:54 pm »
Vaguely related, you can do some pretty cool things with JPG and PNG files using commenting, such as making a file that opens correctly as both an HTML page and an image.  Here is a nice example: http://lcamtuf.coredump.cx/squirrel/

I'm not familiar with Web development that much but you're referring to comments in HTML, right? Is this comment the one responsible for that behavior?

« Last Edit: February 24, 2015, 01:44:06 pm by SatoMew »

joonas2345

  • GCLF Member
  • Offline Offline
  • Gender: Male
    • View Profile
Re: Putting arbitrary data into a BMP
« Reply #6 on: February 18, 2015, 02:45:10 am »
Vaguely related, you can do some pretty cool things with JPG and PNG files using commenting, such as making a file that opens correctly as both an HTML page and an image.  Here is a nice example: http://lcamtuf.coredump.cx/squirrel/

I'm not familiar with Web development that much but you're referring to comments in HTML, right? Is this comment the one responsible for that behavior?
.........

Someone  on StackOverflow explained how it was done: https://stackoverflow.com/a/11587183
« Last Edit: February 18, 2015, 02:48:39 am by joonas2345 »

SatoMew

  • Member+
  • *
  • Offline Offline
  • Gender: Female
    • View Profile
Re: Putting arbitrary data into a BMP
« Reply #7 on: February 18, 2015, 08:21:45 am »
Someone  on StackOverflow explained how it was done: https://stackoverflow.com/a/11587183

Thanks. The body tag on the site blahpy linked to has the JPEG header and a bit more:

Code: [Select]
ÿØÿàJFIF,,ÿþr
And that huge comment is the JPEG image data. Interesting.

blahpy

  • Yeah! Pomeg Berry!
  • Member+
  • *
  • Offline Offline
  • Gender: Female
    • View Profile
Re: Putting arbitrary data into a BMP
« Reply #8 on: February 19, 2015, 08:01:44 pm »
When I said comments I actually meant a comment in the jpg to make the jpg display correctly despite containing arbitrary data.  A jpg file can have jpg comments inside of it, but they can't be edited easily without a hex editor.  You can then stick your html inside of the comment and end the html page with an html comment to hide the characters at the end, and use css to hide the start.
« Last Edit: February 19, 2015, 08:02:52 pm by blahpy »

SatoMew

  • Member+
  • *
  • Offline Offline
  • Gender: Female
    • View Profile
Re: Putting arbitrary data into a BMP
« Reply #9 on: February 20, 2015, 11:11:10 am »
When I said comments I actually meant a comment in the jpg to make the jpg display correctly despite containing arbitrary data.  A jpg file can have jpg comments inside of it, but they can't be edited easily without a hex editor.  You can then stick your html inside of the comment and end the html page with an html comment to hide the characters at the end, and use css to hide the start.

I see. However, doesn't this pose a security risk since someone can unwittingly download a JPEG image file with HTML data in it?

blahpy

  • Yeah! Pomeg Berry!
  • Member+
  • *
  • Offline Offline
  • Gender: Female
    • View Profile
Re: Putting arbitrary data into a BMP
« Reply #10 on: February 20, 2015, 02:20:58 pm »
When I said comments I actually meant a comment in the jpg to make the jpg display correctly despite containing arbitrary data.  A jpg file can have jpg comments inside of it, but they can't be edited easily without a hex editor.  You can then stick your html inside of the comment and end the html page with an html comment to hide the characters at the end, and use css to hide the start.

I see. However, doesn't this pose a security risk since someone can unwittingly download a JPEG image file with HTML data in it?

Only if they try to run it as an HTML file, and who goes downloading JPEG files and trying to run them as HTML?

SatoMew

  • Member+
  • *
  • Offline Offline
  • Gender: Female
    • View Profile
Re: Putting arbitrary data into a BMP
« Reply #11 on: February 20, 2015, 02:26:38 pm »
Only if they try to run it as an HTML file, and who goes downloading JPEG files and trying to run them as HTML?

Heh, you're right :P

IIMarckus

  • Administrator
  • *****
  • Offline Offline
  • Gender: Male
  • Impersonal Text
    • View Profile
    • iimarck.us
Re: Putting arbitrary data into a BMP
« Reply #12 on: February 21, 2015, 11:54:43 pm »
Fun piece of history: the Kindle 4 could be jailbroken by embedding JavaScript in MP3 tags.

blahpy

  • Yeah! Pomeg Berry!
  • Member+
  • *
  • Offline Offline
  • Gender: Female
    • View Profile
Re: Putting arbitrary data into a BMP
« Reply #13 on: February 24, 2015, 05:58:27 am »
Fun piece of history: the Kindle 4 could be jailbroken by embedding JavaScript in MP3 tags.

That's pretty awesome.

MidnightNinetales

  • Member+
  • *
  • Offline Offline
  • Gender: Female
  • It's an adorable PUT IT AWAY.
    • View Profile
Re: Putting arbitrary data into a BMP
« Reply #14 on: February 26, 2015, 03:49:39 am »
I didn't know you could play files that aren't audio as audio in Audacity. How do you do it without the "Error Importing": "Audacity did not recognize the type of the file" message?

Select File, choose Import, and click Raw Data.