Kernel Modification/Hacking/Patching

#!/

Uzman üye
9 Mar 2016
1,323
2
TEM
Kernel Modification, Patching or Hacking

As you can see at the title; hacking, patching or modification works are can seen as different process but they are actually same.

When you clone so download your device's kernel source trees; you might be able to hack that source. This process sounds good thing; because you can reach and add or change so patch whatever of you want.

Learning The Basics & Getting Ready



I am assuming you downloaded already for which you want to hack the device of you have.If not, please refer to Google and search for "YourDevice'sFullName Kernel Source and you are ready for kernel hacking.

You know, there is an efficient web site for development, coding... This is named GitHub. GitHub is will our main focus if you are newbie for kernel hacking.

For an efficient searching in GitHub, you should know some of terms especially called "Commit".

Commit is looks like hashed and defines the pre-applied patches in any source code. We should search commits for hacking and learning easily the kernel or whatever you want to apply something in your source codes.

There is an easy search style in GitHub for list the commits:

https://github.com/search?q=kernel:add+InteractiveX+governor&type=commits


Hacking The Kernel

In defined "GitHub Commit Search Link", you can search pre-patched codes examples and you can apply them into your kernel source if they arent conflict to your kernel.

Lets start with searching the CPU Governors like InteractiveX governor:

Z94Tc.md.jpg


So we would look at that:

https://github.com/BobZhome/GingerKernel-thunderc/commit/12619d368c8e64175c05bce154b9aa75f5229a9b

As you can see, the green colors are defines "addition" and red is "deletion".
at top of every patches, you can see the where these patches are will be applied.

For example;

Kod:
drivers/cpufreq/cpufreq_interactivex.c

this cpufreq_interactivex.c named C file will be created in drivers/cpufreq/ directory of kernel source.

Lets also take a look at this:

https://github.com/BobZhome/GingerK...52ab0d7ec0914b66e6d5a0cae3014a93eecaa69490a2e ;

Kod:
obj-$(CONFIG_CPU_FREQ_GOV_USERSPACE)	+= cpufreq_userspace.o
obj-$(CONFIG_CPU_FREQ_GOV_ONDEMAND)	+= cpufreq_ondemand.o
obj-$(CONFIG_CPU_FREQ_GOV_CONSERVATIVE)	+= cpufreq_conservative.o
obj-$(CONFIG_CPU_FREQ_GOV_INTERACTIVEX) += cpufreq_interactivex.o
obj-$(CONFIG_CPU_FREQ_GOV_SMARTASS2)	+= cpufreq_smartass2.o

# CPUfreq cross-arch helpers
obj-$(CONFIG_CPU_FREQ_TABLE)

except # and one line down; these code's bottom two lines are added for import "smartass" and "interactivex" governors in kernel source's Makefile file can be found by drivers/cpufreq/ directory.

If you want to simply apply this feature in your kernel; then just add ".patch" at last of url link like that:

https://github.com/BobZhome/GingerK...2619d368c8e64175c05bce154b9aa75f5229a9b.patch

then, download this .patch file into your kernel source's root:

Kod:
wget https://github.com/BobZhome/GingerKernel-thunderc/commit/12619d368c8e64175c05bce154b9aa75f5229a9b.patch

then:

Kod:
git apply [I]DownloadedPatchFile'sName.patch[/I]

and hacking process done, enjoy your new patched kernel..




















 
Son düzenleme:
Üst

Turkhackteam.org internet sitesi 5651 sayılı kanun’un 2. maddesinin 1. fıkrasının m) bendi ile aynı kanunun 5. maddesi kapsamında "Yer Sağlayıcı" konumundadır. İçerikler ön onay olmaksızın tamamen kullanıcılar tarafından oluşturulmaktadır. Turkhackteam.org; Yer sağlayıcı olarak, kullanıcılar tarafından oluşturulan içeriği ya da hukuka aykırı paylaşımı kontrol etmekle ya da araştırmakla yükümlü değildir. Türkhackteam saldırı timleri Türk sitelerine hiçbir zararlı faaliyette bulunmaz. Türkhackteam üyelerinin yaptığı bireysel hack faaliyetlerinden Türkhackteam sorumlu değildir. Sitelerinize Türkhackteam ismi kullanılarak hack faaliyetinde bulunulursa, site-sunucu erişim loglarından bu faaliyeti gerçekleştiren ip adresini tespit edip diğer kanıtlarla birlikte savcılığa suç duyurusunda bulununuz.