• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Reverse Engineer Game.dll

Status
Not open for further replies.
Level 8
Joined
Nov 29, 2014
Messages
191

Update v0.0.2a

  • Fixed RenderEdge.mpq loading issue (now mod can be placed in any folder);
  • Fixed bug in CtrlSetText function then all controls that use the font texture have the same text;
  • Changed CtrlSetText function - removed "argb" argument responsible for the color of created text, use CtrlSetColor function instead (the default color is white);
  • Changed CtrlSetDepth function - type of "depth" argument changed to real;
  • Added new native function CtrlSetAngle.
JASS:
native void CtrlSetText(int id, bool autoResize, string text) // autoResize: if true, the GUI element adjusted to the entered text line, else text stretches to size of GUI element.
native void CtrlSetDepth(int id, float fDepth) // Defines the search order of GUI elements by CtrlGetFromMousePoint function. Than fDepth value is less, the GUI control located closer to the screen (1.0 by default).
native void CtrlSetAngle(int id, float fAngle) // Sets the the rotation angle of GUI element (in radians).

Update v0.0.2b

  • Fixed an issue where it was not possible to launch the application on the first try;
  • Improved debug log.

RenderEdge topic on xgm.guru
 

Attachments

  • RenderEdge.rar
    674.1 KB · Views: 105
  • [RenderEdge] Test Map.w3x
    45.3 KB · Views: 130
Last edited:
Do you set war3.exe to run as administrator? If yes, then you can get this error.

Nope.

I tried placing all the files next to war3.exe, or inside /WC3/RenderEdge/, and on desktop, and all said "Failed to find War3 Path".

This is the code SharpCraft is using

C#:
var key = Registry.CurrentUser.OpenSubKey(@"Software\Blizzard Entertainment\Warcraft III");

if (key != null && key.GetValue("InstallPath") != null)
{
    InstallPath = (key.GetValue("InstallPath") as String);
}

if (String.IsNullOrEmpty(InstallPath))
{
    key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Wow6432Node\Blizzard Entertainment\Warcraft III");
    if (key != null && key.GetValue("InstallPath") != null)
        InstallPath = (key.GetValue("InstallPath") as String);
}

// Force user to select path manually if we cannot find
// (you should do this)
if (String.IsNullOrEmpty(InstallPath))
{
    var dialog = new OpenFileDialog();
    dialog.Filter = "Warcraft III|war3.exe";
    var result = dialog.ShowDialog();

    if (dialog.FileName != null && dialog.FileName != "")
    {
        InstallPath = Path.GetDirectoryName(dialog.FileName);

        var doInstall = MessageBox.Show("Install path into registry?", "Launcher", MessageBoxButtons.YesNo);

        if (doInstall == DialogResult.Yes)
        {
            key = Registry.CurrentConfig.CreateSubKey(@"Software\Blizzard Entertainment\Warcraft III");
            key.SetValue("InstallPath", InstallPath);
        }
    }
}
 
Level 8
Joined
Nov 29, 2014
Messages
191
This is the code SharpCraft is using
Thanks, I'll do it tomorrow.

But, maybe the path to the folder is still not registered? Please write the path to your warcraft folder and what you have written here: Software\\BlizzardEntertainment\\Warcraft III\\InstallPath
Not: SOFTWARE\Wow6432Node\Blizzard Entertainment\Warcraft III

Update:
Maybe the problem is that there is space in Blizzard Entertainment (but I haven't it: BlizzardEntertainment)?
Yes, I will have to consider this case in my launcher too.
 
Last edited:
Level 29
Joined
Jul 29, 2007
Messages
5,174
That's actually interesting, I see many names, I wonder if anything useful can be spotted.

MPQ parsing related stuff at sub_6F0179B4

sub_6F02A74C handles portrait loading for models, there are two values that always lead to peon_portrait.
It looks like Blizzard themselves were as confused about their usage of .mdx and .mdl extensions all over the place, so the function checks for both.
It first looks for "<file_name>_portrait.mdl", then "<file_name>_portrait.mdx", and finally defaults to the model itself "<file_name>.mdl" (probably assuming there's a portrait camera).

Yeah:
C:
int __cdecl sub_6F0B49D2(int a1, int a2, char *a3, int a4)
{
  (*(void (__cdecl **)(int, int, _DWORD, char *, int))(*(_DWORD *)a1 + 24))(a1, a2, 0, a3, a4);
  return WEUChangeFileExtension(a3, ".mdl");
}

sub_6F0B573A possibly selects variation models for cliffs.

sub_6F0BB4C2 set vertex color Jass function?

Tons of GUI stuff around 430000?

sub_6F0C59DA is used all over the place to query SLK values.
E.g. sub_6F0C5B46 (find an entry in UnitUI given an ID - this one also checks for UnitData / UnitBalance / UnitAbilities / UnitWeapons).
E.g. sub_sub_6F0C5D42(find an ItemData entry given an ID).
They have many of these wrappers - most of them probably because of their own inconsistencies with how they write values (e.g. different ID names for different SLK files).

sub_6F0C78DA reading map tileset.

sub_6F0F500E loading the map pathing.

sub_6F0F54CA loading ubersplats.

sub_6F1516A4 reads the internal files of a map (.w3e, .wpm, .doo, .w3u, .w3b, .w3d, .w3a, .w3q).
sub_6F1515B0 is used for every specific file.

sub_6F15C118 possibly the main initialization function of a map?

sub_6F198DE6 initializing Jass.
sub_6F17B4A0 initializing GUI.

dword_6FD69104 is a boolean that says whether the game is running in RoC or TFT.

sub_6F189C82 loads a .tga or .blp texture?

sub_6F18B4B0 select a random stand animation.

sub_6F18B682 seems to create the random animation objects for 6F18B4B0.
It grabs any animation with "Stand" in it, unless it also has "Ready".

sub_6F18F52E loads a team color texture given a player ID, either from the file or cache (if file, caches it), and returns it.

"The 'missing string' warning string is missing!!!"

MDX parsing code starts somewhere around sub_6F1CA8AE
sub_6F1CAAF4 loading collision shapes.
sub_6F1CAC5A creates a model. There are two variations, a complex model, and a normal model. It is determined by some flag (in the model?). I assume normal models are ones without emitters/etc.? (such as trees)
 
Last edited:
Status
Not open for further replies.
Top