-1

As i mentioned at the title i need to remove 7z word from the zipped folder. If i will create a 7z archive it just looks like this. If i use n++ to open it it looks like this. Any way to remove just at the start (the other is the folder name inside the zip).

7z¼¯' m®        :       E†D¶€      7 z   f o l d e r   
 42
»Ó      

Here is the file: https://drive.google.com/open?id=18fpX2DzJkt6j0RqgkwWimu_QR-jT5_Qn

If it's possible from dll's can anyone do and send me(i dont know how)

Thanks

If it's possible to remove first 2 letter without messing the remaining and put it back when it's needed using batch or c i can take that.

  • Wouldn't be better to change how you create the archive rather than meddle with the archive itself? –  Mar 13 '18 at 21:18
  • What do you mean – Barış Sedefoğlu Mar 13 '18 at 21:19
  • Change how you create the archive so it doesn't have that folder? What was unclear about my first comment? –  Mar 13 '18 at 21:21
  • The 7z keeps at the beginning the middle one changes. – Barış Sedefoğlu Mar 13 '18 at 21:22
  • 1
    It is part of the [magic bytes](https://en.wikipedia.org/wiki/List_of_file_signatures) that determine what the file is. You'll corrupt the file if you remove it. – Vasan Mar 13 '18 at 21:32
  • Vasan i don't think batch file will really corrupt but (im using dev c++) in c my codes can't even print characters like (Turkish)(ı,İ,ö,Ö,ğ,...) and those aren't magical bytes :D (repl.it on gcc works fine but can't use much). – Barış Sedefoğlu Mar 13 '18 at 21:40
  • [Yes, it is a magic number: 37 7A BC AF 27 1C](https://www.garykessler.net/library/file_sigs.html). If you remove that, you will break the archive. Why are you trying to print these characters? –  Mar 13 '18 at 22:52
  • This is an example of an [XY Problem](https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem). What actual problem are you trying to solve? –  Mar 13 '18 at 23:18
  • Amy i am trying to zip a file that has no sign of zipped with 7z. Why 7z, because command support. – Barış Sedefoğlu Mar 14 '18 at 09:47

1 Answers1

0

Well just making a simple c file works fine.

Code:

#include <stdio.h>
int main(int argc, char *argv[]){
    FILE *file;
    file=fopen(argv[1],"r+b");
    fprintf(file,"text");
}

Btw the text shouldn't be longer than 5 chars or you will corrupt the archive.

For making the archive readable.

Code:

#include <stdio.h>
int main(int argc, char *argv[]){
    FILE *file;
    file=fopen(argv[1],"r+b");
    fprintf(file,"7z¼¯'");
}