tommeke228 Posted April 22, 2008 Posted April 22, 2008 hi this gona be so easy for you but not for me xD ive got a listbox $List1 = GUICtrlCreateList( "", 16, 24, 161, 136) and a refresh button $Button1 = GUICtrlCreateButton("Refresh", 184, 24, 73, 137, 0) if i click refresh procID must come in list1 $ProcID are letters and numbers
Zedna Posted April 22, 2008 Posted April 22, 2008 Look at GUICtrlSetData() Resources UDF ResourcesEx UDF AutoIt Forum Search
smashly Posted April 22, 2008 Posted April 22, 2008 Hi, #include <GuiConstants.au3> $GUI = GUICreate("", 200, 200) $List = GUICtrlCreateList("", 5, 5, 190, 165) $Button = GUICtrlCreateButton("Refresh", 5, 175, 190, 20) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button $PL = ProcessList() GUICtrlSetData($list, "") WinSetTitle($GUI, "", "Processes " & $PL[0][0]) For $i = 1 To $PL[0][0] GUICtrlSetData($list, $PL[$i][1] & " " & $PL[$i][0]) Next EndSelect WEnd Cheers
tommeke228 Posted April 22, 2008 Author Posted April 22, 2008 (edited) This is my program i just want that $ProcID added as text in my listbox and i want that if i press button2 that he patch the selected id in listbox expandcollapse popup#include <GUIConstants.au3> $GUI = GUICreate("", 200, 200) $Form1 = GUICreate("No Dc Patcher", 272, 215, 193, 125) $List1 = GUICtrlCreateList( "", 16, 24, 161, 136) $Button1 = GUICtrlCreateButton("Refresh", 184, 24, 73, 137, 0) $Button2 = GUICtrlCreateButton("Patch", 16, 168, 161, 33, 0) $Group1 = GUICtrlCreateGroup(" No Dc ", 8, 8, 257, 201) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() If $msg = $Button2 Then PatchSro() EndIf If $msg = $Button1 Then Refresh() EndIf If $msg = $GUI_EVENT_CLOSE Then Exit EndIf WEnd Func _MemoryOpen($iv_Pid, $iv_DesiredAccess = 0x1F0FFF, $iv_InheritHandle = 1) If Not ProcessExists($iv_Pid) Then SetError(1) Return 0 EndIf Local $ah_Handle[2] = [DllOpen('kernel32.dll')] If @Error Then SetError(2) Return 0 EndIf Local $av_OpenProcess = DllCall($ah_Handle[0], 'int', 'OpenProcess', 'int', $iv_DesiredAccess, 'int', $iv_InheritHandle, 'int', $iv_Pid) If @Error Then DllClose($ah_Handle[0]) SetError(3) Return 0 EndIf $ah_Handle[1] = $av_OpenProcess[0] Return $ah_Handle EndFunc Func _MemoryWrite($iv_Address, $ah_Handle, $v_Data, $sv_Type = 'dword') If Not IsArray($ah_Handle) Then SetError(1) Return 0 EndIf Local $v_Buffer = DllStructCreate($sv_Type) If @Error Then SetError(@Error + 1) Return 0 Else DllStructSetData($v_Buffer, 1, $v_Data) If @Error Then SetError(6) Return 0 EndIf EndIf DllCall($ah_Handle[0], 'int', 'WriteProcessMemory', 'int', $ah_Handle[1], 'int', $iv_Address, 'ptr', DllStructGetPtr($v_Buffer), 'int', DllStructGetSize($v_Buffer), 'int', '') If Not @Error Then Return 1 Else SetError(7) Return 0 EndIf EndFunc Func _MemoryClose($ah_Handle) If Not IsArray($ah_Handle) Then SetError(1) Return 0 EndIf DllCall($ah_Handle[0], 'int', 'CloseHandle', 'int', $ah_Handle[1]) If Not @Error Then DllClose($ah_Handle[0]) Return 1 Else DllClose($ah_Handle[0]) SetError(2) Return 0 EndIf EndFunc Func _MemoryRead($iv_Address, $ah_Handle, $sv_Type = 'dword') If Not IsArray($ah_Handle) Then SetError(1) Return 0 EndIf Local $v_Buffer = DllStructCreate($sv_Type) If @Error Then SetError(@Error + 1) Return 0 EndIf DllCall($ah_Handle[0], 'int', 'ReadProcessMemory', 'int', $ah_Handle[1], 'int', $iv_Address, 'ptr', DllStructGetPtr($v_Buffer), 'int', DllStructGetSize($v_Buffer), 'int', '') If Not @Error Then Local $v_Value = DllStructGetData($v_Buffer, 1) Return $v_Value Else SetError(6) Return 0 EndIf EndFunc Func Refresh() $List1 = EndFunc Func PatchSro() If ProcessExists("sro_client.exe") Then $ProcID = ProcessExists("sro_client.exe") $OpenProc = _MemoryOpen($ProcID) ;JMP 00bc9e20 _MemoryWrite(0x0073f52e, $OpenProc, 0xe9, "byte[1]") _MemoryWrite(0x0073f52f, $OpenProc, 0xe0, "byte[1]") _MemoryWrite(0x0073f530, $OpenProc, 0xa8, "byte[1]") _MemoryWrite(0x0073f531, $OpenProc, 0x48, "byte[1]") _MemoryWrite(0x0073f533, $OpenProc, 0x90, "byte[1]") ;NOP ;MOV EAX, 492E20 _MemoryWrite(0x00bc9e13, $OpenProc, 0xb8, "byte[1]") _MemoryWrite(0x00bc9e14, $OpenProc, 0x20, "byte[1]") _MemoryWrite(0x00bc9e15, $OpenProc, 0x2e, "byte[1]") _MemoryWrite(0x00bc9e16, $OpenProc, 0x49, "byte[1]") ;CALL EAX _MemoryWrite(0x00bc9e18, $OpenProc, 0xff, "byte[1]") _MemoryWrite(0x00bc9e19, $OpenProc, 0xd0, "byte[1]") ;POP EDI _MemoryWrite(0x00bc9e1a, $OpenProc, 0x5f, "byte[1]") ;ADD ESP, 10 _MemoryWrite(0x00bc9e1b, $OpenProc, 0x83, "byte[1]") _MemoryWrite(0x00bc9e1c, $OpenProc, 0xc4, "byte[1]") _MemoryWrite(0x00bc9e1d, $OpenProc, 0x10, "byte[1]") ;RETN _MemoryWrite(0x00bc9e1e, $OpenProc, 0xc3, "byte[1]") MsgBox(0, "Patch Successful", "No disconnect has been applied to process " & $ProcID) Else MsgBox(0, "Message", "Sro Not Running") EndIf EndFunc Edited April 22, 2008 by tommeke228
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now