thats all i have...
TerrainManagement.au3:
Code:
; ----------------------------------------------------------------------------
; ----------------------------------------------------------------------------
;
; Author:
; Malu05 aka. Mads Hagbart Lund <[email protected]>
;
; Script Function:
; Application _ TerrainManagement (public)
; Version: 0.01
; ----------------------------------------------------------------------------
; ----------------------------------------------------------------------------
;;--------------------------------------------------------------------------------
;;Includes;
;;--------------------------------------------------------------------------------
#Include <NomadMemory.au3>
#Include <GuiListBox.au3>
#include <WindowsConstants.au3>
#Include <Array.au3>
#Include <GuiListView.au3>
#Include <Misc.au3>
#Include <GuiScrollBars.au3>
#include <ScrollBarConstants.au3>
;;--------------------------------------------------------------------------------
;;Variable Definition;
;;--------------------------------------------------------------------------------
;-3.0.9 !!!!!!!!!!!!!!!!!!!!!!
$Debug = 0 ;-Set to 1 For more Advanced Indo
;//PlayerBase Structures:
Global $PlayerBaseStatic = 0x0127F13C ;-Static Offset for the Playerbse
Global $PlayerXyz = 0x7D0 ;-Offset from Playerbase to the X position
;//ADT Structures:
Global $OffsetADTInfo = 0x1286720 ;-Static Adress for Info About The Loaded WDT
Global $OffsetAbegin = 0x01292A20 ;-Offset to gather ADT info for the SUB Chunks
Global $TerrainGeneral = 0x00FED3CC ;-Staric Offset for the Generel Chunk
;//OBJECT Structures:
Global $OffsetM2Static = 0x012CF63C ;Static Offset Pointing to the first object in the linked list
Global $OffsetWMOStatic = 0x012CF614 ;Static Offset Pointing to the first object in the linked list
Global $MouseSelectEnabler = 0x012E965C
;//Prefedined Variables Related to ADT Section
dim $ADT[5000][500], $RDHMbase[19999], $closer[19999], $MCNKindex[19999]
dim $ADTdata[5000][500], $finalX[91999], $finalY[19999], $finalZ[19999]
dim $MCNKinden[5000], $MCNKPosX[19999], $MCNKindenOffs[19999], $MCNKPosY[19999], $MCNKPosZ[19999]
dim $begin, $MCINoffs, $MCNKoffs[19999], $Basevaluepointer, $countANA
;//Prefedined Variables Related to OBJECT Section
dim $m2data[89099][9], $dataokM2[89999], $OBJname[89999]
dim $WMOdata[9000][9], $dataokWMO[9000], $_m2uniqueID[89999]
global $M2NameIndex = 0, $M2listitem[89999]
dim $M2count,$WMOcount, $Listammountm2, $Listammountwmo, $transyn = 0
SetPrivilege ("SeDebugPrivilege", 1)
$dll = DllOpen ("user32.dll")
$DllInformation = _memoryopen (WinGetProcess ("World of Warcraft"))
$lvl1Pointer = _MemoryRead ($PlayerBaseStatic, $DllInformation, 'ptr')
$lvl2Pointer = _MemoryRead (($lvl1Pointer + 0x30), $DllInformation, 'ptr')
$PlayerBase = _MemoryRead (($lvl2Pointer + 0x28), $DllInformation, 'ptr')
$X = $PlayerBase + $PlayerXyz
$Y = $PlayerBase + $PlayerXyz + 0x4
$Z = $PlayerBase + $PlayerXyz + 0x8
;;--------------------------------------------------------------------------------
;;Sample Hotkey Defenition;
;;--------------------------------------------------------------------------------
HotKeySet ("{Numpad1}", "OffsetTerrainUP")
HotKeySet ("{Numpad2}", "OffsetTerrainDown")
HotKeySet ("{Numpad3}", "SelectM2")
;;--------------------------------------------------------------------------------
;;GUI Creation;
;;--------------------------------------------------------------------------------
$MainGUI = GUICreate ("WoW Terrain Manager 0.2 by Malu05", 900, 800)
GUISetState ()
$GUIList = GUICtrlCreateList ("", 0, 0, 300, 300, bitor ($WS_BORDER, $WS_VSCROLL))
$GUIListSub = GUICtrlCreateList ("", 300, 0, 300, 300, bitor ($WS_BORDER, $WS_VSCROLL))
$GUIListSubM2 = GUICtrlCreateListView("UniqueID |File Path |X |Y |Z ", 0, 300, 900, 500, bitor ($WS_BORDER, $WS_VSCROLL))
_GUICtrlListView_SetColumnWidth($GUIListSubM2, 1, 480)
;;--------------------------------------------------------------------------------
;;Main App;
;;--------------------------------------------------------------------------------
_report("Welcome to Malu05's Terrain Manager")
TrayTip("Malu05's Terrain Manager","Please Wait While I'm Grappin the Dataz!",5,2)
TerrainManagement()
ObjectManagement()
TrayTip("Malu05's Terrain Manager","Ready to Rock!",5,2)
;;================================================================================
;;TerrainManagement()
;;--------------------------------------------------------------------------------
;;//This fucntion is used to index all the sub chunks.
;;================================================================================
func TerrainManagement()
_report("")
_report("===ADT TERRAIN MANAGEMENT===")
_report("Initializing ADT load")
_report(_MemoryRead ($OffsetADTInfo, $DllInformation, 'char[60]'))
Global $ChrunkCountANA
Global $bas = 0
Global $ChrunkCount = 0
$posX = _MemoryRead ("0x" & hex ($X), $DllInformation, 'float')
$posy = _MemoryRead ("0x" & hex ($Y), $DllInformation, 'float')
_report("My Position is: " & floor ($posX) & " . " & floor ($posy))
sleep (3000)
;// To Explain the Following, for every 533,3333 coords from the Physical 0,0 WoW Will load a new ADT
;// However since its in both the X and Y axis the system works like this:
;
;// For Every +X New ADT the new offset will be located at 0x100 after the last one
;// For Every +Y New ADT the new offset will be loacted at 0x4 after the last one
;
;// So the first thing we do here is find the Physical 0,0 (32*533,3333-posx and y)
;// Then to find the ADT's located around US and not just from our position and up we will go down 3 ADT's (+533.3333*3)
;
;// Most TBC and WOTLK Areas loads a maximum of 8x8 (64) ADT's at its current stage but this can very likely change with new patches
;// PRE TBC Zones Only load upto 5x5 (25) ADT's at a time
;// Note that this changes depending on your View Distance
$OffsetAfloor = floor ((32 * 533.3333 - floor ($posX + (533.3333 * 4))) / 533.3333) ;Don't Ask!!! ^^
$OffsetAfloorY = floor ((32 * 533.3333 - floor ($posy + (533.3333 * 4))) / 533.3333)
$OffsetA = ($OffsetAbegin + (0x100 * $OffsetAfloor)) + (0x4 * $OffsetAfloorY)
$OffsetB = ($OffsetAbegin + (0x100 * $OffsetAfloor)) + (0x4 * $OffsetAfloorY) + 0x100
$OffsetC = ($OffsetAbegin + (0x100 * $OffsetAfloor)) + (0x4 * $OffsetAfloorY) + 0x200
$OffsetD = ($OffsetAbegin + (0x100 * $OffsetAfloor)) + (0x4 * $OffsetAfloorY) + 0x300
$OffsetE = ($OffsetAbegin + (0x100 * $OffsetAfloor)) + (0x4 * $OffsetAfloorY) + 0x400
$OffsetF = ($OffsetAbegin + (0x100 * $OffsetAfloor)) + (0x4 * $OffsetAfloorY) + 0x500
$OffsetG = ($OffsetAbegin + (0x100 * $OffsetAfloor)) + (0x4 * $OffsetAfloorY) + 0x600
$OffsetH = ($OffsetAbegin + (0x100 * $OffsetAfloor)) + (0x4 * $OffsetAfloorY) + 0x700
$OffsetI = ($OffsetAbegin + (0x100 * $OffsetAfloor)) + (0x4 * $OffsetAfloorY) + 0x800
$OffsAPoint = _MemoryRead ("0x" & hex ($OffsetA), $DllInformation, 'int')
$OffsCPoint = _MemoryRead ("0x" & hex ($OffsetC), $DllInformation, 'int')
$OffsEPoint = _MemoryRead ("0x" & hex ($OffsetE), $DllInformation, 'int')
For $n = 1 to 9 Step + 1
if $n = 1 Then $go = $OffsetA
if $n = 2 Then $go = $OffsetB
if $n = 3 Then $go = $OffsetC
if $n = 4 Then $go = $OffsetD
if $n = 5 Then $go = $OffsetE
if $n = 6 Then $go = $OffsetF
if $n = 7 Then $go = $OffsetG
if $n = 8 Then $go = $OffsetH
if $n = 9 Then $go = $OffsetI
$add = 0x0
For $i = 1 to 9 Step + 1
$subOffs = _MemoryRead ("0x" & hex ($go + $add), $DllInformation, 'int')
$subOffs2 = _MemoryRead ("0x" & hex ($subOffs + 0x238), $DllInformation, 'int')
if hex ($subOffs2) > "00000000" Then _report("ADT MCIN Chunk Loaded at: " & hex ($subOffs2),1)
if _MemoryRead ("0x" & hex ($subOffs2 + 0xC), $DllInformation, 'char[4]') = "RDHM" Then
;// Here we are inside the ADT file itself.
;// Go have a look at www.madx.dk/wowdev/wiki for information about the ADT structure so you can see what possibilities you have get with this.
$ChrunkCountANA = $ChrunkCountANA + 1
$ADT[$n][$i] = "0x" & hex ($subOffs2)
$RDHMbase[$bas] = "0x" & hex ($subOffs2)
$MCINoffs = hex ((_MemoryRead ("0x" & hex ($subOffs2 + 0x18), $DllInformation, 'int')))
$MTEXoffs = hex ((_MemoryRead ("0x" & hex ($subOffs2 + 0x1c), $DllInformation, 'int')))
$MMDXoffs = hex ((_MemoryRead ("0x" & hex ($subOffs2 + 0x20), $DllInformation, 'int')))
$MMIDoffs = hex ((_MemoryRead ("0x" & hex ($subOffs2 + 0x24), $DllInformation, 'int')))
$MWMOoffs = hex ((_MemoryRead ("0x" & hex ($subOffs2 + 0x28), $DllInformation, 'int')))
$MWIDoffs = hex ((_MemoryRead ("0x" & hex ($subOffs2 + 0x2c), $DllInformation, 'int')))
$MDDFoffs = hex ((_MemoryRead ("0x" & hex ($subOffs2 + 0x30), $DllInformation, 'int')))
$MODFoffs = hex ((_MemoryRead ("0x" & hex ($subOffs2 + 0x34), $DllInformation, 'int')))
$MFBOoffs = hex ((_MemoryRead ("0x" & hex ($subOffs2 + 0x38), $DllInformation, 'int')))
$MH2Ooffs = hex ((_MemoryRead ("0x" & hex ($subOffs2 + 0x3c), $DllInformation, 'int')))
;//MFBO CHUNK Locator - http://www.madx.dk/wowdev/wiki/index.php?title=ADT#MFBO_chunk
if $MFBOoffs > 0 Then
_report("Found FLightbox") ;Example of a suboffset
EndIf
;//MMDX CHUNK Indexing - http://www.madx.dk/wowdev/wiki/index.php?title=ADT#MMDX_chunk
$M2NameNR = 0
$MMDXindex = 0
Do
$name = _MemoryRead ("0x" & hex (($subOffs2 + 0x1c) + ("0x" & $MMDXoffs) +$MMDXindex), $DllInformation, 'char[200]')
if $name = "" or StringInStr($name,"DIMM",1) > 0 then ExitLoop
$OBJname[$M2NameNR] = $name
$MMDXindex = $MMDXindex + StringLen($name)+1
$M2NameNR = $M2NameNR + 1
until 1 = 2
;//MDDF CHUNK Indexing http://www.madx.dk/wowdev/wiki/index.php?title=ADT#MDDF_chunk
$MDDFIndex = 0
$OffsetIndex = "0x" & hex (($subOffs2 + 0x1c) + ("0x" & $MDDFoffs))
$length = ((($subOffs2 + 0x1c) + ("0x" & $MODFoffs)) - (($subOffs2 + 0x1c) + ("0x" & $MDDFoffs))) / 24
for $u = 1 to $length
$_m2ID = _MemoryRead ("0x" & hex ($OffsetIndex), $DllInformation, 'int')
if StringInStr($_m2ID,"1297040454",1) > 0 then ExitLoop
$_m2uniqueID[$M2NameIndex] = _MemoryRead ($OffsetIndex + 0x4, $DllInformation, 'int')
$_m2X = _MemoryRead ($OffsetIndex + 0x8, $DllInformation, 'float')
$_m2Y = _MemoryRead ($OffsetIndex + 0xc, $DllInformation, 'float')
$_m2Z = _MemoryRead ($OffsetIndex + 0x10, $DllInformation, 'float')
_report($_m2uniqueID[$M2NameIndex]& "|" & $OBJname[$_m2ID]& "|" & $_m2X& "|" & $_m2Y& "|" & $_m2Z,2)
$OffsetIndex = "0x" & hex (($subOffs2 + 0x1c) + ("0x" & $MDDFoffs)+$MDDFIndex)
$MDDFIndex = $MDDFIndex + 0x24
$M2NameIndex = $M2NameIndex + 1
Next
;//MCNK CHUNK Indexing - http://www.madx.dk/wowdev/wiki/index.php?title=ADT#MCNK_chunk
$MCINintOfs = 0
For $m = 1 to 256 Step + 1
$MCNKoffs[$ChrunkCount] = _MemoryRead ("0x" & hex (($subOffs2 + 0x1c) + ("0x" & $MCINoffs) + $MCINintOfs), $DllInformation, 'int')
$MCNKindenOffs[$m] = "0x" & hex (($subOffs2 + 0x0) + ("0x" & hex ($MCNKoffs[$ChrunkCount])))
$MCNKinden[$m] = _MemoryRead ($MCNKindenOffs[$m], $DllInformation, 'char[4]')
$MCNKPosX[$m] = $MCNKindenOffs[$m] + 0x70
$MCNKPosY[$m] = $MCNKindenOffs[$m] + 0x74
$MCNKPosZ[$m] = $MCNKindenOffs[$m] + 0x78
$MCNKindex[$ChrunkCount] = $MCNKindenOffs[$m]
$finalX[$ChrunkCount] = _MemoryRead ("0x" & hex ($MCNKPosX[$m]), $DllInformation, 'float')
$finalY[$ChrunkCount] = _MemoryRead ("0x" & hex ($MCNKPosY[$m]), $DllInformation, 'float')
$finalZ[$ChrunkCount] = _MemoryRead ("0x" & hex ($MCNKPosZ[$m]), $DllInformation, 'float')
if $Debug = 1 Then _report(floor ($finalX[$ChrunkCount]) & " - " & floor ($finalY[$ChrunkCount]) & " - " & floor ($finalZ[$ChrunkCount]), 1)
$MCINintOfs = $MCINintOfs + 0x10
$ChrunkCount = $ChrunkCount + 1
next
$bas = $bas + 1
EndIf
$add = $add + 0x4
Next
Next
_report("Terrain Details:")
_report("ADT's Loaded = " & $bas)
_report("Chrunk's Loaded = " & $ChrunkCount)
Return
EndFunc ;==>TerrainManagement
;;================================================================================
;;ObjectManagement()
;;================================================================================
func ObjectManagement()
_report("")
_report("===OBJECT MANAGEMENT===")
;---------------------
;M2 INDEX
;---------------------
$m2LISTCOUNT = 1;OFFS:OFFS:EMPT:OFFS:OFFS
$ExtchoM2pre = "0x" & hex(_MemoryRead($OffsetM2Static, $DllInformation, 'int')) ;Find Base Pointer
;Stack Entry
$M2count = -1
$searchAdressM2 = $ExtchoM2pre
$ExtchoM2 = _MemoryRead("0x" & hex($searchAdressM2), $DllInformation, 'int')
;M2 Gathere
$i = -1
while $ExtchoM2 > 0
$i = $i + 1
$KnownXm2 = ($ExtchoM2pre + 0x110)
$m2data[$i][1] = _MemoryRead($KnownXm2, $DllInformation, 'float')
$m2data[$i][2] = _MemoryRead($KnownXm2 + 0x4, $DllInformation, 'float')
$m2data[$i][3] = _MemoryRead($KnownXm2 + 0x8, $DllInformation, 'float')
$m2data[$i][5] = $ExtchoM2pre + 0xc
$m2data[$i][7] = $KnownXm2
$m2data[$i][8] = $i
$searchAdressM2 = $searchAdressM2 + 0xAC
$m2LISTCOUNT = $m2LISTCOUNT + 1
$ExtchoM2pre = _MemoryRead("0x" & hex($searchAdressM2), $DllInformation, 'int')
$ExtchoM2 = _MemoryRead("0x" & hex($ExtchoM2pre), $DllInformation, 'int')
$searchAdressM2 = "0x" & hex($ExtchoM2pre)
$M2count = $M2count + 1
WEnd
$ExtchoM2 = _MemoryRead("0x" & hex($searchAdressM2), $DllInformation, 'int')
_report("M2 Files Loaded :" & $M2count)
;---------------------
;WMO INDEX
;---------------------
$WMOLISTCOUNT = 1;OFFS:OFFS:EMPT:OFFS:OFFS
$ExtchoWMOpre = 0x & _MemoryRead($OffsetWMOStatic, $DllInformation, 'int')
$WMOcount = -1
$searchAdressWMO = $ExtchoWMOpre
$ExtchoWMO = _MemoryRead("0x" & hex($searchAdressWMO), $DllInformation, 'int')
;WMO Gathere
$i = -1
while $ExtchoWMO > 0
$i = $i + 1
$KnownXWMO = ($ExtchoWMOpre + 0xA0)
$WMOdata[$i][1] = _MemoryRead($KnownXWMO, $DllInformation, 'float')
$WMOdata[$i][2] = _MemoryRead($KnownXWMO + 0x4, $DllInformation, 'float')
$WMOdata[$i][3] = _MemoryRead($KnownXWMO + 0x8, $DllInformation, 'float')
$WMOdata[$i][5] = $ExtchoWMOpre + 0xc
$WMOdata[$i][7] = $KnownXWMO
$WMOdata[$i][8] = $i
$searchAdressWMO = $searchAdressWMO + 0x34
$WMOLISTCOUNT = $WMOLISTCOUNT + 1
$ExtchoWMOpre = _MemoryRead("0x" & hex($searchAdressWMO), $DllInformation, 'int')
$ExtchoWMO = _MemoryRead("0x" & hex($ExtchoWMOpre), $DllInformation, 'int')
$searchAdressWMO = "0x" & hex($ExtchoWMOpre)
$WMOcount = $WMOcount + 1
WEnd
$ExtchoWMO = _MemoryRead("0x" & hex($searchAdressWMO), $DllInformation, 'int')
_report("WMO Files Loaded :" & $WMOcount)
Return
EndFunc ;==>ObjectManagement
;;================================================================================
;;Offsterrain
;;--------------------------------------------------------------------------------
;; Here we have the sample code, this is not required.
;;================================================================================
func OffsetTerrainUP()
OffsetTerrain(1.2)
EndFunc ;==>OffsetTerrainUP
func OffsetTerrainDown()
OffsetTerrain(-1.2)
EndFunc ;==>OffsetTerrainDown
Func OffsetTerrain($_input)
;//First of all we want to figure what ADT and Sub Chrunk we want to affect by the Terrain Mover since we don't want to offset ALL terrain loaded
$posX = _MemoryRead ("0x" & hex ($X), $DllInformation, 'float')
$posy = _MemoryRead ("0x" & hex ($Y), $DllInformation, 'float')
if $ChrunkCount > 10 Then
redim $closer[$ChrunkCount + 1]
for $i = 0 to $ChrunkCount step + 1
if $finalX[$i] > $posX Then
if $finalY[$i] > $posy Then
$closer[$i] = Sqrt (($finalX[$i] - $posX) ^ 2 + ($finalY[$i] - $posy) ^ 2)
Else
$closer[$i] = 9999999999999
EndIf
Else
$closer[$i] = 99999999999
EndIf
Next
$minadress = _ArrayMinindex ($closer, 1)
$baseChrunk = "0x" & hex ($MCNKindex[$minadress] + 0x90)
;// Now we have found the baseChrunk we are standing at
;// We then edit the 145 SUBchrunks with Its current offset +/- the $_input
for $i = 0 to 145 step + 1
$currentValue = _MemoryRead ("0x" & hex ($baseChrunk), $DllInformation, 'float')
_MemoryWrite ("0x" & hex ($baseChrunk), $DllInformation, $currentValue + $_input, 'float')
$baseChrunk = $baseChrunk + 0x4
next
Else
TerrainManagement()
EndIf
EndFunc ;==>OffsetTerrain
;;================================================================================
;;SelectM2
;;================================================================================
func SelectM2()
HotKeySet ("{Numpad3}")
if $M2count < 1 Then
ObjectManagement()
EndIf
Dim $radpointX = $MouseSelectEnabler + 0x98
dim $radpointY = $radpointX + 0x4
dim $radpointZ = $radpointX + 0x8
_MemoryWrite($MouseSelectEnabler, $DllInformation, 64, 'byte')
_MemoryWrite($MouseSelectEnabler +0x4, $DllInformation, 170691528, 'int')
sleep(40)
$radpointXpos = _MemoryRead($radpointX, $DllInformation, 'float')
$radpointYpos = _MemoryRead($radpointY, $DllInformation, 'float')
$radpointZpos = _MemoryRead($radpointZ, $DllInformation, 'float')
redim $closer[$M2count + 1]
for $i = 0 to $M2count step +1
$closer[$i] = Sqrt(($m2data[$i][1] - $radpointXpos) ^ 2 + ($m2data[$i][2] - $radpointYpos) ^ 2)
Next
$minadress = _ArrayMinindex($closer, 1)
$testTOTAL = $m2data[$minadress][7]
$minadress = _ArrayMinindex($closer, 1)
$testTOTAL = $m2data[$minadress][7]
$testTOTAL4 = $testTOTAL - 0x78
$radpointXpos = _MemoryRead($radpointX, $DllInformation, 'float')
$radpointYpos = _MemoryRead($radpointY, $DllInformation, 'float')
$radpointZpos = _MemoryRead($radpointZ, $DllInformation, 'float')
;ConsoleWrite(" " &hex($testTOTAL) & " " &hex($testTOTAL2) &@CRLF)
While _IsPressed("63", $dll)
;ConsoleWrite("M2 Selected "& @CRLF)
;ConsoleWrite("Next Step" & @CRLF)
Sleep(5)
$radpointXpos = _MemoryRead($radpointX, $DllInformation, 'float')
$radpointYpos = _MemoryRead($radpointY, $DllInformation, 'float')
$radpointZpos = _MemoryRead($radpointZ, $DllInformation, 'float')
if _MemoryRead("0x" & hex($testTOTAL4), $DllInformation, 'float') < 2.0 Then
lightup($testTOTAL4)
EndIf
;sleep(5)
redim $closer[$M2count + 1]
for $i = 0 to $M2count step +1
$closer[$i] = Sqrt(($m2data[$i][1] - $radpointXpos) ^ 2 + ($m2data[$i][2] - $radpointYpos) ^ 2)
Next
$minadressbef = $minadress
$minadress = _ArrayMinindex($closer, 1)
if $minadressbef <> $minadress Then
lightdown($testTOTAL4)
EndIf
$testTOTAL = $m2data[$minadress][7]
$testTOTAL4 = $testTOTAL - 0x78
WEnd
lightdown($testTOTAL4)
$UniqueID = _MemoryRead("0x" & hex($testTOTAL4 + 0x4), $DllInformation, 'int')
$Index = _ArraySearch($_m2uniqueID,$UniqueID)
if $Index = -1 then
msgbox(0,"Error " & @error,"This Object Have Not Been Indexed: " & $UniqueID)
Else
_GUICtrlListView_SetSelectedColumn($GUIListSubM2,$Index)
_GUICtrlListView_SetItemFocused($GUIListSubM2,$Index)
_GUICtrlListView_EnsureVisible($GUIListSubM2, $Index)
GUICtrlSetState($GUIListSubM2, $GUI_FOCUS)
GUICtrlSetColor($M2listitem[$Index], 0xff0000)
EndIf
_MemoryWrite($MouseSelectEnabler, $DllInformation, 0, 'int')
_MemoryWrite($MouseSelectEnabler +0x4, $DllInformation, 0, 'int')
HotKeySet ("{Numpad3}", "SelectM2")
Return
EndFunc ;==>SelectM2
func lightup($LightVarInput)
ConsoleWrite(hex($LightVarInput - 0x98) &@CRLF)
For $i = _MemoryRead("0x" & hex($LightVarInput), $DllInformation, 'float') to 2.5 Step +0.1
_MemoryWrite("0x" & hex($LightVarInput), $DllInformation, $i, 'float')
sleep(1)
Next
Return
EndFunc ;==>lightup
func lightdown($LightdwnVarInput)
For $i = _MemoryRead("0x" & hex($LightdwnVarInput), $DllInformation, 'float') to 0.5 Step -0.1
_MemoryWrite("0x" & hex($LightdwnVarInput), $DllInformation, $i, 'float')
sleep(1)
Next
Return
EndFunc ;==>lightdown
;;================================================================================
;;_report()
;;================================================================================
func _report($_report, $sub = 0)
if $sub = 0 Then
_GUICtrlListBox_AddString ($GUIList, $_report)
ConsoleWrite (" --- Report: " & $_report & @crlf)
Elseif $sub = 1 Then
_GUICtrlListBox_AddString ($GUIListSub, $_report)
ElseIf $sub = 2 Then
$M2listitem[$M2NameIndex] = GUICtrlCreateListViewItem($_report,$GUIListSubM2)
if $Debug = 1 Then ConsoleWrite(" --- Report: " &$_report &@crlf)
EndIf
EndFunc ;==>_report
;;================================================================================
;;End Loop
;;================================================================================
while 1
$msg = GUIGetMsg ()
Select
Case $msg = $GUI_EVENT_CLOSE
Exit
EndSelect
sleep (10)
WEnd
WMO_Indexing2.au3:
Code:
;;================================================================================
;;INCLUDE DEFINITION
;;================================================================================
#include <NomadMemory.au3>
$detailMOGI = 0 ;Output Flag Data
$detailMODN = 1 ;Output M2 file names
dim $WMOsetname_M2[1]
;;================================================================================
;;PRE PREPERATION
;;================================================================================
SetPrivilege("SeDebugPrivilege", 1)
$list = ProcessList("wow.exe")
if $list[0][0] = 0 Then
MsgBox(0,0,"Error 01")
exit
EndIf
$wow = _memoryopen($list[1][1])
if FileExists("WMO_Output.txt") then FileDelete("WMO_Output.txt")
WMOINDEX()
;;================================================================================
;;WMO Indexing
;;================================================================================
Func WMOINDEX()
WriteOutput("---INGAME WMO INDEXER By MALU05---" & @CRLF)
$mainWMOindex = _MemoryRead(0x010E9F18, $wow, 'ptr') ;- 3.1.3 !!!!!!!!!!!!!!!!!!!!!!
WriteOutput(@crlf)
for $i = 0 to 30 step +1
if $mainWMOindex <> 0x00000000 Then
$_WSMainOffs = $mainWMOindex
$_WSName = _MemoryRead($mainWMOindex + 0x1C, $wow, 'char[700]')
;find number of names
$_WSLinkToWmoMOHD = _MemoryRead($mainWMOindex + 0x120, $wow, 'ptr')
$_WSLinkToWmoMOTX = _MemoryRead($mainWMOindex + 0x120, $wow, 'ptr') ;!!this one is wrong...
$_WSLinkToWmoMOMT = _MemoryRead($mainWMOindex + 0x124, $wow, 'ptr')
$_WSLinkToMOGN = _MemoryRead($mainWMOindex + 0x128, $wow, 'ptr')
$_WSLinkToWmoMOSB = _MemoryRead($mainWMOindex + 0x12C, $wow, 'ptr') ;lol?
$_WSLinkToWmoMOGI = _MemoryRead($mainWMOindex + 0x130, $wow, 'ptr') ;lol?
$_WSLinkToWmoMOPV = _MemoryRead($mainWMOindex + 0x134, $wow, 'ptr')
$_WSLinkToWmoMOPT = _MemoryRead($mainWMOindex + 0x138, $wow, 'ptr')
$_WSLinkToWmoMOPR = _MemoryRead($mainWMOindex + 0x13C, $wow, 'ptr')
$_WSLinkToWmoMOVV = _MemoryRead($mainWMOindex + 0x140, $wow, 'ptr')
$_WSLinkToWmoMOVB = _MemoryRead($mainWMOindex + 0x144, $wow, 'ptr')
$_WSLinkToWmoMOLT = _MemoryRead($mainWMOindex + 0x148, $wow, 'ptr')
$_WSLinkToWmoMODS = _MemoryRead($mainWMOindex + 0x14C, $wow, 'ptr')
$_WSLinkToWmoMODN = _MemoryRead($mainWMOindex + 0x150, $wow, 'ptr')
$_WSLinkToWmoMODD = _MemoryRead($mainWMOindex + 0x154, $wow, 'ptr')
$_WSLinkToWmoMFOG = _MemoryRead($mainWMOindex + 0x158, $wow, 'ptr')
$_WSLinkToWmoMCVP = _MemoryRead($mainWMOindex + 0x15C, $wow, 'ptr')
$_WSLinkToWmo = _MemoryRead($mainWMOindex + 0x1C8, $wow, 'ptr')
$_WSNoOfNames = _MemoryRead($_WSLinkToWmo + 0x18, $wow, 'int')
;find each subgroup
$WMOm2setname = _MemoryRead($_WSLinkToWmoMODS + 0x0, $wow, 'char[20]')
$WMOm2setindex = _MemoryRead($_WSLinkToWmoMODS + 0x14, $wow, 'int')
$WMOm2setnr = _MemoryRead($_WSLinkToWmoMODS + 0x18, $wow, 'int')
$WMOm2Nnr = _MemoryRead($_WSLinkToWmoMOHD + 0x10, $wow, 'int')
;MsgBox(0,0,$_WSLinkToWmoMOHD)
WriteOutput("#######################################################################################################" &@crlf)
WriteOutput("Loading WMO Nr. " & $i & @crlf)
WriteOutput("Located at: " & $mainWMOindex & @crlf)
WriteOutput("FileName: " & $_WSName & @crlf)
WriteOutput("Number Of SUB WMO's: " & $_WSNoOfNames &@crlf)
WriteOutput("Number of Models: " & $WMOm2Nnr &@crlf)
WriteOutput("Model Set Name: " & $WMOm2setname &@crlf)
WriteOutput("Number of set models: " & $WMOm2setnr &@crlf) ;Flags from MOGI
WriteOutput("-------------------------------------------------------------------------------------------------------" &@crlf)
;//==================================================
;// Look through the MODN list and index filenames.
;//==================================================
redim $WMOsetname_M2[$WMOm2Nnr+1]
writeoutput("________________________________________________________________________________________________________" &@crlf)
writeoutput("List of filenames for M2 models that appear in this WMO." &@crlf)
writeoutput(@crlf)
for $i2 = 1 to $WMOm2Nnr step + 1
$plaus = 1
$WMOsetname = _MemoryRead($_WSLinkToWmoMODN + 0x0, $wow, 'char[700]')
if $WMOsetname = "" or $WMOsetname = " "Then
$WMOsetname = _MemoryRead($_WSLinkToWmoMODN + 0x1, $wow, 'char[700]')
if $WMOsetname = "" or $WMOsetname = " "Then
$WMOsetname = _MemoryRead($_WSLinkToWmoMODN + 0x2, $wow, 'char[700]')
$plaus = 2
if $WMOsetname = "" or $WMOsetname = " "Then
$WMOsetname = _MemoryRead($_WSLinkToWmoMODN + 0x3, $wow, 'char[700]')
$plaus = 3
if $WMOsetname = "" or $WMOsetname = " "Then
$WMOsetname = _MemoryRead($_WSLinkToWmoMODN + 0x4, $wow, 'char[700]')
$plaus = 4
EndIf
EndIf
EndIf
EndIf
$WMOsetname_M2[$i2] = StringReplace($WMOsetname,"MDX","M2")
if $detailMODN = 1 Then writeoutput($_WSLinkToWmoMODN & @TAB & $WMOsetname_M2[$i2] &@crlf)
$_WSLinkToWmoMODN = $_WSLinkToWmoMODN + stringlen($WMOsetname) +$plaus
Next
writeoutput(@crlf &@crlf)
;//==================================================
;// Look through the MOGN list and index filenames.
;//==================================================
writeoutput("________________________________________________________________________________________________________" &@crlf)
writeoutput("Data for SUB WMO's." &@crlf)
writeoutput(@crlf)
for $i2 = 1 to $_WSNoOfNames step + 1
$flag = _MemoryRead($_WSLinkToWmoMOGI, $wow, 'int')
$valueFlags = _MemoryRead($_WSLinkToWmoMOGI, $wow, 'ushort')
$valueFlagName = _MemoryRead($_WSLinkToWmo, $wow, 'int')
$plaus = 1
$WMOeditorname = _MemoryRead($_WSLinkToMOGN + 0x0, $wow, 'char[700]')
if $WMOeditorname = "" or $WMOeditorname = " "Then
$WMOeditorname = _MemoryRead($_WSLinkToMOGN + 0x1, $wow, 'char[700]')
if $WMOeditorname = "" or $WMOeditorname = " "Then
$WMOeditorname = _MemoryRead($_WSLinkToMOGN + 0x2, $wow, 'char[700]')
$plaus = 2
if $WMOeditorname = "" or $WMOeditorname = " "Then
$WMOeditorname = _MemoryRead($_WSLinkToMOGN + 0x3, $wow, 'char[700]')
EndIf
EndIf
EndIf
$_WSLinkToMOGN = $_WSLinkToMOGN + stringlen($WMOeditorname) +$plaus
;MODS
;//Announce Data
WriteOutput("SubWMO Located at: " & $_WSLinkToWmoMOGI & " " & @tab & " IndexName: " &$WMOeditorname &@crlf)
if $detailMOGI = 1 Then WriteOutput(@TAB & "*Flags: " & " " & @tab & $valueFlags &@crlf) ;Flags from MOGI
$_WSLinkToWmoMOGI = $_WSLinkToWmoMOGI + 0x20
Next
WriteOutput("=======================================================================================================" &@crlf)
WriteOutput(@crlf)
$mainWMOindex = _MemoryRead($mainWMOindex + 0x14, $wow, 'ptr')
Else
EndIf
Next
EndFunc ;==>Action_RenderOPT
func WriteOutput($_input)
ConsoleWrite($_input)
FileWriteLine("WMO_Output.txt",$_input)
EndFunc
WMO_Indexing.au3:
Code:
#RequireAdmin
;;================================================================================
;;SETTINGS 3.2.2b !!!!!!!!!!!!!!!!!!!!!!
;;================================================================================
global $WMOIndexOffset = 0x01318678 ;//This offset is the Only thing you need to change every patch.
global $detailMOGI = 0 ;//Output Flag Data
global $detailMODN = 1 ;//Output M2 file names
;;================================================================================
;;INCLUDE DEFINITION
;;================================================================================
#include <NomadMemory.au3>
#include <ListboxConstants.au3>
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
;;================================================================================
;;BASIC WOW APP START
;;================================================================================
Opt("GUIOnEventMode", 1)
GUISetOnEvent($GUI_EVENT_CLOSE, "exitnow")
global $Listview
dim $WMOsetname_M2[1]
$MainGUI = GUICreate("WMO INDEXER by Malu05",700,500)
$ListView = GUICtrlCreateList("",0,0,700,500, bitor($WS_BORDER, $WS_VSCROLL))
GUISetState()
GUISetOnEvent($GUI_EVENT_CLOSE, "exitnow")
;;================================================================================
;;PRE PREPERATION
;;================================================================================
SetPrivilege("SeDebugPrivilege", 1)
$list = ProcessList("wow.exe")
if $list[0][0] = 0 Then
MsgBox(0,0,"Unable to detect WoW.exe running")
exit
EndIf
$wow = _memoryopen($list[1][1])
if FileExists("WMO_Output.txt") then FileDelete("WMO_Output.txt")
WMOINDEX()
;;================================================================================
;;WMO Indexing
;;================================================================================
Func WMOINDEX()
WriteOutput("---INGAME WMO INDEXER By MALU05---" & "")
$mainWMOindex = _MemoryRead($WMOIndexOffset, $wow, 'ptr')
WriteOutput("")
for $i = 0 to 30 step +1
if $mainWMOindex <> 0x00000000 Then
$_WSMainOffs = $mainWMOindex
$_WSName = _MemoryRead($mainWMOindex + 0x1C, $wow, 'char[700]')
;find number of names
$_WSLinkToWmoMOHD = _MemoryRead($mainWMOindex + 0x120, $wow, 'ptr')
$_WSLinkToWmoMOTX = _MemoryRead($mainWMOindex + 0x120, $wow, 'ptr') ;!!this one is wrong...
$_WSLinkToWmoMOMT = _MemoryRead($mainWMOindex + 0x124, $wow, 'ptr')
$_WSLinkToMOGN = _MemoryRead($mainWMOindex + 0x128, $wow, 'ptr')
$_WSLinkToWmoMOSB = _MemoryRead($mainWMOindex + 0x12C, $wow, 'ptr') ;lol?
$_WSLinkToWmoMOGI = _MemoryRead($mainWMOindex + 0x130, $wow, 'ptr') ;lol?
$_WSLinkToWmoMOPV = _MemoryRead($mainWMOindex + 0x134, $wow, 'ptr')
$_WSLinkToWmoMOPT = _MemoryRead($mainWMOindex + 0x138, $wow, 'ptr')
$_WSLinkToWmoMOPR = _MemoryRead($mainWMOindex + 0x13C, $wow, 'ptr')
$_WSLinkToWmoMOVV = _MemoryRead($mainWMOindex + 0x140, $wow, 'ptr')
$_WSLinkToWmoMOVB = _MemoryRead($mainWMOindex + 0x144, $wow, 'ptr')
$_WSLinkToWmoMOLT = _MemoryRead($mainWMOindex + 0x148, $wow, 'ptr')
$_WSLinkToWmoMODS = _MemoryRead($mainWMOindex + 0x14C, $wow, 'ptr')
$_WSLinkToWmoMODN = _MemoryRead($mainWMOindex + 0x150, $wow, 'ptr')
$_WSLinkToWmoMODD = _MemoryRead($mainWMOindex + 0x154, $wow, 'ptr')
$_WSLinkToWmoMFOG = _MemoryRead($mainWMOindex + 0x158, $wow, 'ptr')
$_WSLinkToWmoMCVP = _MemoryRead($mainWMOindex + 0x15C, $wow, 'ptr')
$_WSLinkToWmo = _MemoryRead($mainWMOindex + 0x1C8, $wow, 'ptr')
$_WSNoOfNames = _MemoryRead($_WSLinkToWmo + 0x18, $wow, 'int')
;find each subgroup
$WMOm2setname = _MemoryRead($_WSLinkToWmoMODS + 0x0, $wow, 'char[20]')
$WMOm2setindex = _MemoryRead($_WSLinkToWmoMODS + 0x14, $wow, 'int')
$WMOm2setnr = _MemoryRead($_WSLinkToWmoMODS + 0x18, $wow, 'int')
$WMOm2Nnr = _MemoryRead($_WSLinkToWmoMOHD + 0x10, $wow, 'int')
WriteOutput("#######################################################################################################" &"")
WriteOutput("Loading WMO Nr. " & $i & "")
WriteOutput("Located at: " & $mainWMOindex & "")
WriteOutput("FileName: " & $_WSName & "")
WriteOutput("Number Of SUB WMO's: " & $_WSNoOfNames &"")
WriteOutput("Number of Models: " & $WMOm2Nnr &"")
WriteOutput("Model Set Name: " & $WMOm2setname &"")
WriteOutput("Number of set models: " & $WMOm2setnr &"") ;Flags from MOGI
WriteOutput("-------------------------------------------------------------------------------------------------------" &"")
;//==================================================
;// Look through the MODN list and index filenames.
;//==================================================
redim $WMOsetname_M2[$WMOm2Nnr+1]
writeoutput("List of filenames for M2 models that appear in this WMO." &"")
writeoutput("")
if $WMOm2Nnr = 0 Then WriteOutput("//This file does not contain any M2 Objects "&"")
for $i2 = 1 to $WMOm2Nnr step + 1
$plaus = 1
$WMOsetname = _MemoryRead($_WSLinkToWmoMODN + 0x0, $wow, 'char[700]')
if $WMOsetname = "" or $WMOsetname = " "Then
$WMOsetname = _MemoryRead($_WSLinkToWmoMODN + 0x1, $wow, 'char[700]')
if $WMOsetname = "" or $WMOsetname = " "Then
$WMOsetname = _MemoryRead($_WSLinkToWmoMODN + 0x2, $wow, 'char[700]')
$plaus = 2
if $WMOsetname = "" or $WMOsetname = " "Then
$WMOsetname = _MemoryRead($_WSLinkToWmoMODN + 0x3, $wow, 'char[700]')
$plaus = 3
if $WMOsetname = "" or $WMOsetname = " "Then
$WMOsetname = _MemoryRead($_WSLinkToWmoMODN + 0x4, $wow, 'char[700]')
$plaus = 4
EndIf
EndIf
EndIf
EndIf
$WMOsetname_M2[$i2] = StringReplace($WMOsetname,"MDX","M2")
if $detailMODN = 1 Then writeoutput($_WSLinkToWmoMODN & @TAB & $WMOsetname_M2[$i2] &"")
$_WSLinkToWmoMODN = $_WSLinkToWmoMODN + stringlen($WMOsetname) +$plaus
Next
writeoutput("" &"")
;//==================================================
;// Look through the MOGN list and index filenames.
;//==================================================
writeoutput("_______________________________________________________________________________________________________" &"")
writeoutput("Data for SUB WMO's." &"")
writeoutput("")
if $_WSNoOfNames = 0 Then WriteOutput("//This file does not contain any SUB WMO's "&"")
for $i2 = 1 to $_WSNoOfNames step + 1
$flag = _MemoryRead($_WSLinkToWmoMOGI, $wow, 'int')
$valueFlags = _MemoryRead($_WSLinkToWmoMOGI, $wow, 'ushort')
$valueFlagName = _MemoryRead($_WSLinkToWmo, $wow, 'int')
$plaus = 1
$WMOeditorname = _MemoryRead($_WSLinkToMOGN + 0x0, $wow, 'char[700]')
if $WMOeditorname = "" or $WMOeditorname = " "Then
$WMOeditorname = _MemoryRead($_WSLinkToMOGN + 0x1, $wow, 'char[700]')
if $WMOeditorname = "" or $WMOeditorname = " "Then
$WMOeditorname = _MemoryRead($_WSLinkToMOGN + 0x2, $wow, 'char[700]')
$plaus = 2
if $WMOeditorname = "" or $WMOeditorname = " "Then
$WMOeditorname = _MemoryRead($_WSLinkToMOGN + 0x3, $wow, 'char[700]')
EndIf
EndIf
EndIf
$_WSLinkToMOGN = $_WSLinkToMOGN + stringlen($WMOeditorname) +$plaus
;//Announce Data
WriteOutput("SubWMO Located at: " & $_WSLinkToWmoMOGI & " " & @tab & " IndexName: " &$WMOeditorname &"")
if $detailMOGI = 1 Then WriteOutput(@TAB & "*Flags: " & " " & @tab & $valueFlags &"") ;Flags from MOGI
$_WSLinkToWmoMOGI = $_WSLinkToWmoMOGI + 0x20
Next
WriteOutput("")
WriteOutput("=======================================================================================================" &"")
WriteOutput("")
$mainWMOindex = _MemoryRead($mainWMOindex + 0x14, $wow, 'ptr')
EndIf
Next
EndFunc
Run("Notepad.exe " & @scriptdir&"/WMO_Output.txt", "")
while 1
WEnd
func WriteOutput($_input)
if $_input = "" then $_input = " "
GUICtrlSetData($ListView, stringreplace($_input,@TAB,""))
ConsoleWrite($_input &@CRLF)
FileWriteLine("WMO_Output.txt",$_input)
EndFunc
func ExitNow()
Exit
endFunc
M2_Dumper.au3:
Code:
; ----------------------------------------------------------------------------
; ----------------------------------------------------------------------------
;
; Author:
; Malu05 aka. Mads Hagbart Lund <[email protected]>
;
; Script Function:
; World Of Warcraft - Memory Location Extracter (M2 Struc Edition)
; ----------------------------------------------------------------------------
; ----------------------------------------------------------------------------
;;================================================================================
;;Includes;
;;================================================================================
#RequireAdmin ;for Vista Users!
#include <NomadMemory.au3>
;;================================================================================
;;InputSet -----------!!!!!
;;================================================================================
$ExtractAdress = 0x01051FF4 ;The adress to be extracted 01 05 1F F4 F4 1F 05 01
;;================================================================================
;;Variable Definition;
;;================================================================================
dim $Listammount = 0
;;================================================================================
;;Process front
;;================================================================================
Opt("WinTitleMatchMode", -1)
SetPrivilege("SeDebugPrivilege", 1)
Global $ProcessID = WinGetProcess("World of Warcraft","")
Local $DllInformation = _MemoryOpen($ProcessID)
If @Error Then
MsgBox(4096, "ERROR", "Failed to open memory for process;" & $ProcessID)
Exit
EndIf
;;================================================================================
;;Follow static
;;================================================================================
$ExtractAdress = "0x" & hex(_MemoryRead($ExtractAdress, $DllInformation, 'int'))
$ExtractAdress = $ExtractAdress + 0x8
;;================================================================================
;;Run
;;================================================================================
while $ExtractAdress <> -4
$ExtractAdress = "0x" & hex(_MemoryRead($ExtractAdress, $DllInformation, 'int'))
ConsoleWrite("Object Located at: " & hex($ExtractAdress) & " - X Y Z Adress: 0x" & hex($ExtractAdress+0xD8) & " - " & floor(_MemoryRead($ExtractAdress+0xD8, $DllInformation, 'float'))& " , " & floor(_MemoryRead($ExtractAdress+0xDC, $DllInformation, 'float'))& " - " & floor(_MemoryRead($ExtractAdress+0xE0, $DllInformation, 'float')) &@crlf)
$ExtractAdress = $ExtractAdress - 0X4
WEnd
Exit
But the structures changed a bit...
struct _ADT
{
DWORD CHUNK_X; // 0x54
DWORD CHUNK_Y; // 0x58
DWORD ADT_FILE_POINTER; // 0x98
DWORD ADT_OBJ_FILE_POINTER; // 0x9C
}
struct _M2
{
DWORD FULL_FILENAME; // 0x40
DWORD M2_FILE_POINTER; // 0x154
}
struct _WMO
{
DWORD WMO_GROUP_COUNT; // 0x30
DWORD[] WMO_GROUP_FILE_POINTERS; // 0x34
DWORD FULL_FILENAME; // 0x850
DWORD WMO_FILE_POINTER; // 0x954
}
One hint: look for the first 16 bytes to find *.adt-files, the same for m2 and wmo-files.
I just have one problem...
The WMO-Groups seem not always to be the right ones.
Or some are missing.
I cant see its a linked list, so im stuck..
Anyone has an idea?