Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to spawn: remote_write PTRACE_POKEDATA head failed: 5 | HUAWEI #1023

Closed
HermesNWO opened this issue Sep 19, 2019 · 18 comments
Closed

Comments

@HermesNWO
Copy link

HermesNWO commented Sep 19, 2019

Hello everyone,

Thanks to the DEV for this amazing tool.

I'm using a Huawei P20 Lite ANE-LX1 C432 with a Custom ROM and a Custom Kernel. (MorfuZ for EMUI 8.x.x, Kernel 2.1)

####adb root : OK
####adb shell "/data/local/tmp/frida-server --listen 0.0.0.0 &": OK
####frida -U ps : OK 
frida-trace -U -i open com.android.chrome : 
Failed to attach: remote_call PTRACE_POKEDATA failed: 5 
frida -U -f xxx.xxx.xxx -l myinjectionscript.js --no-pause:
Failed to spawn: remote_write PTRACE_POKEDATA head failed: 5    

After some googling I find this issue was due to a lack of Ptrace() in Huawei Hardware, I'm going to install it and update this thread but I want to know if some of you find a way to solve it !

My SELINUX is permissive, ro.debuggable=1, ro.boot.selinux=[permissive], ro.boot.veritymode=[permissive], Zygote64 is running and working but Ptrace() seems to not exist ! (You can edit your props with Magisk, on terminal run "su magisk resetprop {yourprop}=#)

Do I have to install a running ARM64 version of Ptrace() in my system ?

If you have some other clue or documentation for Huawei Kernel pls post it in reply !

Ptrace() scope in Android Kernel don't exist on Huawei

Thank you all !

@HermesNWO
Copy link
Author

Could someone help me please ! If you got huawei pls prompt me !

@ud3v0id
Copy link

ud3v0id commented Jan 1, 2020

You need to recompile the kernel and enable the option CONFIG_HUAWEI_PTRACE_POKE_ON

@Gunkkk
Copy link

Gunkkk commented Nov 11, 2020

You need to recompile the kernel and enable the option CONFIG_HUAWEI_PTRACE_POKE_ON

I have done this,but the issue still be there, is there any trick?
Sloved , also need selinux to disable

@HermesNWO
Copy link
Author

I have done this,but the issue still be there, is there any trick?
Sloved , also need selinux to disable

Nice ! I will Update Soon On Huawei P20 Lite ANE-LX1 if it works with selinux disabled !

@HermesNWO
Copy link
Author

You need to recompile the kernel and enable the option CONFIG_HUAWEI_PTRACE_POKE_ON

I have done this,but the issue still be there, is there any trick?
Sloved , also need selinux to disable

Finally I managed to do do it ! Compile your kernel with
CONFIG_HUAWEI_PTRACE_POKE_ON=y

Everything works perfectly !

My device is Huawei P20 Lite ANE-LX1 C432 - You can build using this kernel to get the same result
https://github.com/catuva21/hi6250-emui8.x

have nice debugging time !

@adproject123
Copy link

adproject123 commented Mar 24, 2021

You need to recompile the kernel and enable the option CONFIG_HUAWEI_PTRACE_POKE_ON

I have done this,but the issue still be there, is there any trick?
Sloved , also need selinux to disable

Finally I managed to do do it ! Compile your kernel with
CONFIG_HUAWEI_PTRACE_POKE_ON=y

Everything works perfectly !

My device is Huawei P20 Lite ANE-LX1 C432 - You can build using this kernel to get the same result
https://github.com/catuva21/hi6250-emui8.x

have nice debugging time !

Good night, can you share the assembled kernel for Huawei HI6250?

I've been trying to build the kernel using the toochain -> aarch64-linux-android-4.9 for the third day and get errors. :(
Generate for Ubuntu 18.04.

My actions:

// To folder

cd Android/utility

// Toolchain ARM x64 (Linux Android 4.9) to ulility folder:

git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9

// Make, patch's:

export PATH=$PATH:/home/myubuntu/Android/utility/aarch64-linux-android-4.9/bin
export CROSS_COMPILE=aarch64-linux-android-
mkdir ../out
make ARCH=arm64 O=../out mydevice_defconfig
make ARCH=arm64 O=../out -j4

Errors:

myubuntu@muubuntu-Lenovo-IdeaPad:~/Android/kernel/BND-AL10$ make ARCH=arm64 O=../out mydevice_defconfig
make[1]: вход в каталог «/home/muubuntu/Android/kernel/out»
  GEN     /home/muubuntu/Android/kernel/out/Makefile
drivers/huawei_platform/sw/Kconfig:4:warning: prompt redefined
drivers/huawei_platform/sw/Kconfig:1:warning: ignoring type redefinition of 'HW_SW_DEVICES' from 'tristate' to 'boolean'
#
# configuration written to .config
#
make[1]: выход из каталога «/home/muubuntu/Android/kernel/out»

Patch's is OK, kernel source - Catuva21
Defconfig not edit. What could be my mistake?

If you do not mind sharing the compiled-core with the included: CONFIG_HUAWEI_PTRACE_POKE_ON = y

Thank you in advance. And sorry for my English.

PS:
I also did not find a solution on this issue in Google. Everything is done according to the instructions. the Patch doesn't fix the problem.

Branches for https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9 did not help. :(-b oreo-release) for tags :(

@HermesNWO
Copy link
Author

You need to recompile the kernel and enable the option CONFIG_HUAWEI_PTRACE_POKE_ON

I have done this,but the issue still be there, is there any trick?
Sloved , also need selinux to disable

Finally I managed to do do it ! Compile your kernel with
CONFIG_HUAWEI_PTRACE_POKE_ON=y
Everything works perfectly !
My device is Huawei P20 Lite ANE-LX1 C432 - You can build using this kernel to get the same result
https://github.com/catuva21/hi6250-emui8.x
have nice debugging time !

Good night, can you share the assembled kernel for Huawei HI6250?

I've been trying to build the kernel using the toochain -> aarch64-linux-android-4.9 for the third day and get errors. :(
Generate for Ubuntu 18.04.

My actions:

// To folder

cd Android/utility

// Toolchain ARM x64 (Linux Android 4.9) to ulility folder:

git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9

// Make, patch's:

export PATH=$PATH:/home/myubuntu/Android/utility/aarch64-linux-android-4.9/bin
export CROSS_COMPILE=aarch64-linux-android-
mkdir ../out
make ARCH=arm64 O=../out mydevice_defconfig
make ARCH=arm64 O=../out -j4

Errors:

myubuntu@muubuntu-Lenovo-IdeaPad:~/Android/kernel/BND-AL10$ make ARCH=arm64 O=../out mydevice_defconfig
make[1]: вход в каталог «/home/muubuntu/Android/kernel/out»
  GEN     /home/muubuntu/Android/kernel/out/Makefile
drivers/huawei_platform/sw/Kconfig:4:warning: prompt redefined
drivers/huawei_platform/sw/Kconfig:1:warning: ignoring type redefinition of 'HW_SW_DEVICES' from 'tristate' to 'boolean'
#
# configuration written to .config
#
make[1]: выход из каталога «/home/muubuntu/Android/kernel/out»

Patch's is OK, kernel source - Catuva21
Defconfig not edit. What could be my mistake?

If you do not mind sharing the compiled-core with the included: CONFIG_HUAWEI_PTRACE_POKE_ON = y

Thank you in advance. And sorry for my English.

PS:
I also did not find a solution on this issue in Google. Everything is done according to the instructions. the Patch doesn't fix the problem.

Branches for https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9 did not help. :(-b oreo-release) for tags :(

Hello ! Yes There's several patches to do on some *.c of the kernel !

Here's for you the compiled Kernel ! Be careful when installing a new kernel ! Use twrp recovery and make a backup of the orig one !

The kernel is bug-proof and working perfectly ! (VPN, ipv6, NAT, etc...)

Flash the zip to twrp to install the kernel ! Write here if it don't work ! The kernel-image.gz is the kernel !

https://www.upload.ee/files/12992392/0vSStX-peta-06-01-2021-02-28-P20l.zip.html

@adproject123
Copy link

Thanks FRIEND! You helped me a lot and I think not only for me

@TA2k
Copy link

TA2k commented Nov 11, 2021

@HermesNWO or @adproject123 Can you please reupload the compiled kernel please

@adproject123
Copy link

@HermesNWO or @adproject123 Can you please reupload the compiled kernel please

Hi, https://dropmefiles.com/hERDD

@TA2k
Copy link

TA2k commented Nov 15, 2021

Kernel patch leads to disabled wifi on my device.
Full Reset show available EMUI 9.1 update.
EMUI9.1 has the needed flag enabled in the kernel, no kernel patch needed for EMUI9.1

@cafissimo
Copy link

@HermesNWO or @adproject123 Can you please reupload the compiled kernel please

Hi, https://dropmefiles.com/hERDD

Hello @HermesNWO and @adproject123 ,
please could you kindly upload again the compiled kernel?
Both previous links lead to empty pages (files expired probably).

Thanks in advance.

@cafissimo
Copy link

@TA2k : can you please share the recompiled kernel image?
Thanks.

@moohaad
Copy link

moohaad commented Feb 1, 2024

Does anyone still have the compiled kernel file?

I have been trying to compile the source with no luck

@cafissimo
Copy link

cafissimo commented Feb 2, 2024 via email

@cafissimo
Copy link

cafissimo commented Feb 4, 2024

@moohaad I am not sure 100% that the kernel image file is the right one, so I am going to share a .zip containing either the kernel.mg file, either the backup I have done from my Huawei P8 Lite 2017.
In the file you will also find a screenshot with informations about software that is running on my phone.
Frida works fine for me.

Best regards.

https://drive.google.com/file/d/1iW9QgsEzlh4bl0gY1wOTF6zD95DL83TY/view?usp=sharing

@moohaad
Copy link

moohaad commented Feb 4, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants