These slides were used to explain the concepts such as android's native
library, NDK and JNI using which demonstration of native library
debugging at runtime was presented in #NSConclave2023.
@0ninaik & @ps_doom
NETSQUARE
● Execute code and try
● Check specific parts of code
● Runtime analysis of code flow and values
● Different tools used for runtime analysis
○ #IDA/Ghidra
○ #Frida
Dynamic Debugging Cont.
9
@0ninaik & @ps_doom
NETSQUARE
How to efficiently debug?
● Identify the interesting code in static analysis
● Understand code logic with specific inputs and conditions while execution
● Execute functions which are hard to understand
● Set breakpoints and analyze variables values.
10
@0ninaik & @ps_doom
NETSQUARE
● Task
● Apktool decompile
● Locate .so file for task
● .so file load in IDA
● Start IDA dbgsrv in android
● Decompile the function after identification
● Set debug points
● Start the task
DEMO TIME !
13
NDK or Native Development Kit is a toolset that is provided by Android to use C or C++ code in our Android application.
code is compiled to a binary code and run directly on OS, while Java code is translated into Java byte-code and interpreted by Dalvik Virtual Machine (VM)
?????
It also allows native code to call Java methods and manipulate Java objects.
Bridge between the Java Virtual Machine (JVM) and the native operating system and libraries.
JNI allows Java developers to access features and functionality that are not available in the standard Java libraries.
Mention native code language C and C++
Interaction between Java and native code.
Functionality that are not available in the standard Java libraries.
Access to device-specific functionality: JNI allows developers to access device-specific functionality such as camera, sensors, and Bluetooth, which may not be available through the standard Java SDK.
Improved performance: JNI allows developers to take advantage of C/C++ code for performance-critical tasks such as image processing, video decoding, and audio processing.
If code readable can understand application logic
Hardcoded string search