WM6: start Java app from C++ app? - Windows Mobile Development and Hacking General

Hello,
I'm currently in the need to code a C++ app under Windows Mobile 6 that starts an installed Java app. I already hoped that call system("java java_app") might work, but my C++ compiler (VS 2005) does not even know system() function. And I don't think it would work this way: to install a Java app, I start a .jar file, and then, I can start the app manually via start menu under Start -> Program Files -> Tools -> Java, where I can select from all installed Java apps, and obviously, the installation does not create .jar or. class files anywhere in the file system. The Java runtime environment on my phone (HTC Diamond) is an Esmertec Jbed.
Thanks for any help.

As far as I could find out, Java apps under Jbed JVM can be started from command line by
\windows\jbed.exe -run sX_
where X=0,1,2,3,... ist the index of the desired app in the list of installed Java apps. So, Java app can be started from C++ programm using ShellExecuteEx(), filling the lpFile member of the SHELLEXECUTEINFO parameter with "\\windows\\jbed.exe" and lpParameters member with "-run sX_".
Very nice, so far, however, there are two troubles remaining:
- the index X of the desired Java app depends on the sequence, in which the Java apps have been installed
- the Java midlets have a hierarchical structure. A midlet might contain several sub-midlets, but only the highest-level midlets are accessable by the s-index

Well, I think the hierarchical structure is a solvable problem, the desired midlet can be installed as a top-level midlet. But still the index problem. Is there maybe a registry entry that maps midlets to indices?

I found the solution!
Jbed stores for each installed midlet a sX_.jah, sX_.obj and a sX_suite.utf file in \windows\appdb folder. The .jah and .obj are binary files, but the .utf files are readable text files that contain some information of the corresponding midlet, that enables one to identify midlet from index X. So, all I need to do in my C++ app is to open the .utf files subsequently and to check if I find the information that identifies the desired midlet.

Related

Genius 0.19

Dear All,
I have developed my first PocketPC game (see attached). It is similar to Master Mind but using numbers. This is the way we play it in Iraq
I would like some help in making an installation that automatically create a shortcut in Windows\Start Menu\Programs\Games. I am planning to publish the game as a freeware.
I am using VB .NET 2005 (.NET FX 2.0) so if I can include the re-distribution libraries that would make it easier for users, else I may need to point them at a link.
I used 2 different installtion builders but both only copy the CAB file to the Program Files but not make a shortcut for it. I have an *.inf file and haven't used the command line setup builder yet unless I have to.
Any easier way please?
ThanQ.

copying and pasting in c# (visual studio)

hi,
i have a problem with visualstudio .net framework 1.1
in my application, i define a context menu and a copy and paste menuitems.
in the correspondent function, i access to the Clipboard object
but the system generates a compilation error: The clipboard object is not defined.
the help contains a reference to the Clipboard class, and the examples of the msdn uses them !!
help me, please.
thank's
I have read that you need cpf 2.0 to access the clipboard idataobject. I have not tried it because I have had too many other problems with the compact framework and now only do win32. It seems to me that there is something funny going on with the clipboard and that mcrosoft have been trying to make it look like its implemented properly when in fact it is not. Look at real software like resco file explorer and see that even they could not find a way to access it. You cannot copy from file explorer to resco file explorer. There is also no help from drop files structure that a pc windows program may use to get the data object. If you do get the clipboard to work properly in cpf2.0 I would love to know if the data object can be used to access the information about the location of files or if it is only useful for framework related purposes.
hi,
if i install the cpf2 and i compile my application with them,
the application works in a pocket with cpf1 or not ?
thank's
It would not work unless the ppc had the 2.0 redistibutable. Its free so you clould just include it in your instalation.

O2 XDA Orbit 2 help

how do you add games (java) or whatever.. ??
Orbit 2 is an PPC, and ALL PPC can insert a geme or program written in ARM code (PPC code) so you can not insert Java (that is for Smartphone or Symbian), PPC have a windows mobile code.
I hope it's all correct that I've write
thefamous said:
Orbit 2 is an PPC, and ALL PPC can insert a geme or program written in ARM code (PPC code) so you can not insert Java (that is for Smartphone or Symbian), PPC have a windows mobile code.
I hope it's all correct that I've write
Click to expand...
Click to collapse
What??????!!!!!!!!!!!!
Havent anyone heard of MIDlet manager?? Just put this program in and run JAR/JAD stuff, its simple.
HTC Version comes with Esmertec Java installed.
rickgillyon said:
HTC Version comes with Esmertec Java installed.
Click to expand...
Click to collapse
The Xda orbit2 has Esmertec Java preinstalled too. Its no problem to install java apps.
Lars
Just open your JAVA emulator go to the programs, select JAVA, app. opens, go to menu, create new folder, give the name of the game. you see the folder on display, go again to menu install ---> local files and select your jar file and finished....the java file will be loaded.

Applet support?

Hi,
I know HTC supports java. With regard to that, I have some questions/doubts.
1. Whether the HTC supports Applet, in other word the IE/Opera/Skyfire browser supports applet? Since many of the banking application I am using is having the logon in applet and it's not loadind in opera. Any idea how to achieve it?
2. I have installed Mysaifu JVM which will run the java program. So it accepts .class file or .jar file. I need to compile it in my phone. How can I do it?
For example: I will write my own java file(.java). I need a compiler to compile the .java to .class file.

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