last day (14 days later) » 

8:48 PM
1
A: File path or file descriptor for ARM execute system call

InfinitelyManicThis example illustrates a simple use of execu in ARMv7. Assumes you have a simple file contain some text to sort. The man page indicates that placement of the pointer to the executable. In my example "/bin/sh" is the executable. So you are looking for an array structure pointer at R0. NA...

 
It seems like the filename is stored in r0. I will give it a try and let you know.
 
@Giuseppe - I think's it's a pointer since, among other reason, the file name length could exceed the size of the register. But you are on the right track.
 
Yes. I meant the pointer to the file name.
Could you run different executable files and check if the file name is always loaded in r0?
Or even tell me how you printed out the assembly code
 
@Giuseppe - I wrote the Assembly code from scratch. If I do '_filename: .string "/usr/bin/top"' , the assembled code will issue the shell top command. What language are you using in this case?
 
I am using C inside the Android Linux kernel. I would like to see the reverse. From C code to assembly code to check whether the file name is always loaded inside r0.
 
8:48 PM
@Giuseppe ok - have you tried something like "objdump -d -M intel -S <file>.o" or "gcc -O2 -S <file>.c" to view the assembly code?
 
It should be slightly different for arm architecture right?
 
Yes! Sorry about that.
 
Let me try it
 
I'm currently moving back and forth between x86-64 and ARM - wasn't aware.
 
fuzzer1: file format elf32-little

objdump: can't disassemble for architecture UNKNOWN!
objdump seems to not work
 
8:53 PM
Are you using a debugger?
 
$ arm-linux-gnueabi-gcc -static -march=armv7-a ~/Desktop/fuzzer1.c -o ~/Desktop/test
 
show you compile command
ok - do you have the objdump for that cross compile tool? I've cross compiled from x86 to ARM using arm-none-eabi... and I need to use arm-none-eabi-objdump... etc.
 
Ok. Makes sense
this actually workd
works
arm-linux-gnueabi-objdump -S fuzzer1
 
Also if you use strace, you'll see the the values in execve(). strace -o <output file> <command>
 
Ok. Thanks a lot
 
9:04 PM
no problem!
 

last day (14 days later) »