{
  "WorkItem": {
    "AffectedComponent": {
      "Name": "",
      "DisplayName": ""
    },
    "ClosedComment": "first available in v1.7.",
    "ClosedDate": "2009-05-08T09:25:36.17-07:00",
    "CommentCount": 0,
    "Custom": null,
    "Description": "From Discussion thread:\n \nI would like the library, ZipFile constructor and Read() method, to be able to accept a sfx file and open/read it.\n \nI know that zlib, SharpZipLib, 7-zip, WinRAR and WinZip all successfully open the various sfx files that I have.\n \nYes, there is not sfx standard. However, I believe that we can scope the problem space in order to be 80% successful. We can classify sfx files into two classes: a) those that are a stub.exe + payload.zip (i.e. created via copy /b a+b c or equivalent), and b) those where the payload.zip is not at the end of the file (i.e. there are pre/post markers, special .data section, ...). Let's ignore class b. For class a, the central directory is at the end of the file and thus discoverable.\n \nMy memory is foggy, but I am guessing that the offsets in the central directory are from the beginning of the file, thus the math to get to file entry is BeginningOfFile + FileHeaderOffset. BeginningOfFile is always 0 and is really just setting the file pointer to the beginning. However, when the first few bytes of the file are not a file header signature, then BeginningOfFile needs to be calculated to a non-0 value. One algorithm to calculate it is a small modification of the code presented in the article at http://smallcode.weblogs.us/oldblog/2006/06/05/self-extracting-executables/, you don't need the last few lines starting at readfile(). While the article is specifically about how the have the sfx stub.exe find the payload.zip, the same \"finding\" logic would still apply to your library. The author states in the second reply \"This method is simple and reliable; Rar self-extractor uses it (see Archive::IsArchive method in UnRAR sources).\"",
    "LastUpdatedDate": "2013-05-16T05:32:31.897-07:00",
    "PlannedForRelease": "1.8 DotNetZip",
    "ReleaseVisibleToPublic": true,
    "Priority": {
      "Name": "Low",
      "Severity": 50,
      "Id": 1
    },
    "ProjectName": "DotNetZip",
    "ReportedDate": "2009-02-10T07:20:19.783-08:00",
    "Status": {
      "Name": "Closed",
      "Id": 4
    },
    "ReasonClosed": {
      "Name": "Unassigned"
    },
    "Summary": "ZipFile constructor and Read method to open synthetic sfx files",
    "Type": {
      "Name": "Feature",
      "Id": 1
    },
    "VoteCount": 1,
    "Id": 7062
  },
  "FileAttachments": [],
  "Comments": [
    {
      "Message": "Mike, can you attach a few sample SFX files produced by multiple other tools?  One from WinRar, one from 7zip, etc.",
      "PostedDate": "2009-02-10T12:25:50.033-08:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2009-02-11T21:31:39.993-08:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2009-02-19T22:41:23.97-08:00",
      "Id": -2147483648
    },
    {
      "Message": "This capability is now supported in DotNetZip as of v1.7 - but only for Zip files produced according to the WinZip model.  ",
      "PostedDate": "2009-05-08T09:25:22.797-07:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2009-05-08T09:25:36.17-07:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2013-02-21T18:44:31.443-08:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2013-05-16T05:32:31.897-07:00",
      "Id": -2147483648
    }
  ]
}