Post Reply

[MOD][KERNEL MODULE] wp_mod: disable system write protection

1st April 2014, 03:36 AM   |  #1  
flar2's Avatar
OP Recognized Developer
Flag Ottawa
Thanks Meter: 26,868
 
5,421 posts
Join Date:Joined: Jun 2012
Donate to Me
More
wp_mod: Module to disable system write protection

This is a kernel module that disables write protection on the system partition while running the stock kernel.


HTC changed the MMC_MUST_PREVENT_WP_VIOLATION code to make it much harder to crack. I had to redo the module completely, so this is experimental. In the past, it was a simple matter of changing a variable, now we have to replace a function in the kernel so it returns something different, causing the kernel to skip over the write protection code.

It works, but needs more testing before I would recommend including it in ROMs. So far I have not found any problems.

I would caution against loading the module after attempting to make changes to the system partition. It could end up corrupting the filesystem. If the module is loaded at boot, there should be no worries.

This module will probably need to be updated to load with future kernels when they are released.


Download:

Sense 4.4.3 (2.22 base):
wp_mod.ko

Sense 4.4.2:
wp_mod.ko

GPE 4.4.4 (thanks to @italyforever):
wp_mod.ko

GPE 4.4.2:
wp_mod.ko




Installation:
Wait for it to be implemented in your favourite ROM

* or *

Copy the module to your device, and type
Code:
su
insmod /location-where-you-copied-it/wp_mod.ko

Changes:

April 2, 2014 - wp_mod 4.1
-only return non-existing partition number if called by generic_make_request_checks
-remove exit from module (we don't want to be able to unload it)
-clean up code


March 31, 2014 - wp_mod 4.0
-new method for HTC One m8



Source:
https://github.com/flar2/wp_mod

Module was compiled against m8 Google Play Edition source. Some symbol CRC checks had to be hexedited in the compiled module to match the stock kernel. Thanks to Michael Coppola for example of function hooking on arm: http://poppopret.org/2013/01/07/sute...6-and-arm/#arm
Last edited by flar2; 10th September 2014 at 02:48 AM.
The Following 69 Users Say Thank You to flar2 For This Useful Post: [ View ]
1st April 2014, 03:51 AM   |  #2  
Account currently disabled
Flag Tinley park,il
Thanks Meter: 7,148
 
2,703 posts
Join Date:Joined: Jun 2012
Donate to Me
More
Nice Job!!!! this is awesome
Last edited by drakeymcmb; 1st April 2014 at 03:58 AM.
1st April 2014, 04:02 AM   |  #3  
HolyAngel's Avatar
Senior Member
Flag Springfield
Thanks Meter: 2,018
 
1,422 posts
Join Date:Joined: Sep 2008
Donate to Me
More
AWESOME! Thank you! Will test and see

Sent from my HTC One_M8 using XDA Premium 4 mobile app
1st April 2014, 04:27 AM   |  #4  
Senior Member
Thanks Meter: 23
 
145 posts
Join Date:Joined: Jul 2013
More
Confirmed working here. I was able to delete stuff with titanium backup and it stuck after reboot. Thanks so much!

Sent from my M8 via XDA Premium app
Last edited by boosting1bar; 1st April 2014 at 04:32 AM.
The Following 3 Users Say Thank You to boosting1bar For This Useful Post: [ View ]
1st April 2014, 04:52 AM   |  #5  
Senior Member
Thanks Meter: 30
 
383 posts
Join Date:Joined: Oct 2008
So as an end user, before it gets baked into ROMs, we need to load this after each boot?
1st April 2014, 04:54 AM   |  #6  
graffixnyc's Avatar
Forum Moderator / Recognized Developer
Flag New York City
Thanks Meter: 4,739
 
5,531 posts
Join Date:Joined: Jan 2011
Donate to Me
More
Worked here as well on the AT&T variant. I added the line to the install recovery script that chainfire uses for SuperSU and it loads it on boot now

what i did was run the insmod command in terminal emulator, made the system rw/ edited /system/etc/install-recovery.sh and added the insmod line in there Sure it would be easier if I had init.d support but I'm on stock and am too lazy to change to a custom rom :P
1st April 2014, 04:57 AM   |  #7  
Senior Member
Thanks Meter: 143
 
970 posts
Join Date:Joined: Sep 2007
You guys are awesome.
1st April 2014, 07:04 AM   |  #8  
Recognized Themer
Flag Dublin
Thanks Meter: 8,068
 
4,981 posts
Join Date:Joined: Apr 2008
Donate to Me
More
Awesome work....Can now scratch my theming itch

Sent from my unknown using Tapatalk
The Following 2 Users Say Thank You to Basil3 For This Useful Post: [ View ]
1st April 2014, 07:50 AM   |  #9  
Senior Member
Flag Brisbane
Thanks Meter: 1,028
 
2,682 posts
Join Date:Joined: Jan 2011
More
Quote:
Originally Posted by gjlowe

So as an end user, before it gets baked into ROMs, we need to load this after each boot?

Nope. It'll get rolled into the kernel/scripts that are loaded at boot automagically.

M.
1st April 2014, 01:25 PM   |  #10  
Senior Member
Thanks Meter: 30
 
383 posts
Join Date:Joined: Oct 2008
Quote:
Originally Posted by mattman83

Nope. It'll get rolled into the kernel/scripts that are loaded at boot automagically.

M.

Hmmm..I ran the command in the OP and rebooted and when I try to create a directory in / it says that it is a read only file system.

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Top Threads in One (M8) Original Android Development by ThreadRank