FORUMS
Remove All Ads from XDA

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

11,933 posts
Thanks Meter: 59,029
 
Post Reply Email Thread
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.

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.


Please consider a donation to support ongoing development
Many thanks to those who have donated!


Download:

wp_mod for GPE Marshmallow 6.0 can be found here:
http://forum.xda-developers.com/htc-...persu-t3242210


Sense 4.4.4 (thanks @migascalp):
http://www.mediafire.com/download/4v...3.28.401.6.zip


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
The Following 74 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,155
 
Donate to Me
More
Nice Job!!!! this is awesome
1st April 2014, 04:02 AM |#3  
HolyAngel's Avatar
Recognized Contributor
Flag Springfield
Thanks Meter: 9,087
 
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: 91
 
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
The Following 3 Users Say Thank You to boosting1bar For This Useful Post: [ View ] Gift boosting1bar Ad-Free
1st April 2014, 04:52 AM |#5  
Senior Member
Thanks Meter: 70
 
More
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
Retired Forum Moderator / Recognized Developer
Flag New York City
Thanks Meter: 6,331
 
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: 162
 
More
You guys are awesome.
1st April 2014, 07:04 AM |#8  
Recognized Themer
Flag Dublin
Thanks Meter: 11,913
 
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 ] Gift Basil3 Ad-Free
1st April 2014, 07:50 AM |#9  
Senior Member
Flag Brisbane
Thanks Meter: 1,057
 
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: 70
 
More
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.
1st April 2014, 01:30 PM |#11  
JEANRIVERA's Avatar
Senior Member
Flag BETHLEHEM
Thanks Meter: 537
 
Donate to Me
More
Quote:
Originally Posted by graffixnyc

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

Can you share your zip please

Sent from my HTC One_M8 using Tapatalk
The Following User Says Thank You to JEANRIVERA For This Useful Post: [ View ] Gift JEANRIVERA Ad-Free
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes