Mobile file paths in MS Visual Studio 2005 - Windows Mobile Development and Hacking General

Hi all,
my father got MS Visual Studio 2005 some time ago and I just discovered that it's capable of creating mobile applications as well so I'm playing with it, trying to do some cool stuff (program for recording my marks at school atm ). The fact is, that I'm not extremely experienced in C# (in which I'm working in the MSVS2005) so I have to look up syntaxes or parts of code in help database every now and then. I have always succeeded so far, but now I have a problem I need someone to help me with.
I just started working with files, everything is fine, I think i quite understand the syntax and stuff, but I can't figure out how file paths under Windows Mobile work. In help file, they say that this should work:
string path = @"c:\temp\MyTest.txt";
but i think this is for desktop Windows only. If I try to use this in my programme, "Catch (Exception Ex)" command returns error saying: System.IO.DirectoryNotFoundException.
I tried various variants of the file path and the only one working was just plain name of file, for example
string path = @"MyTest.txt"
This way, I managed to write into the file and read the input back..but I couldn't find the file anywhere in my phone's memory :S
So if there was someone who would be so kind and told me how to specify file paths under WM correctly, I would really appreciate it. btw if the "someone" gave me his MSN/ICQ too, and was willing to give me real-time help once a time, it would be absolutely perfect

The root of the Windows Mobile filesystem is "\". If you want to place the file in the temp dir of the root, use this:
string path = @"\temp\MyTest.txt";
Øystein

Related

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.

Edit .mui file's....

I whant to change something in that mui file but when i open it with resourche editor i see something like (\0x00) or (000)
after some words..
When i edit this words i can't put buck those 000
Example :
22372, "1\0x00"
22373, "2abc\0x00"
22374, "3def\0x00"
22375, "4ghi\0x00"
Also i have Microsoft Visual Studio 2005 & Pocket PC SDK.
In Microsoft Visual Studio 2005 doesn't show those 000, but if i edit with Microsoft Visual Studio 2005 when i go to sign the file give's me error.
Error: Signing Failed. Result = 80070057, (-2147024809)
Click to expand...
Click to collapse
Please any one to know something about that tell me...
Thank's for your time.
Never ever ever use VS to edit resources! It screws up dialog templates and makes MUIs unusable.
The only good way to edit an MUI is Platform Builder. You can download a free evaluation version that will run for 180 days, but even with most options striped on installation it is still around 1GB.
Hope you have a good internet connection.
what version of Platform builder i need to edit mui files from WM 2003 ?
i see difrent version like: 5, 4.2 and other
but i dont know what chose
levenum said:
Never ever ever use VS to edit resources! It screws up dialog templates and makes MUIs unusable.
The only good way to edit an MUI is Platform Builder. You can download a free evaluation version that will run for 180 days, but even with most options striped on installation it is still around 1GB.
Hope you have a good internet connection.
Click to expand...
Click to collapse
Thank's Levenum ...
I sucesfull download the Windows Embedded CE 6.0 Evaluation Edition but it is say This download is a plug-in for Visual Studio 2005 ...
So what i 'm doing??
I nead the Windows Embedded CE 5.0 ??
I also download the 5 version but at the end give one error and say something like:
the download file have been interuptut before the installation finish...
So what can i do and what for those two version i have to download and if you know how can resolve the error problem on version 5??
Sorry for
&
Many many thank's Levenum
Ok i download and install the platform builder 5.0 but when i load the mui file after do my change's and go to save it he say me:
''Cannot save the file.
Cannot load a resource from the executable.''
So what i'm doing wrong??
Thank's adn sorry again....
I explained this in a PM, but just in case others are interested:
Possible causes are:
1) MUI was signed when you edited it.
2) MUI was extracted using WM5test tool by mamiac. (This tool is excellent for dumping ROMs for viewing but files can not be used on the device)
3) PB sometimes does that for no apparent reason (at least to me)
Get another DLL one that is not signed or dumped from device, delete any resources it has and put the resources from the MUI in it. Then save and rename.
levenum said:
I explained this in a PM, but just in case others are interested:
Possible causes are:
1) MUI was signed when you edited it.
2) MUI was extracted using WM5test tool by mamiac. (This tool is excellent for dumping ROMs for viewing but files can not be used on the device)
3) PB sometimes does that for no apparent reason (at least to me)
Get another DLL one that is not signed or dumped from device, delete any resources it has and put the resources from the MUI in it. Then save and rename.
Click to expand...
Click to collapse
Thank's for your help again Levenum but doesn't work.
I try tu build one new .dll but when i put one string (for test) after i try to save but give's me the same error.
''Cannot save the file.
Cannot load a resource from the executable.''
What else can i do ???
Please help me..
I try weeks now to edit five lines
Thank's and sorry...
Sorry, but now I am stomped. I never had PB fail to save a single string to a new 'clean' DLL.
Any chance there is some kind of access problem to the actual location where the file resides? Could it be 'read only' or under restricted permission?
This is really strange...

SlimServer Client developement - HELP NEEDED with XML

Hi there...
I have embarked upon the developement of a slimserver client for the pocket pc using c#. There is no decent one around that I know of!
Anyway, it is going to be open sourced, and I have already implemented the use of the CLI interface. however, I am a bit stuck with the XML one. I have attached the relevant sources! The problem is that when it runs through the emulator, it is unable to deserialise a slimserver xml file and returns a NotSupported Exception (I have attached a sample xml file). I generated a c# class library for slimserver's xml schema using xsd.exe.
The funny thing is that when I run the compiled .exe file in windows (without the emulator), it runs smoothly, and deserialises it perfectly! It also works when compiled for a normal desktop application!
Could someone help please?

[DEV] ROM Tools

Hi,
I'm currently working on a few tools, and want to know what features would be liked by cooks/users or anyone really.
The first tool is an exe generator for hot fixes. Simply put, you plug some files into it, and it generates an exe that can be run on the target device which will do all the hot fixes.
The advantages it gives:
No more cabs!
Can use a custom icon for the exe if desired
Things like messing around with setup.dll files doesn't need to happen, and an application can be launched after install if wanted
Files can be deleted
File properties can be changed
Can use XMLs
Can edit registry
Can install files
Since it's written in native C++, it should run without a hitch on WM5+ devices, whether or not they have .Net whatever...
The second tool is an AutoRun/UC/whatever like system that simply searches through a folder, finds all cabs/xmls/provxmls and then installs them. This means there's no reliance on autorun for parsing config files, or any other requirements. Again, it's written in native C++ so is better
Any suggestions/ideas would be welcome!
Oh, and once I've got slightly further, both these will be released as open source. Probably.
l3v5y said:
Hi,
I'm currently working on a few tools, and want to know what features would be liked by cooks/users or anyone really.
The first tool is an exe generator for hot fixes. Simply put, you plug some files into it, and it generates an exe that can be run on the target device which will do all the hot fixes.
The advantages it gives:
No more cabs!
Can use a custom icon for the exe if desired
Things like messing around with setup.dll files doesn't need to happen, and an application can be launched after install if wanted
Files can be deleted
File properties can be changed
Can use XMLs
Can edit registry
Can install files
Since it's written in native C++, it should run without a hitch on WM5+ devices, whether or not they have .Net whatever...
The second tool is an AutoRun/UC/whatever like system that simply searches through a folder, finds all cabs/xmls/provxmls and then installs them. This means there's no reliance on autorun for parsing config files, or any other requirements. Again, it's written in native C++ so is better
Any suggestions/ideas would be welcome!
Oh, and once I've got slightly further, both these will be released as open source. Probably.
Click to expand...
Click to collapse
Wow, this sounds very very promising. Can't wait!
dwizzy130
yeah some user friendly and easy to understand specialy editing the rom or making add/remove programs EASILY is the best specialy to noobs like me when cooking ROMS all in one tool with advance AI for error checking
Sounds very attractive. go on my friend.....
Sounds good mate
I'm looking for a tool to easily make a setup.dll. Like setup.dll maker/generator/wizard.
Seems the only tools I can ever found is from e-pocketsetup, but that company was sold to another company and the product was never available since then.
I know cooks hate a cabs with a setup.dll. But seems without setup.dll a cab installer can not execute some little complicated actions. And it is impossible to make a setup.dll without grasp a computer language like c++.
Edit: Found another one: setupdllcreator , but it's not strong enough and not freeware.
Edit: If these can be realized, a setup.dll maker is much less needed:
No more cabs!
Can use a custom icon for the exe if desired
Things like messing around with setup.dll files doesn't need to happen, and an application can be launched after install if wanted
Files can be deleted
File properties can be changed
Can use XMLs
Can edit registry
Can install files
Click to expand...
Click to collapse
But we need above mentioned fubctionalities to be DYNAMIC, like:
Can detect availability of certain reg entries or installed apps, base on the result to decide which variants of install files to be installed, or whether some supporting apps like netcf or mortscript to be installed. Or can detect device id, resolutions, drivers to decide what to do.
Otherwise it still can not completely replace setup.dll.
But if dynamic actions can be executed, wow that's a dream of developers & hackers and even common users can benefit from that, a real revolution !
woww can wait for realese
l3v5y said:
Any suggestions/ideas would be welcome!
Click to expand...
Click to collapse
So I'm posting my requests again, the idea is this: It will be much helpful if I can know what is happening/changed in the registry after I did anything to my WM devices. So maybe you can develop a tool to monitor & log the real-time changes of registry. Or at least we can have a registry-comparision tool on ppc.
Another thing is it seems we don't have a file structure viewer on ppc, not the stuff like total commander etc., want to export the file structure to a file like .txt or .jpg.
Update: Now my idea is clearer for this, what I suggest would be a System Snopshot program to realize this:
Can make a system snapshot to record the registry content, file structure, ram usage etc.
The snapshot can be initialized in the similiar way of CapSure screen capture program, i.e., a hardwre button, a fixed time, a screen tap, a program launch, etc., defined by user.
Can choose a full system snapshot or only on selected part of registr, file system etc.
Can generate a file containing the recorded system condition.
Can compare any two system snapshot result and generate a comparision chart/change log.
So I've posted my requests as per your request, whether or not you'll do it is not my business lol.
Update: Found SK Tracker, cost EUR9.95, so forget this one. Why I did not know it in the past?!

HELP: How to hack a executable file

hi buddies, does anyone one know how to hack an app? for example, change a predefined (hard coded) path like "\storage card" to any other locations. I tried to use hex editor but couldn't find any paths hard coded. I know there's a program called "Olly Debugger" for Win32 which can change binary code to machine code. However it doesn't support PPC applications. Can anyone help?
Many thanks!!
If the path does not appear in the executable then it is not hard coded in the program.
Hard coded strings, string tables, static data and the like, get bundled together by the linker into a separate data segment. They would all appear in the same area within the exe.
The program is probably using FindFirstFlashCard() and FindNextFlashCard() functions to emumerate storage devices. "Storage Card" would be returned by this/these function(s) at run time.
Another reason may be that the executable has been 'signed'. In this case the code is encrypted with the certificate so the hard coded stuff cannot be seen. Altering the code here will invalidate the checksum and the operating system will refuse to run it.
hi stephj, thanks for your info! finally i can figure out the location is hard coded in a dll file instead.
btw do you know how to convert a module (in the form of folders) into a binary dll?
thanks!!
Not quite certain what you mean. A DLL file is the same structure as a .EXE except that it does not have a WinMain() function that a .EXE file has that the loader calls once it is loaded.
Once a DLL is loaded the loader can resolve the real address(es) of its exported function(s).
sorry, i was talking about the modules in rom cooking. after dumping the rom, some DLLs appear in the form of modules (which are folders). what I want to know is the ways to convert these folders into binary files.
In that case it's over to the chefs. My expertise is in the area of application development.
Thanks stephj!!
To convert module to file, look for recmod
It will give you a plain .exe/.dll you want to modify.
After you do it, restore it using reversmod

Categories

Resources