Main Menu
Main Page
Forums
Recent changes
Random page
Help

Databases
GlitchDex
AttackDex
AreaDex
DexDex
ItemDex
TMHMDex
TypeDex
More

Major Glitches
Trainer escape glitch
Old man trick
Celebi Egg trick
SRAM glitch
Buffer overflow techniques
Pomeg glitch data corruption (Glitzer Popping)
Tweaking
Pokémon cloning
Select glitches (Japan)
Time Capsule exploit
Arbitrary code execution
More

Other Glitch Categories
Glitches by generation
Japan-only/language specific glitches
Natural glitches
Non-core series glitches
Non-Pokémon glitches
Recurring glitches
More

References
Pokémon GameShark codes
The Big HEX List
GB programming
Curiosities
Debugging features
Error traps
Non-glitch exploits
Pokémon glitch terminology
Unused content and prerelease information
More

Useful Tools
8F Helper
GBz80 to Items
Old man trick name generator
PATH (Prama's Advanced Tweaking Heaven)
Save file editors
Special stat/Pokémon converter
Trainer escape Trainer Pokémon finder

Affiliates
Legendary Star Blob 2 (Hakuda)
Pokémon Speedruns wiki
PRAMA Initiative
Become an affiliate!

Technical
Site Source Code

Search Wiki

 

Search Forums

 

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

0 Members and 1 Guest are viewing this topic.

Torchickens

  • Administrator
  • *****
  • Offline Offline
  • Gender: Female
  • The Torchic Princess 🌸🦋
    • 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 »
Hi! I identify as female.  She/her pronouns, please.

Online I most often use the username Torchickens or Chickasaurus.

Ah.. koucha ga oishii ♪





Thank you Captain Piika for my avatar.

Thanks too Aeriixion for the cute sprite above! :) Roelof also made different variations of the sprite (which I animated).

Contact:
If you like, please contact me by private message here on the forums as I no longer check other places very often.

YouTube: http://www.youtube.com/user/ChickasaurusGL

I like to collect interesting video games. ^_^
https://www.vgcollect.com/Torchickens

Always be yourself.

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
  • Member+
  • *
  • 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.

Torchickens

  • Administrator
  • *****
  • Offline Offline
  • Gender: Female
  • The Torchic Princess 🌸🦋
    • 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?
Hi! I identify as female.  She/her pronouns, please.

Online I most often use the username Torchickens or Chickasaurus.

Ah.. koucha ga oishii ♪





Thank you Captain Piika for my avatar.

Thanks too Aeriixion for the cute sprite above! :) Roelof also made different variations of the sprite (which I animated).

Contact:
If you like, please contact me by private message here on the forums as I no longer check other places very often.

YouTube: http://www.youtube.com/user/ChickasaurusGL

I like to collect interesting video games. ^_^
https://www.vgcollect.com/Torchickens

Always be yourself.

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.