3
3
@ This file is part of the UPX executable compressor.
5
@ Copyright (C) 2000-2008 John F. Reiser
5
@ Copyright (C) 2000-2009 John F. Reiser
6
6
@ All Rights Reserved.
8
8
@ UPX and the UCL library are free software; you can redistribute them
127
__NR_exit = 1 + __NR_SYSCALL_BASE
128
__NR_read = 3 + __NR_SYSCALL_BASE
129
__NR_write = 4 + __NR_SYSCALL_BASE
130
__NR_open = 5 + __NR_SYSCALL_BASE
131
__NR_close = 6 + __NR_SYSCALL_BASE
132
__NR_brk = 45 + __NR_SYSCALL_BASE
134
__NR_mmap2 = 192 + __NR_SYSCALL_BASE
135
__NR_mprotect = 125 + __NR_SYSCALL_BASE
136
__NR_munmap = 91 + __NR_SYSCALL_BASE
132
swi 0x00900003; mov pc,lr
144
do_sys __NR_read; ret
136
swi 0x00900004; mov pc,lr
148
do_sys __NR_write; ret
140
swi 0x00900005; mov pc,lr
152
do_sys __NR_open; ret
144
swi 0x00900006; mov pc,lr
156
do_sys __NR_close; ret
148
swi 0x0090002d; mov pc,lr
152
swi 0x0090005b; mov pc,lr
164
do_sys __NR_munmap; ret
156
swi 0x0090007d; mov pc,lr
168
do_sys __NR_mprotect; ret
160
172
str r5,[sp,#-4]!; ldr r5,[sp,#4+4]
161
173
str r4,[sp,#-4]!; ldr r4,[sp,#4+4]
162
174
mov r5,r5,lsr #12 @ convert to page number
163
swi 0x009000c0 @ mmap64
168
180
#if 0 /*{ "gcc-3.4 -fPIC" botches string constants when code moves! */