#164263 - moonlightcheese - Fri Oct 24, 2008 7:55 pm
i'm looking at this code snippet from prex, trying to reverse engineer the steps necessary to load ELF binaries and i don't get the syntax for the name## label and the #SYS_##name label. what do those hash signs do there? the rest of it i can read...
also what does =0x200007c mean?
edit: i think i figured out the first question although i'm still don't know the exact syntax. looks like SYS_msg_send and other defines exist in the system call header file and it looks like the hashes do some kind of variable name replacement. still not sure exactly how it works...
Code: |
#define SYSCALL0(name) \
.global name; .align; \ name##: \ stmfd sp!, {r4, r5, lr}; \ mov r4, #SYS_##name; \ ldr r5, =0x200007c; \ add lr, pc, #2; \ mov pc, r5; \ ldmfd sp!, {r4, r5, pc}; |
also what does =0x200007c mean?
edit: i think i figured out the first question although i'm still don't know the exact syntax. looks like SYS_msg_send and other defines exist in the system call header file and it looks like the hashes do some kind of variable name replacement. still not sure exactly how it works...