Reverse engineering kernel workflow with Ghidra - Android Software/Hacking General [Developers Only]

HI, I've been programming in C++ and C for around 6 years and i've been reverse engineering mostly to mod games in the past.
I recently got some interest into reverse engineering the kernel source of the iPlay 40 to allow to build custom roms like lineageos on it, however I am not sure about the recommended workflow with ghidra, I remember seeing an old thread that had an ida pro script for the symbols but i didn't really found much when it comes to ghidra (which is the best open source option except maybe radare2)
i imagine that what would need to be reverse engineered is the kernel build config and the drivers sources, but i haven't that much exp with kernel reversing that's why i was hoping to find some info here as many people are familiar with it
ps : if I didn't post it in the right forum i'm sorry, i wasn't sure in which one i should post, don't hesitate to move it if it's the wrong place.

Note: Questions go in Q&A Forum
If you are posting a Question Thread post it in the Q&A forum. Technical discussion of Android development and hacking. No noobs, please. Device-specific releases should go under the appropriate device forum...
forum.xda-developers.com

Related

[Guide] building and modding custom roms

First of all, i hope the mods and admins forgive me that i open this thread in the development section, it would better fit to general, but i noticed that the developers aren't really present at the general section, if i'm wrong please move it.
This thread is build to become an collection of our developers knowledge that helps newcomers to androiddevelopment to start with it. I know out there are some guides already and in every thread there's a little bit of it, but i would really like to collect as much as possible at one place, if it's not your opinion delete it.
It's not ment to become an step by step guide (but if anyone will write one i'm sure not upset ), it should be an collection of links, and posts of special parts of development, cause i think most developers aren't the overall specialists, but kings in their section^^ and the readers of these informations can compile what they want from it.
So pls dear android developers share your knowledge with us
There are some links i found:
Basic Guide Links:
[GUIDE] How to create a your own ROM
HOW TO: Build your own rom, by ITJE **UPDATED 11 nov**
[Q] Building ROMs
How to Cook a Rom
Android kitchen:
[KITCHEN][September 10 '11] Android Kitchen, v0.179 [Linux / Mac / Windows]
decompiling changing and recompiling apks:
apktool
apk manager
Tectas said:
This thread is build to become an collection of our developers knowledge that helps newcomers to androiddevelopment to start with it.
Click to expand...
Click to collapse
There is already an excellent place for this. http://www.xda-developers.com
Hope this helps.
InfernalByte said:
There is already an excellent place for this. http://www.xda-developers.com
Click to expand...
Click to collapse
Hahaha....Really helpful.
Tectas said:
First of all, i hope the mods and admins forgive me that i open this thread in the development section, it would better fit to general, but i noticed that the developers aren't really present at the general section, if i'm wrong please move it.
This thread is build to become an collection of our developers knowledge that helps newcomers to androiddevelopment to start with it. I know out there are some guides already and in every thread there's a little bit of it, but i would really like to collect as much as possible at one place, if it's not your opinion delete it.
It's not ment to become an step by step guide (but if anyone will write one i'm sure not upset ), it should be an collection of links, and posts of special parts of development, cause i think most developers aren't the overall specialists, but kings in their section^^ and the readers of these informations can compile what they want from it.
So pls dear android developers share your knowledge with us
There are some links i found:
Basic Guide Links:
....
....
Click to expand...
Click to collapse
Much appreciated, I've incoroported these posts into a new section called Development Guides within the Development INDEX thread
Anymore useful finds will be appreciated.
Added an link!
Thanks so much for this!!

[Completed] Source Question

I have some basic questions with just a need of clerance. I'm willing to do the research just need to be nudged in the right direction.
Do I need android SDK installed onto my linux laptop in order to port CWM?
What is a source exactly? A backup of my system files or the code of android verison?
Depends on your meaning of port, but no for the most part you don't need the SDK although some of the tools will be helpful for debugging
Source usually refers to android source and/or custom ROM/kernel or oem source code
For more info to get you started try xda university
http://www.xda-university.com
Further questions should be asked in general q&a found here
http://forum.xda-developers.com/android/help

[Completed] [Q] Learning to build AOSP from source for new devices

Hi guys,
So I've always loved flashing ROMs on my phones and tinkering, but I've never really understood how to do it all. I figured I should learn and try to give back to the community, considering the amount of time I spend on here.
I've followed the steps on source.android.com for initializing my build environment. I'm done syncing with the repo, but I can't find a thorough guide on what to do next. I can't use the breakfast command because my phone is not an official device. In the "Building for devices" section, it states that I need to obtain proprietary drivers for my device, but I'm not sure any manufacturers will give away their proprietary drivers
I'm looking to do all this for my Moto X 2013. So my question is, how does CyanogenMod have (some) proprietary drivers for my phone, and would it be possible for me to pull from CM's repo for those drivers? Is there a better forum for me to ask these questions?
If anyone has an idea of where I should look next to do some more research, I'd really appreciate the help!
Hi,
This section has many guides and tutorials. Please do your research and try your hand at it. After you read read read, if you still need help, ask in the thread of the guide you use, or create your own thread and ask for help...
http://forum.xda-developers.com/chef-central/android
Good luck!

[Completed] Easiest ways to examine and recompile android sepolicy

I'm using Android 6.0.0 on a bunch of Nexus 6 and Nexus 5x phones, but I think this question likely applies to other recent devices and versions of android (including Lollipop). I'm relatively experienced when it comes to selinux in the server world, and am looking for ways to examine and customize my Android selinux policy. Mind you I have no trouble creating and booting custom boot.img files, where I can alter /init.rc and /sepolicy. Hence, my question is what is the best way to decompile /sepolicy (to see what it is doing), and what is the best way to rebuild it.
Some things I've tried that don't work: Existing tools (sedispol, sesearch) on linux distributions that support selinux do not work, because android uses some weird forked v30 policy file format. The standard tools only go up to version 29, and worse there seems to be a competing candidate for v30 that is incompatible. I've also compiled the AOSP selinux tools on regular linux (https://android.googlesource.com/platform/external/selinux), and those seem to work on standard v29 policy files (such as those from stock fedora), but dispol still cannot seem to examine an android sepolicy file. I get errors like "libsepol.avtab_read_item: more than one specifier".
The final thing I could do is take it on faith that if, say, for my nexus 5x I clone https://android.googlesource.com/device/lge/bullhead, that the contents of the sepolicy directory actually corresponds to what is on my phone. I guess I can live with that since I'll just be replacing the sepolicy file with my own customized version. However, I also can't figure out how to build sepolicy, given again this weird v30 output format required.
So I would appreciate either a pointer to a "howto," or some sort of reference on how to build sepolicy for android, especially those geared towards people who are already use selinux, just don't know how to get the android variants of the tools up and running.
Hello,
Welcome to XDA.
Normally I would just give a link to a better place to ask your question but in your case I will give you the link and a tip for finding what you are going to want to know about this since you are asking about this for the purposes of applying it to many devices.
Ok, to make your search simpler. If you are on your PC or on mobile device using a mobile browser(not an android app that lets you view these forums) look in the top right corner of the page and in the "search all forums" search box, in that box type "SELinux (your model number)" or just "SELinux" this will give you threads that pertain to your devices specifically and SELinux, in them you can find most of what you want.
For more help with questions you can post your questions in the forum linked below.
http://forum.xda-developers.com/android/help
The experts there may be able to help.
Remember to register an XDA account so you can post and reply in the forums. Good luck.
Droidriven said:
Hello,
Welcome to XDA.
Normally I would just give a link to a better place to ask your question but in your case I will give you the link and a tip for finding what you are going to want to know about this since you are asking about this for the purposes of applying it to many devices.
Ok, to make your search simpler. If you are on your PC or on mobile device using a mobile browser(not an android app that lets you view these forums) look in the top right corner of the page and in the "search all forums" search box, in that box type "SELinux (your model number)" or just "SELinux" this will give you threads that pertain to your devices specifically and SELinux, in them you can find most of what you want.
For more help with questions you can post your questions in the forum linked below.
http://forum.xda-developers.com/android/help
The experts there may be able to help.
Remember to register an XDA account so you can post and reply in the forums. Good luck.
Click to expand...
Click to collapse
Thanks for the response. I did search for selinux before posting, and couldn't find anything. This is really a general question about building AOSP, so not that appropriate for any specific device forum. I also browsed the forums, and I think more appropriate than the one you suggested is the software hacking forum (http://forum.xda-developers.com/android/software-hacking), but since I don't have 10 posts I can't post there.
15xda said:
Thanks for the response. I did search for selinux before posting, and couldn't find anything. This is really a general question about building AOSP, so not that appropriate for any specific device forum. I also browsed the forums, and I think more appropriate than the one you suggested is the software hacking forum (http://forum.xda-developers.com/android/software-hacking), but since I don't have 10 posts I can't post there.
Click to expand...
Click to collapse
The forum linked below has some off topic threads that you can post in until you get 10
http://forum.xda-developers.com/general/off-topic
Then you can do a search for XDA University and it will give you everything you want to know about android hacking compiling, porting and building.

[DEV] [ROM] Pull and modify an existing ROM off a Samsung phone.

Greetings,
I'm embarking on a new journey to rooting and putting a "custom" ROM onto my phone. However I've never modified an android phone, so this process is all new to me.
Obviously the first step would be rooting my phone, but from there I'm stuck. I'm using a Samsung-SM-J320A, and I'd like to keep the main features of the OS (look and data that's already installed), but upgrade the actual Android version. It's currently running Android 7.1.1, though I'd like to upgrade it to 8.1 (Oreo).
I do understand the header of the forum said "no noobs", but I cannot for the life of me find a method to pull the existing ROM that's installed on my phone off and modify it.
Any assistance is welcome. (Apologies if this is not in the right category/titled correctly)
Note: Questions go in Q&A Forum
If you are posting a Question Thread post it in the Q&A forum. Technical discussion of Android development and hacking. No noobs, please. Device-specific releases should go under the appropriate device forum...
forum.xda-developers.com

Categories

Resources