📄 00000006.htm
字号:
0804a494 fl_set_object_lsize
<BR> 0804a4a4 fl_add_checkbutton
<BR> 0804a4b4 fl_set_object_callback
<BR> 0804a4c4 fl_add_menu
<BR> 0804a4d4 fl_use_fselector
<BR> 0804a4e4 __errno_location
<BR> 0804a4f4 exit
<BR> 0804a504 fl_get_filename
<BR> 0804a514 __fxstat
<BR> 0804a524 fl_add_timer
<BR> 0804a534 fl_set_object_resize
<BR> 0804a544 open
<BR> 0804a554 fl_set_object_lalign
<BR> 0804a564 fl_get_directory
<BR> 0804a574 fl_show_choice
<BR> 0804a584 fl_set_slider_size
<BR> 0804a594 fputs
<BR> 0804a5a4 execvp
<BR> 0804a5b4 fl_get_counter_value
<BR> 0804a5c4 close
<BR> 0804a5d4 XOpenDisplay
<BR> 0804a5e4 free
<BR> 0804a604 fl_set_button
<BR> 0804a614 _start
<BR> 08052e7c whereError
<BR> 080583c0 _fini
<BR> mtv用到了xforms库,fl_xxxx都是这个库里的函数, 其中的哪个fl_get_input是
<BR>这么的显眼, 虽然没有做过xforms的编程,但是可以大胆设想这个东东会不会类似
<BR>windows中的GetDlgItemText(GetDlgItemTextA), 所以不妨试试
<BR>
<BR>(gdb)break fl_get_input
<BR>Breakpoint 1 at 0x804a264
<BR>(gdb)r
<BR>Starting program: /usr/X11R6/bin/mtv
<BR>(no debugging symbols found)...Breakpoint 1 at 0x400429e3
<BR>
<BR>出现填写注册信息对话框, 我做如下输入
<BR>
<BR>Name: I007
<BR>Order number: B123456789 (有editmask,只能一字母后跟字数)
<BR>Key: 87654321 (也有editmask)
<BR>
<BR>按OK键后, mtv果然在断点处停住, 猜得不错. 如果没猜中, 只好慢慢跟踪罗
<BR>(no debugging symbols found)...(no debugging symbols found)...
<BR>Breakpoint 1, 0x400429e3 in fl_get_input ()
<BR>(gdb)
<BR>
<BR>继续让它运行...
<BR>(gdb) c
<BR>Continuing.
<BR>
<BR>Breakpoint 1, 0x400429e3 in fl_get_input ()
<BR>(gdb) c
<BR>Continuing.
<BR>
<BR>Breakpoint 1, 0x400429e3 in fl_get_input ()
<BR>(gdb) c
<BR>Continuing.
<BR>
<BR>它连续调用了fl_get_input三次, 正好对应三个输入项, 然后注册信息错误的
<BR>对话框就出现了, 看来是没错了, 现在关键是要看最后一次调用fl_get_input
<BR>后的代码,当然看它每次调用fl_get_input后到取回的字串放到了什么地地方
<BR>也很重要.我重新输入一次注册信息,然后让它在三次调用fl_get_input后的
<BR>情况:
<BR>(gdb) c
<BR>Continuing.
<BR>
<BR>Breakpoint 1, 0x400429e3 in fl_get_input ()
<BR>(gdb) bt
<BR>#0 0x400429e3 in fl_get_input ()
<BR>#1 0x804ea96 in _start ()
<BR>#2 0x4003b5f5 in fl_do_forms ()
<BR>#3 0x8050a59 in _start ()
<BR>
<BR>这是堆栈中的情况, 看来调用完fl_get_input后应返回到_start中的
<BR>地址0x804ea96处, 我们来看看这段代码
<BR>(gdb) disass 0x804ea96 0x804ffff
<BR>Dump of assembler code from 0x804ea96 to 0x804ffff:
<BR>0x804ea96 <_start+17538>: movl %eax,0x806e584
<BR>0x804ea9b <_start+17543>: pushl %eax
<BR>0x804ea9c <_start+17544>: movl 0x806e9d4,%eax
<BR>0x804eaa1 <_start+17549>: movl 0x18(%eax),%ecx
<BR>0x804eaa4 <_start+17552>: pushl %ecx
<BR>0x804eaa5 <_start+17553>: call 0x804a264 <fl_get_input> <-第二次
<BR>0x804eaaa <_start+17558>: movl %eax,%ebp
<BR>0x804eaac <_start+17560>: movl 0x806e9d4,%eax
<BR>0x804eab1 <_start+17565>: pushl %eax
<BR>0x804eab2 <_start+17566>: movl 0x10(%eax),%edx
<BR>0x804eab5 <_start+17569>: pushl %edx
<BR>0x804eab6 <_start+17570>: call 0x804a264 <fl_get_input> <-第三次
<BR>0x804eabb <_start+17575>: movl %eax,%ebx
<BR>0x804eabd <_start+17577>: movl %ebp,%edx
<BR>0x804eabf <_start+17579>: movl %ebp,%eax
<BR>0x804eac1 <_start+17581>: addl $0x18,%esp
<BR>0x804eac4 <_start+17584>: andl $0x3,%edx
<BR>0x804eac7 <_start+17587>: je 0x804eadf <_start+17611>
<BR>0x804eac9 <_start+17589>: jp 0x804eada <_start+17606>
<BR>0x804eacb <_start+17591>: cmpl $0x2,%edx
<BR>0x804eace <_start+17594>: je 0x804ead5 <_start+17601>
<BR>0x804ead0 <_start+17596>: cmpb %dh,(%eax)
<BR>....
<BR>(gdb) break *0x804ea96
<BR>Breakpoint 2 at 0x804ea96
<BR>(gdb) c
<BR>Continuing.
<BR>
<BR>Breakpoint 2, 0x804ea96 in _start ()
<BR>(gdb) info reg eax
<BR>eax 0x8083dd0 134757840
<BR>(gdb) x/s 0x8083dd0
<BR>0x8083dd0: "I007"
<BR>
<BR>看来 "I007" 放在 0x8083dd0, 这个地址还存放到了 0x806e584
<BR>
<BR>(gdb) ni
<BR>....
<BR>
<BR>到第三次调用fl_get_input完回到0x804eabb时,我们知道了输入的信息存在在哪
<BR>
<BR>名称 值 地址
<BR>Name "I007" 0x8083dd0
<BR>Order number "B123456789" 0x809e850
<BR>Key "87654321" 0x809e880
<BR>
<BR>以下的一些反汇编代码中会有一些注释, 主要说明是执行到这样地方时一些情况,
<BR>也不一步步的ni了..
<BR>(gdb) disass 0x804eabb 0x804ffff
<BR>Dump of assembler code from 0x804eabb to 0x804ffff:
<BR>0x804eabb <_start+17575>: movl %eax,%ebx (eax: 0x809e880->""87654321") <BR>
<BR>0x804eabd <_start+17577>: movl %ebp,%edx (ebp: 0x809e850->"B123456789" <BR>)
<BR>0x804eabf <_start+17579>: movl %ebp,%eax
<BR>0x804eac1 <_start+17581>: addl $0x18,%esp
<BR>0x804eac4 <_start+17584>: andl $0x3,%edx
<BR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -