C# Extract/Unzip a .EXE file











up vote
-1
down vote

favorite












Using the DOTNETZIP library, I can currently unzip/extract .ZIP files using the following code:



private void Unzip(object sender, EventArgs e)
{
string zipPath = pub.DepoDirDaily + @"";
string unzipPath = pub.DepoDirDaily + @"";

DirectoryInfo efaFiles = new DirectoryInfo(zipPath);
foreach (var file in efaFiles.GetFiles("*.exe*"))
{
if (file.ToString().Contains(pub.YYYMMDD_t0) && file.ToString().Contains(".exe"))
{
try
{
String FileName = file.ToString().Replace(zipPath, "");
String FileNameClean = FileName.Replace(".exe", "");
String OutputDir = unzipPath + FileNameClean;
String InputDir = zipPath + file;

ExtractFileToDirectory(InputDir, OutputDir, "password1");
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
}
}
}

public void ExtractFileToDirectory(string existingZipFile, string outputDirectory, string Password)
{
try
{
ZipFile zip = ZipFile.Read(existingZipFile);
Directory.CreateDirectory(outputDirectory);

foreach (ZipEntry e in zip)
{
e.Password = Password;
e.Extract(outputDirectory);
}
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
}


However, when attempting to unzip .EXE files, I get the following error:



Ionic.Zip.ZipException: Cannot read that as a ZipFile ---> Ionic.Zip.BadReadException: Bad signature (0x00505A4D) at position 0x00000000



I have researched further, and it looks like that DOTNETZIP is not capable of handling .EXE files, so this does actually make sense. I have tried renaming the extension to .ZIP and attempt to unzip, and it comes up with the same error unfortunately.



It looks like it is possible to extract using the 7ZIP library, however I am struggling to find any proper examples online, and the ones that I do, don't include the possibility to include a password, so aren't useful.



Does anyone have anything that may be of help to me?
Either a different library, a work-around, or some help understanding the 7ZIP library would be much appreciated!



THANKS!










share|improve this question
























  • You can use the 7ZIP from command line inside your c# code. Just use the C# code to execute a .exe file and pass the correct paramters to 7zip. You only need to have access to the 7zip.exe path where your running your app from
    – Brad
    Nov 12 at 17:34










  • Dotnetzip can of course hande *.exe file. Maybe it is a virus scanner interfering with extraction?
    – Klaus Gütter
    Nov 12 at 17:44










  • @Brad To execute via command line do I use something similar to: System.Diagnostics.Process.Start("CMD.exe",comm); Where 'comm' is my 'command text'?
    – dhowells217
    Nov 12 at 17:45










  • @KlausGütter Thanks for confirmation. In respect to the virus scanner interfering, how should I approach this?
    – dhowells217
    Nov 12 at 17:46






  • 1




    What kind of exe files are you talking about? Are you trying to unpack self-extracting archives, or do you just want to get some resource sections from exe files?
    – elgonzo
    Nov 12 at 17:53

















up vote
-1
down vote

favorite












Using the DOTNETZIP library, I can currently unzip/extract .ZIP files using the following code:



private void Unzip(object sender, EventArgs e)
{
string zipPath = pub.DepoDirDaily + @"";
string unzipPath = pub.DepoDirDaily + @"";

DirectoryInfo efaFiles = new DirectoryInfo(zipPath);
foreach (var file in efaFiles.GetFiles("*.exe*"))
{
if (file.ToString().Contains(pub.YYYMMDD_t0) && file.ToString().Contains(".exe"))
{
try
{
String FileName = file.ToString().Replace(zipPath, "");
String FileNameClean = FileName.Replace(".exe", "");
String OutputDir = unzipPath + FileNameClean;
String InputDir = zipPath + file;

ExtractFileToDirectory(InputDir, OutputDir, "password1");
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
}
}
}

public void ExtractFileToDirectory(string existingZipFile, string outputDirectory, string Password)
{
try
{
ZipFile zip = ZipFile.Read(existingZipFile);
Directory.CreateDirectory(outputDirectory);

foreach (ZipEntry e in zip)
{
e.Password = Password;
e.Extract(outputDirectory);
}
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
}


However, when attempting to unzip .EXE files, I get the following error:



Ionic.Zip.ZipException: Cannot read that as a ZipFile ---> Ionic.Zip.BadReadException: Bad signature (0x00505A4D) at position 0x00000000



I have researched further, and it looks like that DOTNETZIP is not capable of handling .EXE files, so this does actually make sense. I have tried renaming the extension to .ZIP and attempt to unzip, and it comes up with the same error unfortunately.



It looks like it is possible to extract using the 7ZIP library, however I am struggling to find any proper examples online, and the ones that I do, don't include the possibility to include a password, so aren't useful.



Does anyone have anything that may be of help to me?
Either a different library, a work-around, or some help understanding the 7ZIP library would be much appreciated!



THANKS!










share|improve this question
























  • You can use the 7ZIP from command line inside your c# code. Just use the C# code to execute a .exe file and pass the correct paramters to 7zip. You only need to have access to the 7zip.exe path where your running your app from
    – Brad
    Nov 12 at 17:34










  • Dotnetzip can of course hande *.exe file. Maybe it is a virus scanner interfering with extraction?
    – Klaus Gütter
    Nov 12 at 17:44










  • @Brad To execute via command line do I use something similar to: System.Diagnostics.Process.Start("CMD.exe",comm); Where 'comm' is my 'command text'?
    – dhowells217
    Nov 12 at 17:45










  • @KlausGütter Thanks for confirmation. In respect to the virus scanner interfering, how should I approach this?
    – dhowells217
    Nov 12 at 17:46






  • 1




    What kind of exe files are you talking about? Are you trying to unpack self-extracting archives, or do you just want to get some resource sections from exe files?
    – elgonzo
    Nov 12 at 17:53















up vote
-1
down vote

favorite









up vote
-1
down vote

favorite











Using the DOTNETZIP library, I can currently unzip/extract .ZIP files using the following code:



private void Unzip(object sender, EventArgs e)
{
string zipPath = pub.DepoDirDaily + @"";
string unzipPath = pub.DepoDirDaily + @"";

DirectoryInfo efaFiles = new DirectoryInfo(zipPath);
foreach (var file in efaFiles.GetFiles("*.exe*"))
{
if (file.ToString().Contains(pub.YYYMMDD_t0) && file.ToString().Contains(".exe"))
{
try
{
String FileName = file.ToString().Replace(zipPath, "");
String FileNameClean = FileName.Replace(".exe", "");
String OutputDir = unzipPath + FileNameClean;
String InputDir = zipPath + file;

ExtractFileToDirectory(InputDir, OutputDir, "password1");
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
}
}
}

public void ExtractFileToDirectory(string existingZipFile, string outputDirectory, string Password)
{
try
{
ZipFile zip = ZipFile.Read(existingZipFile);
Directory.CreateDirectory(outputDirectory);

foreach (ZipEntry e in zip)
{
e.Password = Password;
e.Extract(outputDirectory);
}
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
}


However, when attempting to unzip .EXE files, I get the following error:



Ionic.Zip.ZipException: Cannot read that as a ZipFile ---> Ionic.Zip.BadReadException: Bad signature (0x00505A4D) at position 0x00000000



I have researched further, and it looks like that DOTNETZIP is not capable of handling .EXE files, so this does actually make sense. I have tried renaming the extension to .ZIP and attempt to unzip, and it comes up with the same error unfortunately.



It looks like it is possible to extract using the 7ZIP library, however I am struggling to find any proper examples online, and the ones that I do, don't include the possibility to include a password, so aren't useful.



Does anyone have anything that may be of help to me?
Either a different library, a work-around, or some help understanding the 7ZIP library would be much appreciated!



THANKS!










share|improve this question















Using the DOTNETZIP library, I can currently unzip/extract .ZIP files using the following code:



private void Unzip(object sender, EventArgs e)
{
string zipPath = pub.DepoDirDaily + @"";
string unzipPath = pub.DepoDirDaily + @"";

DirectoryInfo efaFiles = new DirectoryInfo(zipPath);
foreach (var file in efaFiles.GetFiles("*.exe*"))
{
if (file.ToString().Contains(pub.YYYMMDD_t0) && file.ToString().Contains(".exe"))
{
try
{
String FileName = file.ToString().Replace(zipPath, "");
String FileNameClean = FileName.Replace(".exe", "");
String OutputDir = unzipPath + FileNameClean;
String InputDir = zipPath + file;

ExtractFileToDirectory(InputDir, OutputDir, "password1");
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
}
}
}

public void ExtractFileToDirectory(string existingZipFile, string outputDirectory, string Password)
{
try
{
ZipFile zip = ZipFile.Read(existingZipFile);
Directory.CreateDirectory(outputDirectory);

foreach (ZipEntry e in zip)
{
e.Password = Password;
e.Extract(outputDirectory);
}
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
}


However, when attempting to unzip .EXE files, I get the following error:



Ionic.Zip.ZipException: Cannot read that as a ZipFile ---> Ionic.Zip.BadReadException: Bad signature (0x00505A4D) at position 0x00000000



I have researched further, and it looks like that DOTNETZIP is not capable of handling .EXE files, so this does actually make sense. I have tried renaming the extension to .ZIP and attempt to unzip, and it comes up with the same error unfortunately.



It looks like it is possible to extract using the 7ZIP library, however I am struggling to find any proper examples online, and the ones that I do, don't include the possibility to include a password, so aren't useful.



Does anyone have anything that may be of help to me?
Either a different library, a work-around, or some help understanding the 7ZIP library would be much appreciated!



THANKS!







c# .net exe unzip






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 12 at 17:53









Spara

1,32511122




1,32511122










asked Nov 12 at 17:32









dhowells217

86




86












  • You can use the 7ZIP from command line inside your c# code. Just use the C# code to execute a .exe file and pass the correct paramters to 7zip. You only need to have access to the 7zip.exe path where your running your app from
    – Brad
    Nov 12 at 17:34










  • Dotnetzip can of course hande *.exe file. Maybe it is a virus scanner interfering with extraction?
    – Klaus Gütter
    Nov 12 at 17:44










  • @Brad To execute via command line do I use something similar to: System.Diagnostics.Process.Start("CMD.exe",comm); Where 'comm' is my 'command text'?
    – dhowells217
    Nov 12 at 17:45










  • @KlausGütter Thanks for confirmation. In respect to the virus scanner interfering, how should I approach this?
    – dhowells217
    Nov 12 at 17:46






  • 1




    What kind of exe files are you talking about? Are you trying to unpack self-extracting archives, or do you just want to get some resource sections from exe files?
    – elgonzo
    Nov 12 at 17:53




















  • You can use the 7ZIP from command line inside your c# code. Just use the C# code to execute a .exe file and pass the correct paramters to 7zip. You only need to have access to the 7zip.exe path where your running your app from
    – Brad
    Nov 12 at 17:34










  • Dotnetzip can of course hande *.exe file. Maybe it is a virus scanner interfering with extraction?
    – Klaus Gütter
    Nov 12 at 17:44










  • @Brad To execute via command line do I use something similar to: System.Diagnostics.Process.Start("CMD.exe",comm); Where 'comm' is my 'command text'?
    – dhowells217
    Nov 12 at 17:45










  • @KlausGütter Thanks for confirmation. In respect to the virus scanner interfering, how should I approach this?
    – dhowells217
    Nov 12 at 17:46






  • 1




    What kind of exe files are you talking about? Are you trying to unpack self-extracting archives, or do you just want to get some resource sections from exe files?
    – elgonzo
    Nov 12 at 17:53


















You can use the 7ZIP from command line inside your c# code. Just use the C# code to execute a .exe file and pass the correct paramters to 7zip. You only need to have access to the 7zip.exe path where your running your app from
– Brad
Nov 12 at 17:34




You can use the 7ZIP from command line inside your c# code. Just use the C# code to execute a .exe file and pass the correct paramters to 7zip. You only need to have access to the 7zip.exe path where your running your app from
– Brad
Nov 12 at 17:34












Dotnetzip can of course hande *.exe file. Maybe it is a virus scanner interfering with extraction?
– Klaus Gütter
Nov 12 at 17:44




Dotnetzip can of course hande *.exe file. Maybe it is a virus scanner interfering with extraction?
– Klaus Gütter
Nov 12 at 17:44












@Brad To execute via command line do I use something similar to: System.Diagnostics.Process.Start("CMD.exe",comm); Where 'comm' is my 'command text'?
– dhowells217
Nov 12 at 17:45




@Brad To execute via command line do I use something similar to: System.Diagnostics.Process.Start("CMD.exe",comm); Where 'comm' is my 'command text'?
– dhowells217
Nov 12 at 17:45












@KlausGütter Thanks for confirmation. In respect to the virus scanner interfering, how should I approach this?
– dhowells217
Nov 12 at 17:46




@KlausGütter Thanks for confirmation. In respect to the virus scanner interfering, how should I approach this?
– dhowells217
Nov 12 at 17:46




1




1




What kind of exe files are you talking about? Are you trying to unpack self-extracting archives, or do you just want to get some resource sections from exe files?
– elgonzo
Nov 12 at 17:53






What kind of exe files are you talking about? Are you trying to unpack self-extracting archives, or do you just want to get some resource sections from exe files?
– elgonzo
Nov 12 at 17:53














1 Answer
1






active

oldest

votes

















up vote
0
down vote













.exe file is not a zip file, it is a portable executable file. Have a look at the suggestions from Parsing plain Win32 PE File (Exe/DLL) in .NET for libraries that can parse the file to some preprocessed form, or you could just read it as a binary file and pull the fields you want yourself.






share|improve this answer








New contributor




MadKarel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.


















  • Thanks for the link. The only reason I "want" to unzip it, is to access the file manually I am unzipping it (on 7zip funnily enough) to be able to access the file itself. I will read your links though, thanks.
    – dhowells217
    Nov 12 at 17:48






  • 1




    I'm reasonably sure that the OP isn't refering to any exe file, but to a self-extracting zip file, which is nothing that a zip file plus a mini executable module that extracts the thing.
    – Alejandro
    Nov 12 at 17:50










  • Thanks @Alejandro
    – dhowells217
    Nov 12 at 17:53






  • 2




    @Alejandro, that is not certain. Note how OP mentions 7zip being capable to do so. But consider that 7zip can be used to extract resources from exe files. So, it is not clear to me whether the OP speaks about self-extracting archives or not...
    – elgonzo
    Nov 12 at 17:53










  • I'm pretty sure that @Alejandro has it right. The thing is, that a self-executing zip file is not a zip file. A program like 7zip reads the file, recognizes it as a PE file, then strips away the PE-ness of the file and un-zips the zippy part. Your zip library probably doesn't di that
    – Flydog57
    Nov 12 at 17:56











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53267274%2fc-sharp-extract-unzip-a-exe-file%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote













.exe file is not a zip file, it is a portable executable file. Have a look at the suggestions from Parsing plain Win32 PE File (Exe/DLL) in .NET for libraries that can parse the file to some preprocessed form, or you could just read it as a binary file and pull the fields you want yourself.






share|improve this answer








New contributor




MadKarel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.


















  • Thanks for the link. The only reason I "want" to unzip it, is to access the file manually I am unzipping it (on 7zip funnily enough) to be able to access the file itself. I will read your links though, thanks.
    – dhowells217
    Nov 12 at 17:48






  • 1




    I'm reasonably sure that the OP isn't refering to any exe file, but to a self-extracting zip file, which is nothing that a zip file plus a mini executable module that extracts the thing.
    – Alejandro
    Nov 12 at 17:50










  • Thanks @Alejandro
    – dhowells217
    Nov 12 at 17:53






  • 2




    @Alejandro, that is not certain. Note how OP mentions 7zip being capable to do so. But consider that 7zip can be used to extract resources from exe files. So, it is not clear to me whether the OP speaks about self-extracting archives or not...
    – elgonzo
    Nov 12 at 17:53










  • I'm pretty sure that @Alejandro has it right. The thing is, that a self-executing zip file is not a zip file. A program like 7zip reads the file, recognizes it as a PE file, then strips away the PE-ness of the file and un-zips the zippy part. Your zip library probably doesn't di that
    – Flydog57
    Nov 12 at 17:56















up vote
0
down vote













.exe file is not a zip file, it is a portable executable file. Have a look at the suggestions from Parsing plain Win32 PE File (Exe/DLL) in .NET for libraries that can parse the file to some preprocessed form, or you could just read it as a binary file and pull the fields you want yourself.






share|improve this answer








New contributor




MadKarel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.


















  • Thanks for the link. The only reason I "want" to unzip it, is to access the file manually I am unzipping it (on 7zip funnily enough) to be able to access the file itself. I will read your links though, thanks.
    – dhowells217
    Nov 12 at 17:48






  • 1




    I'm reasonably sure that the OP isn't refering to any exe file, but to a self-extracting zip file, which is nothing that a zip file plus a mini executable module that extracts the thing.
    – Alejandro
    Nov 12 at 17:50










  • Thanks @Alejandro
    – dhowells217
    Nov 12 at 17:53






  • 2




    @Alejandro, that is not certain. Note how OP mentions 7zip being capable to do so. But consider that 7zip can be used to extract resources from exe files. So, it is not clear to me whether the OP speaks about self-extracting archives or not...
    – elgonzo
    Nov 12 at 17:53










  • I'm pretty sure that @Alejandro has it right. The thing is, that a self-executing zip file is not a zip file. A program like 7zip reads the file, recognizes it as a PE file, then strips away the PE-ness of the file and un-zips the zippy part. Your zip library probably doesn't di that
    – Flydog57
    Nov 12 at 17:56













up vote
0
down vote










up vote
0
down vote









.exe file is not a zip file, it is a portable executable file. Have a look at the suggestions from Parsing plain Win32 PE File (Exe/DLL) in .NET for libraries that can parse the file to some preprocessed form, or you could just read it as a binary file and pull the fields you want yourself.






share|improve this answer








New contributor




MadKarel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









.exe file is not a zip file, it is a portable executable file. Have a look at the suggestions from Parsing plain Win32 PE File (Exe/DLL) in .NET for libraries that can parse the file to some preprocessed form, or you could just read it as a binary file and pull the fields you want yourself.







share|improve this answer








New contributor




MadKarel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this answer



share|improve this answer






New contributor




MadKarel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









answered Nov 12 at 17:45









MadKarel

812




812




New contributor




MadKarel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





MadKarel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






MadKarel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • Thanks for the link. The only reason I "want" to unzip it, is to access the file manually I am unzipping it (on 7zip funnily enough) to be able to access the file itself. I will read your links though, thanks.
    – dhowells217
    Nov 12 at 17:48






  • 1




    I'm reasonably sure that the OP isn't refering to any exe file, but to a self-extracting zip file, which is nothing that a zip file plus a mini executable module that extracts the thing.
    – Alejandro
    Nov 12 at 17:50










  • Thanks @Alejandro
    – dhowells217
    Nov 12 at 17:53






  • 2




    @Alejandro, that is not certain. Note how OP mentions 7zip being capable to do so. But consider that 7zip can be used to extract resources from exe files. So, it is not clear to me whether the OP speaks about self-extracting archives or not...
    – elgonzo
    Nov 12 at 17:53










  • I'm pretty sure that @Alejandro has it right. The thing is, that a self-executing zip file is not a zip file. A program like 7zip reads the file, recognizes it as a PE file, then strips away the PE-ness of the file and un-zips the zippy part. Your zip library probably doesn't di that
    – Flydog57
    Nov 12 at 17:56


















  • Thanks for the link. The only reason I "want" to unzip it, is to access the file manually I am unzipping it (on 7zip funnily enough) to be able to access the file itself. I will read your links though, thanks.
    – dhowells217
    Nov 12 at 17:48






  • 1




    I'm reasonably sure that the OP isn't refering to any exe file, but to a self-extracting zip file, which is nothing that a zip file plus a mini executable module that extracts the thing.
    – Alejandro
    Nov 12 at 17:50










  • Thanks @Alejandro
    – dhowells217
    Nov 12 at 17:53






  • 2




    @Alejandro, that is not certain. Note how OP mentions 7zip being capable to do so. But consider that 7zip can be used to extract resources from exe files. So, it is not clear to me whether the OP speaks about self-extracting archives or not...
    – elgonzo
    Nov 12 at 17:53










  • I'm pretty sure that @Alejandro has it right. The thing is, that a self-executing zip file is not a zip file. A program like 7zip reads the file, recognizes it as a PE file, then strips away the PE-ness of the file and un-zips the zippy part. Your zip library probably doesn't di that
    – Flydog57
    Nov 12 at 17:56
















Thanks for the link. The only reason I "want" to unzip it, is to access the file manually I am unzipping it (on 7zip funnily enough) to be able to access the file itself. I will read your links though, thanks.
– dhowells217
Nov 12 at 17:48




Thanks for the link. The only reason I "want" to unzip it, is to access the file manually I am unzipping it (on 7zip funnily enough) to be able to access the file itself. I will read your links though, thanks.
– dhowells217
Nov 12 at 17:48




1




1




I'm reasonably sure that the OP isn't refering to any exe file, but to a self-extracting zip file, which is nothing that a zip file plus a mini executable module that extracts the thing.
– Alejandro
Nov 12 at 17:50




I'm reasonably sure that the OP isn't refering to any exe file, but to a self-extracting zip file, which is nothing that a zip file plus a mini executable module that extracts the thing.
– Alejandro
Nov 12 at 17:50












Thanks @Alejandro
– dhowells217
Nov 12 at 17:53




Thanks @Alejandro
– dhowells217
Nov 12 at 17:53




2




2




@Alejandro, that is not certain. Note how OP mentions 7zip being capable to do so. But consider that 7zip can be used to extract resources from exe files. So, it is not clear to me whether the OP speaks about self-extracting archives or not...
– elgonzo
Nov 12 at 17:53




@Alejandro, that is not certain. Note how OP mentions 7zip being capable to do so. But consider that 7zip can be used to extract resources from exe files. So, it is not clear to me whether the OP speaks about self-extracting archives or not...
– elgonzo
Nov 12 at 17:53












I'm pretty sure that @Alejandro has it right. The thing is, that a self-executing zip file is not a zip file. A program like 7zip reads the file, recognizes it as a PE file, then strips away the PE-ness of the file and un-zips the zippy part. Your zip library probably doesn't di that
– Flydog57
Nov 12 at 17:56




I'm pretty sure that @Alejandro has it right. The thing is, that a self-executing zip file is not a zip file. A program like 7zip reads the file, recognizes it as a PE file, then strips away the PE-ness of the file and un-zips the zippy part. Your zip library probably doesn't di that
– Flydog57
Nov 12 at 17:56


















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53267274%2fc-sharp-extract-unzip-a-exe-file%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to send String Array data to Server using php in android

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

Is anime1.com a legal site for watching anime?