Grimoire 1.2 3/25/2007
http://www.wc3campaigns.net/showthread.php?t=86652


Contributors:
Bryan "PipeDream" Steinbach - bsteinbach@berkeley.edu
Andy "xttocs" Scott
Mike "PitzerMike" Pitzer
Victor "Vexorian" Soliz
Nikolaj "MindWorX" Mariager


Collection of utilities for using warcraft hacks
see other text files in this directory for descriptions of utilities

Quickstart:
Run startwar3.bat or we.bat to begin


Changelog:
1.2:
Menus for Mike's grimext pack embedded
Saving map on longer necessary for test map
More control code farmed out to lua - add your own tools to the menus easily, see example for jasshelper or mike's tools.
ongameload.dll / ongameload.lua - war3err.dll, japi.dll should be loaded from ongameload.dll via ongameload.lua
split nativepack.dll out of japi.dll
war3err.lua replaces war3err.conf
war3err can be enabled/disabled from grimoire menu

function compilemap() in wehack.lua is executed when map compilation is enabled, before running mapcompiler.exe.  Soon mapcompiler execution will be shuffled into lua so you can do order yourself.
function testmap() in wehack.lua is run when testmap is clicked.


1.1d:
Configuration GUI actually included
wehack.lua added for adding custom menu entries
loadmpq.conf switched with loadmpq.lua - now supports paths with spaces
setregstring(key,value,str) and setregdword(key,value,dword) added to lua files

1.1c:
Configuration GUI - wxLua 2.8
NoLimits absorbed into wehack
common.j / native prototypes synced
DebugPrint fixed, must have been broken since 1.1a
exehack should now play nicely with rootkits like AV programs

1.1b:
war3err.dll:  speed improvement of bytecode logging.  If I missed some possible crash causes it might not log the last few bytecodes.
we.lua:  Updated No-Limits to 1.21 (thanks PitzerMike)

1.1a:
war3err.dll: now logs via popen on logd.exe.  Sample logd.exe writes last 1000 lines to bytecode.txt when warcraft crashes/exits.

1.1:
all:  should give much better error messages now that exception handling works
wehack.dll:  --configure option added for mapcompiler
jAPI.dll:  added DebugPrint() native
war3err.dll:  new conf file war3err.conf
	currently has two options
	nopause = on and bytecodetrace = on
	nopause prevents warcraft from pausing, i.e. when alt tabbing
	helps when you want to walk away and let something run for awhile
	bytecodetrace fills bytecode.txt with each opcode warcraft executes.  This file will grow BIG!
	notes types and names of operations along with the function in which the op resides
	Good for getting a look under the hood into the VM or determining where warcraft stops executing on a crash.



1.0:
all: Improved patch independence & multiple map support
war3err.dll:  
  Uninitialized var use prints name of var in addition to function
  Player(Invalid number) Is replaced with Player(0) and an error message
  rudimentary leak tracing of groups/locations
    call DestroyGroup(null) to report function with most created and not destroyed groups
    call RemoveLocation(null) for same purpose
    reports attempted double frees
  ExecuteFunc("non void func") reports error instead of crashing
    distinguishes between functions that don't exist and those with args
wehack.dll: 
  --nopreprocessor menu option added for mapcompiler

0.7b:
mapcompiler exit codes interpreted correctly
Added option to test map by running startwar3.bat to allow you to use whichever hacks
Forced another case of triggers being un enable able when there are syntax errors in custom script

0.7:
war3err.dll:  prints red error messages in game
wehack.dll: configure hacks from WE menu
Extracts common.j / Blizzard.j from map / warcraft
Runs user supplied mapcompiler in grimoire folder with generated map as argument if option is enabled
Use mpqutils if you want to work with war3map.j
Return 0:  Allow test map
Return other:  Disallow test map 

0.6:
ListFile.dll:  Reports all files opened in .mpq by world editor or warcraft.  can use to build archive listfiles.
Loadmpq opens .conf from working directory at exehack startup

0.5c:
loadmpq finally works with gcc
errors now reported through dialog boxes

0.5b:
Fixed CPU thrashing
Added war3err.dll, which detects:
- Divide by zero
- Uninitialized var use
- Op limit overrun
If one of these occurs during JASS executing, the offending function is noted in war3err.txt

0.5:
DLL injection made more reliable
Warcraft found via registry-  now completely path free.  if you don't have warcraft installed, manually set path
Removed pjass integration
Added source for a JAPI implementation
loadmpq occasionally not working should be fixed
ported to mingw/GCC and nasm.

0.4b:
renamed lots of stuff
added some documentation
added loadmpq.dll for overriding war3patch.mpq

0.4a:
added utilities for adding/deleting mpq files

0.4:
embedded lua
added DLL injection
e.g. can use jAPI.dll from test map button (not included)
pjass 0.99 included

0.3a:
fixed command line argument problem
made a nicer tmap.bat that pops up notepad if there are script errors

0.3:
support for 1.20c - 1.20e
allows one to always enable disabled triggers
removes nag dialog when saving with default map description
get rid of prepend with war3mapImported on imported files
execute tmap.bat instead of war3.exe by default
disable syntax checking


Compiling:
I use mingw 5.0.2 (g++ 3.4.2), nasm 0.98.39 and scons.
You'll need python for scons.
copy nasmw.exe to mingw\bin\
Add mingw\bin\; to the path (Control panel -> System -> Advanced -> Environment Variables -> System Variables -> Path)
Add Python25\ to the path (version number irrelevant)
where python/mingw are the directories you installed each to
Type scons in the grimoire directory to compile



Known bugs:
war3mapImported prefix will return while you open the map without the loader

Includes Lua 5.1 http://www.lua.org/


Thanks to
PitzerMike / Vexorian for original windowwe concept and implementation
Zoxc and his WEHelper for keeping me on my toes with competition