<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -48,7 +48,6 @@
 #endif
 
 int debug;
-static int verbose = 0;
 
 #define DFU_IFF_DFU		0x0001	/* DFU Mode, (not Runtime) */
 #define DFU_IFF_VENDOR		0x0100
@@ -294,52 +293,6 @@ static int count_dfu_devices(struct dfu_if *dif)
 	return num_found;
 }
 
-
-static int list_dfu_interfaces(void)
-{
-	struct usb_bus *usb_bus;
-	struct usb_device *dev;
-
-	/* Walk the tree and find our device. */
-	for (usb_bus = usb_get_busses(); NULL != usb_bus;
-	     usb_bus = usb_bus-&gt;next ) {
-		for (dev = usb_bus-&gt;devices; NULL != dev; dev = dev-&gt;next) {
-			find_dfu_if(dev, &amp;print_dfu_if, NULL);
-		}
-	}
-	return 0;
-}
-
-static int parse_vendprod(struct usb_vendprod *vp, const char *str)
-{
-	unsigned long vend, prod;
-	const char *colon;
-
-	colon = strchr(str, ':');
-	if (!colon || strlen(colon) &lt; 2)
-		return -EINVAL;
-
-	vend = strtoul(str, NULL, 16);
-	prod = strtoul(colon+1, NULL, 16);
-
-	if (vend &gt; 0xffff || prod &gt; 0xffff)
-		return -EINVAL;
-
-	vp-&gt;vendor = vend;
-	vp-&gt;product = prod;
-
-	return 0;
-}
-
-
-static int resolve_device_path(struct dfu_if *dif)
-{
-	fprintf(stderr,
-	    &quot;USB device paths are not supported by this dfu-util.\n&quot;);
-	exit(1);
-}
-
-
 static void help(void)
 {
 	printf(&quot;Usage: dfu-util [options] ...\n&quot;
@@ -359,25 +312,6 @@ static void help(void)
 		);
 }
 
-static struct option opts[] = {
-	{ &quot;help&quot;, 0, 0, 'h' },
-	{ &quot;version&quot;, 0, 0, 'V' },
-	{ &quot;verbose&quot;, 0, 0, 'v' },
-	{ &quot;list&quot;, 0, 0, 'l' },
-	{ &quot;device&quot;, 1, 0, 'd' },
-	{ &quot;path&quot;, 1, 0, 'p' },
-	{ &quot;configuration&quot;, 1, 0, 'c' },
-	{ &quot;cfg&quot;, 1, 0, 'c' },
-	{ &quot;interface&quot;, 1, 0, 'i' },
-	{ &quot;intf&quot;, 1, 0, 'i' },
-	{ &quot;altsetting&quot;, 1, 0, 'a' },
-	{ &quot;alt&quot;, 1, 0, 'a' },
-	{ &quot;transfer-size&quot;, 1, 0, 't' },
-	{ &quot;upload&quot;, 1, 0, 'U' },
-	{ &quot;download&quot;, 1, 0, 'D' },
-	{ &quot;reset&quot;, 0, 0, 'R' },
-};
-
 enum mode {
 	MODE_NONE,
 	MODE_UPLOAD,
@@ -386,7 +320,6 @@ enum mode {
 
 int download(AbstractFile* file, unsigned int transfer_size, int final_reset)
 {
-	struct usb_vendprod vendprod;
 	struct dfu_if _rt_dif, _dif, *dif = &amp;_dif;
 	int num_devs;
 	int num_ifs;
@@ -394,7 +327,6 @@ int download(AbstractFile* file, unsigned int transfer_size, int final_reset)
 	struct dfu_status status;
 	struct usb_dfu_func_descriptor func_dfu;
 	char *alt_name = NULL; /* query alt name if non-NULL */
-	char *end;
 	int page_size = getpagesize();
 	int ret;
 	
@@ -455,7 +387,6 @@ int download(AbstractFile* file, unsigned int transfer_size, int final_reset)
 	if (!get_first_dfu_if(&amp;_rt_dif))
 		exit(1);
 
-dfustate:
 	if (alt_name) {
 		int n;
 </diff>
      <filename>dfu-util/main.c</filename>
    </modified>
    <modified>
      <diff>@@ -256,7 +256,6 @@ get_status:
 	printf(&quot;Done!\n&quot;);
 out_close:
 	file-&gt;close(file);
-out_free:
 	free(buf);
 
 	return ret;</diff>
      <filename>dfu-util/sam7dfu.c</filename>
    </modified>
    <modified>
      <diff>@@ -4,6 +4,7 @@
 
 #include &lt;dmg/dmg.h&gt;
 #include &lt;dmg/filevault.h&gt;
+#include &lt;inttypes.h&gt;
 
 #ifdef HAVE_CRYPT
 
@@ -207,7 +208,7 @@ AbstractFile* createAbstractFileFromFileVault(AbstractFile* file, const char* ke
 	file-&gt;read(file, &amp;signature, sizeof(uint64_t));
 	FLIPENDIAN(signature);
 	if(signature != FILEVAULT_V2_SIGNATURE) {
-		printf(&quot;Unknown signature: %x\n&quot;, signature);
+		printf(&quot;Unknown signature: %&quot; PRId64 &quot;\n&quot;, signature);
 		/* no FileVault v1 handling yet */
 		return NULL;
 	}
@@ -222,7 +223,9 @@ AbstractFile* createAbstractFileFromFileVault(AbstractFile* file, const char* ke
 	flipFileVaultV2Header(&amp;(info-&gt;header.v2));
 	
 	for(i = 0; i &lt; 16; i++) {
-		sscanf(&amp;(key[i * 2]), &quot;%02hhx&quot;, &amp;(aesKey[i]));
+		unsigned int curByte;
+		sscanf(&amp;(key[i * 2]), &quot;%02x&quot;, &amp;curByte);
+		aesKey[i] = curByte;
 	}
 
 	for(i = 0; i &lt; 20; i++) {</diff>
      <filename>dmg/filevault.c</filename>
    </modified>
    <modified>
      <diff>@@ -1,27 +1,28 @@
-#include &lt;stdlib.h&gt;
-#include &lt;stdio.h&gt;
-#include &lt;stdint.h&gt;
-#include &lt;time.h&gt;
-#include &lt;string.h&gt;
-#include &lt;unistd.h&gt;
-#include &lt;hfs/hfsplus.h&gt;
-#include &lt;dmg/dmgfile.h&gt;
-#include &lt;dmg/filevault.h&gt;
-#include &lt;sys/types.h&gt;
-#include &lt;sys/stat.h&gt;
+#include &lt;stdlib.h&gt;
+#include &lt;stdio.h&gt;
+#include &lt;stdint.h&gt;
+#include &lt;time.h&gt;
+#include &lt;string.h&gt;
+#include &lt;unistd.h&gt;
+#include &lt;hfs/hfsplus.h&gt;
+#include &lt;dmg/dmgfile.h&gt;
+#include &lt;dmg/filevault.h&gt;
+#include &lt;sys/types.h&gt;
+#include &lt;sys/stat.h&gt;
 #include &lt;dirent.h&gt;
-#include &quot;hfs/hfslib.h&quot;
-
-char endianness;
-
-void cmd_ls(Volume* volume, int argc, const char *argv[]) {	
-	if(argc &gt; 1)
-		hfs_ls(volume, argv[1]);
-	else
-		hfs_ls(volume, &quot;/&quot;);}
-
-void cmd_cat(Volume* volume, int argc, const char *argv[]) {
-	HFSPlusCatalogRecord* record;
+#include &quot;hfs/hfslib.h&quot;
+
+char endianness;
+
+void cmd_ls(Volume* volume, int argc, const char *argv[]) {	
+	if(argc &gt; 1)
+		hfs_ls(volume, argv[1]);
+	else
+		hfs_ls(volume, &quot;/&quot;);
+}
+
+void cmd_cat(Volume* volume, int argc, const char *argv[]) {
+	HFSPlusCatalogRecord* record;
 	AbstractFile* stdoutFile;
 
 	record = getRecordFromPath(argv[1], volume, NULL, NULL);</diff>
      <filename>hdutil/hdutil.c</filename>
    </modified>
    <modified>
      <diff>@@ -16,6 +16,7 @@ extern &quot;C&quot; {
 	void extractAllInFolder(HFSCatalogNodeID folderID, Volume* volume);
 	int copyAcrossVolumes(Volume* volume1, Volume* volume2, char* path1, char* path2);
 
+	void hfs_untar(Volume* volume, AbstractFile* tarFile);
 	void hfs_ls(Volume* volume, const char* path);
 #ifdef __cplusplus
 }</diff>
      <filename>includes/hfs/hfslib.h</filename>
    </modified>
    <modified>
      <diff>@@ -13,6 +13,7 @@ extern &quot;C&quot; {
 	AbstractFile* openAbstractFile2(AbstractFile* file, const unsigned int* key, const unsigned int* iv);
 	AbstractFile* duplicateAbstractFile(AbstractFile* file, AbstractFile* backing);
 	AbstractFile* duplicateAbstractFile2(AbstractFile* file, AbstractFile* backing, const unsigned int* key, const unsigned int* iv, AbstractFile* certificate);
+	void init_libxpwn();
 #ifdef __cplusplus
 }
 #endif</diff>
      <filename>includes/xpwn/nor_files.h</filename>
    </modified>
    <modified>
      <diff>@@ -16,8 +16,8 @@ int main(int argc, char* argv[]) {
 
 	AbstractFile* template = NULL;
 	AbstractFile* certificate = NULL;
-	int key[16];
-	int iv[16];
+	unsigned int key[16];
+	unsigned int iv[16];
 	int hasKey = FALSE;
 	int hasIV = FALSE;
 </diff>
      <filename>ipsw-patch/xpwntool.c</filename>
    </modified>
    <modified>
      <diff>@@ -607,11 +607,12 @@ local int unzlocal_GetCurrentFileInfoInternal (file,
 
 
     /* we check the magic */
-    if (err==UNZ_OK)
+    if (err==UNZ_OK) {
         if (unzlocal_getLong(&amp;s-&gt;z_filefunc, s-&gt;filestream,&amp;uMagic) != UNZ_OK)
             err=UNZ_ERRNO;
         else if (uMagic!=0x02014b50)
             err=UNZ_BADZIPFILE;
+    }
 
     if (unzlocal_getShort(&amp;s-&gt;z_filefunc, s-&gt;filestream,&amp;file_info.version) != UNZ_OK)
         err=UNZ_ERRNO;
@@ -687,11 +688,13 @@ local int unzlocal_GetCurrentFileInfoInternal (file,
         else
             uSizeRead = extraFieldBufferSize;
 
-        if (lSeek!=0)
+        if (lSeek!=0) {
             if (ZSEEK(s-&gt;z_filefunc, s-&gt;filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0)
                 lSeek=0;
             else
                 err=UNZ_ERRNO;
+        }
+
         if ((file_info.size_file_extra&gt;0) &amp;&amp; (extraFieldBufferSize&gt;0))
             if (ZREAD(s-&gt;z_filefunc, s-&gt;filestream,extraField,uSizeRead)!=uSizeRead)
                 err=UNZ_ERRNO;
@@ -712,11 +715,12 @@ local int unzlocal_GetCurrentFileInfoInternal (file,
         else
             uSizeRead = commentBufferSize;
 
-        if (lSeek!=0)
+        if (lSeek!=0) {
             if (ZSEEK(s-&gt;z_filefunc, s-&gt;filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0)
                 lSeek=0;
             else
                 err=UNZ_ERRNO;
+	}
         if ((file_info.size_file_comment&gt;0) &amp;&amp; (commentBufferSize&gt;0))
             if (ZREAD(s-&gt;z_filefunc, s-&gt;filestream,szComment,uSizeRead)!=uSizeRead)
                 err=UNZ_ERRNO;
@@ -976,11 +980,12 @@ local int unzlocal_CheckCurrentFileCoherencyHeader (s,piSizeVar,
         return UNZ_ERRNO;
 
 
-    if (err==UNZ_OK)
+    if (err==UNZ_OK) {
         if (unzlocal_getLong(&amp;s-&gt;z_filefunc, s-&gt;filestream,&amp;uMagic) != UNZ_OK)
             err=UNZ_ERRNO;
         else if (uMagic!=0x04034b50)
             err=UNZ_BADZIPFILE;
+    }
 
     if (unzlocal_getShort(&amp;s-&gt;z_filefunc, s-&gt;filestream,&amp;uData) != UNZ_OK)
         err=UNZ_ERRNO;
@@ -1534,7 +1539,6 @@ extern int ZEXPORT unzGetGlobalComment (file, szComment, uSizeBuf)
     char *szComment;
     uLong uSizeBuf;
 {
-    int err=UNZ_OK;
     unz_s* s;
     uLong uReadThis ;
     if (file==NULL)</diff>
      <filename>minizip/unzip.c</filename>
    </modified>
    <modified>
      <diff>@@ -189,13 +189,6 @@ local void init_linkedlist(ll)
     ll-&gt;first_block = ll-&gt;last_block = NULL;
 }
 
-local void free_linkedlist(ll)
-    linkedlist_data* ll;
-{
-    free_datablock(ll-&gt;first_block);
-    ll-&gt;first_block = ll-&gt;last_block = NULL;
-}
-
 
 local int add_data_in_datablock(ll,buf,len)
     linkedlist_data* ll;</diff>
      <filename>minizip/zip.c</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>0c6a370bcc986c609cb1ec109b5f687fdb02432a</id>
    </parent>
  </parents>
  <author>
    <name>planetbeing</name>
    <email>planetbeing@gmail.com</email>
  </author>
  <url>http://github.com/planetbeing/xpwn/commit/92f15ce132f4b75d4cea32e91e86727995ad16cb</url>
  <id>92f15ce132f4b75d4cea32e91e86727995ad16cb</id>
  <committed-date>2008-07-20T22:31:27-07:00</committed-date>
  <authored-date>2008-07-20T22:31:27-07:00</authored-date>
  <message>warnings fixes</message>
  <tree>89a255ab2141106a76da3c441e5cb64a92c852f9</tree>
  <committer>
    <name>planetbeing</name>
    <email>planetbeing@gmail.com</email>
  </committer>
</commit>
