[NEED HELP]wp_mod for HTC Desire 826
It's extremely easy to disable write protection if you compile your own kernel, you just turn off MMC_MUST_PREVENT_WP_VIOLATION.
Previously, the wp_mod hack was dead simple. All we had to do was call an existing kernel function to change the number of the partition that write protection applied to. In the new source (below), HTC got rid of all this extraneous code and just hardcoded it to apply the write protection to /system. This happens in block/blk-core.c as you can see below. We need to skip over the quoted code.
Hello Sir,
I'm trying to disable S-ON system write protection on HTC Desire 826 (3.10.49-perf-gca7b0f1), In this device also, HTC uses MMC_MUST_PREVENT_WP_VIOLATION for /system write protection (commit:
b75b4f2).
Code:
(bootloader) version: 0.5
(bootloader) version-bootloader: 3.19.0.0000
(bootloader) version-baseband: 1.0.U20410.1@60201
(bootloader) version-cpld: None
(bootloader) version-microp: None
(bootloader) version-main:
(bootloader) version-misc: PVT SHIP S-ON
(bootloader) serialno: CC55EYG01638
(bootloader) imei:
(bootloader) imei2:
(bootloader) meid: 00000000000000
(bootloader) product: a52_dtul
(bootloader) platform: hTCBmsm8939
(bootloader) modelid: 0PHC10000
(bootloader) cidnum: HTC__038
(bootloader) battery-status: good
(bootloader) battery-voltage: 0mV
(bootloader) partition-layout: Generic
(bootloader) security: on
(bootloader) build-mode: SHIP
(bootloader) boot-mode: FASTBOOT
(bootloader) commitno-bootloader: 7b3f8116
(bootloader) hbootpreupdate: 11
(bootloader) gencheckpt: 0
(bootloader) mfg-name: 1001
all: Done!
finished. total time: 0.109s
With reference to your quoted post. . .
https://xdaforums.com/showpost.php?p=54577811&postcount=124
I've hexedited the module to match the CRC checks for my device kernel-3.10.49-perf-gca7b0f1 but it doesn't seems to work. . .
Code:
insmod: init_module 'system/lib/modules/wp_mod.ko' failed (Exec format error)
I've attached the module I'm using (wp_mod.ko) and the reference module (mmc_test.ko) to match module_layout
With reference to your quoted post. . .
https://xdaforums.com/showpost.php?p=51586322&postcount=25
and this commit:
b75b4f2
This can be done by changing. . .
Code:
might_sleep();
#ifdef CONFIG_MMC_MUST_PREVENT_WP_VIOLATION
sprintf(wp_ptn, "mmcblk0p%d", get_partition_num_by_name("system"));
if (!strcmp(bdevname(bio->bi_bdev, b), wp_ptn) && !board_mfg_mode() &&
(get_tamper_sf() == 1) && (get_atsdebug() != 1) && (bio->bi_rw & WRITE)) {
pr_info("blk-core: Attempt to write protected partition %s block %Lu \n",
to
Code:
might_sleep();
#ifdef CONFIG_MMC_MUST_PREVENT_WP_VIOLATION
sprintf(wp_ptn, "mmcblk0p%d", get_partition_num_by_name("xxxxxx"));
if (!strcmp(bdevname(bio->bi_bdev, b), wp_ptn) && !board_mfg_mode() &&
(get_tamper_sf() == 1) && (get_atsdebug() != 1) && (bio->bi_rw & WRITE)) {
pr_info("blk-core: Attempt to write protected partition %s block %Lu \n",
Now that I'm a bit new to modifying kernel through this kernel source, I need your help Sir!
What I'm trying to do here is remove this /system write protection by any means: modifiying the kernel or by using wp_mod.ko
I've also attached the stock boot.img for my device for your reference.
Thank You