Commit f10ff50
committed
kernel: core_hook: fixup 32-on-64 compat detection via linux_binprm
I'll just post code comments as I'm too lazy.
Maybe i'll do a writeup later blah blah
/*
* 32-on-64 compat detection
*
* notes:
* bprm->buf provides the binary itself !!
* https://unix.stackexchange.com/questions/106234/determine-if-a-specific-process-is-32-or-64-bit
* buf[0] == 0x7f && buf[1] == 'E' && buf[2] == 'L' && buf[3] == 'F'
* so as that said, we check ELF header, then we check 5th byte, 0x01 = 32-bit, 0x02 = 64 bit
* we only check first execution of /data/adb/ksud and while ksu_execveat_hook is open!
*
*/
Signed-off-by: backslashxx <[email protected]>1 parent f4cc6e5 commit f10ff50
2 files changed
+27
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
692 | 692 | | |
693 | 693 | | |
694 | 694 | | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
695 | 699 | | |
696 | 700 | | |
697 | 701 | | |
698 | 702 | | |
699 | 703 | | |
700 | 704 | | |
701 | 705 | | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
702 | 729 | | |
703 | 730 | | |
704 | 731 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | 67 | | |
72 | 68 | | |
73 | 69 | | |
| |||
0 commit comments