This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Menu

Author Topic: Blizzard Installer Customisation  (Read 16827 times)

stoneharry

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 617
    • View Profile
Re: Blizzard Installer Customisation
« Reply #45 on: March 28, 2013, 08:38:53 pm »
Quote from: "schlumpf"
Use 1.2.3. I guess other versions than their own won't get proper results.

Tested with 1.2.3 version of zlib again.

Modifications to code:
Code: [Select]
 input_file.read_into (&input_data, entry->data_size * 2);

  std::vector<unsigned char> output_data (entry->inflated_data_size * 2);
Both values are * 2.

The inflation always returns 1 (success).

The inflated integer is: 3026296
The output size is: 6052592 (6052592 / 2 = 3026296), which matches the inflated integer. So modified the condition that checks for errors to:
Code: [Select]
if (res || inflated != output->size() / 2)So everything is inflated correctly and no errors are generated throughout.

However the resulting executable file cannot be run - the same error message as which I previously posted:



I believe the executable file has not been constructed correctly, since it cannot be opened with a archive program as any other Windows executable can be.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

stoneharry

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 617
    • View Profile
Re: Blizzard Installer Customisation
« Reply #46 on: March 29, 2013, 02:35:24 pm »
I had someone else test this and they had the same issues with as me, both before and after the modifications. Did you test this on Windows?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: Blizzard Installer Customisation
« Reply #47 on: March 29, 2013, 04:25:30 pm »
Of course I did not.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

happyhack

  • Contributors
  • Race Changer
  • *****
  • Posts: 38
    • View Profile
Re: Blizzard Installer Customisation
« Reply #48 on: March 30, 2013, 06:38:27 pm »
Hey guys,

im interested in this too,
here is the error (should add a binary flag in open_flag enum instead) :
Code: [Select]
// /! BINARY MODE !!!!!!
 static const char* to_string (const open_flag& flag)
  {
    if (flag == read)
    {
      return "rb";
    }
    else if (flag == write)
    {
      return "wb";
    }
    else if (flag == (read|write))
    {
      return "rwb";
    }
    else
    {
      throw std::runtime_error ("bad opening flags");
    }
  }

(win32 > filestream  :P )
hope this can help

btw nice work, tried to reverse the installer a long time ago but didnt manage to get it work !
« Last Edit: March 31, 2013, 12:38:09 pm by Admin »

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: Blizzard Installer Customisation
« Reply #49 on: March 31, 2013, 03:52:30 am »
Gnah. m(
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

happyhack

  • Contributors
  • Race Changer
  • *****
  • Posts: 38
    • View Profile
Re: Blizzard Installer Customisation
« Reply #50 on: March 31, 2013, 12:53:36 pm »
Code: [Select]
void seek (const int& pos) const
  {
    if (pos <= 0)
    {
      fseek (_handle, -pos, SEEK_END);
    }
    else
    {
      fseek (_handle, pos, SEEK_SET);
    }
  }
should be pos < 0 else seek(0) result in EOF ( seek(0) called in read_all() )

in append.bsni.cpp,
Code: [Select]
 BsnI_entry* entry (reinterpret_cast<BsnI_entry*> (&entries[i]));
should be
Code: [Select]
 BsnI_entry* entry (reinterpret_cast<BsnI_entry*> (&entries[sizeof(BsnI_entry)*i]));
because entries is an array of char

then all is working fine.

But each time I try to assemble the installer, I get the same message
"version 3.3.5.12213 is needed and you already have version 3.3.5.12340", regardless which version of the extracted installer I repack in, or which mpq I use.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

stoneharry

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 617
    • View Profile
Re: Blizzard Installer Customisation
« Reply #51 on: March 31, 2013, 08:30:01 pm »
Quote from: "happyhack"
Code: [Select]
void seek (const int& pos) const
  {
    if (pos <= 0)
    {
      fseek (_handle, -pos, SEEK_END);
    }
    else
    {
      fseek (_handle, pos, SEEK_SET);
    }
  }
should be pos < 0 else seek(0) result in EOF ( seek(0) called in read_all() )

in append.bsni.cpp,
Code: [Select]
 BsnI_entry* entry (reinterpret_cast<BsnI_entry*> (&entries[i]));
should be
Code: [Select]
 BsnI_entry* entry (reinterpret_cast<BsnI_entry*> (&entries[sizeof(BsnI_entry)*i]));
because entries is an array of char

then all is working fine.

But each time I try to assemble the installer, I get the same message
"version 3.3.5.12213 is needed and you already have version 3.3.5.12340", regardless which version of the extracted installer I repack in, or which mpq I use.

Thanks for the information, I will test this when I have some free time. :)

The attached MPQ needs to be made in a special way - it shouldn't just be a random MPQ you want to install.

Open one of Blizzards patches with a MPQ editor (e.g: 3.3.5 to 3.3.5a) and then look at the files. There are instructions on which files to extract/execute/install/move, need to experiment. There is one file that contains installer information - the target WoW version and what version it patches to, etc.

I would test this by taking the contents of 3.3.5 to 3.3.5a and changing the target version and contents that is copied over.

edit: Just made your changes and it was extracted perfectly! :) Will do more tests later. I have also updated the original download link on the first post of the thread - it now contains the original version (that worked on Mac) and the Windows version (the changes you have submitted).

edit two: Currently only able to generate the generic error "Out of harddrive space".  This error is standard - it does not mean what it says. Will need to trace it in ollydebug to see why it is failing - at what condition. I expect it is due to Blizzard's signature not being found or similar since they put this verification on all the other parts.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

stoneharry

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 617
    • View Profile
Re: Blizzard Installer Customisation
« Reply #52 on: April 01, 2013, 10:33:43 pm »
Bringing everything together at the moment, just need to get the launcher and this fully working (viewtopic.php?f=26&t=4379) then push it into a single tidy document.

On the subject of this - the Blizzard Installer - I have no idea where to go next. In the contents of the attached MPQ is a file size - patch.cmd "PatchSize 1992294400" - what should this value be representing? The file size of the MPQ or the entire installer? Even when this is correct (for each value), I cannot get it to start up correctly.

Why is there a Blizzard Updater.exe within the contents of a patch? What is this for? (Referencing 3.3.5 to 3.3.5a).

Is there any verification methods Blizzard uses that I need to disable?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

happyhack

  • Contributors
  • Race Changer
  • *****
  • Posts: 38
    • View Profile
Re: Blizzard Installer Customisation
« Reply #53 on: April 02, 2013, 02:52:08 pm »
hmmmm... dont know what I did wrong during my last post but nvm, it seems everything work fine.
The .cmd file in the mpq contains information on the version of the updater.

Quote
In the contents of the attached MPQ is a file size - patch.cmd "PatchSize 1992294400" - what should this value be representing?
was wondering too... seems a lot too large for a file size... but the updater work anyway.

dont know what you could do wrong... i got the "disk full" message sometimes because I closed the repacker before full writing so the "BsnI" section was missing. You have to extract an mpq from an installer correctly too.

Quote
I have also updated the original download link on the first post of the thread - it now contains the original version (that worked on Mac)
u should make the modifications to this one too....

Quote
Text files are files containing sequences of lines of text. Depending on the environment where the application runs, some special character conversion may occur in input/output operations in text mode to adapt them to a system-specific text file format. Although on some environments no conversions occur and both text files and binary files are treated the same way, using the appropriate mode improves portability.
opening a file with "fopen("rw")" open the file as a text file... on binary file this may result in corrupted data. Maybe on mac it will work, but if there is an error someday, it will be seriously hard to find.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

stoneharry

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 617
    • View Profile
Re: Blizzard Installer Customisation
« Reply #54 on: April 02, 2013, 03:06:37 pm »
Quote from: "happyhack"
hmmmm... dont know what I did wrong during my last post but nvm, it seems everything work fine.
The .cmd file in the mpq contains information on the version of the updater.

Quote
In the contents of the attached MPQ is a file size - patch.cmd "PatchSize 1992294400" - what should this value be representing?
was wondering too... seems a lot too large for a file size... but the updater work anyway.

dont know what you could do wrong... i got the "disk full" message sometimes because I closed the repacker before full writing so the "BsnI" section was missing. You have to extract an mpq from an installer correctly too.

Quote
I have also updated the original download link on the first post of the thread - it now contains the original version (that worked on Mac)
u should make the modifications to this one too....

Quote
Text files are files containing sequences of lines of text. Depending on the environment where the application runs, some special character conversion may occur in input/output operations in text mode to adapt them to a system-specific text file format. Although on some environments no conversions occur and both text files and binary files are treated the same way, using the appropriate mode improves portability.
opening a file with "fopen("rw")" open the file as a text file... on binary file this may result in corrupted data. Maybe on mac it will work, but if there is an error someday, it will be seriously hard to find.

Ah, okay. Thank you for the clarifications.

Quote
dont know what you could do wrong... i got the "disk full" message sometimes because I closed the repacker before full writing so the "BsnI" section was missing. You have to extract an mpq from an installer correctly too.

What do you mean by correctly? I'm opening it up with a default MPQ editor and extracting it that way at the moment. Is there another way you should do it?

And I open the assembler through command prompt, it executes fine from the looks of it:

« Last Edit: January 01, 1970, 01:00:00 am by Admin »

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: Blizzard Installer Customisation
« Reply #55 on: April 02, 2013, 04:01:08 pm »
The bad flags on opening the file were my error. On (li|u)n(i|u)x, it seems fine as no conversion takes place. On windows, line feeds get converted.

The other corrections are fine as well, they all had been an error on my side. Please remove my bad code from the download.

PatchSize equals 1,8GB, thus hardly is too large. I think it is the maximum size per patch-#.MPQ, to avoid FAT32 limitations.

The BsnI chunk contains filenames, which are copied, as given in the command line. Thus, your updater will extract to C:UsersHarryDesktopBsnI Project, thus will break upon execution due to not finding files.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

stoneharry

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 617
    • View Profile
Re: Blizzard Installer Customisation
« Reply #56 on: April 02, 2013, 06:31:39 pm »
Thank you, schlumpf. Now it is executing correctly and progress is being made. The information you have given also explains a lot. :)

Progress:

Code: [Select]
World of Warcraft Update (3.3.5.12340 - 3.3.5.12341)

This patch upgrades World of Warcraft from version 3.3.5.12340 to version 3.3.5.12341.
Installing World of Warcraft Update at "C:WoW 3.3.5" on Tue Apr 02 17:58:41 2013.
Error: The file "C:WoW 3.3.5output.exe" appears to be corrupt. You may need to download this file again.

Things I don't understand:

How does it know which patch to write to? Patch.lst obviously contains the path in the MPQ, file name, path to write to.

Delete.lst contains files to delete at start of the patch (?? repeated file names in existing patches (realmlist.wtf appears 4 times in 3.0.2 to 3.3.5a))

Other list files? Verification files to look for?

Blizzard Updater.exe? What is this for? Does this contain the information on what to write to?

I'm being told my installer is corrupt. How is it determining this? I removed all the instructions other than to move battle.net.dll and to go from 12340 to 12341.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

mferrill

  • Registred Member
  • Race Changer
  • *****
  • Posts: 36
    • View Profile
Re: Blizzard Installer Customisation
« Reply #57 on: April 03, 2013, 01:34:18 am »
Quote from: "stoneharry"
Things I don't understand:

Blizzard Updater.exe? What is this for? Does this contain the information on what to write to?


It applies the downloaded patches, so I'd imagine, yes it contains the info on what to write to.

There used to be a manual patch workaround to bypass the launcher so you don't auto-update past the version you want...

Basically you take the MPQ and TFIL Files that match your locale and OS...
Drop them in your wow directory... Rename the MPQ to     'wow-patch.MPQ'
Then run the updater, and it takes the wow-patch.MPQ info and updates to that patch for you.

--Update--

Found a more recent link to the above explanation...  Maybe this guy outlined it better....

http://eu.battle.net/wow/en/forum/topic/1710171900
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

happyhack

  • Contributors
  • Race Changer
  • *****
  • Posts: 38
    • View Profile
Re: Blizzard Installer Customisation
« Reply #58 on: April 03, 2013, 04:25:29 am »
Quote from: "stoneharry"
How does it know which patch to write to? Patch.lst obviously contains the path in the MPQ, file name, path to write to.
there is a "WoWPatchIndex 3" in patch.cmd, the number change from one update to another. Maybe it has something to do with it.

Quote from: "stoneharry"
Things I don't understand:
Blizzard Updater.exe? What is this for? Does this contain the information on what to write to?
Quote from: "mferrill"
It applies the downloaded patches, so I'd imagine
hmmm.... yes. I saw it in some old updates. But it seems its not used in theses... i think u can delete it. This exe is generic. The one from 11723-to-12213.exe and 12213-to-12340.exe are strictly identicals.

Quote from: "stoneharry"
I'm being told my installer is corrupt. How is it determining this? I removed all the instructions other than to move battle . net . dll and to go from 12340 to 12341.
because of strong signature check.
The signature check is done in Installer.exe and u can bypass it by replacing 0x75 by 0xEB at file offset 0x15E2ED in the installer.exe extracted from WoW-3.3.5.12213-to-3.3.5.12340-xxXX-patch.exe

The way the installer check the version of Wow.exe is through the resource version data of the exe. u can change it with a resource editor/hacker.

Finally, .exe inside of the .mpq are not working exe, they seems to be bsdiff patch, have to confirm this too.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

stoneharry

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 617
    • View Profile
Re: Blizzard Installer Customisation
« Reply #59 on: April 03, 2013, 02:39:14 pm »
Quote from: "happyhack"
there is a "WoWPatchIndex 3" in patch.cmd, the number change from one update to another. Maybe it has something to do with it.

Yeah, I guessed this would be the case - however some patches do not specify this - and what about where multiple patches are written to? :)

I've modified the version info and component data in the WoW executable now and will test the Installer executable edits shortly. Thank you for the help.

edit:

Worked, thank you:



Almost fully working:



edit2: That index number does determine which file to write to, I got "writing to patch-4.mpq" before it errors on me. ;)

edit3:



Getting there.

edit4:

At the moment, as soon as it tries to write some data it crashes. I'm testing with a single blp file being written to patch-4.MPQ and tried testing with a random file. Not sure why yet, now to try with 3.3.5 to 3.3.5a contents again but tell it to write to 4 instead of 3.

edit5:
Code: [Select]
The patch "basecomponent.wow-data.txt" could not be applied. (Invalid header: size 25404, version 111.)
Code: [Select]
Patch can't be applied because it is missing data for: "base".It seems these component files are vital in same way.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »