############################################################################################################
# D I S C L A I M E R                                                                                      #
#                                                                                                          #
# I am NOT responsible for any direct or indirect problems or damages caused by using this tool, and       #
# the instructions contained within it! If you brick your scope, that's YOUR problem, not mine.            #
# This was developed mostly as a curiosity, but I eventually polished my procedure to the point where it   #
# SHOULD be reproducible by others.                                                                        #
############################################################################################################

LiberateScope, a simple way to gain access to the WinCE dekstop on some Keysight (Agilent) oscilloscopes.
Tested on DSOX1102G.

Initial version written by Jason Gin on August 30, 2018. https://ripitapart.com
This is Version 2.0, written on September 3, 2018.
(This version does not need an external method to crash the scope. See below for more info.)

-[Information]----------------------------------------------------------------------------------------------

This batch file is designed to enable desktop access in Windows CE on the oscilloscope.
From then on, well, you decide. Just don't touch the paths "\Agilent Flash\" or "\Secure\" since these are
NON-VOLATILE storage locations (and they're hidden in Explorer anyway). Everything else is in RAM/ROM and
Windows CE will be reset to its defaults as configured by Keysight in the oscilloscope firmware image.

*** TAMPERING WITH THOSE FOLDERS AND THEIR CORRESPONDING FILES RISKS BRICKING THE SCOPE! ***
Copying these folders to a USB drive might be a good firmware backup (but I haven't tested restoring them).

-[Instructions] --------------------------------------------------------------------------------------------

You will need:
* USB hub
* USB Flash drive formatted to FAT/FAT32 with this batch file and "ShowTaskbar.exe" and "EnableLocalCmd.exe".
  These files MUST be in the root directory of the Flash drive and MUST NOT be renamed.
  I named this batch file "a.bat" for faster typing.
* USB keyboard
* USB mouse
* Fast typing skills! (You have only a few seconds before the Infiniivision software locks you out :3)

To use this batch file, follow these steps:
1. Connect the USB keyboard, mouse, and USB drive to a USB hub.
2. Connect the USB hub to the oscilloscope.
3. Power on the oscilloscope and wait for the splash screen to appear and the front panel LEDs to cycle.
4. Shortly after the LEDs begin to cycle, press these keys (Note, below is NOT a key combination):
   [Windows Key]
   [R]
   \usb\a.bat       (or whatever you have called this batch file, but a.bat is fast to type in)
   [ENTER]
5. Wait for the mouse pointer and the "Infiniivision encountered an unexpected error" crash screen.
   In a few moments, the crash screen will disappear, then the desktop and taskbar should appear.
6. Enjoy Windows CE and its Windows 95-esque interface. There isn't much here by default, though.
7. Optional: Run "PrepareDotNetInstall.exe" and then open the "NETCFv35.wce.armv4.cab" and "NETCFv35.Messages.EN.cab"
   files if you want to run programs that require the .NET Compact Framework and use a GUI. The default WinCE setup
   lacks the GUI components and they will otherwise crash with a "System.MissingMethodException" error.

Notes:
* This has only been validated on the DSOX1102G but I suspect this works on the whole 1000X lineup.
* Timing is key. You only have a few SECONDS between the LEDs cycling and the Infiniivision software starting up
  to do your thing. Don't be surprised if this takes a little practice.