Skip to main content
added 7 characters in body
Source Link
End Antisemitic Hate
  • 8.5k
  • 35
  • 85
  • 138

For a specific task (replace an image inside a firmware without any data offset shifting), I need to create a GIF file of size 409x240 pixels of exactly 6449 bytes:

  • offset 0-5: GIF89a (magic string)
  • ...
  • offset 6447-6448: hex 00 3B

When I created such a GIF with, for example MSPaint, the output is ~ 2 KB, which is too small.

Question: is there a way to modify a GIF file to take a larger given size? Can we do null-byte (hex 00) padding near the end of the GIF file? Maybe with ImageMagick, or directly with a HEX editor (I already have one)?

For a specific task (replace an image inside a firmware without any data offset shifting), I need to create a GIF file of size 409x240 of exactly 6449 bytes:

  • offset 0-5: GIF89a (magic string)
  • ...
  • offset 6447-6448: hex 00 3B

When I created such a GIF with, for example MSPaint, the output is ~ 2 KB, which is too small.

Question: is there a way to modify a GIF file to take a larger given size? Can we do null-byte (hex 00) padding near the end of the GIF file? Maybe with ImageMagick, or directly with a HEX editor (I already have one)?

For a specific task (replace an image inside a firmware without any data offset shifting), I need to create a GIF file of size 409x240 pixels of exactly 6449 bytes:

  • offset 0-5: GIF89a (magic string)
  • ...
  • offset 6447-6448: hex 00 3B

When I created such a GIF with, for example MSPaint, the output is ~ 2 KB, which is too small.

Question: is there a way to modify a GIF file to take a larger given size? Can we do null-byte (hex 00) padding near the end of the GIF file? Maybe with ImageMagick, or directly with a HEX editor (I already have one)?

Source Link
Basj
  • 1.9k
  • 14
  • 64
  • 107

Make a GIF image with an exact given byte size

For a specific task (replace an image inside a firmware without any data offset shifting), I need to create a GIF file of size 409x240 of exactly 6449 bytes:

  • offset 0-5: GIF89a (magic string)
  • ...
  • offset 6447-6448: hex 00 3B

When I created such a GIF with, for example MSPaint, the output is ~ 2 KB, which is too small.

Question: is there a way to modify a GIF file to take a larger given size? Can we do null-byte (hex 00) padding near the end of the GIF file? Maybe with ImageMagick, or directly with a HEX editor (I already have one)?