Position:Home>Mobile Development> Windows CE process examines program DIY
Windows CE process examines program DIY
From;  Author:Stand originally
The article is written before in me " simulator and long-range debugging aids (2) " in the “Remote Process Viewer” of long-range debugging aids that told about PB to be taken oneself. Use this tool to be able to examine a few information of the course that running on actual platform on development platform, these information include process ID, sentence handle, base address, included line Cheng amount, and the information of every line Cheng (first step of Cheng of ID of the Cheng that be like a line, line, visit bolts) , the information of every DLL that still has whole process to load additionally (DLL file name, ID, use computation, base address, size, method) . This debugging aids debugs a program to using simulator, perhaps use card of string of mouth, net to join actual platform debugs a program for very effective. But show the weakness that gives it again in this debugging aids below some circumstances.



The software that runs below development Windows CE lets develop platform and actual platform link without necessary hour, not be all programs, all function after all need sheet to the pace dogs or examine memory variable in real time condition. And should use “Remote Process Viewer” , must be the same as development platform actual platform join to rise first, sometimes not only not necessary, waste time instead. For this, I wrote the debugging aids of a similar “Remote Process Viewer” designedly, just the “Remote” take out it. This tool name is “CEInfo” , can find on VCKBASE website, publish in VCKBASE additionally " VC knowledge base CD of edition of collect carefully of 5 years of elite " go up to also can be found. Because there is National X86 CPU only here, so this software is based on X86 to dictate collect is compiled. Can move on all CPU that support X86 instruction market, include the simulator of PB. Pursue below 1 be this tool advocate interface.


Graph 1 CEInfo advocate interface

A main API——Toolhelp that the article basically tells about a process to examine a program to use. Toolhelp API is located in in Toolhelp.DLL. Include 13 function and 5 constructions system. Use these you can write function to suit your to need already, suit oneself again the debugging aids of actual platform. Particular function statement expresses as follows:

Function function CreateToolhelp32Snapshot founds systematic snapshot, in parameter 2 middle finger decide the object of snapshot, the object includes Cheng of process, line, DLL, lot. Because of these objects inside the system live period the likelihood is very short, the data after forming snapshot so does not reflect true condition completely certainly. Function returns a power of snapshot. CloseToolhelp32Snapshot closes snapshot boy or girl friend. Parameter is a handle. Heap32First function obtains the first when caboodle interior appoints in appointing a process piece information. Information includes piece an address, piece size, piece the mark. Heap32Next and union of a function are used, obtain the next piece information. Heap32ListFirst function obtains the information of the first caboodle in appointing a process. Heap32ListNext and union of a function are used, obtain the information of next caboodle. Module32First function obtains the first module in appointing a process (DLL) information. The ID that information includes module, cite computation, head address, size, method. Module32Next and union of a function are used, obtain the information of next module. Process32First function obtains information of the first process in object of current system snapshot. Process32Next and union of a function are used, obtain the information of next course. Thread32First function obtains the information of Cheng of the first line in appointing a process. Information includes the line Cheng ID, first step, ID that founds this line Cheng, visit to bolt. Thread32Next and union of a function are used, obtain the information of next line Cheng. Toolhelp32ReadProcessMemory function obtains the data that memory area designates in appointing a process.

Previous12 Next