Browse Source

Minor optimization; 'Folder Name' is now skipped instead of read for null.

master
Jessica James 9 years ago
parent
commit
275c21ca46
  1. 20
      UDK GUID Reader/Main.c

20
UDK GUID Reader/Main.c

@ -26,7 +26,6 @@ int main(int argc, const char **args)
const char *filename; const char *filename;
FILE *file; FILE *file;
uint32_t GUID[4]; uint32_t GUID[4];
int chr;
if (argc < 2 || strcmp(args[1], "-help") == 0 || strcmp(args[1], "/?") == 0) 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; return 0;
} }
// seek to string // seek to string size
fseek(file, 0x10, SEEK_CUR); fseek(file, 0x0C, SEEK_CUR);
// parse through string // read string size (repurpose GUID[0])
while (chr = fgetc(file) != 0) fread(GUID, sizeof(uint32_t), 1, file);
{
if (chr == EOF)
{
puts("ERROR: UNEXPECTED EOF.");
return 0;
}
}
// seek to GUID // seek to GUID
fseek(file, 48, SEEK_CUR); fseek(file, *GUID + 0x30, SEEK_CUR);
// read GUID // read GUID
if (fread(GUID, sizeof(uint32_t), 4, file) != 4) if (fread(GUID, sizeof(uint32_t), 4, file) != 4)

Loading…
Cancel
Save