Related
I recently got myself an ATT Tilt (Kaiser), which I plan on taking with me to a conference in Europe next month, and I'm not planning on taking a laptop so I can travel lightly afterwards. The phone currently has WM6 on there (I'm not going to play with flashing the ROM until after my trip).
To the point: I want a C/C++ compiler on my phone that I can use for potentially testing a few things over there (assuming the application I have in mind will work, but that's another story). I'm assuming that if I get the compiler working, it will have access to the standard C libs, including network stack.
I've tried PocketGCC, but I can't get it to work. The cabs from pocketgcc.sourceforge.net install fine, but the CMD Prompt won't open (I click on the icon and nothing happens).
Searching these boards, the only reference I've found was to http://www.mobilitysite.com/boards/business-development/135816-pocket-c.html#post1187340, but the links it points to for getting the various files no longer work.
Any suggestions or alternate links on how to get a working compiler on my smartphone?
As a backup, is CeGCC the best option for pre-compiling for the phone? Anyone know if it runs under 64-bit linux? Or if not, under win32 cygwin? Ideally, I'd love to have a cygwin-equivalent on the phone...but I guess that'll be deprecated with Android later on.
Thanks,
- David
Hi David,
I'm also looking for this and the best aproach was a DOS emulator (I think it is called Pocket DOS and there is another one that is free but don't remember the name) and Turbo C. I used it just to test very basic software that was just displayed in the DOS windows. But it was a really really little software (a couple of FORs and couple of variable incrementing), it was not fast to copile/run.
Hope this helps a little.
there is a cool project here, it's C#, not C++ but it might be of interest.
This one is supposed to be C++, but it is old and you may have problems with it. From what I recall, the command shell isn't compatible with wm6, but if you look around you may be able to find one to replace it that works.
Here is a command shell that's supposed to work with WM5/6
Good luck and let us know if you find anything else.
Also, the link to Mamaich's Version on that page you referenced works
Digicrat said:
I
is CeGCC the best option for pre-compiling for the phone? Anyone know if it runs under 64-bit linux?
Click to expand...
Click to collapse
mingw32ce (cegcc) is used to compile haret and roadmap (afaik vlc too).
It runs on amd64 very well. Have not tried it on my old DEC alpha.
Thanks for the quick responses.
edgar: PocketDOS looks interesting, but where can I find versions of Turbo C/C++ compatible with the pocketPC?
The program I'll be testing is actually a simple command-line C application, but it does use networking, UDP to be precise.
The link to Mamiach's link works on that page, but not the links on there for PocketConsole, PocketCMD, or the .bat files, though the bat files can be taken from the rar file itself.
I tried the PocketConsole and PocketCMD versions from the pocketgcc.sourceforge.net site again, and managed to get them (mostly) working after changing the reg key value.
I tried the PocketGCC cab file from gforge. It kind of works, but the test program won't compile. I still had to manually set the path for this, and for some reason it doesn't include gcc but calls the various other parts of it.
I'll try uninstalling the PocketGCC Cab and extracting Mamiach's version again and see if I have better luck with that later in the week and see how that goes.
Looks like I got it working for the most part.
Compilation is slow, but I don't want to waste space on the internal memory extracting all those .rar libs, unless I can get it installed/moved to the SD card later and adjust the paths accordingly (using spaces in file paths is always annoying).
I'm using Mamiach's version of GCC from the link above (extracted to /pgcc), plus PocketConsole and PocketCMD cabs from the pocketgcc.sourceforge.net distribution.
The only lingering (and annoying) issue is that it does not save the PATH setting after closing the cmd prompt.
Correction, I just noticed another more important issue. After switching programs, the CMD prompt seems to disappear. If I open another application, and then close that program, it will take me back to the CMD prompt. However, if I return to the "Today" screen, that prompt is still open but I can't get it back. It does not appear in that little task-switcher icon, nor in the detailed 'Task Manager'.
Any ideas?
Thanks
Update:
I just installed Dotfred's Task Manager. It looks like the problem is that the CMD prompt is being seen as a Process and not as an application. Now the question is can I change that...
Here is what I'd like to do: I'd like to use Samsung Omnia 2's default Contact Manager with my other WM phone. So I copied the Omnia 2's contact manager program in the \Windows folder (SECContact.exe) to my other WM phone and tried to run it. But it only gives me a black screen.
I know you probably should install an app rather than copy the .exe file, but since it's only a single-file program, I was hoping this would work.
Is there any way to make this work? I really like Samsung Omnia 2's contact manager and calendar apps.
i dont know what wm phone youre trying but there are extracted samsung app in cab files floating around on modaco forum. that calendar is called touch calendar.. google search it
screwdriv said:
i dont know what wm phone youre trying but there are extracted samsung app in cab files floating around on modaco forum. that calendar is called touch calendar.. google search it
Click to expand...
Click to collapse
I'm trying to extract the calendar and contact apps.
Yes, I've seen them at Modaco.
But the problem is, they are not in CAB format. They are in just zipped files to be used when creating a custom ROM.
Is there an easy way to create an installable CAB file from these extracted files?
You got a black screen cos You didn't copy the corresponding DLL file(s) also. The ZIP files are not always for ROM creation, sometimes they are just for copying. And if You didn't find i8000 contact manager and calendar CABs, You didn't search enough, sorry.
For CAB file creation search for WinCECabManager.
If you have a PC with a Microsoft development environment on it, you can use the command DUMPBIN /ALL SECContact.exe to dump out the program's import table, which contains a list of the DLLs the program requires.
If you use a Borland/Embarcadero development setup, Rad Studio, Delphi, C++ Cuilder etc., TDUMP does a similar job.
If it has been written in .NET use Red Gate's .NET Reflector to open it up and see the address spaces it requires.
aiiro said:
You got a black screen cos You didn't copy the corresponding DLL file(s) also. The ZIP files are not always for ROM creation, sometimes they are just for copying. And if You didn't find i8000 contact manager and calendar CABs, You didn't search enough, sorry.
For CAB file creation search for WinCECabManager.
Click to expand...
Click to collapse
Well, I did get the i8000 contact manager and calendar apps from Modaco, but they result in the same black screen also.
http://windows.modaco.com/topic/298414-cabs-repository/
Is it possible that these apps are supposed to work only on Samsung phones from the beginning? It's conceivable that these apps check the device first and decide to operate or not based on the device.
stephj said:
If you have a PC with a Microsoft development environment on it, you can use the command DUMPBIN /ALL SECContact.exe to dump out the program's import table, which contains a list of the DLLs the program requires.
If you use a Borland/Embarcadero development setup, Rad Studio, Delphi, C++ Cuilder etc., TDUMP does a similar job.
Click to expand...
Click to collapse
You do NOT need these development environments to examine native apps, you simply need CFF Explorer, and the best is, it costs nothing because it is freeware!
Why do low-level actions on .exe analysis if probably the packaging on the donor device has done already all you need? A rough workflow could be:
Get the .nbh from the donor device
dump it with e.g. OS Builder
identify the package with the application you need
You could also pick it from a kitchen for the donor device.
It will require effort to analyze the dependencies (.rgu, .provxml) and linked .dll.
In general there are apps that are easy to get and others are difficult, no simple rule here.
@jwoegerbauer Good point!
CFF Explorer is a nifty bit of work for a freeware program.
Click on the Dependency Walker tree entry to see what the program requires.
My view of the things
tobbbie said:
Why do low-level actions on .exe analysis if probably the packaging on the donor device has done already all you need?
Click to expand...
Click to collapse
An .EXE (always by default) relies on COREDLL.DLL, regardless the .EXE is written either in managed or in native code, but COREDLL.DLL is not COREDLL.DLL. It is alone OEM's decision what functionality to pack into device's COREDLL.DLL . Means which API-functions COREDLL.DLL exports.
This also is known as OS's license level. For a core version, i.e small function range, OEM (actually) has to pay Microsoft a license fee of $3 USD, a pro version, i.e full function range, (actually) costs $16 USD.
This in mind, you first of all always have to compare the unit's COREDLL.DLL's export table and the .EXE's import table, if an .EXE will not run, hereby mostly reporting an error like "components missing".
Resume: Only if you find the APIs imported by .EXE in COREDLL.DLL's export table, the .EXE runs.
No one else seems to be in a hurry to write a new resolution switcher so I made one myself.
I designed it mainly for Win8 on the HTC Shift but it would be easy to modify for whatever.
Some screenshots:
Features:
Separate resolutions for desktop (1024x600) and Metro (1152x864)
All resolutions easily changed in the .ini file or the source
Doesn't force the desktop to show when executed in Metro (like the default switcher from HTC)
The window that displays the resolution afterwards is optional
A simple installer that allows you to set either of the right hand buttons to run the switcher
Rar file contains these files
A compiled .exe
.bat file calling the installer/uninstaller function (optional)
.ini file containing the standard settings (optional)
You can download the source from my thread at the AutoIt forums, Resolution switcher.
To use simply extract the archive somewhere (anywhere) and run the .bat file to select which button to use, then log out/log in or restart the computer for the new settings to load.
To go back to the default settings, run the .bat again and press cancel when it asks you what button to install to.
(previous downloads: 66)
Thank you!
Sincere thanks for this, just got my shift up and running in 8 and this is very helpful. Thanks for taking the time to do this work and for your willingness to share!
Thank you for your interest roll0ver. It's nice to see I'm not the only one that still has a Shift! :highfive:
I made some updates:
Now also detects Metro apps and not just the Start screen. I don't think I mentioned that limitation before. Oops!
Does not jump to a lower resolution while in Metro (by default). Metro copes with resolution changes by closing all applications. Very annoying.
I have not done any work on supporting multiple monitors, but it kinda works as long as the internal display is the "main" one.
Download is in first post.
Can anyone tell me when / why I want to use desktop mode (I've got a Surface for Windows RT)?
I know the Office apps force you there. Otherwise, is it only when I want to hit up the control panel or Explorer?
Is there anything else to do in Desktop mode?
Also, stupid question, but is there any way to launch an app (other than the 5 pinned to the taskbar) directly in desktop mode?
When you don't have a tablet?
Sent from my SCH-I510 using Tapatalk 2
JihadSquad said:
When you don't have a tablet?
Sent from my SCH-I510 using Tapatalk 2
Click to expand...
Click to collapse
Sorry, I should have specified, I'm asking about the Surface for Windows RT
I think when Microsoft releases the next visual studio it will be compatible with rt in desktop mode. Also you have calculator, paint etc. on the desktop.
Sent from my SCH-I510 using Tapatalk 2
I believe Desktop mode is short term legacy support. Should disappear in the next version of RT.
junialum said:
I believe Desktop mode is short term legacy support. Should disappear in the next version of RT.
Click to expand...
Click to collapse
And quite possibly in a couple iterations of Windows itself...
Thanks.
Sent from my Nexus 7 using xda app-developers app
Windows explorer? IE with addons? Control Panel?
Sent from my RM-820_nam_att_100 using Board Express
junialum said:
I believe Desktop mode is short term legacy support. Should disappear in the next version of RT.
Click to expand...
Click to collapse
JihadSquad said:
And quite possibly in a couple iterations of Windows itself...
Click to expand...
Click to collapse
No. Desktop mode is never going to be phased out, "legacy" is just a marketing ploy to accentuate that the new UI is "modernUI".
Desktop mode is for desktop things. Like when you plug a keyboard and mouse into your Surface, and you browse the internet with IE desktop and manage your files with explorer or use office. The full functions of office could never and will never be crammed into an app: it would violate the simplicity/stylistic/touchfriendly guidelines.
Desktop will never be phased out of RT or Windows, I don't know why people think this.
Other things to use Desktop Mode for:
Scripting (CMD, Powershell, etc.).
Proper multitasking (more than two windows at once).
Task Manager.
Advanced management tools (Management console and all its snap-ins, diskpart and netsh and other command-line tools, etc.).
IE developer tools.
Setting up file and folder sharing.
anything else that apps can't do...
Oh, and (especially once we get this working better), running existing apps that have ben recompiled for ARM.
link68759 said:
Desktop mode is for desktop things. Like when you plug a keyboard and mouse into your Surface, and you browse the internet with IE desktop and manage your files with explorer or use office. The full functions of office could never and will never be crammed into an app: it would violate the simplicity/stylistic/touchfriendly guidelines.
Desktop will never be phased out of RT or Windows, I don't know why people think this.
Click to expand...
Click to collapse
Yeah, that's how I've been using it. I picked up a bluetooth mouse that works nicely without a dongle. I used desktop mode to copy some files around - it was nice. I plan to use Remote Apps and some other stuff that will only work well in desktop mode.
Its nice. I can switch back and forth with ease. Some things (content consumption with ass parked on a couch) are easier with the don't-call-it-metro mode and some things (content creation/manipulation while sitting at a desk) are easier to do in desktop mode. I can't do that with any of my iOS or Android tablets. Because of this, I see desktop mode as an advantage WinRT has over iOS and Android. Neither of those have anything similar and probably never will have.
But hey - don't like desktop mode? Don't use it.
I see the don't-call-it-metro mode and desktop mode as similar to the way DOS and Windows used to be. Win95/NT/2000 was nice, but sometimes you just needed to drop into DOS to do some things easier. I still use ipconfig /all quite a bit now that I am thinking about it.
I sincerely hope desktop mode is never phased out. I can't imagine why it would be - DOS Command Prompt is still around after all these years and it still has its uses.
Just to clarify, because this is a pet peeve of mine: THAT IS NOT DOS! It is a command-line shell which emulates certain portions of the DOS user interface and, on 32-bit machines, also the DOS API... but it's not DOS. CMD can do all kinds of things that DOS can't, ranging from UI features like path or command completion to system capabilities like running apps in the background (DOS had no multitasking capability). 32-bit builds of Windows NT (including 2000, XP, Vista, Win7, and Win8, plus corresponding server builds, which all use NT) include NTVDM - the NT Virtual DOS Machine - for running 16-bit DOS apps with emulated hardware (DOS granted full access to the hardware for any app; NT doesn't, so it had to provide virtual hardware for compatibility). NTVDM will *claim* to be a version of DOS, for compatibility's sake, but that's no more true than Wine on Linux claiming to be a version of Windows.
However, I absolutely agree that some things are best done in the command line. I actually rather dislike CMD; its command completion sucks, its scripting language is lame, its quotation parsing rules are bizarre and archaic, and it's missing some capabilities such as what you get from `command-goes-here` on POSIX shells. On versions of Windows which can run it, I prefer to use bash via SUA; on versions which can't, Cygwin is an almost-acceptable alternative. I'm slowly learning Powershell (accelerated somewhat by the fact that the Surface RT has both CMD and Powershell, but neither SUA nor Cygwin) as well; it's very powerful but its scripting syntax feels weird to me and the software itself is very heavyweight and tends to run slowly at times (such as when loading new modules).
GoodDayToDie said:
Just to clarify, because this is a pet peeve of mine: THAT IS NOT DOS! .
Click to expand...
Click to collapse
Yeah... I know... But its much easier to type DOS than it is to type "a command-line shell which emulates certain portions of the DOS user interface and, on 32-bit machines, also the DOS API..." Don't you agree?
or "CMD", "CLI", "command line", "command-line interface", "terminal", "command prompt", "TUI", "text user interface", "text shell", "cmd.exe", "powershell", even "NTVDM", ...
Sorry, totally off-topic, I know. It's just frustrating when people claim that 'Windows is just a graphical interface over DOS" (hasn't been true since the early 90s) or 'Windows is still built on a DOS core" (hasn't been true since ME), or "Windows still includes a copy of DOS" (not true at all for 64-bit or ARM or Itanium or anything other than x86, and arguable even there). To people who actually heavily used (or, haven forbid, still use) DOS, or have old DOS apps they need to run, that just results in problems which, annoyingly often, I end up needing to solve. It would help a lot of people who knew better didn't perpetuate the untruths.
Oh, and back on-topic: if you use desktop IE, you can add Tracking Protection lists (and edit the automatic one) and also enable ActiveX filtering (which might not be needed on RT due to its limited Flash list and lack of many other plug-ins, but I still prefer it).
This is a very simple application that enables you to specify any kind of Uri to launch. This is done through creating a Toast notification that, when clicked on, will execute the specified Uri. This uses a native method outside of the regular SDK; the standard methods available in the SDK that you'd normally use to create a Toast notification are restrictive in what kind of Uri you can specify. By using the native method not part of the SDK, these limitations can be by-passed.
I've attached both the XAP and the source code. The source project contains three projects:
CShellChromeAPI: The C++/CLI project which calls the native un-documented method
NativeToastLauncher: The .NET wrapper which simplifies the interaction with the C++/CLI project
NativeToastLauncherApp: The test application used to quickly launch any Uri
You'll notice I've hard-coded a default Uri when you launch the application: this will open the Windows Phone 8 "About" page.
To run this, you'll need to side load the XAP which requires a dev unlocked device...
Can I use any system GUID to launch?
djtonka said:
Can I use any sytem GUID to launch?
Click to expand...
Click to collapse
Any registered app GUID yes. You'd do app://GUID/_default (or replace the _default with the particular task to run - in most cases, that's _default).
@cpuguy this is awesome, thanks!
If you guys are looking for GUIDS and default tasks, they are all in the app's WMAppMAnifest.xml. the "ProductID" is the GUID and the "DefaultTask Name" property contains the name of the default task.
Hopefully we can use this to find a program to exploit.
Sent from my Nokia 521 using XDA Windows Phone 7 App
Does anyone happen to have a list of the ID's for the system and settings apps? Obviously, I can't go into the code and get these without messing with the file system. If no one has them, then I can just trial/error until I get some...
If you download the registry hives located at http://forum.xda-developers.com/showthread.php?t=2393883 , you can load the Software hvie and search for "app://" That will give you a few system files you can launch.
EDIT:
I posted a zip file of the default ones in a new thread.
IF anyone has tethering blocked, see if you can get it to work by launching this URI app://5B04B775-356B-4AA0-AAF8-6491FFEA5629/Default
compu829 said:
If you download the registry hives located at http://forum.xda-developers.com/showthread.php?t=2393883 , you can load the Software hvie and search for "app://" THat will give you a few system files you can launch.
Click to expand...
Click to collapse
Im only seeing the app:// function used on the system settings options after going through the regsistries so far.
aclegg2011 said:
Im only seeing the app:// function used on the system settings options after going through the regsistries so far.
Click to expand...
Click to collapse
that's what I saw too. I am having way more luck finding cool stuff in the extracted ffu. Take a look at the zip file in the new thread I started.
compu829 said:
that's what I saw too. I am having way more luck finding cool stuff in the extracted ffu. Take a look at the zip file in the new thread I started.
Click to expand...
Click to collapse
yea, I saw the new thread. Hopefully somebody can find a exploit in all that. It executes some cool files. Too bad there wasn't a cmd.exe file on our phones that we can execute.
aclegg2011 said:
yea, I saw the new thread. Hopefully somebody can find a exploit in all that. It executes some cool files. Too bad there wasn't a cmd.exe file on our phones that we can execute.
Click to expand...
Click to collapse
actually..there is! but it's stuck in a WIM. It inflates it on an "as-needed" basis.
I am hoping that we can use the backgroundworker to run some stuff elevated
compu829 said:
I am hoping that we can use the backgroundworker to run some stuff elevated
Click to expand...
Click to collapse
But they all are pretty much isolated. It is unlikely that you will be able to run anything elevated
aclegg2011 said:
yea, I saw the new thread. Hopefully somebody can find a exploit in all that. It executes some cool files. Too bad there wasn't a cmd.exe file on our phones that we can execute.
Click to expand...
Click to collapse
Not only is there a CMD.exe, but there are other interesting things like a BSOD screen, Control Panel, registry keys referencing desktop (A future exploit I might attempt), and even native EXEs (We knew about native EXEs since WPs release).
Why does this launcher not work with "normal" toasts: {YOUR-APP-GUID} and "/Page1.xaml"? Only with empty GUID and full path.
Similarly, any chance this could be used to open arbitrary XAML pages, rather than just the ones defined in the app manifest? For example, something like what was posted in another thread (http://forum.xda-developers.com/showpost.php?p=45265419&postcount=56) using the following URI: app://5edbdbbc-2ab2-df11-8a2f-00237de2db9e/_default#/View/APNSettingPage.xaml to launch a hidden page in the Connection Setup app. I don't know if that's a weird behavior of CS or if its universally possible (and while it feels lazy to ask, I'm at work right now). There are a bunch of "hidden" pages in the ATIV S Diagnosis app, some of which would be very useful, but the navigation code for them is blocked or outright missing. If we could invoke those directly... There are probably a bunch of other such hidden gems in other OEM apps too.
Yes you can. The way I found the one in the HTC app was by loading the dlls in JetBrain's dotPeek. Then I looked for the xaml files. It is all a relative URI based on what dotPeek/the app "sees". The only thing the manifest states is where the default entry point is for the page. Basically I looked in the manifest file for how it calls the "default" page. and then replace it with the relative URI for the other page you want.
If you guys want, I can write up a simple tutorial. I just have an HTC 8x, so my hands are tied. If someone can figure out how to deflate an nbh file so I can browse it, that'd be fantastic! I found a "dead" 521 on eBay that I am thinking of picking up for research since there are way more tools for Nokia.
compu829 said:
Yes you can. The way I found the one in the HTC app was by loading the dlls in JetBrain's dotPeek. Then I looked for the xaml files. It is all a relative URI based on what dotPeek/the app "sees". The only thing the manifest states is where the default entry point is for the page. Basically I looked in the manifest file for how it calls the "default" page. and then replace it with the relative URI for the other page you want.
If you guys want, I can write up a simple tutorial. I just have an HTC 8x, so my hands are tied. If someone can figure out how to deflate an nbh file so I can browse it, that'd be fantastic! I found a "dead" 521 on eBay that I am thinking of picking up for research since there are way more tools for Nokia.
Click to expand...
Click to collapse
That's correct. I have been navigating to various - normally unreachable - XAML pages in quite a few of the Nokia apps. I gave an example of that in a different thread:
Code:
app://[COLOR="Navy"][B]2377fe1b-c10f-47da-92f3-fc517345a3c0[/B][/COLOR]/[COLOR="Orange"][B]_default[/B][/COLOR]#/[COLOR="Green"][B]Launcher[/B][/COLOR];component/[COLOR="DarkRed"][B]MainPage.xaml[/B][/COLOR]
In this example, I launch the Nokia extras+info app (2377fe1b-c10f-47da-92f3-fc517345a3c0) with the default entry point (_default) which, as @compu829 stated, can found in the app's manifest. Following that, you can add "#/" (not sure if either the hash-tag or slash can be taken out or both are required to work but I know with both, it does work) to the URI to specify a particular XAML file you'd like to open. Following the "#/", you get to specify the assembly (i.e. the .DLL in the XAP file) in which the XAML file is located (Launcher). And finally, you add ";component/" followed by the full path to the XAML as defined in the embedded resource file (MainPage.xaml).
-W_O_L_F- said:
Why does this launcher not work with "normal" toasts: {YOUR-APP-GUID} and "/Page1.xaml"? Only with empty GUID and full path.
Click to expand...
Click to collapse
I presume your reference to the "empty GUID" is for the first parameter of my static Launcher.LaunchToast method? That first parameter is, as far as I can see, ignored for the actual toast launch. If I'd have the signature of the "Shell_PostMessageToast" method, I could perhaps understand what it does but, without it, I just knew it wanted a GUID (passed to it as a string) and that that GUID could be an empty one. I reversed engineered the signature from that native method (found in ShellChromeAPI.dll) by taking a look at another native assembly calling it. Naturally, this only tells shows me how that method is being called but doesn't return the name of the parameters. If I remember correctly, the assembly calling that method was passing its own application GUID... I could have done the same but, I didn't see what use it had so I decided to keep passing it an empty GUID.
The format of the toast is different most likely because that's the raw toast launching method. The other format you're used to is the more developer friendly one that's sanitized prior to launching it (so you can't launch another app directly).
Success!
@GoodDayToDie , this is exactly what I'm trying to do! And here is result: