Author Topic: WINCE question  (Read 736 times)

0 Members and 1 Guest are viewing this topic.

Offline BicuricoTopic starter

  • Super Contributor
  • ***
  • Posts: 1725
  • Country: pt
    • VMA's Satellite Blog
WINCE question
« on: April 22, 2024, 09:53:57 am »
Hello,

I am exercising and entertaining my mind with firmware hacking: the usual process of writing a keygen or a patched FW, to enable all software options.

At this moment, I think I have everything needed, but I lack the hardware to test, hence my other post in the Test Equipment forum.

The exercise is purely academic and not to be made public. The device in question is discontinued - I mean no harm to the manufacturer.

The device runs on WINCE. I got a FW Update file, which is basically a *.CAB file. I was able to extract all files with some CAB extractor/compressor.

The main apps are made in .Net, which allowed me to look at the sources.

The question here is as follows:

I was really amazed that I could double click the executables and execute some of them (the others showed the error "CoreDLL not found", which makes sense). But how is it possible that my Windows 11 can run WINCE binaries? Some work just fine (if they don't rely on CoreDLL.dll)! Is this because the code is compiled to IL and hence works on any OS/CPU that has a IL runtime interpreter?

Also, is there any CoreDLL.dll for Windows 11, that would allow me to actually run the executables that need this?

Offline discomike

  • Contributor
  • Posts: 18
  • Country: se
Re: WINCE question
« Reply #1 on: April 29, 2024, 10:21:52 am »
Yes it's like you're assuming.

When building a .Net (C#/VB.net) executable for WinCe/Phone you target the .Net compact framework which is a subset of the normal desktop .Net framework. And the windows PE (.exe) format is platform agnostic so that is why you can have the same .exe and run it on x86 win10 as well as some MIPS WinCE 5.0 =) The IL get's compiled at runtime (or installation).

Some requirements for this to work properly is that the executable is flagged as re-targetable (some option during compilation, can maybe be patched afterwards) and you have to be aware to not use any feature that is not present in both versions of the .Net platform you target.

If you use any native code/dll, you can write your application to load different DLLs depending on what platform you're running on etc.

I used to do this as a quick solution when customers wanted to run some embedded applications we developed on the desktop, without having to provide support/deliveries/testing of a real desktop solution. One alternative here would be to use the mobile device emulator, but that used to be quite slow compared to this approach, but could help you if you need to run some native code.

You also had to be aware that some GUI controls etc behave slightly different depending on platforms and add a few workarounds/tweaks/etc.

Now it's been 10 years since I last touched this stuff, but I did save one customer from having to buy 300 new Android hand-scanners that would only be used for 6 months (during a system migration, of which later they would only need ~30 new units) using this trick (and writing a slim WinCE client for their old PDAs to connect to the new WEB/HTTP/REST back-end system).
 

Offline coromonadalix

  • Super Contributor
  • ***
  • Posts: 6105
  • Country: ca
Re: WINCE question
« Reply #2 on: April 29, 2024, 10:43:45 am »
I think you should discuss elsewhere,  hacking any windows or parts of it is not tolerated ... you may face mods ban or warnings


you have dedicated forums for this ...
 

Offline BicuricoTopic starter

  • Super Contributor
  • ***
  • Posts: 1725
  • Country: pt
    • VMA's Satellite Blog
Re: WINCE question
« Reply #3 on: April 29, 2024, 12:02:55 pm »
I don't see any issue. This is the embedded forum and we are talking about WinCE, which is for embedded devices.

The fact that the binaries run on a PC with Windows is within topic, I would say

Offline Postal2

  • Regular Contributor
  • *
  • Posts: 82
  • Country: ru
Re: WINCE question
« Reply #4 on: May 03, 2024, 12:06:43 am »
we are talking about WinCE
I am using Visual Studio wich binaries can be used for WinCE, Win98, WinXP, Win10,11...
 

Offline TomS_

  • Frequent Contributor
  • **
  • Posts: 845
  • Country: gb
Re: WINCE question
« Reply #5 on: May 05, 2024, 11:25:01 am »
I think you should discuss elsewhere,  hacking any windows or parts of it is not tolerated ... you may face mods ban or warnings


you have dedicated forums for this ...
Not tolerated by who?

If you think the post is out of line or inappropriate you can report it to the mods and let them make a determination.
 

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 3505
  • Country: ua
Re: WINCE question
« Reply #6 on: May 22, 2024, 10:23:17 am »
But how is it possible that my Windows 11 can run WINCE binaries? Some work just fine (if they don't rely on CoreDLL.dll)! Is this because the code is compiled to IL and hence works on any OS/CPU that has a IL runtime interpreter?

.net binaries just use EXE or DLL container to store IL byte code.
Actually such EXE/DLL has native jmp to mscoree.dll at entry point, which reads IL byte code, compile it and run.
Some platform may even don't run that native entry point, it just detect that this is .net assembly and read IL byte code, compile and run it.
« Last Edit: May 22, 2024, 10:25:17 am by radiolistener »
 

Offline BicuricoTopic starter

  • Super Contributor
  • ***
  • Posts: 1725
  • Country: pt
    • VMA's Satellite Blog
Re: WINCE question
« Reply #7 on: May 22, 2024, 03:04:57 pm »
How can I write such an application myself (*.exe binary made with Visual Studio that runs on WinCE 5.0)?

Do I need to install some old Visual Studio release, or can I do that with my current Visual Studio 2022? I would like to use C# and/or VB .net.

Offline Postal2

  • Regular Contributor
  • *
  • Posts: 82
  • Country: ru
Re: WINCE question
« Reply #8 on: May 22, 2024, 05:07:32 pm »
I don't use WinCE, I screenshotted some info for you.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf