aus pid alle gestarteten programme oder fenster auslesen.

  • gibt es eine möglichkeit alle programme ausfindig zu machen die ein programm startet und jede msgbox die sie auf macht auf einen style zu setzten ?Ich kenne nur die Pid des programmes.


    Und wollte noch fragen ob man irgendwie das icon eines programmes auslesen kann.

    2 Mal editiert, zuletzt von manuel6000 (25. August 2011 um 14:15)

  • kann man fremde messagboxes nicht irgendwie auf $WS_POPUP setzten also nicht die von autoit?

  • aber eine msgbox ist ja nichts anderes als ein normales fenster und kann man sie unterdrücken ein fenster herstellen und das fenster als die msgbox ausgeben?

  • Und wie?

    aber wenn ich kein CC+ kann und es mit autoit machen will.

    Dann lern ASM..
    Lies die Adresse der Funktion MessageBoxW (oder MessageBoxA kommt drauf an) aus, sicher die 5 Bytes (wobei du den Call ja überschreiben willst, d.h. du löschst alle 5 Bytes, schreibtst an den Anfang ein JMP und danach 4 NOP), schreib einen JMP dorthin, der zu deiner Codecave führt (bzw. allokierter Memoryblock),
    schreib dort in ASM deine GUI hinein, die ausgeführt werden soll, und danach springst du aus der Codecave (bzw. Memoryblock) wieder zurück ein Byte weiter als der JMP (Trampolin).
    Das ganze in ASM Coden, Opcodes auslesen, und dann mit GetModuleHandle, GetProcAddress und WriteProcessMemory arbeiten (OpenProcess und CloseHandle nicht vergessen).


  • Dann lern ASM..
    Lies die Adresse der Funktion MessageBoxW (oder MessageBoxA kommt drauf an) aus, sicher die 5 Bytes (wobei du den Call ja überschreiben willst, d.h. du löschst alle 5 Bytes, schreibtst an den Anfang ein JMP und danach 4 NOP), schreib einen JMP dorthin, der zu deiner Codecave führt (bzw. allokierter Memoryblock),
    schreib dort in ASM deine GUI hinein, die ausgeführt werden soll, und danach springst du aus der Codecave (bzw. Memoryblock) wieder zurück ein Byte weiter als der JMP (Trampolin).
    Das ganze in ASM Coden, Opcodes auslesen, und dann mit GetModuleHandle, GetProcAddress und WriteProcessMemory arbeiten (OpenProcess und CloseHandle nicht vergessen).

    da hab ich nichts verstanden ja aber du sagtest Assambler

  • weiß nicht was ich in die parameter schreiben muss

    Spoiler anzeigen
    [autoit]

    ;===============================================================================
    ; Function Name: _TargetStyle()
    ; Description: Retrieves/Sets/Unsets/Replaces Styles and/or Exstyles of 'targeted' control/window
    ; When called with no parameters returns the current Styles/Exstyles for the window/control
    ; Parameter(s): $action[optional] - "set", "unset", "toggle", and "replace"
    ; $Bool[optional] - 1 to Update window/control when finished
    ; $Style[optional] - New window style (multiple styles can be BitOr'd)
    ; $ExStyle[optional] - New window exstyle (multiple styles can be BitOr'd)
    ; $LocTargethWnd[optional] - 'Local' _GuiTarget assigned variable
    ; Requirement(s): #include <guiconstants.au3>
    ; Return Value(s): On success: $action left blank-returns an array with $array[0] as the current Style and $array[1] as the current Exstyle
    ; otherwise it returns previous style and exstyle
    ; If style and exstyle are changed the function will return an array
    ; with $Array[0] as the previous style and
    ; $Array[1] as the previous exstyle
    ; On Error:affected array element returns 0, error flag set to 1 if Style, 2 if ExStyle.
    ; MsgBox displayed for either.
    ; Msgbox displayed for incorrect 'action' verb, returns 0 and sets error
    ; Author(s): Chase/Xenogis- - -Modified by Quaizywabbit
    ; 3 AUG 2005: corrected "Remove" to operate properly(Thanks Valik and Nutster!)
    ; 7 AUG 2005: changed 'action' verbs to "set", "unset", and "replace"
    ; 8 AUG 2005 fixed _TargetStyle() Select/Case logic (messed it up from v2.2___ooops!!)
    ; 10 AUG 2005 added "toggle"
    ; Comments: can only do a single 'verb' during each call, so required Style/Exstyle combinations may require
    ; additional _TargetStyle() calls with the last call setting $Bool to 1 to update the 'target'
    ;===============================================================================
    Func _TargetStyle($action = 0, $Bool = 0, $style = -1, $exstyle = -1, $LocTargethWnd = 0)
    If Not ($LocTargethWnd = 0) Then $TargethWnd = $LocTargethWnd
    Local $ostyle = DllCall("user32.dll", "long", "GetWindowLong", "hwnd", $TargethWnd, "int", -16);get existing Style
    Local $oexstyle = DllCall("user32.dll", "long", "GetWindowLong", "hwnd", $TargethWnd, "int", -20);get existing ExStyle
    Select
    Case $action = "set"
    If $style <> -1 Then Local $scall = DllCall("user32.dll", "long", "SetWindowLong", "hwnd", $TargethWnd, "int", -16, "long", BitOR($ostyle[0], $style));add Style to old style
    If $exstyle <> -1 Then Local $exscall = DllCall("user32.dll", "long", "SetWindowLong", "hwnd", $TargethWnd, "int", -20, "long", BitOR($oexstyle[0], $exstyle));add Exstyle to old exstyle
    Case $action = "unset"
    If $style <> -1 Then Local $scall = DllCall("user32.dll", "long", "SetWindowLong", "hwnd", $TargethWnd, "int", -16, "long", BitAND($ostyle[0], BitNOT($style)));remove Style from old style
    If $exstyle <> -1 Then Local $exscall = DllCall("user32.dll", "long", "SetWindowLong", "hwnd", $TargethWnd, "int", -20, "long", BitAND($oexstyle[0], BitNOT($exstyle)));remove Exstyle from old exstyle
    Case $action = "toggle"
    If $style <> -1 Then Local $scall = DllCall("user32.dll", "long", "SetWindowLong", "hwnd", $TargethWnd, "int", -16, "long", BitXOR($ostyle[0], $style));Toggle Style(s) on or off
    If $exstyle <> -1 Then Local $exscall = DllCall("user32.dll", "long", "SetWindowLong", "hwnd", $TargethWnd, "int", -20, "long", BitXOR($oexstyle[0], $exstyle));Toggle ExStyle(s) on or off
    Case $action = "replace"
    If $style <> -1 Then Local $scall = DllCall("user32.dll", "long", "SetWindowLong", "hwnd", $TargethWnd, "int", -16, "long", $style);replace Style
    If $exstyle <> -1 Then Local $exscall = DllCall("user32.dll", "long", "SetWindowLong", "hwnd", $TargethWnd, "int", -20, "long", $exstyle);replace Exstyle
    Case Else
    Dim $ret[2]
    $ret[0] = $ostyle[0]
    $ret[1] = $oexstyle[0]
    Return $ret
    EndSelect
    Dim $return[2]
    If $style <> -1 And $scall[0] <> $ostyle[0] Then
    SetError(1)
    $return[0] = 0
    MsgBox(4096, "Error setting Style", "Please check your Style settings and try again")
    ElseIf $exstyle <> -1 And $exscall[0] <> $oexstyle[0] Then
    SetError(2)
    $return[1] = 0
    MsgBox(4096, "Error setting ExStyle", "Please check your ExStyle settings and try again")
    Else
    If $style <> -1 Then
    $return[0] = $scall[0]
    Else
    $return[0] = $ostyle[0]
    EndIf
    If $exstyle <> -1 Then
    $return[1] = $exscall[0]
    Else
    $return[1] = $oexstyle[0]
    EndIf
    EndIf
    If $Bool = 1 Then _Refresh($TargethWnd)

    [/autoit] [autoit][/autoit] [autoit]

    Return $return
    EndFunc ;==>_TargetStyle

    [/autoit]