VB程序员博客
VB程序开发
原型:
push -1
push eax
push edx
mov ecx,14FB5B4
call 8152C0
VB:
Private Sub Command1_Click()
Dim pid As Long
hwd = FindWindow(vbNullString, "测试程序")
GetWindowThreadProcessId hwd, pid
hProcess = OpenProcess(PROCESS_ALL_ACCESS, 0, pid)
Dim asm As New clsASM
Dim a As String
Dim b As String
a = Text1.Text
b = Text2.Text
With asm
.Pushad
.Push -1
.Mov_EAX (a)
.Mov_EDX (b)
.Push_EAX
.Push_EDX
.Mov_ECX &H14FB5B4 'ecx是一个重要参数
.Mov_EBP &H8152C0
.Call_EBP
.Popad
.ret
End With
asm.Run_ASM pid, 0
CloseHandle (hProcess)
End Sub
这段代码运行后会出错,不知道错在哪里,请教了!
会出现什么错误?堆栈不平衡么?
你可以用ollydbg、windbg一类的调试器看看。
clsASM是自己写的代码?把代码贴出来看看。
<
你如何确保 clsASM 中的 8152C0 与原汇编一致?