Menu

Tree [r311] /
 History

HTTPS access


File Date Author Commit
 bin 2009-05-29 b_steinbach [r294] SConstruct updated
 delphi 2008-04-19 pitzermike [r237] added config error message
 doc 2008-03-29 pitzermike [r233] umswe additions and fast external evaluation fo...
 japi 2007-09-09 b_steinbach [r168] moved japi test map to unittests
 jit 2009-06-01 b_steinbach [r311] added jit directory for temp C code / dlls. wa...
 logs 2009-05-26 b_steinbach [r292] readded makefile
 lua 2007-04-12 b_steinbach [r12] lua 5.1 -> 5.1.2
 pyw3jdebug 2007-11-29 pitzermike [r212] added py2exe setup, however the required dlls t...
 source 2009-06-01 b_steinbach [r311] added jit directory for temp C code / dlls. wa...
 unittests 2008-07-17 b_steinbach [r257] libhook: hook_function() implemented and tested
 LICENSE.txt 2007-09-06 b_steinbach [r159] switched to a license short enough for my atten...
 Makefile 2009-05-26 b_steinbach [r292] readded makefile
 SConstruct 2008-11-06 b_steinbach [r264] SCons broken: Makefile work around
 exehack.txt 2007-04-01 b_steinbach [r1] initial import
 findpath.lua 2009-03-08 b_steinbach [r290] updated version and readme.txt
 loadmpq.lua 2008-03-27 pitzermike [r231] added GUI for tileset editing
 loadmpq.txt 2007-04-01 b_steinbach [r1] initial import
 lua5.1.dll 2007-04-12 b_steinbach [r12] lua 5.1 -> 5.1.2
 newgenicon.ico 2007-11-09 pitzermike [r197] fixed several possible problems why findpath.lu...
 nosound.mpq 2008-03-27 pitzermike [r231] added GUI for tileset editing
 ongameload.lua 2008-03-16 pitzermike [r227] fix for TogMenuEntry default values
 readme.txt 2009-03-08 b_steinbach [r290] updated version and readme.txt
 startwar3.bat 2007-11-09 pitzermike [r197] fixed several possible problems why findpath.lu...
 todo.txt 2008-07-17 b_steinbach [r256] war3err: new VM exit handler in construction
 war3.conf.lua 2008-11-07 b_steinbach [r265] war3err: div zero / uninitvar / oplimit fixed,...
 war3.lua 2009-02-01 b_steinbach [r287] bytecode fetch and handle corruption detection
 war3err.lua 2009-02-01 b_steinbach [r287] bytecode fetch and handle corruption detection
 war3win.bat 2007-04-01 b_steinbach [r1] initial import
 warcraft.ico 2008-04-19 pitzermike [r236] added newgen icon
 we.bat 2007-11-09 pitzermike [r197] fixed several possible problems why findpath.lu...
 we.conf.lua 2008-11-07 b_steinbach [r265] war3err: div zero / uninitvar / oplimit fixed,...
 we.lua 2008-11-07 b_steinbach [r265] war3err: div zero / uninitvar / oplimit fixed,...
 wehack.lua 2008-04-28 vexorian [r242] jasshelper 0.9.A.0 uses the --nooptimize flag, ...
 wehacklib.lua 2008-03-27 pitzermike [r232] changed calls to grimex tools to directly call ...
 windows.mpq 2007-09-09 pitzermike [r165] added improved mapsize hack

Read Me

Grimoire 2.0 3/8/09
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

Source available via SVN at:
https://w3grimoire.svn.sourceforge.net/svnroot/w3grimoire

Changelog:
2.0:
 war3err:
  Ported to war3 1.22
  handle monitor dumps hrbj lines for handle returned by jass function
  handle corruption detection when a free handle is set illegitimately
  Cheat("GetBackTrace "+I2S(N)) dumps N lines of the stack trace
  Cheat("GetBytecode "+functionname) dumps the bytecode of function
  bytecodetrace, nopause, profiling, debugger, loc leak tracer disabled
	


1.5b:
 Cheat("War3errMsg: ") puts debug message in war3err.txt instead of war3erruser.txt

 added handle_monitor for handles returned by natives
  in war3err.lua:
   handle_monitor = true
   handle_monitor_add(somehandle)
  war3err.txt will log lines of the form
   hrbn <jass function> <native that returned the value> <handle>

 Cheat() messages for debugging handles
    call Cheat("NHandles")
    call Cheat("NFreeHandles")
    call Cheat("HandleInFreeStack "+I2S(HtoI(u)))
    call Cheat("HandleRefCount "+I2S(HtoI(u)))
    call Cheat("HandleObjPointer "+I2S(HtoI(u)))

1.5a:
 Append var values to read var lines in bytecode logs
 Added an alternative bytecode logger for long logs
 Renamed "pop" to "poparg" and "setreg" to "pop" in bytecode logs
 startinject exehack command split into startinject1 and 2
  startinject1() uses the new method introduced for 1.21b
  startinject2() uses an older method which may work for you if startinject1() does not.


1.5:
 Reworked loader for 1.21b compatibility (xttocs)
  we DLLs now loaded by auxiliary "weload.dll", which runs we.conf.lua.
  old ongameload.dll used for same purpose for war3

1.4:
 findpath.lua bug fix for warcraft not found in registry
 Cheat("war3err_PauseTracer")/Cheat("war3err_ContinueTracer")
 PitzerMike:
  increase map size to 480x480 directly in the editor
  input custom object IDs when you create an object
  improved international support
  Customize test map settings
  


1.3:
nativepack: new native CallByName.
  To use it:
  call InitNatives()
  call CallByName("somefunction")
  call prototypefunction(string arg1, int arg2)
  This replaces the call to prototypefunction with somefunction dynamically.
  It replaces the next instance of a JASS call, so if you do:
  call foo(bar())
  it will replace the call to bar, not foo.
  the argument types don't have to be the same, but the number should be.
  the replacement is immediate, permanent.
  It scans downward, stopping at the end of the current function.
  It ignores native calls while scanning.
  You need to call InitNatives() once per map run before you use CallByName().

w3jdebug:
 debugger = true in war3err.lua
 Cheat("war3err_Break") to set a breakpoint
 Once warcraft reaches a breakpoint and freezes, start a debugging client
 two debugging clients:  w3jdebug (console) pyw3jdebug.py (GUI)
  pyw3jdebug requires python 2.5, wxPython 2.8, pythoncard 0.8.2
 current commands:
  run
  step
  disas
  getvarval <var>
  funcname
  opnum
  locals
  addbp
  delbp
  listbp
  backtrace
  stack

Cheat("DebugMsg: "+msg) prints to log\\war3erruser.txt

Added backtraces to the usual error messages.  Configure with btonerr and btonerrlen in war3err.lua.
btonerr = false restores the one function behavior.

Cheat("war3err_LocalHTSize") reports size of global hashtable
Cheat("war3err_GlobalHTSize") reports size of local hashtable
Cheat("war3err_DumpLocalHT") prints local hash table to war3err log
Cheat("war3err_DumpGlobalHT") prints global hash table to war3err log

lua upgraded to 5.1.2
wehack.mapmodified() reports if WE thinks the map has been modified
RemoveLocation(-1)/DestroyGroup(-1) report info instead of null, null spouts warning
nopause working again in single player
Removed max op count logging (thread death still detected)
Profiling (LogJASSCalls()/LogVariableUse()) a war3err.lua option

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 0.96.94.  New scons are broken for mingw.
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

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.