WINCE question - Page 1
Forum section: electronics / general

author: Bicurico
author_rank: Super Contributor
timestamp: April 22, 2024, 09:53:57 am
content: 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?

author: discomike
author_rank: Contributor
timestamp: April 29, 2024, 10:21:52 am
content: 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).

author: coromonadalix
author_rank: Super Contributor
timestamp: April 29, 2024, 10:43:45 am
content: I think you should discuss elsewhere, hacking any windows or parts of it is not tolerated ... you may face mods ban or warningsyou have dedicated forums for this ...

author: Bicurico
author_rank: Super Contributor
timestamp: April 29, 2024, 12:02:55 pm
content: 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

author: Postal2
author_rank: Frequent Contributor
timestamp: May 03, 2024, 12:06:43 am
content: Quote from: Bicurico on April 29, 2024, 12:02:55 pmI am using Visual Studio wich binaries can be used for WinCE, Win98, WinXP, Win10,11...

author: TomS_
author_rank: Frequent Contributor
timestamp: May 05, 2024, 11:25:01 am
content: Quote from: coromonadalix on April 29, 2024, 10:43:45 amNot 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.

author: radiolistener
author_rank: Super Contributor
timestamp: May 22, 2024, 10:23:17 am
content: Quote from: Bicurico on April 22, 2024, 09:53:57 am.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.

author: Bicurico
author_rank: Super Contributor
timestamp: May 22, 2024, 03:04:57 pm
content: 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.

author: Postal2
author_rank: Frequent Contributor
timestamp: May 22, 2024, 05:07:32 pm
content: I don't use WinCE, I screenshotted some info for you.