dependency checker - Windows Mobile Development and Hacking General

So you extract files from a rom and you find a program or dll that you want to use, but you don't know what other files it requires. Is there a tool available to scan the file to see what symbols it references and then scan the other files for that symbol?

hannip said:
So you extract files from a rom and you find a program or dll that you want to use, but you don't know what other files it requires. Is there a tool available to scan the file to see what symbols it references and then scan the other files for that symbol?
Click to expand...
Click to collapse
Any PE viewer or disassembler will tell you the imports used by the dll or the prog. If you have VStudio, just look for dependency walker.
Cheers,
.Fred

Awesome, thanks dotfred!

The Dependency Checker tool from the Windows SDK (big Windows, not CE) will handle CE executables.

Related

search path for dll's

Say I wanted to install a new version of poutlook on a device. If I install the exe in a folder outside of \windows along with any dependant dll's will the OS search for these dll's in the run dir and use them over the ones in \windows?
Yes. Dll search path on Windows Mobile are run dir, windows, root. Not sure about the order of the last two but run dir is definitely first. This behavior is inherited from desktop windows.
hannip said:
Say I wanted to install a new version of poutlook on a device. If I install the exe in a folder outside of \windows along with any dependant dll's will the OS search for these dll's in the run dir and use them over the ones in \windows?
Click to expand...
Click to collapse
The search dll path is always first in the application directory, then in the system directories. So it should work...
Cheers,
.Fred
That's good news. Thanks!
Also, you can add your own system path directories (to look for DLL's) at HKEY_LOCAL_MACHINE\ Loader\SystemPath ; see links in http://www.pocketpcmag.com/blogs/menneisyys/UltimateRoundupOfRegistryEditors.asp for more info
Menneisyys said:
Also, you can add your own system path directories (to look for DLL's) at HKEY_LOCAL_MACHINE\ Loader\SystemPath ; see links in http://www.pocketpcmag.com/blogs/menneisyys/UltimateRoundupOfRegistryEditors.asp for more info
Click to expand...
Click to collapse
You could add my registry editor...
Cheers,
.Fred

Extract .dll from .cab

Excuse me for beeing a newbie, but can't seem to fin any way to extract the .dll and .gif files from a cab file. For example I downloaded CrossbowPhonepad.zip from http://forum.xda-developers.com/showthread.php?t=292014&highlight=media+player+skin
But I'm not quite happy with the way it looks and I would like to start to play and alter with it. But when I extract the .Cab file all i get is strange .012-fil and so on. And of course the .XML file where you se how the .dll and .gif files shall be installed.
How to I extract them (.dll and . gif) from the .Cab file??
I'v tried Winrar, Winace, Total commander.
Please Help
the simplist way
Have you tried cabdump.pl (it can be found on the XDA-Wiki, main wiki page->complete tool list -> RomTools->cabdump.pl)
But I've found the simplest way is to install the cab on your device, and then copy the files you're interested in to your pc.
There is an excellent, easy to use program called MSCEInf that allows you to work with CAB files, including drag and drop extraction of files - with their original names - from CAB installation files. It's available here:
http://www.freewareppc.com/utilities/msceinf.shtml
It's developed by a Frenchman named Benoît Thonnart.
You should also try WinCE Cab Manager.
But generally WinRar works fine. The files in the cab are simply renamed to 8.3 convention with extension showing the file number. Extract the xml and you will see what name belongs to what file. Just extract and rename.
Thanx gues...that really helped

Build Cab File of an app

Hey Guys!
How can i Build a cab for my programs in vs2005 or have i to use another tool to do this?
thanks SciLor
WinCe cab manager does the job.
its not free though.
but its worth it
isnt there another tool i can use?
look in the Visual studio's help file on making an installer..i cant remember now but i did create a cab once..btw which version of VS do u use
This is from My VS 2008 Pro Documentation
This section describes creating CAB files for distributing ATL and MFC controls over the Internet. If you need more information about CAB files, see the Cabinet File Reference in the Windows SDK documentation (in MSDN Library/Setup and System Administration/Setup/Setup API/Overview/Cabinet Files).
To create a CAB file:
Create an INF file.
Run the CABARC utility.
Creating an INF File
The INF file is a text file that specifies the files (such as DLLs or other OCXs) that need to be present or downloaded for your control to run. An INF file allows you to bundle all the needed files in one compressed CAB file. By default, files with the same version numbers as existing files on the user's hard disk will not be downloaded. For more information about INF files and their options, including how to create platform-independent INF files, see About INF Files and Using INF Files in the Windows SDK documentation (in MSDN Library/Setup and System Administration/Setup/Setup API/Overview/Setup Applications).
As an example, the following INF will be used to create a CAB file for the ATL Polygon control. You can build POLYGON.DLL by downloading the ATL POLYGON sample files from the Visual C++ CD and building a MinSize version. If you build a MinSize version of the Polygon control, you need one additional DLL, ATL.DLL. Since ATL.DLL needs to be registered before POLYGON.DLL, put the ATL.DLL first in the INF file:
Copy Code
; Sample INF file for POLYGON.DLL
[version]
; version signature (same for both NT and Win95) do not remove
signature="$CHICAGO$"
AdvancedINF=2.0
[Add.Code]
polygon.dll=polygon.dll
atl.dll=atl.dll
; needed DLL
[atl.dll]
file-win32-x86=thiscab
FileVersion=2,00,0,7024
DestDir=11
RegisterServer=yes
[polygon.dll]
file-win32-x86=thiscab
clsid={4CBBC676-507F-11D0-B98B-000000000000}
FileVersion=1,0,0,1
RegisterServer=yes
; end of INF file
This INF specifies that ATL.DLL with the given version needs to be installed on the system. If ATL.DLL doesn't exist already on the system, it will be downloaded from the CAB file created with this INF. "thiscab" is a keyword meaning the CAB containing this INF. You can also download a needed DLL from an HTTP location by specifying an absolute or relative path, for example:
Copy Code
file-win32-x86=http://example.microsoft.com/mydir/NEEDED.DLL
The keyword "file-win32-x86" identifies the platform as x86 specific.
You can get the version number of a file by clicking the right mouse button on the file in Windows Explorer. Select Properties from the list that appears, then select the Version tab on the dialog box that appears. You will sometimes need to insert an extra 0 in the file version. For example, the version number for the ATL.DLL is shown as 2.00.7024 in the dialog box. This becomes 2, 00, 0, 7024 in the INF file.
The "DestDir" is where the directory where the file will be loaded: 11 specifies the system directory WINDOWS/SYSTEM or WINNT/SYSTEM32; 10 specifies the windows directory, WINDOWS or WINNT. If no DestDir is specified (typical case), code is installed in the fixed OCCACHE directory.
The "clsid" is the CLSID of the control to be installed.
Once you have created an INF file, run the CABARC utility (available in the Mssdk\Bin directory) to create the CAB file. You should run CABARC in the directory that contains your source files. On the command line, put the source files in the order they appear in the INF and the INF file last. For example, to make a CAB file for the Polygon control from the INF above, use the following command:
Copy Code
C:\MSSDK\BIN\CABARC -s 6144 POLYGON.CAB ATL.DLL POLYGON.DLL POLYGON.INF
The POLYGON.CAB file contains a compressed version of ATL.DLL and POLYGON.DLL along with the information needed to extract them in the POLYGON.INF file.
For an example of how to parse and extract component files from CAB files, see the CabView sample in the MSDN Online Code Center at http://msdn.microsoft.com/visualc/downloads/samples.asp (select the CabView link).
The DLL files you need to include with an MFC control are MSVCRT.DLL, MFC42.DLL, and OLEPRO32.DLL.
Running the CABARC Utility
The CABARC utility is available in the Mssdk\Bin directory. For example:
Copy Code
C:\MSSDK\BIN\CABARC -s 6144 n MYCTL.CAB NEEDED1.DLL NEEDED2.DLL MYCTL.OCX MYCTL.INF
CABARC creates a CAB file called MYCTL.CAB.
You should run CABARC in the directory that contains your source files (the INF, OCX, and DLL files). The files to be archived in the CAB file should be listed on the command line in the same order they are listed in the INF file. In the example above, the INF file should list NEEDED1.DLL first, then NEEDED2.DLL, and then MYCTL.OCX.
The -s option reserves space in the cabinet for code signing. The n command specifies that you want to create a CAB file. For a list of CABARC commands and options, type CABARC alone on the command line:
Copy Code
C:\MSSDK\BIN\CABARC
Click to expand...
Click to collapse
I found an older version of this online:
http://www.aperitto.com/content/view/14/159/
I have version 2.0 and it works great without registering the copy. Look into it
I can't find the original setup I used... sorry, I will keep looking... but I've heard good things about SPB's installatation creator
http://www.spbsoftwarehouse.com/products/ezsetup/index.html?en
It is easy with VS 2008 there you can create a CAB Builder

Cooking SDKCERT in ROM

Hallo everybody,
I just want to ask how I can built in SDKCERT directly into ROM.If I want to convert SDKCERT.CAB to EXT then after I have again CAB so newerending story.
You won't need to use the SDKCERT package. If you are using Ervius Visual Kitchen for example, all you need to do is ensure that Disable Cert(ificate) checking is selected. This way, your compiled ROM will already have Certificate checking disabled allowing you to install updated drivers and such.
This tutorial discusses some of the changes you'll likely need to make:
http://forum.xda-developers.com/showthread.php?t=526610
HTH,
if you still need it ,here its is. just add to any package.
faria said:
if you still need it ,here its is. just add to any package.
Click to expand...
Click to collapse
Thank you very much!!!
Johan Kraczmar said:
Thank you very much!!!
Click to expand...
Click to collapse
Np.
Here is a little tip for future...
most certificates are in cab form,open the cab with winrar,you will see a file called;_setup.xml, that is the cert info.
just rename _setup.xml to mxip_999_certname.provxml and you done.
faria said:
if you still need it ,here its is. just add to any package.
Click to expand...
Click to collapse
Did I understand correctly that I would need to add this to each package that needs a certificate?
Thanks
He said that you need to add this in every cab that need certificates, if you use EVK or Oskitchen you dont need anything because they auto patch the certs.
Lewy1 said:
Did I understand correctly that I would need to add this to each package that needs a certificate?
Thanks
Click to expand...
Click to collapse
af974 said:
He said that you need to add this in every cab that need certificates, if you use EVK or Oskitchen you dont need anything because they auto patch the certs.
Click to expand...
Click to collapse
Thanks. The problem is that I've tried quite a few times to install the Vogue Camera as an EXT with EVK, and I always end up with the "The file 'camera' cannot be opened. Either is not signed with a trusted certificate or one of it's components cannot be found." etc.
Did you tried the solution in post #3?
For which device are you trying to install?...from Vogue to -> ?
Sometimes from different devices isnt a certificate fault but some missing dll.
Check for this app Dependency walker and search if you have all the modules to make run camera Vogue.
Lewy1 said:
Thanks. The problem is that I've tried quite a few times to install the Vogue Camera as an EXT with EVK, and I always end up with the "The file 'camera' cannot be opened. Either is not signed with a trusted certificate or one of it's components cannot be found." etc.
Click to expand...
Click to collapse
Lewy1 said:
Thanks. The problem is that I've tried quite a few times to install the Vogue Camera as an EXT with EVK, and I always end up with the "The file 'camera' cannot be opened. Either is not signed with a trusted certificate or one of it's components cannot be found." etc.
Click to expand...
Click to collapse
Hi Lewy1,
You are missing a package dependency. If you navigate to the .\Windows folder using File Explorer on your device and try and launch the Camera application, you will encounter an error - confirming that you have dependency issue.
Have a look at this post:
http://forum.xda-developers.com/showpost.php?p=4259031&postcount=1070
HTH,
Lewy1 said:
Thanks. The problem is that I've tried quite a few times to install the Vogue Camera as an EXT with EVK, and I always end up with the "The file 'camera' cannot be opened. Either is not signed with a trusted certificate or one of it's components cannot be found." etc.
Click to expand...
Click to collapse
Yeah, that is just a generic error message, and it almost never has anything to do with certs. You could be missing dependencies, or it could just be that you have a broken shortcut. One of the problems with the 6.5 start menu is that you can't always tell just by looking that the shortcut is effed, because you may have an ico assigned through the registry. Use Total Commander to see if you have the correct shortcut path.
hilaireg said:
Hi Lewy1,
You are missing a package dependency. If you navigate to the .\Windows folder using File Explorer on your device and try and launch the Camera application, you will encounter an error - confirming that you have dependency issue.
Have a look at this post:
http://forum.xda-developers.com/showpost.php?p=4259031&postcount=1070
HTH,
Click to expand...
Click to collapse
Farmer Ted said:
Yeah, that is just a generic error message, and it almost never has anything to do with certs. You could be missing dependencies, or it could just be that you have a broken shortcut. One of the problems with the 6.5 start menu is that you can't always tell just by looking that the shortcut is effed, because you may have an ico assigned through the registry. Use Total Commander to see if you have the correct shortcut path.
Click to expand...
Click to collapse
First of all, thanks guys for your help!
Yes, your right that the problem is also when I try launching the camera from the windows directory. Now the problem is that I don't understand too much when it comes to digging into the contents of these files, so I think I'll need some help.
I assumed I needed Dependency Walker which you wrote about in your Kitchen Utensils review, so I opened the camera.exe and the results are attached as a Dependency Walker Image. The camera EXT I have come from converting a cab that's been floating around XDA. By the way I had the same problem when using the mega camera.
Thanks so much for the patience and help.
Had a look at the .DWI file you attached. Your next steps:
Create a folder on your system (ex: C:\WINMO_OS)
Copy all of the camera package files to the folder.
In DEPENDS, remove all of the "Module Search Order" paths - Options menu.
Add the folder path (ex: C:\WINMO_OS)
Search your kitchen for each file that is listed in CAMERA.EXE and copy them to the folder.
Once you have the files from CAMERA.EXE in the folder, open each of the yellow ( ? ) files.
Repeat the steps above until you have examined all of the files in the folder you created.
Essentially, you want to locate all of the files listed in each .DLL, .EXE, etc. that is displayed in DEPENDS.
If the files appear in the .\SYS or .\OEM folder, it's likely those aren't the issue. Some files may be modules; it's likely those aren't the issue as well - I usually RECMOD a copy of the file and place it in the folder or I copy it from the device when connected using USB. This will reveal additional files that are "missing". I suspect you will discover the missing dependency to be in another file. If you find the files in packages, it's likely the entire package is a dependency. If you can't find a file, make note of it and continue on. At the end, post the list of files you couldn't find.
Lastly, examine each of the .REG files for references to other files; you may need to do a global search through the kitchen to find other packages that may be writing to the same keys ... these will likely be dependant packages as well.
HTH,
* EDIT *
If at all possible, it would be beneficial for you to find the official source ROM that the package originated from.
hilaireg said:
Had a look at the .DWI file you attached. Your next steps:
Create a folder on your system (ex: C:\WINMO_OS)
Copy all of the camera package files to the folder.
In DEPENDS, remove all of the "Module Search Order" paths - Options menu.
Add the folder path (ex: C:\WINMO_OS)
Search your kitchen for each file that is listed in CAMERA.EXE and copy them to the folder.
Once you have the files from CAMERA.EXE in the folder, open each of the yellow ( ? ) files.
Repeat the steps above until you have examined all of the files in the folder you created.
Essentially, you want to locate all of the files listed in each .DLL, .EXE, etc. that is displayed in DEPENDS.
If the files appear in the .\SYS or .\OEM folder, it's likely those aren't the issue. Some files may be modules; it's likely those aren't the issue as well - I usually RECMOD a copy of the file and place it in the folder or I copy it from the device when connected using USB. This will reveal additional files that are "missing". I suspect you will discover the missing dependency to be in another file. If you find the files in packages, it's likely the entire package is a dependency. If you can't find a file, make note of it and continue on. At the end, post the list of files you couldn't find.
Lastly, examine each of the .REG files for references to other files; you may need to do a global search through the kitchen to find other packages that may be writing to the same keys ... these will likely be dependant packages as well.
HTH,
* EDIT *
If at all possible, it would be beneficial for you to find the official source ROM that the package originated from.
Click to expand...
Click to collapse
Thanks, that was quick. Looks like I got a lot of work ahead of me.

Disassemble or Reverse Engineer WM 6.5 dll

Can anyone suggest tools/utilities that would allow me to disassemble a WM 6.5 dll to reveal it's methods and parameters? In .net desktop world I can use tools like Reflector to do this, but I seem to be having difficulty doing this on WM apps.
Unregister dll - EDiT - Register dll
Here two threads discussing Developer tools & Kitchen Utilities for (ROM) Chef's;
Kitchen Utensils
60 Universal Tutorials for Customizing any Device and Cooking
Have fun, develop something nice for free and please do it here on xda-developers
There are a lot of ifs and buts to this but here goes:
If the dll was created as a .NET app, then reflector should be able to list the code within it, as it will contain the MSIL code within it. If it has been run through an obfuscator when it was built, this can mangle some of the internals and give Reflector a bit of a hard time.
Otherwise it will be a Win32/MFC/ATL object containing ARM object code. A DLL file is the same format as an exe file i.e. Microsoft's PE (Portable Executable) format. Microsoft's DUMPBIN, part of Visual Studio, (run it from the VS Command Prompt), is able to dump out the EXPORT table which lists the public functions visible in it.
There is a freeware ARM dissassembler , CHARMED, which can run on your device which can display the ARM assembly code, but to make any sense out of it, you will require a pretty good knowledge of the ARM instruction set and basic knowledge of how compilers work. If you don't know what a stack frame is, you'll struggle.
Providing a link to chARMed and C/P from that page
stephj said:
There is a freeware ARM dissassembler , CHARMED, which can run on your device which can display the ARM assembly code, but to make any sense out of it, you will require a pretty good knowledge of the ARM instruction set and basic knowledge of how compilers work. If you don't know what a stack frame is, you'll struggle.
Click to expand...
Click to collapse
Here is the link for this nice freeware ARM dissassembler;
http://sites.google.com/site/naphos/software
Requirements: Windows 98,Me,2000,XP Size: 246kb Description: ABOUT ChARMeD:
ChARMeD is a Windows Mobile / Pocket PC / Win CE (for ARM CPUs) Disassembler and Assembler
The name ChARMeD stands for:
Carolo's Hexadecimal ARM Editor and Disassembler
FEATURES:
· Disassemble a Windows CE Executable for ARM CPUs.
· Assemble instructions in ARM Assembler.
· Upload modified file to Windows CE Device.
· View MZ and PE Headers of executable.
· View Import Table of executable.
ASSEMBLER:
· Added NOP instruction 0x90909090, which is not part of the ARM instruction set, but nevertheless works because it is an undefined instruction.
· Supports all no operand instructions, Branches (Jumps) and instructions with two registers as operands.
DISASSEMBLER:
· Recognises 0x90909090 as NOP (see ASSEMBLER above)
· Supports all no operand instructions, Branches (Jumps) and double operand instructions.
ARM Classic Processors
ARM Infocenter
I think IDA is standard for this kinda reversing. If you can find a location where the DLL is called from in another app, you should be able to quickly identify at least the number and format of the parameters. Obviously you can also refer to the import/export tables for this.
V
Awsome bits of info to get me started ... thanks!!
Is a DLL signed?
And if it is, how does one know it? I use a tool from sysinternals called Sigcheck
Sigcheck
Verify that images are digitally signed and dump version information with this simple command-line utility.
One way to use the tool is to check for unsigned files in your \Windows\System32 directories with this command:
Code:
sigcheck -u -e c:\windows\system32
Though there are way more options than the example above.
As all reverse engineers/hackers or cooks you too should investigate the purpose of any files that are not signed.
Besides some nice sysinternals standard utilities, there's also;
SystemInternals_Suite
For obvious reasons I'm using not a direct link to the Suite. Therefore you need to click on it (on the left) yourself. There's a load of useful utilities there waiting to be downloaded by (would be) developers, power users and system / network administrators (are we not all).
If it is signed with a signature; you need to unsign it before editing it!
It's dead easy.
1) Copy your DLL from your phone to your PC. You may need to use ROMExtractor to do this if you have problems.
2) Unsign it using Unsigner. To do this download Unsigner and the Unsigner batch file here. Copy Unsigner, the Batch file and the dll from the phone to one directory and run the .bat file. It should tell you that the certificate has been removed.
3) Download Reshack
4) Open the dll from the phone using Reshack or the better not free PE Explorer
5) Do your editing.
6) Click Compile String at the top and then save the file.
7) Download Ssigner. Launch it and use Select File to select the DLL file you've just modified. Click Start Sign Process! When it's done check the text file that's created to make sure it signed properly.
8) Copy the file back to the Windows directory on the device using for PPC/handheld/CE free Total Commander. If necessary Reboot.
Kitchen Utils Reviewed gives links to programs a developer / cook needs!
Have fun edtinig, vewinig ,bwroisng, assilimating, copamirng and itengaritng your files,
o/~

Categories

Resources