CAB Quiz

If you know much about me, you probably know that simple doesn’t excite me.  I like problems that are interesting yet tough to solve.  A year or more ago or so I decided that I really needed to know how CAB files work.  If you do much work creating CE devices you’re familiar with the frustration of trying to include some third party package in your device image, but all you have is a CAB.  So you have to find all of the files, folders registry entries and the like that the CAB creates – usually through a process of elimination.


Well I knew that a CAB file has to contain that info, and experience had told me that just unpacking the CAB gives you all of the files (though with mangled names).  So I started playing in my free time reverse engineering how they’re packed up.  Like many of my side projects, I’d tabled the project a couple months ago due to a lack of time and paying work that needed doing.  That was until this week, when I needed to combine a third-party CAB with a customer’s app to give them a single-CAB deployment.  I spent a couple days working on the tool to get it to generate an INF file that was compatible with CABWIZ.  And that brings us to the quiz.  The following is an output from the tool – right from the source 3rd party CAB.  If I run this and the files into CABWIZ I get the came CAB back out that installs on the device as expected.  Any guess on what the CAB is (yes it’s so easy it’s a rhetorical question)?


; +————————————————-+
; | INF Generated by OpenNETCF CABConstructor       |
; | visit
http://www.OpenNETCF.com for product info |
; +————————————————-+


[Version]
Signature=”$Windows NT$”
CESignature=”$Windows CE$”
Provider=”Microsoft”


[CEStrings]
AppName=”.NET CF 2.0″
InstallDir=”%CE2%”


[DefaultInstall]
AddReg=”RegKeys”
CESetupDLL=”NETCF_~1.dll”
CopyFiles=”Destination3″,”Destination2″


[CEDevice]
VersionMin=”4.0″
VersionMax=”4.999″
BuildMax=”0xE0000000″
UnsupportedPlatforms=”HPC”,”JUPITER”,”SMARTPHONE”


[SourceDisksNames]
1=,”SRCFILES”,,SourceFiles


[SourceDisksFiles]
“00System.008″=1
“0mscoree.006″=1
“0NETCFv2.000″=1
“cgacutil.005″=1
“CGACUT~1.021″=1
“CUSTOM~1.020″=1
“MICROS~1.018″=1
“MICROS~2.017″=1
“MICROS~4.019″=1
“MSCORE~1.002″=1
“MSCORE~1.022″=1
“mscorlib.007″=1
“NETCF2~1.001″=1
“NETCFA~1.003″=1
“NETCFD~1.004″=1
“NETCF_~1.dll”=1
“NETCF_~1.dll”=1
“SY40C7~1.014″=1
“SY4317~1.016″=1
“SY726F~1.010″=1
“SY9B57~1.013″=1
“SYC6B2~1.011″=1
“SYSTEM~1.015″=1
“SYSTEM~3.009″=1
“SYSTEM~4.012″=1
“_setup.xml”=1


[DestinationDirs]
Destination3=0,”%CE2%.NET CF 2.0″
Destination2=0,”%CE2%”


[Destination3]
“mscorlib.dll”,”mscorlib.007″,,0x40000001
“System.dll”,”00System.008″,,0x40000001
“System.Drawing.dll”,”SYSTEM~3.009″,,0x40000001
“System.Messaging.dll”,”SY726F~1.010″,,0x40000001
“System.Web.Services.dll”,”SYC6B2~1.011″,,0x40000001
“System.Windows.Forms.dll”,”SYSTEM~4.012″,,0x40000001
“System.Windows.Forms.DataGrid.dll”,”SY9B57~1.013″,,0x40000001
“System.Xml.dll”,”SY40C7~1.014″,,0x40000001
“System.Net.IrDA.dll”,”SYSTEM~1.015″,,0x40000001
“System.Data.dll”,”SY4317~1.016″,,0x40000001
“Microsoft.VisualBasic.dll”,”MICROS~2.017″,,0x40000001
“Microsoft.WindowsCE.Forms.dll”,”MICROS~1.018″,,0x40000001
“Microsoft.WindowsMobile.DirectX.dll”,”MICROS~4.019″,,0x40000001
“CustomMarshalers.dll”,”CUSTOM~1.020″,,0x40000001
“cgacutil.exe.-410~-410~ARMV4″,”CGACUT~1.021”,,0x40000001
“mscoree.dll.-410~-410~ARMV4″,”MSCORE~1.022”,,0x40000001


[Destination2]
“netcf2_0license.txt”,”NETCF2~1.001″,,0x40000001
“MSCOREE2_0.dll”,”MSCORE~1.002″,,0x40000001
“netcfagl2_0.dll”,”NETCFA~1.003″,,0x40000001
“netcfd3dm2_0.dll”,”NETCFD~1.004″,,0x40000001
“cgacutil.exe”,”cgacutil.005″,,0xA0000001
“mscoree.dll”,”0mscoree.006″,,0xA0000001


[RegKeys]
HKLM,”GACPath”,””%InstallDir%””,0x00000000,”%InstallDir%”


 

4 thoughts on “CAB Quiz”

  1. I haven’t been able to find CABConstructor on the OpenNetCF .org or .com site. Does that mean it’s not available? All I really want to do is read the source file location of the shortcuts created by the cab. Any tips on reading the information from the CAB file?

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s