- Joined
- Dec 12, 2010
- Messages
- 2,074
A tool for advanced JASS decompiling at runtime.
How it works
Everytime a native from common.j called, it being hooked and written into the log. Then action starts, and, if it didn't crash, line being marked with [returned value] or [OK].
It's useful when
You've got unknown crash or undefined behaviour or strange bugs which cannot be found deductively.
How to use
You will need an Injector in order to use it properly. Why? Because it hooks EVERY single native, which are being executed. It happens everytime when you selects map - game parses initializing code and find info about players. When map loading it's tracking every native call made from Common.j, Blizzard.j and the script from map itself. Normally it's 10000+ native calls.
Writting happens at the very moment the native is called. That causes hard drive "overheat" - literally it asks for file way too often. Because of that and exlusive "access lock" you won't be able to open and look at the data while WC3 is running.
JassSpy.ini (in the archive) allows you to select which natives you'd like to track. By default - every. You can disable some of them, but normally I prefer to watch at the whole log. OK, let's get started.
Drop JassSpy files into the WC3's folder, Injector's location doesn't matter.
So, run the map (or replay), run D3SceneInjector (in the archive), get to the place you'd like to inspect (prepare the skill or situation or fast forward replay to desired position), switch over to injector and insert "war3" into "Processname". Then select UnrealJassSpy.dll as "File you want to inject". Note: you have to put replay on pause in order to not overload writting query.
Injection starts when you make any action (left click) at War3 window and takes 10-20 seconds, based on your CPU speed, longer for old machines. As soon as WC3 become operable you can unpause replay or start reproducing.
Result:
Everything being stored at jassSpy.txt file:
Be aware that included functions like filters fires right inbetween main function. For instance, filter starts right after GroupEnumUnitsInRange being called, causing following listing:
Mark about "succesfully done" and given params will be found at the very end of filtering:
And so what?
You will only see raw natives. You won't have any idea what function are running right here. At best you could track it by raw data mentioned around and actions order. For my researches I used next line:
with RegExp replacing:
into
Surely you'll need some proper text tool in order to apply it to the whole script.
Last words
I didn't understand this tool until started developing myself. It saved me a lot of time debugging non-obvious things. It also shown me many bad perfomance-wise decisions, allowing me to fix it.
Use it to fix unknown issues or speed up your map - whatever you need.
Archive listing:
Injector; config file; DLL.
How it works
Everytime a native from common.j called, it being hooked and written into the log. Then action starts, and, if it didn't crash, line being marked with [returned value] or [OK].
It's useful when
You've got unknown crash or undefined behaviour or strange bugs which cannot be found deductively.
How to use
You will need an Injector in order to use it properly. Why? Because it hooks EVERY single native, which are being executed. It happens everytime when you selects map - game parses initializing code and find info about players. When map loading it's tracking every native call made from Common.j, Blizzard.j and the script from map itself. Normally it's 10000+ native calls.
Writting happens at the very moment the native is called. That causes hard drive "overheat" - literally it asks for file way too often. Because of that and exlusive "access lock" you won't be able to open and look at the data while WC3 is running.
JassSpy.ini (in the archive) allows you to select which natives you'd like to track. By default - every. You can disable some of them, but normally I prefer to watch at the whole log. OK, let's get started.
Drop JassSpy files into the WC3's folder, Injector's location doesn't matter.
So, run the map (or replay), run D3SceneInjector (in the archive), get to the place you'd like to inspect (prepare the skill or situation or fast forward replay to desired position), switch over to injector and insert "war3" into "Processname". Then select UnrealJassSpy.dll as "File you want to inject". Note: you have to put replay on pause in order to not overload writting query.
Injection starts when you make any action (left click) at War3 window and takes 10-20 seconds, based on your CPU speed, longer for old machines. As soon as WC3 become operable you can unpause replay or start reproducing.
Result:
Everything being stored at jassSpy.txt file:

- A line which marks module loading started;
- Exec: Native;
- Handle, related to any handle-based object in game;
- Returned handle object;
- Object's ID, used in editor;
- It parses every value big enough to be translated into hex;
- Function which returns nothing, as example.
Be aware that included functions like filters fires right inbetween main function. For instance, filter starts right after GroupEnumUnitsInRange being called, causing following listing:
Mark about "succesfully done" and given params will be found at the very end of filtering:
And so what?
You will only see raw natives. You won't have any idea what function are running right here. At best you could track it by raw data mentioned around and actions order. For my researches I used next line:
JASS:
local string teststring="functionname"
JASS:
function (.*) takes (.*)$
JASS:
function \1 takes \2
local string teststring="\1"
Last words
I didn't understand this tool until started developing myself. It saved me a lot of time debugging non-obvious things. It also shown me many bad perfomance-wise decisions, allowing me to fix it.
Use it to fix unknown issues or speed up your map - whatever you need.
Archive listing:
Injector; config file; DLL.