x
This website is using cookies. We use cookies to ensure that we give you the best experience on our website. More info. That's Fine
HPC:Factor Logo 
 
Latest Forum Activity

wcecabinfo - Tool to extract info from cab files

1 2
Karpour Page Icon Posted 2022-01-17 8:46 PM
#
Avatar image of Karpour
Subscribers
H/PC Philosopher

Posts:
350
Location:
Austria
Status:
Voila! here's some example output

I pieced together the formatting of .reg files by making exports myself. Luckily 000 files can only contain 4 types of data types, SZ, MULTI_SZ, DWORD and BINARY

$ ./wcecabinfo -r ./HPCPRO~1.000
REGEDIT4 
 
[HKEY_CLASSES_ROOT\ieceimage\Shell\Open\Command] 
@="%InstallDir%\Image Expert CE.exe %1" 
 
[HKEY_CLASSES_ROOT\ieceimage\DefaultIcon] 
@="%InstallDir%\Image Expert CE.exe,-133" 
 
[HKEY_CLASSES_ROOT\.jpg] 
@="ieceimage" 
 
[HKEY_CLASSES_ROOT\.jpeg] 
@="ieceimage" 
 
[HKEY_CURRENT_USER\Software\Sierra Imaging\Image Expert CE] 
@="Image Expert CE" 
 
[HKEY_CURRENT_USER\Software\Sierra Imaging\Image Expert CE\Install] 
"Init"=dword:00000000 
"UseSysParams"=dword:00000001 
"Dev"="HP, Jornada;HP,Jornada" 
"oemdemo"=dword:00000001 
 
[HKEY_CURRENT_USER\Software\Sierra Imaging\Image Expert CE\State] 
"Path"="My Documents\images\Samples"
 Top of the page
C:Amie Page Icon Posted 2022-01-17 9:11 PM
#
Avatar image of C:Amie
Administrator
H/PC Oracle

Posts:
16,029
Location:
United Kingdom
Status:
Most excellent. Great job!
 Top of the page
Karpour Page Icon Posted 2022-01-18 3:26 PM
#
Avatar image of Karpour
Subscribers
H/PC Philosopher

Posts:
350
Location:
Austria
Status:
Almost ready for release!

JSON output looks like this (this .000 file doesn't create links, so no links entries), only thing left to do is add formatting for DWORD and hex reg keys in JSON mode.

For convenience you can also directly feed the program .cab files, in this case it will need to have cabextract installed since it uses it to get the .000 file

{ 
        "appName":      "Contact App Addin Dialer", 
        "provider":     "Microsoft", 
        "architecture": "MIPS", 
        "unsupported":  ["PALM PC"], 
        "minCeVersion": { 
                "minCeVersionMajor":    2, 
                "minCeVersionMinor":    0, 
                "minCeVersionString":   "2.0" 
        }, 
        "maxCeVersion": { 
                "maxCeVersionMajor":    2, 
                "maxCeVersionMinor":    1, 
                "maxCeVersionString":   "2.1" 
        }, 
        "directories":  [{ 
                        "id":   2, 
                        "path": "%CE3%" 
                }, { 
                        "id":   3, 
                        "path": "%CE2%" 
                }, { 
                        "id":   1, 
                        "path": "%CE2%" 
                }], 
        "files":        [{ 
                        "id":   1, 
                        "name": "dialer.dll", 
                        "directory":    "%CE2%" 
                }, { 
                        "id":   2, 
                        "name": "dtmf.dll", 
                        "directory":    "%CE2%" 
                }, { 
                        "id":   3, 
                        "name": "dtmf11.dll", 
                        "directory":    "%CE2%" 
                }, { 
                        "id":   4, 
                        "name": "dtmf22.dll", 
                        "directory":    "%CE2%" 
                }], 
        "registryEntries":      [{ 
                        "path": "HKEY_LOCAL_MACHINE\\Software\\Microsoft\\PowerToys\\Dialer", 
                        "name": "Version", 
                        "dataType":     "REG_DWORD", 
                        "value":        "\u0001" 
                }, { 
                        "path": "HKEY_LOCAL_MACHINE\\Software\\Microsoft\\PimApps\\PimExtensions\\Contacts\\Addins\\Dialer", 
                        "name": "Menu", 
                        "dataType":     "REG_SZ", 
                        "value":        "&Dial" 
                }, { 
                        "path": "HKEY_LOCAL_MACHINE\\Software\\Microsoft\\PimApps\\PimExtensions\\Contacts\\Addins\\Dialer", 
                        "name": "Dll", 
                        "dataType":     "REG_SZ", 
                        "value":        "dialer.dll" 
                }], 
        "links":        [] 
}
 Top of the page
Karpour Page Icon Posted 2022-01-19 8:51 PM
#
Avatar image of Karpour
Subscribers
H/PC Philosopher

Posts:
350
Location:
Austria
Status:
I'm happy to announce that I created a release for everyone to try!

The Windows build is here: https://github.com/HPC-Factor/windows-ce-cab-info/releases/download/...
If you need a Linux build and can't do it yourself please lmk!

Please test it with various cab files and let me know if you find any bugs!

For usage instructions, please refer to the readme file here: https://github.com/HPC-Factor/windows-ce-cab-info/blob/main/README.m...

Or type

wcecabinfo.exe -h


[EDIT]

Well now there's an issue! While I can cross-compile for Windows, cabextract isn't available as a native windows build. only for cygwin. I can probably substitute this for 7-zip.

What this means is that for now, this application (on Windows) will only work with .000 files, not .cab files, so you need to extract them first using 7zip or another program that can extract cabs.

Edited by Karpour 2022-01-19 9:27 PM
 Top of the page
C:Amie Page Icon Posted 2022-01-19 10:32 PM
#
Avatar image of C:Amie
Administrator
H/PC Oracle

Posts:
16,029
Location:
United Kingdom
Status:
There are third party libs you can use to stub it into the executable e.g.
https://www.codeproject.com/Articles/15397/Cabinet-File-CAB-Compress...

or there is (the horror of) good old win32:
https://docs.microsoft.com/en-us/windows/win32/devnotes/extracting-f...

Though I'm sure it's cleaner to make an external call to the shell to have an exec do it for you.
 Top of the page
Karpour Page Icon Posted 2022-01-20 12:59 AM
#
Avatar image of Karpour
Subscribers
H/PC Philosopher

Posts:
350
Location:
Austria
Status:
Success! I have now made a Windows build that uses 7zip

Also, 1 hour lost because I had to find out the hard way that you have to set file input streams to binary mode first.

Instructions

Download the binary:
https://github.com/HPC-Factor/windows-ce-cab-info/releases/download/...

Make sure 7-Zip is installed:
https://www.7-zip.org/

Add the directory that contains 7z.exe (probably C:\Program Files\7-Zip) to your PATH environment variable, here's a guide if you need one

Open the Command prompt, go to where wcecabinfo.exe is and try it on some cabs

wcecabinfo.exe cabfile.CAB
To get registry output:
wcecabinfo.exe -r cabfile.CAB
To get JSON output:
wcecabinfo.exe -j cabfile.CAB


Edited by Karpour 2022-01-20 1:09 AM
 Top of the page
Karpour Page Icon Posted 2022-01-20 8:36 PM
#
Avatar image of Karpour
Subscribers
H/PC Philosopher

Posts:
350
Location:
Austria
Status:
Interesting find! I tried compiling cabextract with mingw64 and it compiles just fine!
Makes me wonder why there are loads of builds available on the cabextract site, but no windows one.

This means that I can use cabextract both on linux and Windows as a way of extracting the .000 files, and possibly even completely do away with the external dependency and include libmspack, which cabextract uses under the hood.
 Top of the page
C:Amie Page Icon Posted 2022-01-20 9:27 PM
#
Avatar image of C:Amie
Administrator
H/PC Oracle

Posts:
16,029
Location:
United Kingdom
Status:
Why don't you fork a win32 build onto the GitHub? Sounds like a worthy find!
 Top of the page
1 2
Jump to forum:
Seconds to generate: 0.171 - Cached queries : 65 - Executed queries : 9
Server Time now is: Saturday, 22 January 2022 - 17:31