Important information: this site is currently scheduled to go offline indefinitely by end of the year.

Help reinjecting PNG and JPG

Get your graphics formats figures out here! Got details for others? Post here!
Post Reply
absarhegde
n00b
Posts: 10
Joined: Wed Aug 20, 2008 7:52 pm
Has thanked: 1 time

Help reinjecting PNG and JPG

Post by absarhegde »

Hello friends..am new to this site..found very helpful and great..
i downloaded two tool filestripper and jaednauber.
used them..both extracted graphics from a particular file...
but in filestripper it doesnot allow me to inject the graphics with different file size..it only except the original size..
and in jaednaub it reinjects with different size file but when i again extract the graphics..i get are all the originals files...
wonder why...
am i doing somthing wrong ?
or is there a program tht can ask me at wat size of image or graphic it shud create...
so tht i can use filestripper..as a choice..

thanks... :)
Mr.Mouse
Site Admin
Posts: 4073
Joined: Wed Jan 15, 2003 6:45 pm
Location: Dungeons of Doom
Has thanked: 450 times
Been thanked: 682 times
Contact:

Re: Help reinjecting PNG and JPG

Post by Mr.Mouse »

So you seek a generic injector?
Itze
veteran
Posts: 81
Joined: Sat Mar 15, 2008 4:43 pm
Has thanked: 2 times
Been thanked: 6 times

Re: Help reinjecting PNG and JPG

Post by Itze »

there's a REASON why filestripper only allows to reinject the same size file...

if you would inject a file that is larger than the original the offsets of the filetable would be fucked up and not correct anymore, which could probably destroy the whole archive :roll:
absarhegde
n00b
Posts: 10
Joined: Wed Aug 20, 2008 7:52 pm
Has thanked: 1 time

Re: Help reinjecting PNG and JPG

Post by absarhegde »

so is there anyway i can make images or graphics..to have sames as original ..???
Darkstar
advanced
Posts: 67
Joined: Thu Jun 14, 2007 1:14 pm
Location: Southern Germany
Has thanked: 7 times
Been thanked: 1 time
Contact:

Re: Help reinjecting PNG and JPG

Post by Darkstar »

If the new files are smaller than the original it should be no problem, just put them back in. If the tools you use don't allow that, simply fill the files up with zeroes until they're the same size as the original.
If they're bigger, well, you could try one or more of the following
- optimizing compression (pngcrush can help you there if it's PNG files that you're dealing with -- similar tools probably exist for GIF and JPG as well)
- reducing quality, wither by dithering or stronger jpeg compression

alternatively you can try to hack/fix the file offset table but this depends on the particular file archive that you're dealing with and is generally considered too hard for a n00b so I won't recommend it, you probably end up destroying your data files :twisted:

-Darkstar
Check out the REWiki!
absarhegde
n00b
Posts: 10
Joined: Wed Aug 20, 2008 7:52 pm
Has thanked: 1 time

Re: Help reinjecting PNG and JPG

Post by absarhegde »

thnx for the help darkstar

after trying hard..it was so simple..
i just chnged the log file and chnge the size to my own required one..
still i have not tested it..but arcive seems to be fine n wrking..
anyways thnx...
absarhegde
n00b
Posts: 10
Joined: Wed Aug 20, 2008 7:52 pm
Has thanked: 1 time

Re: Help reinjecting PNG and JPG

Post by absarhegde »

simply fill the files up with zeroes until they're the same size as the original.
how can i do this ?
Darkstar
advanced
Posts: 67
Joined: Thu Jun 14, 2007 1:14 pm
Location: Southern Germany
Has thanked: 7 times
Been thanked: 1 time
Contact:

Re: Help reinjecting PNG and JPG

Post by Darkstar »

Depends. On unix/linux there's a tool called "dd" that can do it. It should also be available on windows.
Any hexeditor should also be able to handle it (like frhed or hexedit32 on windows).
the third option involves some small C program to do it. sth. like this:

Code: Select all

#include <stdio.h>
int main(int argc, char **argv)
{
  long i;
  FILE *f = fopen(argv[1], "a");
  fseek(f, 0, SEEK_END);
  for (i = 0; i < atol(argv[2]); i++)
  {
    fputc(0, f);
  }
  fclose(f);
  return 0;
}
Disclaimer: I just hacked this up so I don't guarantee that it'll work. call it like "./a.out <filename> <num-bytes-to-add>". Failure to supply 2 cmd line arguments will probably make it kill your cat or something ;-)

-Darkstar
Check out the REWiki!
Post Reply