Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET
Hello.. I am interested to know how its possible to output the api calls of a windows executable to a textbox or win forms control.
 
here is a bit of output from a sandbox analyzer which is the type of output I am looking for
 
Executing: C:\Program Files (x86)\TeamViewer\Version8\TeamViewer.exe
VirtualAllocEx(C:\Program Files (x86)\TeamViewer\Version8\TeamViewer.exe, MEM_COMMIT MEM_RESERVE MEM_TOP_DOWN, PAGE_READWRITE, RegionSize=0x000C2000) [c:\program files (x86)\teamviewer\version8\teamviewer.exe]
LoadLibrary(AVICAP32.dll) [c:\program files (x86)\teamviewer\version8\teamviewer.exe]
LoadLibrary(WINMM.dll) [c:\program files (x86)\teamviewer\version8\teamviewer.exe]
LoadLibrary(VERSION.dll) [c:\program files (x86)\teamviewer\version8\teamviewer.exe]
LoadLibrary(MSVFW32.dll) [c:\program files (x86)\teamviewer\version8\teamviewer.exe]
LoadLibrary(SHELL32.dll) [c:\program files (x86)\teamviewer\version8\teamviewer.exe]
LoadLibrary(SHLWAPI.dll) [c:\program files (x86)\teamviewer\version8\teamviewer.exe]
LoadLibrary(COMCTL32.dll) [c:\program files (x86)\teamviewer\version8\teamviewer.exe]
LoadLibrary(WINSPOOL.DRV) [c:\program files (x86)\teamviewer\version8\teamviewer.exe]
LoadLibrary(COMDLG32.dll) [c:\program files (x86)\teamviewer\version8\teamviewer.exe]
LoadLibrary(WS2_32.dll) [c:\program files (x86)\teamviewer\version8\teamviewer.exe]
LoadLibrary(NSI.dll) [c:\program files (x86)\teamviewer\version8\teamviewer.exe]
LoadLibrary(MSWSOCK.dll) [c:\program files (x86)\teamviewer\version8\teamviewer.exe]
LoadLibrary(MSIMG32.dll) [c:\program files (x86)\teamviewer\version8\teamviewer.exe]
LoadLibrary(MPR.dll) [c:\program files (x86)\teamviewer\version8\teamviewer.exe]
LoadLibrary(NETAPI32.dll) [c:\program files (x86)\teamviewer\version8\teamviewer.exe]
LoadLibrary(netutils.dll) [c:\program files (x86)\teamviewer\version8\teamviewer.exe]
LoadLibrary(srvcli.dll) [c:\program files (x86)\teamviewer\version8\teamviewer.exe]
LoadLibrary(wkscli.dll) [c:\program files (x86)\teamviewer\version8\teamviewer.exe]
LoadLibrary(BROWCLI.DLL) [c:\program files (x86)\teamviewer\version8\teamviewer.exe]
LoadLibrary(SCHEDCLI.DLL) [c:\program files (x86)\teamviewer\version8\teamviewer.exe]
LoadLibrary(SAMCLI.DLL) [c:\program files (x86)\teamviewer\version8\teamviewer.exe]
 
I know my question is a bit vague but I am wanting to learn how to achieve this output in vb.net
 

thank you in advance..
Posted 12-Apr-13 6:17am
Dale 20121.8K
Comments
Sergey Alexandrovich Kryukov at 12-Apr-13 12:33pm
   
Well, very interesting question. :-) My 5 for this post.
—SA
Dale 2012 at 12-Apr-13 12:41pm
   
Is there a way to hook the windows messaging service to output the API calls of a executable to a textbox or am I off course?

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Take a look at
Microsoft Research: Detours[^]
You could intercept the API calls of interest and add code to put the log output to your TextBox or however you want to log them.
We used this for injecting/testing specific failures to the calls in addition to logging the call with it's arguments.
  Permalink  
Comments
Dale 2012 at 13-Apr-13 10:00am
   
How were you able to intercept the API calls?... this was my original question and then output it to a textbox?... is there not some way pragmatically to accomplish this?
Steve44 at 13-Apr-13 17:04pm
   
In our case we identified a DLL the app was loading and we replaced it with a modified version that was using Detours to inject the API interceptions. Then we used shared memory to configure the failures we wanted to force and were logging to a different memory buffer.
An external app was reading a database to configure the failure injections and reading the logging buffer, putting the results back into the database. In your case you could have this external app just populate the TextBox with the contents of the log buffer.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web03 | 2.8.140709.1 | Last Updated 12 Apr 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid