Help Inject into a zip
#1
Basically what I want to do is inject stuff into another zip, not recompile the whole zip.
Every library I used just starts recreating the whole zip, while I just want it to change 1 file in a existing zip AND NOT FREAKIN RECOMPILE THE WHOLE ZIP
It drives me crazy, and yes I looked for functions in the library but I couldn't find any.
I'm using the DotNetZip library.
http://dotnetzip.codeplex.com
Also no bullshit 'Just try another library' questions because I already tried 2 library's and they both do the same.

TL;DR:
I want to change a file like winRAR does

[Image: 8X9P9pa3XB.png]]
Reply

#2
Use an injector Troll
[Image: azuw.jpg]
Reply

#3
*bump*

really need help with this
Reply

#4
The images are still not aligned.
Make a thread on http://stackoverflow.com/
[Image: MaEIQ.png]
Reply

#5
@Pozzuh SO WHAT.
and thanks. i guess.
Reply

#6
Jariz, I have some really really nice c# zip functions.

Code:
// Copyright 2012 Tim Walton (CloudInk) using System; using System.Collections; using System.IO; using ICSharpCode.SharpZipLib.Zip; namespace crAyon.common { /// <summary> /// Created By : Tim Walton (timdwalton[at]gmail.com) /// Created Date : 02-02-2012 /// License : May be used without permission as long as proper credit /// License : is given. /// </summary> public class ZipUtil { public static void ZipFiles(string inputFolderPath, string outputPathAndFile, string password) { ArrayList ar = GenerateFileList(inputFolderPath) int TrimLength = (Directory.GetParent(inputFolderPath)).ToString().Length; TrimLength += 1; FileStream ostream; byte[] obuffer; string outPath = outputPathAndFile; ZipOutputStream oZipStream = new ZipOutputStream(File.Create(outPath)); if (password != null && password != String.Empty) oZipStream.Password = password; oZipStream.SetLevel(9); ZipEntry oZipEntry; foreach (string Fil in ar) { oZipEntry = new ZipEntry(Fil.Remove(0, TrimLength)); oZipStream.PutNextEntry(oZipEntry); if (!Fil.EndsWith(@"/")) { ostream = File.OpenRead(Fil); obuffer = new byte[ostream.Length]; ostream.Read(obuffer, 0, obuffer.Length); oZipStream.Write(obuffer, 0, obuffer.Length); } } oZipStream.Finish(); oZipStream.Close(); } private static ArrayList GenerateFileList(string Dir) { ArrayList fils = new ArrayList(); bool Empty = true; foreach (string file in Directory.GetFiles(Dir)) fils.Add(file); Empty = false; } if (Empty) { if (Directory.GetDirectories(Dir).Length == 0) { fils.Add(Dir + @"/"); } } foreach (string dirs in Directory.GetDirectories(Dir)) // recursive { foreach (object obj in GenerateFileList(dirs)) { fils.Add(obj); } } return fils; } public static void UnZipFiles(string zipPathAndFile, string outputFolder, string password, bool deleteZipFile) { ZipInputStream s = new ZipInputStream(File.OpenRead(zipPathAndFile)); if (password != null && password != String.Empty) s.Password = password; ZipEntry theEntry; string tmpEntry = String.Empty; while ((theEntry = s.GetNextEntry()) != null) { string directoryName = outputFolder; string fileName = Path.GetFileName(theEntry.Name); if (directoryName != "") { Directory.CreateDirectory(directoryName); } if (fileName != String.Empty) { if (theEntry.Name.IndexOf(".ini") < 0) { string fullPath = directoryName + "\\" + theEntry.Name; fullPath = fullPath.Replace("\\ ", "\\"); string fullDirPath = Path.GetDirectoryName(fullPath); if (!Directory.Exists(fullDirPath)) Directory.CreateDirectory(fullDirPath); FileStream streamWriter = File.Create(fullPath); int size = 2048; byte[] data = new byte[2048]; while (true) { size = s.Read(data, 0, data.Length); if (size > 0) { streamWriter.Write(data, 0, size); } else { break; } } streamWriter.Close(); } } } s.Close(); if (deleteZipFile) File.Delete(zipPathAndFile); } } }

DO NOT USE WITHOUT CREDIT TO ME.

And I hate to say this @JariZ , but try this lib, its great.

And if anything, you can always tear the zip down, and rebuild it.



Attached Files
.zip   Win64Release.zip (Size: 340.48 KB / Downloads: 23)
crAyon makes no warranty with respect to documents or other information available from this place, assumes no legal liability or responsibility whatsoever for the accuracy, completeness, or usefulness of any such information, and does not represent that its use would not infringe privately owned rights. crAyon disclaims all warranties, express and implied, including the warranties of merchantability and fitness for a particular purpose.
Reply

#7
lulz just released the program. forgot to check the thread.
Ah well, next version i guess. I made a method that's pretty fast as well
Also, I always credit the people who help me.
EDIT:
[Image: 7pRHV6hNxs.png]
Reply

#8
(02-13-2012, 01:13)JariZ Wrote: lulz just released the program. forgot to check the thread.
Ah well, next version i guess. I made a method that's pretty fast as well
Also, I always credit the people who help me.
EDIT:
[Image: 7pRHV6hNxs.png]

Yea I know, they deleted it, those assholes.

But it was cool while it lasted.

Anyway, I have to because of legal reasons on this code not freely
just dump it in a thread.
crAyon makes no warranty with respect to documents or other information available from this place, assumes no legal liability or responsibility whatsoever for the accuracy, completeness, or usefulness of any such information, and does not represent that its use would not infringe privately owned rights. crAyon disclaims all warranties, express and implied, including the warranties of merchantability and fitness for a particular purpose.
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  Help all the Hack by memory inject are invalid arx-4 1 63,672 02-02-2012, 09:14
Last Post: surtek

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2026 Melroy van den Berg.