Code:
include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <NomadMemory.au3>
$Form1 = GUICreate("Form1", 172, 109, 308, 197)
$Go = GUICtrlCreateButton("Go", 40, 40, 75, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
Global $StaticPlayer=0x00A7B434,$ClienConec=0xC923C0 , $Pbdec1=0x0c , $Pbdec2=0x24 ,$PlayerBase
Global $ObjManag=0x2e04,$firstObject = 0xAC,$nextObject = 0x3C ,$TypeObj = 0x14 ,$WowPid,$WowProcess
Global $SLOT_1=0x5c8,$guidbag=0xC3BD70
SetPrivilege("SeDebugPrivilege", 1)
$WowPid=ProcessExists("wow.exe")
If $WowPid=0 Then
MsgBox(0, "Infos", "World of warcraft n est pas lancer")
exit
EndIf
$WowProcess = _MEMORYOPEN($WowPid)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Go
InfosSacs()
EndSwitch
WEnd
Func InfosSacs()
Local $AdrSo1,$AdrSo2,$Type,$Firstob,$Curobj
Local $FreeSac0=0,$FreeSac1=0,$FreeSac2=0,$FreeSac3=0,$FreeSac4=0,$FreeSac5=0
$AdrPb1 = _MEMORYREAD($StaticPlayer,$WowProcess,"dword")
$AdrPb2 = _MEMORYREAD($AdrPb1+$Pbdec1,$WowProcess,"dword")
$PlayerBase = _MEMORYREAD($AdrPb2+$Pbdec2,$WowProcess,"dword")
$AdrSo1=_MEMORYREAD($ClienConec,$WowProcess,"dword")
$AdrSo2=_MEMORYREAD($AdrSo1+$ObjManag,$WowProcess,"dword")
$Firstob=_MEMORYREAD($AdrSo2+$firstObject,$WowProcess,"dword")
$Curobj=$Firstob
$Type=_MEMORYREAD($Curobj+$TypeObj,$WowProcess,"dword")
$TotalPlace=16
$firstSlot01=_MEMORYREAD($PlayerBase+0x8,$WowProcess,"dword")
$firstSlot=$firstSlot01+0x5c8
$nbsac=1
$baguid1=_MEMORYREAD($guidbag,$WowProcess,"uint64")
If $baguid1>0 Then $nbsac +=1
$baguid2=_MEMORYREAD($guidbag+8,$WowProcess,"uint64")
If $baguid2>0 Then $nbsac +=1
$baguid3=_MEMORYREAD($guidbag+16,$WowProcess,"uint64")
If $baguid3>0 Then $nbsac +=1
$baguid4=_MEMORYREAD($guidbag+24,$WowProcess,"uint64")
If $baguid4>0 Then $nbsac +=1
$FreeSac0=0
For $xx=0 To 15
$calfree=_MEMORYREAD($firstSlot+($xx*8),$WowProcess,"uint64")
If $calfree=0 Then $FreeSac0 +=1
Next
While $Type < 8
If $Type=2 Then
$descript=_MEMORYREAD($Curobj+8,$WowProcess,"dword")
$guid=_MEMORYREAD($descript,$WowProcess,"int64")
$Datasac=$descript+0x20
$taillesac=_MEMORYREAD($Datasac+0xe0,$WowProcess,"dword")
$firstSlot=$Datasac+0xE8
Switch $guid
Case $baguid1
$FreeSac1=0
For $xx=0 To $taillesac-1
$calfree=_MEMORYREAD($firstSlot+($xx*8),$WowProcess,"uint64")
If $calfree=0 Then $FreeSac1 +=1
Next
$TotalPlace +=$taillesac
Case $baguid2
$FreeSac2=0
For $xx=0 To $taillesac-1
$calfree=_MEMORYREAD($firstSlot+($xx*8),$WowProcess,"uint64")
If $calfree=0 Then $FreeSac2 +=1
Next
$TotalPlace +=$taillesac
Case $baguid3
$FreeSac3=0
For $xx=0 To $taillesac-1
$calfree=_MEMORYREAD($firstSlot+($xx*8),$WowProcess,"uint64")
If $calfree=0 Then $FreeSac3 +=1
Next
$TotalPlace +=$taillesac
Case $baguid4
$FreeSac4=0
For $xx=0 To $taillesac-1
$calfree=_MEMORYREAD($firstSlot+($xx*8),$WowProcess,"uint64")
If $calfree=0 Then $FreeSac4 +=1
Next
$TotalPlace +=$taillesac
EndSwitch
EndIf
$Curobj=_MEMORYREAD($Curobj+$nextObject,$WowProcess,"dword")
$Type=_MEMORYREAD($Curobj+$TypeObj,$WowProcess,"dword")
WEnd
MsgBox(0,"Infos sac","J ai "&$nbsac&" sac(s) et "& $FreeSac0+$FreeSac1+$FreeSac2+$FreeSac3+$FreeSac4 & " places de dispo sur " & $TotalPlace)
EndFunc