From 275c21ca46285233f33cd4c15194114993685e58 Mon Sep 17 00:00:00 2001 From: JAJames Date: Mon, 11 Apr 2016 22:46:23 -0400 Subject: [PATCH] Minor optimization; 'Folder Name' is now skipped instead of read for null. --- UDK GUID Reader/Main.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/UDK GUID Reader/Main.c b/UDK GUID Reader/Main.c index 67a366a..c8b95c4 100644 --- a/UDK GUID Reader/Main.c +++ b/UDK GUID Reader/Main.c @@ -26,7 +26,6 @@ int main(int argc, const char **args) const char *filename; FILE *file; uint32_t GUID[4]; - int chr; if (argc < 2 || strcmp(args[1], "-help") == 0 || strcmp(args[1], "/?") == 0) { @@ -43,21 +42,14 @@ int main(int argc, const char **args) return 0; } - // seek to string - fseek(file, 0x10, SEEK_CUR); - - // parse through string - while (chr = fgetc(file) != 0) - { - if (chr == EOF) - { - puts("ERROR: UNEXPECTED EOF."); - return 0; - } - } + // seek to string size + fseek(file, 0x0C, SEEK_CUR); + + // read string size (repurpose GUID[0]) + fread(GUID, sizeof(uint32_t), 1, file); // seek to GUID - fseek(file, 48, SEEK_CUR); + fseek(file, *GUID + 0x30, SEEK_CUR); // read GUID if (fread(GUID, sizeof(uint32_t), 4, file) != 4)