Thursday, February 28, 2008

Windows Mobile Trojan

WindowsForDevices post an article on the first trojan discovered by MacAfee's Avert Lab on WiMo devices. This trojan opens security permission on the device and can contaminate other devices using SDCards.

Read full article ...

- Nicolas

Tuesday, February 26, 2008

Readers contribution

First of all, thanks all for your fidelity.

To exactly match your expectation in term of content, I'm opening a suggestion emailbox to submit your questions and ideas for the next articles to publish on this blog.

You can send your requests to : nbesson DOT blog AT gmail DOT com
Again, thanks for your help.

- Nicolas

Tuesday, February 19, 2008

Smart Device deployment and debugging using VS2005

When developing smart device application, in C# or C++ (Win32 or MFC) using Visual Studio 2005, you have different solutions for the deployment and debugging of your application.

ActiveSync :

This is the easiest way as it just required the support of ActiveSync in your Run Time image and a Serial or USB Function interface correctly setup. When connecting the device to you development computer ActiveSync should start and connect to the device. VS2005 is setup to use the ActiveSync link automatically for the deployment and debugging. No particular actions are required for this connection type.


If you have the chance to have a KITL connection between the device and Platform Builder, you can directly use this connection with another instance of VS2005.


Before been able to use the KITL connection from VS2005, you have to create and setup a device configuration. To do so you have to open the Connectivity Options window in the VS2005 instance running the Platform Builder plug-in. Use the Create Device button to add a new device to the list of devices identified by Platform Builder. Associate this new device to an SDK if you got one or to the Generic Platform Builder OSDesign in the drop list as shown bellow.

Then select this new device and setup the Transport and Download information as you are usually doing it with your target device. Then attach and download the Runtime image to the target. This VS2005 instance will be use to debug the OS, and not your application. You will be able to add break point in the drivers and/or OAL.


In the second VS2005’s instance start/load your application solution and go to the Tools menu followed by Options then Device Tools group, select Devices, select the device created previously in the list and edit the Properties. Check that the Transport configuration is KITL. Validate all the open windows and close.

Now your system is ready to deploy and debug your application on the device using the KITL layer.

Corecon :

Corecon use the network interface to communicate with Visual Studio and requires to launch two applications on the device, but before you need least the following files on your device:

  • clientshutdown.exe
  • CMAccept.exe
  • ConmanClient2.exe
  • DeviceDMA.dll
  • eDbgTL.dll
  • TcpConnectionA.dll

Those files can be directly integrated in the nk.bin using the project.bib file or copied on the device at runtime using USB flash key or FTP connection.

Those files are not provided directly with the Windows Embedded CE 5.0/6.0 development environment, but are located in the VS2005 folders in the folder :

c:\Program Files\Microsoft Shared\CoreCon\1.0\Target\wce400\ProcessorType\

Binary versions are available for all processors supported by WinCE (ProcessorType).


The two applications, CMAccept and Conmanclient2 have to be launched manually when a connection to VS2005 is required. To do so you have to get a way to launch them, using the explorer window on the device, or using a telnet connection. You will also need the IP address of your device to correctly setup VS2005 connection. Without this IP address VS2005 would not be able to connect to the device.

Launch and connect

Under VS2005 you have to select and edit the device connection property by going to the menu Tools followed by Options then Device Tools group, select Devices, select the device in the list and edit the Properties.

In the Properties window select the Transport as TCP Connect Transport and then Configure. In the Configure window check the Use Specific IP address andx enter the IP address of the device. Validate all the open windows and close.

On the device you have to launch the ConmanClient2 application, followed by CMAccept. At this time you have approximately 3 minutes to connect the VS2005/2008 instance with your target. Elapsing this time you will have to launch the CMAccept application again before trying to connect.

In the VS2005, select the device in the device drop box list and click on Tools followed by Connect To Device. The connection may succeed and you should be able to start the deployment and/or debugging.

Those three configuration are using different communication layers but will provide the same set of functionalities for the deployment and debugging of Smart Device applications.

[Updated on 02/19/2008]
For the Windows Mobile user, to get all the steps for those platforms, you can check out the article on the Fabien blog.

- Nicolas

Monday, February 18, 2008

Catalog item notification

BSP components (drivers, or custom applications) require some attention from the user and should notify him. A catalog description of a you can easily integrates a notification messages that will show up when user will add this component to the OSDesign, like the one displayed when adding the FTP server or Telnet server to an OSDesigns.

By adding that kind of notification message Platform Builder will also display an exclamation mark icon next to the check box of the catalog component. The notification message and title can personalized, for that add to a specific component the Notification Html (body message) and the Notification Title (shown in bold in the notification window) as shown bellow.

- Nicolas

Monday, February 11, 2008

Dynamic JIT Debugging [Updated]

Booting a device with the debugger is sometime a real challenge due to the stability of the device. So loading the debugger later could be the solution. To do so, we have to include the JIT debugger files in the Windows Embedded CE binary image, to launch it when required.
If the debugger is not launched exceptions are not handled correctly, and second chance exceptions neither.

Inclusion of the JIT Debugger
In the project.bib file of the current OSDesign, add the following lines in the FILES section :
kd.dll $(_FLATRELEASEDIR)\kd.dll NK SHK
osaxst0.dll $(_FLATRELEASEDIR)\osaxst0.dll NK SHK
osaxst1.dll $(_FLATRELEASEDIR)\osaxst1.dll NK SHK

The files are added to the FILES instead of the MODULE section to ensure that the debugger will not be launched 'till you launch it manually.
[Update 07/25/08] You can also include the loaddbg.exe file to the runtime image to avoid the loading of this files over KITL. But do not include hd.dll, otherwise the debugger will be started automatically at startup.

OSDesign configuration
Select the following options for the OSDesign:
- Unselect Kernel debugger
- Enable KITL

Launch the debugger
To launch the debugger when required, you just have to launch the loaddbg.exe application using the target control window.
s loaddbg.exe
Note : When activating the debugger, the system may take few seconds load all the symbols files from your hard drive.

- Nicolas