Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <assembleit.au3>
- ;~ #include <ButtonConstants.au3>
- ;~ #include <EditConstants.au3>
- ;~ #include <GUIConstantsEx.au3>
- ;~ #include <StaticConstants.au3>
- ;~ #include <WindowsConstants.au3>
- ;~ #include <winapi.au3>
- ;~ ;#include <Winapi_ex.au3>
- ;««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
- ; _WinAPI_CreateWindowEx.au3
- ;««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
- #include <WindowsConstants.au3>
- #include <GuiConstantsEx.au3>
- #include <ButtonConstants.au3>
- #include <EditConstants.au3>
- #include <StaticConstants.au3>
- #include <Constants.au3>
- #include <Winapiex.au3>
- #include <WinAPI.au3>
- Global Const $IDC_STATIC = -1
- Global Const $IDC_EDIT = 101
- global $z=0
- ;Global $hInstance = _WinAPI_GetModuleHandle(0)
- Global $hwndMain = GUICreate( _
- "- Demo", _ ; Titel des Fensters
- 400, 300, -1, -1, _ ; Grösse und Position des Fensters
- BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPCHILDREN), _ ; Fensterstile
- $WS_EX_WINDOWEDGE, _ ; Erweiterte Fensterstile
- 0 _ ; Handle des Parent-Fensters
- )
- ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $hwndMain = ' & $hwndMain & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console
- ; Eine einfache Schaltfläche erzeugen
- $hwndButton = GUICtrlCreateButton("Drücken für weiter!", 50, 50, 140, 40)
- ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $hwndButton = ' & $hwndButton & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console
- GUISetState()
- While 1
- $msg = GUIGetMsg()
- Select
- Case $msg = -3
- Exit
- Case $hwndButton
- ExitLoop ;$hwndButton then ExitLoop
- EndSelect
- WEnd
- MsgBox(0, "weiter", "weiter gehts ins asm-prog")
- Func MyWM_COMMAND($hwnd, $message, $wParam, $lParam)
- ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $wParam = ' & $wParam & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console
- Local $sMessage
- ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $sMessage = ' & $sMessage & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console
- Switch (_WinAPI_LoWord($lParam))
- Case $IDC_EDIT
- ; Nachrichten des Eingabefeldes
- Switch (_WinAPI_LoWord($wParam))
- Case $EN_UPDATE
- ContinueCase
- Case $EN_CHANGE
- ConsoleWrite(_WinAPI_GetWindowText($lParam) & @CRLF)
- EndSwitch
- Case $hwndButton
- $sMessage = StringFormat("Die Schaltfläche mit der ID %d wurde gedrückt.", $hwndButton)
- _WinAPI_MsgBox( _
- BitOR($MB_OK, $MB_ICONASTERISK), _
- "MyWM_COMMAND", _
- $sMessage _
- )
- EndSwitch
- Return $GUI_RUNDEFMSG
- EndFunc ;==>MyWM_COMMAND
- Global $DEBUGMODE = 0
- Enum $NODEBUG, $MANUALDEBUG, $STEPBYSTEP
- ;Global $_DBG_Form1,$_DBG_Edit1,$_DBG_Edit2,$_DBG_Edit3,$_DBG_Button1,$_DBG_Label1,$_DBG_Label2,$_DBG_Label3
- Global $_DBG_CBREG[2]
- $_DBG_CBREG[0] = DllCallbackRegister("_DBG_REGS_AI", "dword", "");dword;dword;dword;dword;dword;dword;dword;dword")
- OnAutoItExitRegister("_dbg_exit")
- $DEBUGMODE = $MANUALDEBUG ;1
- ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $MANUALDEBUG = ' & $MANUALDEBUG & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console
- $return = _assembleit("ptr", "F2", "int", 100, "int", 200, "ptr", 0xFF00FF00)
- ; DllCall($user32, "none", "CallWindowProcW", "ptr", DllStructGetPtr($__structformuster), "int", $w, "int", $h, "ptr", $ptr, "ptr", DllCallbackGetPtr($cb))
- While (True)
- Switch (GUIGetMsg())
- Case $GUI_EVENT_CLOSE
- ExitLoop
- EndSwitch
- WEnd
- Func F2()
- _("use32")
- _("org " & FasmGetBasePtr($Fasm))
- ;
- _("mov eax,[esp+4]") ;
- _("mov [w],eax") ;w
- _("mov eax,[esp+8]") ;
- _("mov [h],eax") ;h
- ;startadresse in ebx, dann muss ebx immer nur um 4 erhöht werden, um das nächste pixel zu schreiben
- _("mov ebx,[esp+12]") ;scan0
- _("mov eax,[funcp]")
- _ShowRegister()
- _("mov eax,0xDEADBEEF")
- _ShowRegister()
- _("ret") ;Ende
- _("funcp dd 1.25") ;Variable auf Funktionspointer
- _("w dd 0") ;Speicher für Parameter reservieren
- _("h dd 0") ;
- EndFunc ;==>F2
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;;;;;ab hier kommt alles in die _assembleit.au3;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- Func _DBG_REGS_AI() ;$eax, $ebx, $ecx, $edx, $esi, $edi, $ebp, $esp)
- ;ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $eax = ' & $eax & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
- ; If $DEBUGMODE=$NODEBUG Then Return 0
- $z+=1
- $a = GUICtrlSetData($hwndButton, "im Callback! Z="&$z)
- msgbox(0,"im callback","weiter...")
- ; _WinAPI_RedrawWindow($hwndMain)
- ; GUIDelete($_DBG_Form1)
- Return 0
- EndFunc ;==>_DBG_REGS_AI
- Func _ShowRegister()
- ;~ _("pushad")
- ;~ _("push esp")
- ;~ _("push ebp")
- ;~ _("push edi")
- ;~ _("push esi")
- ;~ _("push edx")
- ;~ _("push ecx")
- ;~ _("push ebx")
- ;~ _("push eax")
- ; _("add esp,32")
- _("call " & DllCallbackGetPtr($_DBG_CBREG[0]))
- ; _("sub esp,32")
- ;~ _("popad")
- EndFunc ;==>_ShowRegister
- Func _dbg_exit()
- DllCallbackFree($_DBG_CBREG[0])
- ;~ DllCallbackFree($_DBG_CBREG[1])
- ; GUIDelete($_DBG_Form1)
- EndFunc ;==>_dbg_exit
- Func _DBG_GUI($title = "Debug", $button = "OK")
- EndFunc ;==>_DBG_GUI
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement