Automatically doing stuff on startup? - Windows Mobile Development and Hacking General

Hi
Am quite new to this, but it would appear there are quite many people familar with WM2003 (and it's various incarnations) here; so I figured it'd be the best place to ask this question:
a) How do I create a file (.cab or any other means) that I can run in my pocketPC that would load (or change) certain registry values in my Pocket PC?
b) Is there a location i can place a file within my pocket PC that will be loaded/run on every soft reset?
c) Is there a location i can place a file within my pocket PC that will be loaded/run on every wake up? (eg: everytime the power button is pressed and the screen comes on)
Things I'd like to do with the above; create 3 versions of a) above:
Drop a.1 into the extended rom so that on a hard reset; certain values are preloaded into the unit (eg: Owner name/ information/ various comon settings I always use/ etc)
a.2 + b would basically change my input method from 'keyboard' to 'block recognizer' after every soft reset (I just find it very annoying it switches back to 'keyboard' by default after my weekly scheduled sprite backup, or whenever I have to soft reset the unit.
a.3 + c would nuke the 'last owner' key in IIWPO so it'd send me a SMS everytime the unit is turned on; rather than only when the owner name changes. (if c) is not possible, I could drop it in b) so it'd resend an SMS on every soft reset instead).
Finally, I'd also like to know if anyone could recommend something or other I could read to learn how to write stuff for my PocketPC, and what tools you normally use. (I'd like to modify IIWPO; so that'd it'd resend an SMS every time any information is changed on the owner page (not just name); and/or to resend a new sms every 48 hours - or at least write some small code that would 'interact' with it, since the source doesn't appear to be available (?); eg: delete 'last owner' information every 48 hours...
Thanks!

for a.2b:
There are registry hacks to change the default SIP. Try Tweaks2K for an easy interface.
If you want to, try searching on the board for my program SIPwwitch to change the SIP from a shortcut, eg SIPswitch "Block Recogniser" (you'll have to look up the details on my other post on the development forum). Put this shortcut in your startup folder and it'll change the sip on every boot.
V

Runing on startup
Hi drean!
Here's how you make your program run automatically:
1. After hard reset: you must create a special folder on your devices flash drive (or whatever part of its memory that doesn't get wiped by hard reset. Not sure how memory is managed on XDA's on iPaqs there is a 'File Store'). The folder name must correspond to the number of your processor. (again for ipaq's PXA270 its 2577). In this folder place a file named autorun.exe This file will automatically lunch after every hard reset. (you can also do this with an SD or CF card see this thread http://forum.xda-developers.com/viewtopic.php?t=22861&highlight=grabit)
2. For your program to run after every soft reset place it or a shortcut to it in WINDOWS\StartUp (the program must not be on a storage card! You can also add a registry key with your programs path to HKLM\init.
3. To catch wake up events (power button) your application must be running and respond to power notifications. Here's the full explanations on how they work: http://msdn.microsoft.com/library/d.../wceddk40/html/cxconnotificationinterface.asp
As for how to program for pocket pc, here's a nice thread that will give you plenty of options: http://forum.xda-developers.com/viewtopic.php?t=29623
Hope this helps!
Good luck!

Related

IIWTBTPO

I remember reading a post from a user about the slight ineffectiveness of IIWPO with regard to resetting the device, and I have also seen that it does not quite function properly, so here's what I propose, and plan to initiate work on, as soon as eMbedded VC++ downloads...
application works on the following security level;
a registry setting is created from the cab file after a hard-reset (so it's assuming that the PDA already has a built-in security code as part of WM) that contains a hash of a 5-digit security code, upon the soft-reset of the device, if another registry key that contains an XOR (XOR codes will be hardcoded) of the correct code is not found, then a window pops up, which will create another registry key, in the event that the user soft-resets the device (resulting in the preset number being sent a text) and the software never bothering the user again (in the hope that the user won't smell a rat, and will instead feel rather big and clever). should they however input a code, and that code is incorrect, a message will also be sent, but the program will once again disappear. and if the correct code is input, the program will apply the appropriate XOR version to the registry.
Hopefully, it will also be possible to a) disable active sync until after the program has either had a success with the code, or failure, and also disable all incoming beams, so that the init of the program cannot be bypassed by remote means.
and if you were wondering, IIWTBTPO = Interesting Interaction With Thieving B'stard Then Previous Owner.
comments? suggestions? need me to simplify the convoluted mess of a process?
Couldn't you just put a file into the extended rom, that would load the revelant settings into the registry that:
1. enabling 'strong alphanumeric password' (with a hardcoded password)
2. check 'prompt if device is unused for 0 mins'
3. load owner information (also hardcoded)
4. display owner information on startup
Effectively, on every hard reset, he won't be able to turn off the password, since he'd need to key in the existing password. Also, once the unit goes into standby, it gets locked and the owner information is displayed.
The only 1 chance to defeat this, would be to hard reset; load a registry editor via SD card, and disable the password from there. Any thief who gets this far, would probably also know how to unlock the extended rom and remove these registry settings from there.
I've changed the splash screen in the extended rom for my hp6365 to display a custom .bmp with my 'owner information' instead of the default startup screen on every soft reset. I think it's resonably annoying enough that he can't sell it except to someone else who'd know the unit was found/stolen.
The changes I'd like to see done to IIWPO include:
a) not using "IIWPO" in the registry (user customisable registry key, as well as executable file name)
b) not storing owner name & number 'in the clear' (a simple XOR to hide it would be just as effective)
c) a hash of the entire owner info page (not just the last name) so unit will resend an SMS if any info changes
d) a new sms is resent after a preset time (eg: every 24/48/120 hours for example), regardless if owner info has changed or not.
I don't believe the source is available (I'd like to poke into it if it was), but if IIWPO would do all of the above, i'd remove my custom splash screen, and not make use of any 'locks' that would prevent the unit from being used; Perhaps just 'preload' some owner infomation on every hard reset; but keeping the unit as 'normal' as possible would perhaps increase the chances of recovery with IIWPO.
or flashing a new ExtROM, or soft-resetting right before it rolls out the ExtROM.
if anyone has any info on the Password capability built into WM, I'd appreciate it
After having my last 2 XDA's stolen (Africa), I put this app straight into my VERY expensive JasJar and I'm DELIGHTED to see it works (incl sending the SMS SO discretely that I thought it MUST have tanked). Ran out and made a donation to xda-developers to IIWPO credit straight away!
I'd love to see a suggestion I saw elsewhere; Regular SMS's with theif's recent calls and sms's. Also, a 'honeypot' approach; put an obvious filename (eg Anti-theft.exe) in the startup directory that does nothing, but if deleted IIWPO reacts, and re-enables "show owner info on startup" key. (all this cos I'm not convinced that thieves know to change the owner info)
Also, if someone could provide some strategies for installing on a JasJar where we do NOT have access to the ROM, that would be great! African thieves are not very smart, but I would like it to survive a hard reset.
perhaps it might be an idea to toy with the possibility of hooking into the password screen, if possible in order to have a 3-strikes system whereby if after 3 incorrect tries, the PDA will send a message, and again, upon hard reset, password info is re-applied
enhancement
the best thing is - upon theft, The JJ will grow 2 legs,
and start running to the last owner address using Built in GPS..
but seriously:
a password screen that will appear every 24H saying:
"The rightfull owner is *Name*.
contact him at *Number* for a finders fee of **GBP".
The message wont contain "Enter Password:" but upon putting correct password (you can also apply an X,Y screen value like 0,0 which is lower left corner) the phone will unlock.
if he tries to H.R the password screen (in the same format) will appear.
+ after 2 wrong passes / no passes - disable all beams & USB.
so there is no away around it. (I think).
comments any 1?
Olipro - not necessary to hook password screen: write your own.
I'll try and write one one day. I've already done a bit of theft protection, to do the following:
-my plugin will detect an unauthorised sim and sms me back with cellid.
-Optionally hard reset and format the sd card by sms to the stolen phone.
-Am looking into how to "brick" the phone instead...
I don't want to encourage him to flash/hard reset, because then I will lose the SMS/cell id tracking function, so my protection system is benign, hidden in the background.
However, this is for the magician, and not for rom installation (although it can be!). But, I think: if a thief is knowledgable enough to know how to hard reset and flash a HTC phone, I think he's a fellow hacker and deserves the phone. I'm insured either way... however, for non-insureds, you get your own back a bit.
V
as soon as I get some free time from essays... I'll get round to this.
if you want to brick the PDA, then I believe that HimaClearJumpCode.exe when run on the PDA should do the job quite effectively

Storing email on SD card in WM2005

Hi all, I'm a noob with a Wizard on O2 running WM2005. I have had some partial success with the above topic. Would appreciate any advice as to whether I've done something really silly or whether the idea could be taken further.
OK, I nicked all of this from other threads so only take the credit for putting it together.
Suggest before you start you empty all of your mailboxes on the device.
Step 1. Disable messaging on startup. Believe there are two ways of doing this, one is to remove it from the "Today" screen items, or the following registry hack. "HKLM\Microsoft\Today\Items\"Messaging" And change Enabled to 0
Step 2. Apply the following hack: HKCU\Software\Microsoft\MAPI Add a new string value called PropertyPath. For the value in that field, I added the storage card directory without the "attachments sub folder. i.e. \Storage Card\Inbox.mst... where ... is the (random?) number assigned.
Ok, when I synch the device, all of my emails now go to the storage card in the above named directory.
Right, now for the "partial" success bit (hoping the experienced guys can help out here).
Because I've disabled messaging in the registry, in order to get the items on the today display, I have to go into settings etc. Once that is set, it updates the registry so at reset time it screws up and creates a new "storage card" directory on the unit itself and renames the storage card as storage card 2.
Any thoughts on how to get round this ?
I've tried adding "messaging" to the startup folder and it ***** up as above.
So... thoughts are as follows:
Is it possible to add a cab to the extended ROM which forces the registry key to zero on reset (was thinking along the lines of the one already there which removes the battery icon)
....and for the gurus, is there something I could run to automatically add the "messaging" item to the today screen with some sort of delay on it to allow the card to initialise ?
and finally, have I banjaxed my device by doing this? Seems to work OK
Thanks all

Easy way to delete registry key over and over?

I'm after a quick and easy way to delete a specific registry key - preferably from a command line/shortcut.
This has to be done on a number of PPCs for work (always the same registry key) and I need an easy way to distribute it so I don't have to walk users through it each time - ie a single shortcut or executable would be best.
no-one knows? WM5 if that makes a difference..
MortScript
leyton01 said:
no-one knows? WM5 if that makes a difference..
Click to expand...
Click to collapse
If you tell me what key and data you want deleted I can write you a small app that can do it (silently).
-Jwrightmcps
Use MortScript and Autorun.exe on a SD card. Just inserting the card on the device will run the script and change the registry for you.
Other option is to create a cab file with the registry change in it, and then setup a batch script to automatically install it on the users device when their PDA is connected to their PC. Here is something I put together that may help:
http://www.jaml.com/CreateApp/
Jwrightmcps - thanks for the offer, I will PM the details
Markvan - will check out the link. Looks like it will be handy for a couple of other projects I have. KISS principle definitely applies for execs and technology - if I can email them a cab that can run a couple of things offsite users shouldn't be able to screw it up too bad (they will find a way no doubt)

[Q] Duplicate file in file system: cannot remove either. Video included

Hello,
Earlier today, I copied a file named AVATOR.PNG into the \Windows folder of my HTC Touch HD (running Grzegorz10s custom Dusk ROM). The file was meant to replace an existing Avator.png file. (The graphics file is part of a skinned Manila 2.5 installation, but that's beside the point.) I ended up with two separate files in \Windows; one named AVATOR.PNG and the other named Avator.png.
At this point, I can't remove either file, nor can I change their file properties. A few days ago (before doing a task 29 and reflashing the ROM to improve device performance), I could replace the packaged file without problem. The procedure at that time was simply to stop HTC Sense from the list of Home Screen items, remove the read only attribute of Avator.png, and overwrite it with another graphic with the same name.
This time, I apparently didn't pay enough attention to upper and lower case characters.... To view the symptoms and issue, please refer to this YouTube video:
http://www.youtube.com/watch?v=UMQkgENs0DA
Can anybody help me out? I could always reflash the ROM but it seems like too much work for something this "simple."
Thanks,
Svein
ok, you already wrote, you will care for case sentitivity next time, so no lecturing there
these might sound stupid, but have you tried, either renaming AVATOR.png (the one you copied there, if i'm not mistaking) to Avator.png (should either ask to overwrite or at least give another error) or something completely unrelated (to get rid of the conflict)?
can you maybe move that file to, say, my documents\ and delete it there?
the only other things, that would come to mind would be to write a script to delete that one file and run it in startup, before anything else starts, or in a UC environment, where also nearly everything else is stopped, but to be honest, you should rather perform a hard reset, much faster.
Chef_Tony said:
ok, you already wrote, you will care for case sentitivity next time, so no lecturing there
these might sound stupid, but have you tried, either renaming AVATOR.png (the one you copied there, if i'm not mistaking) to Avator.png (should either ask to overwrite or at least give another error) or something completely unrelated (to get rid of the conflict)?
can you maybe move that file to, say, my documents\ and delete it there?
the only other things, that would come to mind would be to write a script to delete that one file and run it in startup, before anything else starts, or in a UC environment, where also nearly everything else is stopped, but to be honest, you should rather perform a hard reset, much faster.
Click to expand...
Click to collapse
Thanks, Tony. Yeah, the case sensitivity is a given - my bad. And I will likely opt for a hard reset. I had *really* looked forward to not having to reconfigure my device again, now that I finally found a ROM that I thoroughly enjoy, but alas... The files are locked (can't move, delete, or change attributes no matter what...)
Googled "UC environment" with both HTC and windows mobile as keywords and came up with Unified Communication. Is that the right way to go or did I just blow my cover and will get tossed outta here as the functional, non-techie user that I just professed to be?
by UC, i was referring to the automatic customizations (formerly known as EXTROM), run after a hard reset or through an automatic installer integrated in many roms, i saw it as XDA_UC or Cloudy AutoInstall. Because the purpose of these automatic customizations are to install settings (mms, internet) or skins and wallpapers, usually done by your carrier, when running this setup, all connections are cut, all apps are shut down and only a basic windows mobile is running (also sense is shut down).
these autoinstallers can use cab or xml or mortscript files, but setting up a mortscript to try and delete a file, when you've never done it before, probably takes longer than hard resetting and setting up your device again. yet, you can make use of autoinstallers to get all your programs up and running, sync with myphone, and all that is left to do is make some basic settings like owner information. usually that should take less than an hour, that way, being much faster than searching solutions for several days
This software worked for me - dublicatefilesdeleter.com

[Q] What is an old/broken blackstone good for?

Hello,
Today I found my old broken (digitizer not working) touch HD sleeping in a dusty box... and I kind of felt sad for it.
All the hardware on the phone is working just fine except for the touch pannel
So I was thinking, is it possible to make some good use of it without investing any money for repair (it's just not worth it, as I have the brilliant HD2 since the day it got realeased)?
Having a non-working digitizer doesn't leave a lot of options but here is an idea:
Car tracking device? - have it installed in my car, constantly charging from the car battery, listening to GPS and sending coordinates over gsm data to my PC/server.
1. The blackstone have a GPS and you can install a simple data only SIM card from your provider, allowing your device to connect to a remote server over the internet and send important data - like gps coordinates.
2. It's still possible to install any custom rom you like.
3. There is a way to skip initial touch calibration screen: make an empty text file and rename it to "welcome.not" and place it in the root ot your sd card. (Thanks to Chef_Tony for pointing that out!)
4. There is a way to control the device via PC and a USB cable: after hard reset your device default usb connection mode will be ActiveSync. Then run the free MyMobiler application on the PC and it will automatically install on the usb connected device, allowing you to fully control it via your PC mouse and keyboard. (Thanks to Chef_Tony for pointing that out!)
I'm sure that I'm not the first nor the only one that came up with an idea like this, but I couldn't find any topic on it. I also know there are many brilliant developers in XDA that make loads of awesome apps for our HTC devices.
So, any ideas?
Shouts to:
Chef_Tony
Best wishes,
Xeno
new digitizer is about $8.. buy it, fix it at home and sell it for $100
yes, you can always replace the digitizer and have a fine phone.
but anyways, since your plan seems pretty interesting, here is some basic input to help you:
3. you can bypass the OOBE. all you need to do is, create an empty txt file on your pc, "untitled.txt" and rename it to "Welcome.not", (yes, change the extension to "not") and put it in the root of the sd card, then the welcome wizard should be skipped after a hard reset, and so you don't need to align the screen.
4. after a hard reset, the default option for a usb connection is activesync. then you can run MyMobiler on your pc, it will install on the device automatically and you can control the device on your pc's screen with keyboard and mouse.
so you can still use it for anything you like, if you control it over the pc and preconfigure it to meet your needs.
sleby said:
new digitizer is about $8.. buy it, fix it at home and sell it for $100
Click to expand...
Click to collapse
I gave it a shot few months ago and I failed The problem was that the digitizer is literally glued to the lcd panel, and detaching it is a REAL pain the butt (I almost broke it). Anyway, after reassembly the new touch screen didn't work and I gave up. I cursed myself later on when I found the topic here in XDA forums that the best way is to buy a digitizer+lcd combo...
Chef_Tony said:
yes, you can always replace the digitizer and have a fine phone.
but anyways, since your plan seems pretty interesting, here is some basic input to help you:
3. you can bypass the OOBE. all you need to do is, create an empty txt file on your pc, "untitled.txt" and rename it to "Welcome.not", (yes, change the extension to "not") and put it in the root of the sd card, then the welcome wizard should be skipped after a hard reset, and so you don't need to align the screen.
4. after a hard reset, the default option for a usb connection is activesync. then you can run MyMobiler on your pc, it will install on the device automatically and you can control the device on your pc's screen with keyboard and mouse.
so you can still use it for anything you like, if you control it over the pc and preconfigure it to meet your needs.
Click to expand...
Click to collapse
Thank you fine sir for the light on the topic. I'll make sure to add this in the first post
Every new idea/info will be of great value reaching the goals of this thread
Ok, putting a welcome.not file on the root of the sd card did the trick as promised. I conneced the device to my PC via usb and as expected it connected via ActiveSync by default.
Unfortunatelly MyMobiler was unable to install the mobile part of the app automatically - it poped a message on the phone "This program is from an unknown publisher..." and it's now waiting for confirmation to continue the execution of the app... and it's pretty impossible to confirm this with a broken touch pannel
I believe there is a registry workaround for this, but it should be set by default in a cooked rom? I'm using the latest WWE rom from HTC.com.
It will be great if some good chef could mod this rom and make this annoying message go away
1. i just had an idea on how to get mymobiler running. i cannot promise, that it'll work, but it certainly doesn't hurt.
having the latest mymobiler on your pc, you see different files there, some of which are named:
remote.exe
remote.exe.40
remote.exe.50
when you connect the device in activesync mode, and set it up for syncing (at least notes or browser favorites, something that does not actually mess with your pim data), you will see the blackstone in "My Computer". entering it, you have the storage home drive and the storage card. by enabling "Show hidden files" and disabling "Hide system files" in your windows explorer, you should be able to access the windows folder of the device. then you can copy the file remote.exe.50 there, rename it to remote.exe (the .40 file is for wm2003, the .50 file for wm5 or greater, but you need to remove the extension to make it executable).
and then, since you cannot make shortcuts yet, copy the file again to \Windows\StartUp\
thereby making it run automaticly, when the device boots. then soft reset, and i am fairly certain, you should be able to run mymobiler.
from there on, you could disable the signature warning for future programs.
EDIT: apparently, the startup folder is victim to the certification warning as well. still i leave this paragraph, as i find it interesting as to how mymobiler works.
2. another idea would be to just flash any cooked rom found here on the forum. all of them have this stupid signature warning disabled and are ready to run mymobiler out of the box.
3. my third idea to get it running is trying to modify the responsible reg key:
\HKEY_LOCAL_MACHINE\\Security\Policies\Policies\0000101a
it is a dword key, where the value '0' is activated warning, and '1' means, the warning is disabled.
in the 2577.zip in the attachment, you will find a reg key, that changes this value and also a cab file to do the same thing.
on a device with an ARM cpu, the folder 2577\ on the storage card will be monitored for autorun.exe and execute it, when the card is inserted. i also packed 3 different autorun.exe files in there, one by me, one by navigon, and one by igo, hoping at least one of them would work with a proper certificate. what you'd need to do, is extract it, and copy it to the storage card, so the path is \Storage Card\2577\Autorun.exe
autorun classic works with the CFG.txt, which is also included and changed to work, as long as your rom is WWE and the storage card is actually named \Storage Card\, if not, edit the path.
until now, i was unable to run it, because the autorun.exe files aren't signed with a trusted certificate either, but i'll give other people time to post ideas, and rethink the thing, maybe i can make it work for you.
still i think, if you are gonna use the device for a few little features, you are not required to use the stock rom, so flashing another rom, which then does not have the certification warning would be the easiest way to go for everyone involved.
Connect it to your PC and use it as a monitoring tool!
Can come handy when benchmarking.
http://forum.xda-developers.com/showthread.php?t=695298

Categories

Resources