It is quite easy if you use the right tools.
Code: Select all
import os
f = open("img.png","wb")
for path,dir,files in os.walk("manyfiles"):
for file in files:
f.write(chr(len(open(os.path.join(path,file)).read())))
f.close()
Code: Select all
import os
f = open("img.png","wb")
for path,dir,files in os.walk("manyfiles"):
for file in files:
f.write(chr(len(open(os.path.join(path,file)).read())))
f.close()
Code: Select all
irb(main):066:0> File.open("../r.png",File::WRONLY|File::TRUNC|File::CREAT){|ofile|
irb(main):067:1* Dir.glob("**/*txt").sort.each{|filename|
irb(main):068:2* ofile.putc File.size(filename)
irb(main):069:2> }}
Code: Select all
unzip -l manyfiles.zip |
sort -k 4 |
perl -n -e "$i++;m/^ +([0-9]+) /;$n=$1;printf """%2.2x""",$n;printf"""\n""" if (($i+1)%32==0)" |
hex2bin.pl - img.png
Code: Select all
#!/bin/bash
a=0
k=0
for i in manyfiles/*/*/*/*/* ;
do
s=`ls -al $i | cut -d" " -f5`
if [ $k -eq 0 ] ;
then
printf "%06x:" $a
fi
printf " %02x" $s
k=$((k+1))
a=$((a+1))
if [ $k -eq 16 ] ;
then
k=0
echo ""
fi
done
echo ""
Code: Select all
static HashMap<String,Integer> _len = new HashMap<String,Integer>();
public static void main(String args[]){
try{
ZipFile zipfile = new ZipFile(new File("c:\\hacker\\manyfiles.zip"));
Enumeration ez = zipfile.entries();
List<String> paths = new ArrayList<String>();
while(ez.hasMoreElements()){
ZipEntry ze = (ZipEntry) ez.nextElement();
paths.add(ze.getName());
java.io.InputStream is = zipfile.getInputStream(ze);
byte[] buf = new byte[is.available()];
is.read(buf);
is.close();
_len.put(ze.getName(), buf.length);
}
Collections.sort(paths);
FileOutputStream fo = new FileOutputStream("c:\\hacker\\test.png");
for(int i=0;i<paths.size();i++)
fo.write((byte)(int)_len.get(paths.get(i)));
fo.close();
}catch(Exception ex){}
}
No, there are only two PNGs. The "central directory" of the zip file starts at this position, of course you can decode both images from it.Broker wrote:3rd: After Position 0x00229622 (around the middle of the file) there is an invalid zip-envelope/header, so normal zip-decompression ignores this part. Inside you will find the identical PNG to the 1st PNG with the hint "You are on the right track"
Code: Select all
import os
f = open("img.png","wb")
for path,dir,files in os.walk("manyfiles"):
for file in files:
f.write(chr(os.stat(os.path.join(path, file)).st_size))
f.close()
Code: Select all
dir /s > manyfiles.txt
Code: Select all
f_out = open('c:\manyfilesout-2.png', 'w')
for i in lines:
if i[17:26] == "Datei(en)":
## print int(i[38:41])
f_out.write (chr(int(i[38:41])))
f_out.close()