Youtube comments of (@lauriewired).
-
265
-
179
-
42
-
27
-
23
-
15
-
12
-
10
-
You're absolutely right about ARM's use of pipelining, and this indeed impacts how the PC behaves in certain situations.
ARM is a pipelined architecture, which means it fetches, decodes, and executes instructions in stages, overlapping these operations for different instructions. The PC (Program Counter) indeed points ahead in the instruction stream due to the pipeline.
Regarding your observation about the use of the -4 offset with LDR: When an instruction is fetched, the PC is often a few instructions ahead of the current instruction being executed. With 32-bit ARM instructions, the PC is typically 8 bytes ahead during the fetch stage.
However, since in the ARM architecture, the PC behaves as if it is two instructions ahead of the current instruction (4 bytes per instruction, so 8 bytes total), the offset -4 essentially compensates for this advancement. This way, we are "correcting" the PC value to the desired address.
9
-
9
-
9
-
You're partly correct in your understanding, and it's a common source of confusion when we discuss Android and Linux
Yes, Android does use the Linux kernel, but it's not considered a typical Linux distribution due to various reasons, including the ones you mentioned. It modifies the kernel and creates a different user space that is not standard to other Linux systems.
The JNI (Java Native Interface) is indeed used to call native code (usually C or C++) from Java, and vice versa, in the Android environment. However, this isn't the same as the syscall mechanism. JNI just provides a way to use native libraries from Java, it doesn't change how system calls are made.
When it comes to system calls, POSIX (Portable Operating System Interface) is a standard that defines a set of system calls among other things. Android, being based on the Linux kernel, does support many POSIX system calls natively. However, it's true that the NDK (Native Development Kit) does implement some POSIX features on top of Android system calls, as not all POSIX features are natively supported in Android.
Lastly, whether Android is considered "Linux" or not often depends on context. If we're discussing kernel-level features, Android is very much Linux. But if we're talking about the user-space environment (including system libraries and application behavior), Android is quite different from what is traditionally considered a Linux system.
8
-
7
-
7
-
7
-
7
-
It's a tricky problem. Because Android is just linux underneath, you could technically use iptables to sort by UID. That being said, many android applications these days spin up multiple processes, often with the same UID. In my opinion, there are a couple of hacky ways to do it, but all methods have their own issues, and it's much easier to focus on a single application at a time.
Keep in mind, IP packets carry no ownership information. Hence, you can't just dump a random PCAP file and immediately tell what process spawned the traffic without a lot of additional work.
Another potential option would be to run a per-app proxy or VPN with something like NetGuard:
https://github.com/M66B/NetGuard
However, because that relies on the Android VPN service, theoretically a really sneaky malware could change it's behavior if a VPN was detected/present.
There are a few other potential ways of doing it, but they all have various pros and cons. There is an excellent thread on StackExchange that goes into some various scenarios here:
https://android.stackexchange.com/questions/203868/how-to-view-network-traffic-requested-by-a-specific-app
6
-
6
-
6
-
6
-
6
-
6
-
5
-
5
-
5
-
5
-
4
-
4
-
4
-
4
-
4
-
4
-
4
-
3
-
3
-
3
-
3
-
3
-
3
-
3
-
3
-
3
-
3
-
3
-
3
-
3
-
3
-
3
-
2
-
2
-
2
-
2
-
2
-
2
-
2
-
2
-
2
-
2
-
2
-
2
-
2
-
2
-
2
-
2
-
2
-
2
-
2
-
2
-
2
-
2
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1