Subscribe to the RSS feed then follow me on twitter at @mrlacey (misc) and @wpug (WPDev news)

Tuesday, March 01, 2011

What hackers can teach us about what might be coming in future versions of Windows Phone

Ever wondered why so many of the "hacked" Windows Phone 7 apps show loading additional ringtones or accessing the camera directly?

Well I've had a little look at what some of the hackers have been doing and have found a few managed assemblies that aren't publicly available and it seems to be these that most of the people exploring in this area have been looking at.

So, for your amusement, interest and to satisfy your curiosity, here, in no particular order are some of those methods:

public abstract class Camera : IDisposable
{
  // ...
}

public sealed class PhotoCamera : Camera
{
  // ...
}

public sealed class VideoCamera : Camera
{
  // ...
}

public sealed class RingtoneLibrary
{
  // ...
  public void AddRingtone(Stream ringtoneSource, string ringtoneName)
  {
    // ...

    StreamHelper helper = new StreamHelper(ringtoneSource);
    try
    {
        NativeMethods.MediaApi_AddRingtoneFile(helper.GetTempFile(), ringtoneName);
    }
    finally
    {
        helper.Cleanup();
    }

    // ...
  }

  // ...
}

[DllImport("netcfmail3_7.dll")]
internal static extern byte GetMessageData(IntPtr pMessageNode, byte[] dataBuffer, int cbDataBuffer, byte[] idBuffer, int cbIdBuffer);
 
[DllImport("netcfmail3_7.dll")]
internal static extern int SendAsAttachment(string to, string subject, string messageClass, byte[] data, int cbData, string attachmentFileName);

[DllImport("netcfmail3_7.dll")]
internal static extern int SendInBody(string to, string subject, string messageClass, string body, int cchBody);

public CivicAddress ResolveAddress(GeoCoordinate coordinate)
{
  // ...
}

public static extern int HostGetAvailableFreeSpace(IntPtr pRuntimeHost, out long pAvailableSpace);

The things that jump out at me, apart from the camera access are the methods relating to emails!

My theory is that if there is managed functionality in the framework already (and its use doesn't pose a threat to the security of the users data or device) it's not unreasonable to assume that this could be made public in the future.

Just in case it bears repeating, this is all speculation and I have no special insight into what might be coming in future versions.

Are you a Windows Phone developer? If so, you could be getting rewards for the apps you build and the success they achieve by joining Nokia's DVLUP program.

2 comments:

  1. Nothing new here. Those are managed un-exposed hooks that were documented a while ago.

    Ringtones:
    http://dotnet.dzone.com/articles/how-you-can-add-custom

    Camera:
    http://dotnet.dzone.com/articles/how-videocameracamera-content
    http://dotnet.dzone.com/articles/not-your-regular-photo-and

    ReplyDelete
  2. @Den I posted this before those articles on dzone were posted. Yes, this is all old hat now - but did point tp some things that have been announced for Mango.

    ReplyDelete