Phatware DBExplorer v3.0
http://www.phatware.com/


A friend of mine 'PDAFreak' ask me to make an easy tuts for beginners.  So here it is!

Among the many protections used in PPC, the easiest one to handle is the one using a nag screen.

My example is Pocket DBExplorer version 3.0 from Phatware

Download the demo from the above link.

Protection used: Serial.  Unregistered version will have a nag asking for serial everytime you start it.
After 30-days, the application will expire.

So our target is to patch the nag.

Install the demo and open it with Resource Hacker.  Find the string containing this:

152, 	"You have %d days left until the end the trial period. Do you want to register Pocket dbExplorer now?"

That is the nag that shows up everytime you start it.  

Once expired, you'll see another nag:

71, 	"You must register Pocket dbExplorer to use this command.\nDo you want to register now?"

If you choose yes, you'll get to input the serial, if no then the application will exit.

So by converting the Decimal 152 to Hex you'll get 98.

Open the execute file with IDA and search for #0x98.  By doing so, you'll arrive here:


.text:0002B434                 CMP     R0, #0
.text:0002B438                 BNE     loc_2B490
.text:0002B43C                 BL      sub_2B248     <--- This routine here checks the installation time
.text:0002B440                 MOV     R5, R0
.text:0002B444                 CMP     R5, #0x1D     <--- Compare if the time exceeds 29 days
.text:0002B448                 BHI     loc_2B4B0     <--- If exceeds then jump to loc_2B4B0, expired message
.text:0002B44C                 CMP     R6, #0
.text:0002B450                 BNE     loc_2B490
.text:0002B454                 MOV     R2, #0x100
.text:0002B458                 ADD     R1, SP, #0x414+var_414
.text:0002B45C                 MOV     R0, #0x98     <-------- if not then the nag 'You have %d days left...'
.text:0002B460                 BL      sub_2113C
.text:0002B464                 RSB     R2, R5, #0x1E
.text:0002B468                 ADD     R1, SP, #0x414+var_414
.text:0002B46C                 ADD     R0, SP, #0x414+var_214
.text:0002B470                 BL      wsprintfW
.text:0002B474                 MOV     R2, #0x44
.text:0002B478                 ADD     R1, SP, #0x414+var_214
.text:0002B47C                 MOV     R0, R4
.text:0002B480                 BL      sub_21170
.text:0002B484                 CMP     R0, #6
.text:0002B488                 MOVEQ   R0, R4
.text:0002B48C                 BLEQ    sub_2B3A0
.text:0002B490
.text:0002B490 loc_2B490                               ; CODE XREF: sub_2B410+28j
.text:0002B490                                         ; sub_2B410+40j
.text:0002B490                 LDR     R0, [SP,#0x414+var_14]
.text:0002B494                 BL      sub_2F668
.text:0002B498                 MOV     R4, #1
.text:0002B49C
.text:0002B49C loc_2B49C                               ; CODE XREF: sub_2B410+CCj
.text:0002B49C                                         ; sub_2B410+DCj
.text:0002B49C                 MOV     R0, R4
.text:0002B4A0                 MOVL    R12, 0x404
.text:0002B4A8                 ADD     SP, SP, R12
.text:0002B4AC                 LDMFD   SP!, {R4-R6,PC}
.text:0002B4B0 ; ---------------------------------------------------------------------------
.text:0002B4B0
.text:0002B4B0 loc_2B4B0                               ; CODE XREF: sub_2B410+38j
.text:0002B4B0                 MOV     R2, #0x44
.text:0002B4B4                 MOV     R1, #0x47     <----- The second nag 'You must register...'
.text:0002B4B8                 MOV     R0, R4
.text:0002B4BC                 BL      sub_21158
.text:0002B4C0                 CMP     R0, #6


In order to patch this application, you just need to skip the time check and nag.  To do so:

.text:0002B438                 BNE     loc_2B490

Force it to:                   B     loc_2B490

In Hex code:

14 00 00 1A  change to 14 00 00 EA

Make the change and sign the execute file.

Voila! the protection is defeated by changing a single byte of code.

Cheers!

SJ_Treo650
www.c4pda.com