Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 3.94 KB | None | 0 0
  1. #include <assembleit.au3>
  2.  
  3. #include <ButtonConstants.au3>
  4. #include <EditConstants.au3>
  5. #include <GUIConstantsEx.au3>
  6. #include <StaticConstants.au3>
  7. #include <WindowsConstants.au3>
  8. #include <winapi.au3>
  9.  
  10.  
  11.  
  12.  
  13. Global $DEBUGMODE=0
  14. Enum $NODEBUG,$MANUALDEBUG,$STEPBYSTEP
  15.  
  16. Global $_DBG_Form1,$_DBG_Edit1,$_DBG_Edit2,$_DBG_Edit3,$_DBG_Button1,$_DBG_Label1,$_DBG_Label2,$_DBG_Label3
  17. Global $_DBG_CBREG[2]
  18. $_DBG_CBREG[0] = DllCallbackRegister("_DBG_REGS_AI", "dword", "dword;dword;dword;dword;dword;dword;dword;dword")
  19. OnAutoItExitRegister("_dbg_exit")
  20. _DBG_GUI()
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31. $DEBUGMODE=$MANUALDEBUG
  32.  
  33. $return = _assembleit("ptr", "F2", "int", 100, "int", 200, "ptr", 0xFF00FF00)
  34. ;   DllCall($user32, "none", "CallWindowProcW", "ptr", DllStructGetPtr($__structformuster), "int", $w, "int", $h, "ptr", $ptr, "ptr", DllCallbackGetPtr($cb))
  35.  
  36.  
  37.  
  38. Func F2()
  39.     _("use32")
  40.     _("org " & FasmGetBasePtr($Fasm))
  41.     ;
  42.     _("mov eax,[esp+4]") ;
  43.     _("mov [w],eax") ;w
  44.     _("mov eax,[esp+8]") ;
  45.     _("mov [h],eax") ;h
  46.  
  47.     ;startadresse in ebx, dann muss ebx immer nur um 4 erhöht werden, um das nächste pixel zu schreiben
  48.     _("mov ebx,[esp+12]") ;scan0
  49.     _("mov eax,[funcp]")
  50.     _ShowRegister()
  51.     _("mov eax,0xDEADBEEF")
  52.     _ShowRegister()
  53.  
  54.  
  55.     _("ret") ;Ende
  56.  
  57.     _("funcp dd 1.25") ;Variable auf Funktionspointer
  58.     _("w dd 0") ;Speicher für Parameter reservieren
  59.     _("h dd 0") ;
  60. EndFunc   ;==>F2
  61.  
  62. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  63. ;;;;;;ab hier kommt alles in die _assembleit.au3;;;;;;;;;;;;;;;;;;;;;;;;;;;
  64. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  65.  
  66. Func _DBG_REGS_AI($eax, $ebx, $ecx, $edx, $esi, $edi, $ebp, $esp)
  67.     If $DEBUGMODE=$NODEBUG Then Return 0
  68.     GUISetState(@SW_SHOW,$_DBG_Form1)
  69.     Local $text1,$text2,$text3
  70.     $text1="EAX = " & Ptr($eax)&@CRLF&"EBX = " & Ptr($ebx)&@CRLF& _
  71.            "ECX = " & Ptr($ecx)&@CRLF&"EDX = " & Ptr($edx)&@CRLF& _
  72.            "ESI = " & Ptr($esi)&@CRLF&"EDI = " & Ptr($edi)&@CRLF& _
  73.            "EBP = " & Ptr($ebp)&@CRLF&"ESP = " & Ptr($esp)&@CRLF
  74.     $text2="EAX = " & Int($eax)&@CRLF&"EBX = " & Int($ebx)&@CRLF& _
  75.            "ECX = " & Int($ecx)&@CRLF&"EDX = " & Int($edx)&@CRLF& _
  76.            "ESI = " & Int($esi)&@CRLF&"EDI = " & Int($edi)&@CRLF& _
  77.            "EBP = " & Int($ebp)&@CRLF&"ESP = " & Int($esp)&@CRLF
  78.     $text3="EAX = " & $eax&@CRLF&"EBX = " & $ebx&@CRLF& _
  79.            "ECX = " & $ecx&@CRLF&"EDX = " & $edx&@CRLF& _
  80.            "ESI = " & $esi&@CRLF&"EDI = " & $edi&@CRLF& _
  81.            "EBP = " & $ebp&@CRLF&"ESP = " & $esp&@CRLF
  82.     GUICtrlSetData($_DBG_Edit1,$text1)
  83.     GUICtrlSetData($_DBG_Edit2,$text2)
  84.     GUICtrlSetData($_DBG_Edit3,$text3)
  85.     MsgBox(0,"","")
  86.     While 1
  87.         $msg=GUIGetMsg()
  88.         If $msg=-3 Or $msg=$_DBG_Button1 Then ExitLoop
  89.         Sleep(10)
  90.     WEnd
  91.     GUISetState(@SW_HIDE,$_DBG_Form1)
  92. ;~  DllCall("DLL.dll","none","MakeGUI@0")
  93.     Return 0
  94. EndFunc   ;==>_DBG_REGS_AI
  95.  
  96. Func _ShowRegister()
  97.     _("push esp")
  98.     _("push ebp")
  99.     _("push edi")
  100.     _("push esi")
  101.     _("push edx")
  102.     _("push ecx")
  103.     _("push ebx")
  104.     _("push eax")
  105.     _("pushad")
  106.     _("add esp,32")
  107.     _("call " & DllCallbackGetPtr($_DBG_CBREG[$DEBUGMODE-1]))
  108.     _("sub esp,32")
  109.     _("popad")
  110. EndFunc   ;==>_ASMDBG_REGS
  111.  
  112.  
  113.  
  114.  
  115. Func _dbg_exit()
  116.     DllCallbackFree($_DBG_CBREG[0])
  117. ;~  DllCallbackFree($_DBG_CBREG[1])
  118.     GUIDelete($_DBG_Form1)
  119. EndFunc
  120.  
  121.  
  122. Func _DBG_GUI($title="Debug",$button="OK")
  123.     $_DBG_Form1 = GUICreate($title, 439, 426)
  124.     $_DBG_Edit1 = GUICtrlCreateEdit("", 8, 8, 129, 273, BitOR($ES_READONLY,$ES_WANTRETURN))
  125.     $_DBG_Edit2 = GUICtrlCreateEdit("", 152, 8, 129, 273, BitOR($ES_READONLY,$ES_WANTRETURN))
  126.     $_DBG_Edit3 = GUICtrlCreateEdit("", 296, 8, 129, 273, BitOR($ES_READONLY,$ES_WANTRETURN))
  127.     $_DBG_Button1 = GUICtrlCreateButton($button, 144, 392, 129, 25, $WS_GROUP)
  128.     $_DBG_Label1 = GUICtrlCreateLabel("Line: ", 120, 304, 180, 17)
  129.     $_DBG_Label2 = GUICtrlCreateLabel("This line: ", 120, 328, 177, 17)
  130.     $_DBG_Label3 = GUICtrlCreateLabel("Next line:", 120, 352, 184, 17)
  131.     GUISetState(@SW_HIDE)
  132.     _WinAPI_UpdateWindow(WinGetHandle($title))
  133. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement