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>
- 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")
- _DBG_GUI()
- $DEBUGMODE=$MANUALDEBUG
- $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))
- 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)
- If $DEBUGMODE=$NODEBUG Then Return 0
- GUISetState(@SW_SHOW,$_DBG_Form1)
- Local $text1,$text2,$text3
- $text1="EAX = " & Ptr($eax)&@CRLF&"EBX = " & Ptr($ebx)&@CRLF& _
- "ECX = " & Ptr($ecx)&@CRLF&"EDX = " & Ptr($edx)&@CRLF& _
- "ESI = " & Ptr($esi)&@CRLF&"EDI = " & Ptr($edi)&@CRLF& _
- "EBP = " & Ptr($ebp)&@CRLF&"ESP = " & Ptr($esp)&@CRLF
- $text2="EAX = " & Int($eax)&@CRLF&"EBX = " & Int($ebx)&@CRLF& _
- "ECX = " & Int($ecx)&@CRLF&"EDX = " & Int($edx)&@CRLF& _
- "ESI = " & Int($esi)&@CRLF&"EDI = " & Int($edi)&@CRLF& _
- "EBP = " & Int($ebp)&@CRLF&"ESP = " & Int($esp)&@CRLF
- $text3="EAX = " & $eax&@CRLF&"EBX = " & $ebx&@CRLF& _
- "ECX = " & $ecx&@CRLF&"EDX = " & $edx&@CRLF& _
- "ESI = " & $esi&@CRLF&"EDI = " & $edi&@CRLF& _
- "EBP = " & $ebp&@CRLF&"ESP = " & $esp&@CRLF
- GUICtrlSetData($_DBG_Edit1,$text1)
- GUICtrlSetData($_DBG_Edit2,$text2)
- GUICtrlSetData($_DBG_Edit3,$text3)
- MsgBox(0,"","")
- While 1
- $msg=GUIGetMsg()
- If $msg=-3 Or $msg=$_DBG_Button1 Then ExitLoop
- Sleep(10)
- WEnd
- GUISetState(@SW_HIDE,$_DBG_Form1)
- ;~ DllCall("DLL.dll","none","MakeGUI@0")
- Return 0
- EndFunc ;==>_DBG_REGS_AI
- Func _ShowRegister()
- _("push esp")
- _("push ebp")
- _("push edi")
- _("push esi")
- _("push edx")
- _("push ecx")
- _("push ebx")
- _("push eax")
- _("pushad")
- _("add esp,32")
- _("call " & DllCallbackGetPtr($_DBG_CBREG[$DEBUGMODE-1]))
- _("sub esp,32")
- _("popad")
- EndFunc ;==>_ASMDBG_REGS
- Func _dbg_exit()
- DllCallbackFree($_DBG_CBREG[0])
- ;~ DllCallbackFree($_DBG_CBREG[1])
- GUIDelete($_DBG_Form1)
- EndFunc
- Func _DBG_GUI($title="Debug",$button="OK")
- $_DBG_Form1 = GUICreate($title, 439, 426)
- $_DBG_Edit1 = GUICtrlCreateEdit("", 8, 8, 129, 273, BitOR($ES_READONLY,$ES_WANTRETURN))
- $_DBG_Edit2 = GUICtrlCreateEdit("", 152, 8, 129, 273, BitOR($ES_READONLY,$ES_WANTRETURN))
- $_DBG_Edit3 = GUICtrlCreateEdit("", 296, 8, 129, 273, BitOR($ES_READONLY,$ES_WANTRETURN))
- $_DBG_Button1 = GUICtrlCreateButton($button, 144, 392, 129, 25, $WS_GROUP)
- $_DBG_Label1 = GUICtrlCreateLabel("Line: ", 120, 304, 180, 17)
- $_DBG_Label2 = GUICtrlCreateLabel("This line: ", 120, 328, 177, 17)
- $_DBG_Label3 = GUICtrlCreateLabel("Next line:", 120, 352, 184, 17)
- GUISetState(@SW_HIDE)
- _WinAPI_UpdateWindow(WinGetHandle($title))
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement