GithubHelp home page GithubHelp logo

droidimg's People

Contributors

0xxa avatar 5lipper avatar idl3r avatar nforest avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

droidimg's Issues

Load the kernel file error.

Detected file format: Android/Linux Kernel Image(ARM)
[+]kallsyms_arch = arm64
[!]could be offset table...
[+]numsyms: 134453
[+]kallsyms_address_table = 0x2180600
[+]kallsyms_relative_base = 0x20d35
[+]kallsyms_num = 134453 (6869120560323428100)
[!]not equal, maybe error...
[!]get kallsyms error...

Symbol table offsets incorrect?

Trying to load the attached image (after) KALSR fix the symbol table seems off, some of the symbols written even seem to overwrite others at the same offset wondering if anyone who's following this has an idea on what might be going wrong.

Example of offsets being overwritten by the same symbols:

ffffff8008080000 T _text
ffffff8008080000 T do_undefinstr
ffffff8008080000 T _stext
ffffff8008080800 T __exception_text_start
ffffff8008080800 T do_cp15instr
ffffff8008080800 T do_sysinstr

ffffff80080810a0 T __irqentry_text_end
ffffff80080810a0 T __irqentry_text_start
ffffff80080810a0 T __softirqentry_text_start
ffffff80080810a0 T __entry_text_start
ffffff80080810a0 T __softirqentry_text_end

ffffff8008082970 t el1_sp_pc
ffffff8008082970 t el1_undef

When looking at various functions against the actual kernel source in a decompiler it was pretty clear that the symbol table being generated by the vmlinux.py script was off/wrong, I've been reading through the source to see how all of this works and try to correct it but figured in the mean time path of least resistance may be asking those who are already familiar with what it's doing.

Any help would be greatly appreciated...

extracted.zip

Does not work SAMSUNG Galaxy A33 5G

[My ENV]
OS : Windows 10 x64 Enterprise
i use IDA 7.5
My android device is SAMSUNG Galaxy A33 5G(A336NKSU3CWB3)
Security Patch : 2023-02-01

Can't find _start in android kernel image

IDA Warning log

C:\IDA Pro 7.5\loaders\vmlinux.py: Traceback (most recent call last):
  File "C:/IDA Pro 7.5/loaders/vmlinux.py", line 1028, in load_file
    do_kallsyms(kallsyms, vmlinux)
  File "C:/IDA Pro 7.5/loaders/vmlinux.py", line 788, in do_kallsyms
    do_guess_start_address(kallsyms, vmlinux)
  File "C:/IDA Pro 7.5/loaders/vmlinux.py", line 459, in do_guess_start_address
    assert False,"  [!]kernel start address error..."
AssertionError:   [!]kernel start address error...

how to fix?

Error...

Loading file 'D:\kernel' into database...
Detected file format: Android/Linux Kernel Image(ARM)
[+]kallsyms_arch = arm64
[!]could be offset table...
[+]numsyms: 128652
[+]kallsyms_address_table = 0x1a80600
[+]kallsyms_relative_base = 0x1f68c
[+]kallsyms_num = 128652 (6869121646950153988)
[!]not equal, maybe error...
[!]get kallsyms error...

create a pip package?

In lieu of accepting the PR creating a BN plugin, would you consider creating this as a pip package? That would let me more easily separate out the BN plugin logic while still relying on this as an upstream package and not having to constantly maintain a fork which is suboptimal.

Error with Pixel 3 kernel

Running the script over the Pixel 3 kernel I get this error:

input image Pixel 3 blueline-qq1a.200205.002

python3 vmlinux.py  ../../extrkern/blueline-qq1a.200205.002/keree/extracted/kernelimage

b'Linux version 4.9.185-g15c0389f9d0d-ab6076840 (android-build@abfarm-us-east1-c-0059) (Android (5484270 based on r353983c) clang version 9.0.3 (https://android.googlesource.com/toolchain/clang 745b335211bb9eadfa6aa6301f84715cee4b37c5) (https://android.googlesource.com/toolchain/llvm 60cf23e54e46c807513f7a36d0a7b777920b5881) (based on LLVM 9.0.3svn)) #0 SMP PREEMPT Mon Dec 16 20:48:48 UTC 2019'
[+]kallsyms_arch = arm64
[!]could be offset table...
[+]numsyms: 177502
[+]kallsyms_address_table = 0x1985000
[+]kallsyms_relative_base = 0x2b55e
[+]kallsyms_num = 177502 (6869121621180350212)
  [!]not equal, maybe error...
[!]get kallsyms error...


kernelimage.zip

Segmentation fault (core dumped) fixing kaslr arm64

fix_kaslr_arm64.c

crashes inside relocate_kernel() function! i think the negative sym_offset is the problem!

Program received signal SIGSEGV, Segmentation fault. 0x0000000008000aa9 in relocate_kernel () at fix_kaslr_arm64.c:228 228 *(size_t *)LOCAL_VA(p) = new_addr; (gdb) info locals new_addr = 18446743798860776160 p = 0xffffffc000092998 rela_entry = 0x7ffffe7a35c8 sym_offset = -274877306472 sym_info = 1027 sym_addr = 18446743798860776160 count = 0

also samsung fix code works but vmlinux is not able to find the symbol table!

if needed the kernel image im attaching
image.zip

Hi can u try disassemble this?

It's not working for me when use ur script
this file isn't disassembling

Not working for me
If it works for you than can you try giving me the database of this exported from Ida ?

Not working ida 32bit

I can't do it when I select Ida 32bit or I launch it from 32bit icon and than script option isn't there but for 64bit it's there.
Why?
Is it a bug?

could be offset table...

pixel_vmlinux.zip

Linux version 4.4.155-g897374879e0c ([email protected]) (Android clang version 5.0.300080 (based on LLVM 5.0.300080)) #1 SMP PREEMPT Fri Nov 30 04:06:13 UTC 2018
[+]kallsyms_arch = arm64
[!]could be offset table...
[!]lookup_address_table error...
[!]get kallsyms error...

could be offset table

I am sorry for meeting so many error to use this tool.And the following is logs of ida_7.5
Detected file format: Android/Linux Kernel Image(ARM)
[+]kallsyms_arch = arm64
[!]could be offset table...
[!]lookup_address_table error...
[!]get kallsyms error...
and then ida stoped.
I don't know why.If you has time could you please tell me how to resolve this problem?Thank you every much!!!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.