以下是我跟踪程序的主要跟踪过程,<br>被跟踪的程序是一个数据录入程序,但它是加密保存数据的,无法自己进行分析。<br>该程序主要跟踪用户的数据录入控件,并保存自己的备份:<br><br>procedure TForm1.FormCreate(Sender: TObject);<br>var<br> ss:tstringlist;<br> i,dow:integer;<br> s:string;<br> t:ttimestamp;<br><br>begin<br> datafile:='';<br> ss:=tstringlist.create;<br> ss.loadfromfile('people.txt');<br> for i:=1 to ss.count-1 do<br> listbox2.Items.add(ss.strings[i-1]);<br> ss.free;<br> d:=date;<br> dow:=dayofweek(d);<br> t:=datetimetotimestamp(d);<br> t.date:=t.date-6-dow;<br> d:=timestamptodatetime(t);<br> datetimepicker1.date:=d;<br><br> listbox2.itemindex:=0;<br> p:=GetWindow(getdesktopwindow,GW_child);<br> while (p<>0) do<br> begin<br> setlength(s,100);<br> GetwindowText(p,pchar(s),100);<br>// listbox1.Items.add(s);<br> setlength(s,100);<br> GetClassName(p,pchar(s),100);<br>// listbox1.Items.add(s);<br> setlength(s,16);<br> if s='ThunderRT6FormDC' then break;<br> p:=GetWindow(p,GW_HWNDNEXT);<br> end;<br><br> if not(s='ThunderRT6FormDC') then<br> begin<br> showmessage('Traced Program not run!');<br> application.terminate;<br> end;<br> pp:=p;<br> chd:=p;<br> p:=GetWindow(chd,GW_child);<br> while (p<>0) do<br> begin<br> setlength(s,100);<br> GetwindowText(p,pchar(s),100);<br>// listbox1.Items.add(s);<br> setlength(s,100);<br> GetClassName(p,pchar(s),100);<br>// listbox1.Items.add(s);<br> setlength(s,22);<br> if s='ThunderRT6PictureBoxDC' then break;<br> p:=GetWindow(p,GW_HWNDNEXT);<br> end;<br><br><br> chd:=p;<br> p:=GetWindow(chd,GW_child);<br> while (p<>0) do<br> begin<br> setlength(s,100);<br> GetwindowText(p,pchar(s),100);<br>// listbox1.Items.add(s);<br> setlength(s,100);<br> GetClassName(p,pchar(s),100);<br>// listbox1.Items.add(s);<br> setlength(s,23);<br> if s='ThunderRT6UserControlDC' then<br> begin<br> break;<br>// nn:=nn+1;<br> // if (nn=2) then break;<br> end;<br><br> p:=GetWindow(p,GW_HWNDNEXT);<br> end;<br><br> bringwindowtotop(pp);<br> chd:=p;<br> p:=GetWindow(chd,GW_child);<br> while (p<>0) do<br> begin<br> setlength(s,100);<br> GetwindowText(p,pchar(s),100);<br>// listbox1.Items.add(s);<br> setlength(s,100);<br> GetClassName(p,pchar(s),100);<br>// listbox1.Items.add(s);<br> setlength(s,21);<br> if<br> //((length(trim(s))=21) and<br> (s='ThunderRT6UserControl') then<br> break;<br> p:=GetWindow(p,GW_HWNDNEXT);<br> end;<br>//////////////////////////////////////////////<br> chd:=p;<br> listbox1.clear;<br> p:=GetWindow(chd,GW_child);<br>{<br> sendmessage(p,wm_mouseactivate,wparam(pp),lparam(MA_ACTIVATE *256*256+HTCLIENT));<br> sendmessage(p,wm_setcursor,wparam(chd),lparam(MA_ACTIVATE *256*256+HTCLIENT));<br> sendmessage(p,wm_lbuttondblclk,wparam(mk_lbutton),lparam(10*256*256+10));<br> sendmessage(p,wm_lbuttonup,wparam(mk_lbutton),lparam(10*256*256+10));<br>// sendmessage(p,wm_lbuttondblclk,wparam(mk_lbutton),lparam(50*256+50));<br>// sendmessage(p,wm_lbuttonup,wparam(mk_lbutton),lparam(50*256+50));<br>}<br><br>