2

I basically need to find out if there is a way to capture movements or keystrokes of a game such as "Angry Birds" etc using the touch screen of an iPhone and save them to a file on the device.

I'm sure these phones have security issues and don't want native "keystroke logging", but if it's a layer that sits over the other game, it should be ok

Please let me is there any way to achieve the same. Your help would be appreciated. Thanks In Advance

NSExpression
  • 721
  • 5
  • 18
  • I highly doubt you'd be allowed to do intercept the touches from any app without some serious event hacking. As a commercial app, I fear it's not possible, but on a device that grants you su permissions, I think it's entirely possible. You could set up a daemon process to monitor the Quartz event loop. – CodaFi Feb 26 '13 at 08:04
  • Hi @CodaFi Thanks for you instant reply. Can you elaborate the term : " You could set up a daemon process to monitor the Quartz event loop ". ? – NSExpression Feb 26 '13 at 08:35

1 Answers1

0

What you are trying to do can be very easily accomplished by using MobileSubstrate, a very powerful framework created by Jay Freeman that allows you to modify virtually any function of any process at runtime. The build environment theos, by Dustin Howett, can be used in place of Xcode, with its Logos preprocessor making all this seemingly complicated mischief a very, very simple task.

Something like this could be accomplished with a very small amount of code.

Example:

%hook UIApplication //Hooks into the UIApplication class.

- (void)sendEvent:(id)arg1{//Hook the sendEvent function, the function which handles all events passed to a UIApplication.

  if([arg1 isKindOfClass:%c(UITouchesEvent)]){//Make sure we're not processing other events, such as device rotation.

    for(UITouch *touch in [arg1 allTouches])
      NSLog(@"Touch recorded: %@", NSStringFromCGPoint([touch locationInView: [[UIApplication sharedApplication] keyWindow]]));

  }

  %orig;//Call the original function, so the app can still process the events, and we don't eat them all.

}

As you can see, it is actually quite simple.

Unfortunately, jailbroken devices are your only option. Obviously, you won't be able to put anything like this in the App Store. However, Cydia has become a very prominent part of iOS, and success through it can be reached just as easily, if not more easily, than something on the App Store could.

eswick
  • 519
  • 4
  • 16