Advertisement
Guest User

Untitled

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