Skip to content

Commit d89fc7e

Browse files
authored
Merge pull request #24 from qilingframework/dev
Dev sync
2 parents b84eee7 + 40e36ca commit d89fc7e

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

examples/src/freebsd/syscall_dump.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
#
33
# Cross Platform and Multi Architecture Advanced Binary Emulation Framework
44
# Built on top of Unicorn emulator (www.unicorn-engine.org)
5-
# The 'freebsd_syscall' can be download at 'https://github.com/freebsd/freebsd/blob/master/sys/kern/syscalls.master'.
5+
6+
# https://github.com/freebsd/freebsd/blob/master/sys/kern/syscalls.master
67

78
import re
89

@@ -39,5 +40,5 @@ def read_file(f):
3940
line = f.readline()
4041

4142
if __name__ == '__main__':
42-
file = open('./freebsd_syscall')
43+
file = open('./syscalls.master')
4344
read_file(file)

tests/test_elf.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ def check_write(ql, write_fd, write_buf, write_count, *args, **kw):
3636
try:
3737
buf = ql.mem.read(write_buf, write_count)
3838
buf = buf.decode()
39-
if buf.startswith("thread 2 ret"):
40-
ql.buf_out = buf
39+
target = "thread 2 ret val is : 2"
40+
if buf.find(target):
41+
ql.buf_out = target
4142
except:
4243
pass
4344

@@ -46,7 +47,7 @@ def check_write(ql, write_fd, write_buf, write_count, *args, **kw):
4647
ql.set_syscall("write", check_write, QL_INTERCEPT.ENTER)
4748
ql.run()
4849

49-
self.assertEqual("thread 2 ret val is : 2\n", ql.buf_out)
50+
self.assertEqual("thread 2 ret val is : 2", ql.buf_out)
5051

5152
del ql
5253

0 commit comments

Comments
 (0)