|
3 | 3 | # Cross Platform and Multi Architecture Advanced Binary Emulation Framework |
4 | 4 | # |
5 | 5 |
|
| 6 | +from qiling import Qiling |
6 | 7 |
|
7 | | -from qiling.const import * |
8 | | -from qiling.os.linux.thread import * |
9 | | -from qiling.const import * |
10 | | -from qiling.os.posix.filestruct import * |
11 | | -from qiling.os.filestruct import * |
12 | | -from qiling.os.posix.const_mapping import * |
13 | | -from qiling.exception import * |
| 8 | +def ql_syscall_uname(ql: Qiling, buf: int): |
| 9 | + UTSLEN = 65 |
14 | 10 |
|
15 | | -def ql_syscall_uname(ql, address, *args, **kw): |
16 | | - buf = b'' |
17 | | - buf += b'QilingOS'.ljust(65, b'\x00') |
18 | | - buf += b'ql_vm'.ljust(65, b'\x00') |
19 | | - buf += b'99.0-RELEASE'.ljust(65, b'\x00') |
20 | | - buf += b'QilingOS 99.0-RELEASE r1'.ljust(65, b'\x00') |
21 | | - buf += b'ql_processor'.ljust(65, b'\x00') |
22 | | - buf += b''.ljust(65, b'\x00') |
23 | | - ql.mem.write(address, buf) |
24 | | - regreturn = 0 |
25 | | - return regreturn |
| 11 | + fields = ( |
| 12 | + b'QilingOS', # sysname |
| 13 | + b'ql_vm', # nodename |
| 14 | + b'99.0-RELEASE', # release |
| 15 | + b'QilingOS 99.0-RELEASE r1', # version |
| 16 | + b'ql_processor', # machine |
| 17 | + b'' # domainname |
| 18 | + ) |
| 19 | + |
| 20 | + for i, f in enumerate(fields): |
| 21 | + ql.mem.write(buf + i * UTSLEN, f.ljust(UTSLEN, b'\x00')) |
| 22 | + |
| 23 | + return 0 |
0 commit comments