Tuesday, May 29, 2018

PUBG Mobile Mouse Helper

This is something I made a couple of days ago to enable me to rapid fire single shot weapons while negating recoils of most guns in PUBG Mobile's official PC version by Tencent. I first tried to achieve the same using AutoHotkey - but it, or perhaps my knowledge of it, quickly fell short. So, I decided to make something to the same effect in C. I did, but I wanted a nice GUI with the ability to modify the different parameters of the script. I thought my SimWin library could do the job but I decided trackbar controls would be better suited for the purpose of modulating the recoil parameters than some plain old textboxes, and unfortunately, I'd not implemented trackbars in SimWin yet. So, I decided .Net with P/Invoke would have to do. Two days later, here it is :

The primary goal and functionality of the program is quite simple but here are the major highlights :
  • Hold middle mouse button to auto fire single shot weapons
  • Allows modulation of four different parameters : i) Horizontal correction (dx) ii) Vertical correction (dy) iii) Sleep period between consecutive mouse moves during recoil correction* (WaitMs) iv) Delay period between consecutive shots fired (DelayMs)
  • Ability to save custom presets for different weapons along with six built-ins
  • Enter key switches between different presets when in monitoring mode for when within the game
  • Arrow keys modify the dx and dy parameters when in monitoring mode for when within the game
*The recoil correction has been implemented by basically holding and dragging the in-game cursor since the game crosshair doesn't correspond to the actual cursor position. And while the in-game cursor does correspond to the actual cursor position, it is constantly repositioned to somewhere near the center of the game window. So, a simple SetCursorPos() call doesn't do the trick (tried and failed). This is the reason mouse_event() calls have been used to simulate mouse movement in terms of x and y displacements - dx and dy - for recoil correction. Furthermore, looping through each of the dx and dy pixels without any artificially placed delays seems to be too quick for the game to register - the recoil correction stops working altogether. This is why a WaitMs delay is required.

The original C code that I experimented with is available here

Download the program here

Project @ GitHub

Note : .Net Framework 4.6.1 is required to run this program.

Update : Version 2.3 has been published on GitHub.

Friday, May 18, 2018

x64 inline hooking of ntdll functions

This is a 64-bit update to this code.
I learned a few things about 64-bit assembly and corresponding calling conventions during the writing of this fairly simple program. The code is self-explanatory and can be found here

Tuesday, January 9, 2018

Phone Monitor

I had made a basic phone monitoring program using B4A some years back just out of curiosity. I had a fairly good grasp of malware programming in Windows, so I had thought of giving my mobile phone's OS a try with it. Basic felt easy since it was the language I was most accustomed to using then, and it was Basic, for Android. The mobile OS itself was still not very mature so a lot more loopholes than now and certain things were more easily doable, not to mention the availability of third-party libraries for B4A. Anyway, I never released it; must be sitting around somewhere on my old desktop's hard disk.
The above program is not what this post is about though. This blog has seen me transform from a quick and dirty vb6 - read procedural - programmer to a relatively organized, more modular C# - say OOP - coder. I write OO programs now. I taught myself Java too, not too different from C#. So, about two weeks ago, I made up my mind about giving a new Android project a go, this time not in B4A, but in Java, the mainstream language that most Android apps are written in (that may change to Kotlin in the future, who knows), and in determining what, I figured why not make a better, updated, extended version of something cool I'd created before. The result is PhoneMonitor.
The old program was called SMSLogger because I'd built it up from exactly that, a program that would upload the target Android device's SMS messages to a specified FTP server. In its final form, it was capable of doing more than that of course, like recording phone conversations, listening for SMS based commands to do some fun stuff like vibrating the phone or more useful stuff like retrieving the phone's GPS coordinates, calling a specified number, messaging a specified number etc. So, this PhoneMonitor follows a similar development path but is more comprehensive and geared towards web panel based command and control rather than SMS'es (one of the reasons being the new security features concerning SMS write/broadcast permissions in Android KitKat and above. Life used to be easier back in the Gingerbread days.) The major functionalities include retrieving call logs, contacts, sms messages, device location (this too is harder than used to be), back and front camera pics, command to call, send an SMS, vibrate, enable Wifi - oh, and of course, it records phone conversations and uploads them to the specified FTP server.
The full source code for the app and the web panel along with some screenshots is available @ github