Dim a As String
Open "test12.txt" For Input As #1
Input #1, a
Text1.Text = a
Close #1
End Sub
Private Sub Command2_Click()
Dim i As Integer
Dim j As Integer
Dim c As String
Dim r As Integer
Dim k As String
k = Text1.Text
Text2.Text = ""
While Len(k) >0
r = 1
For i = 1 To Len(k)
If Mid(k, r, 1) >Mid(k, i, 1) Then
r = i
End If
Next i
Text2.Text = Text2.Text &Mid(k, r, 1)
k = Left(k, r - 1) &Mid(k, r + 1)
Wend
End Sub
Private Sub Command3_Click()
Open "test12.txt" For Append As #1
Print #1, Text2.Text
Close #1
End Sub
Private Sub Form_Load()
Command1.Caption = "读入"
Command2.Caption = "排序"
Command3.Caption = "追加"
End Sub
1、通过编写好的脚本来获取按钮事件:
先将以下脚本保存至 .txt 文件中:
var Addrmov Addr,401000
loop:
find Addr,#740E8BD38B83????????FF93????????#
cmp $RESULT,0
je Exit
add $RESULT,0A
bp $RESULT
add $RESULT,1
mov Addr,$RESULT
jmp loop
Exit:
ret
用OD载入 Delphi 程序,右键 运行脚本-->打开,选择上面保存的文件,运行,如果d出了script finished 窗口就表示找到按钮事件断点位置。
2、用资源编辑工具+十六进制编辑工具来查找:
首先用ResScope或者其他工具打开目标程序,在RCData中能够找到窗体的资源信息,例如
object Form1: TForm1object Button1: TButton
Caption = 'Button1'
OnClick = Button1Click
end
end
此时假设我们要找“Button1”按钮事件,记住OnClick的名字(在这里就是Button1Click)
然后再用WinHex打开程序,查找事件名“Button1Click”,如下图所示: 事件名的前一个字节就是事件名的长度,再前面就是事件地址了:
找到地址后,用 OD载入程序,直接Ctrl+G前往该地址。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)