hier der sourcecode und das fertige programm
Code:
; -- Inludes
#include <GDIPlus.au3>
#include <NoMadMemory.au3>
#include <Memory.au3>
#include <GUIConstants.au3>
; -- Daten nachladen
$ProcName = IniRead("Pixelfehler.ini","System","ProzessID","")
$base_HP = "0x" & IniRead("Pixelfehler.ini","Pointer","base_HP","")
$base_HP_offset_1 = "0x" & IniRead("Pixelfehler.ini","Pointer","base_HP_offset_1","")
$base_HP_offset_2 = "0x" & IniRead("Pixelfehler.ini","Pointer","base_HP_offset_2","")
$base_HP_offset_3 = "0x" & IniRead("Pixelfehler.ini","Pointer","base_HP_offset_3","")
$base_HP_type = IniRead("Pixelfehler.ini","Pointer","base_HP_type","")
; -- Variablen
Global $iGUIWidth = @DesktopWidth ; Bildschirmbreite auslesen
Global $iGUIHeight = @DesktopHeight ; Bildschirmhöhe auslesen
Global $vUser32DLL = DllOpen("User32.dll") ;
Global $x_Pos = $iGUIWidth / 2
$tSize = DllStructCreate($tagSIZE) ;
$tSource = DllStructCreate($tagPOINT) ;
$tBlend = DllStructCreate($tagBLENDFUNCTION);
$pSize = DllStructGetPtr($tSize) ;
$pSource = DllStructGetPtr($tSource) ;
$pBlend = DllStructGetPtr($tBlend) ;
DllStructSetData($tSize, "X", $iGUIWidth) ;
DllStructSetData($tSize, "Y", $iGUIHeight) ;
DllStructSetData($tBlend, "Alpha", 255) ;
DllStructSetData($tBlend, "Format", 1) ;
_GDIPlus_Startup()
$hDummy = GUICreate("") ;
$hWnd = GUICreate("", $iGUIWidth, $iGUIHeight,$x_pos - 400 ,15, BitOR(0x80000000, 0x08000000), BitOR(0x00080000, 0x00000008), $hDummy)
GUISetState() ;
$hDC_Window = _WinAPI_GetDC($hWnd) ;
$hDC_Buffer = _WinAPI_CreateCompatibleDC($hDC_Window)
$hBitmap_Buffer = _WinAPI_CreateCompatibleBitmap($hDC_Window, $iGUIWidth, $iGUIHeight)
_WinAPI_SelectObject($hDC_Buffer, $hBitmap_Buffer)
$hGraphics = _GDIPlus_GraphicsCreateFromHDC($hDC_Buffer)
_GDIPlus_GraphicsSetSmoothingMode($hGraphics, 2)
;-------------------------------------------------------------------------------------------------------------------------
$iPID = ProcessExists ($ProcName) ; Prozessname einlesen ( Fiesta.bin )
SetPrivilege ("SeDebugPrivilege", 1) ; Privilegien geben
$hOpen = _MemoryOpen($iPID) ;
$iBase = _MemoryModuleGetBaseAddress($iPID, $ProcName) ;
; -- HP_Check
$base_HP1 = $iBase + $base_HP
$base_HP2 = _Memoryread($base_HP1, $hOpen) + $base_HP_offset_1
$base_HP3 = _Memoryread($base_HP2, $hOpen) + $base_HP_offset_2
$base_HP4 = _Memoryread($base_HP3, $hOpen) + $base_HP_offset_3
$base_HPFinal = _Memoryread($base_HP4, $hOpen,$base_HP_type)
$hBrush = _GDIPlus_BrushCreateSolid(0xFFFFFFFF)
$hFormat = _GDIPlus_StringFormatCreate()
$hFamily = _GDIPlus_FontFamilyCreate("Arial")
$hFont = _GDIPlus_FontCreate($hFamily, 25)
$tLayout = _GDIPlus_RectFCreate(0, 0, 0, 0)
$aInfo = _GDIPlus_GraphicsMeasureString($hGraphics, $base_HPFinal , $hFont, $tLayout, $hFormat)
;------------------------------------------------------------------------------------------------------------------------------
While Sleep(20)
$base_HPFinal = _Memoryread($base_HP4, $hOpen,$base_HP_type)
_Erase() ; zum cleanen, da sonst das alte nur übermalt wird
$aInfo = _GDIPlus_GraphicsMeasureString($hGraphics, $base_HPFinal , $hFont, $tLayout, $hFormat)
_GDIPlus_GraphicsDrawStringEx($hGraphics, $base_HPFinal, $hFont, $aInfo[0], $hFormat, $hBrush)
_WinAPI_UpdateLayeredWindow($hWnd, $hDC_Window, 0, $pSize, $hDC_Buffer, $pSource, 0, $pBlend, 2) ; immer ganz zum schluss, updatet das dann
WEnd
Func _OnTop()
WinSetOnTop($hWnd, "", 1)
EndFunc ;==>_OnTop
Func _Erase()
_GDIPlus_GraphicsClear($hGraphics, 0x00000000)
EndFunc ;==>_Erase






