Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions qiling/os/posix/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,24 @@
'O_LARGEFILE': None
}

windows_x86_open_flags = {
'O_RDONLY': 0x0,
'O_WRONLY': 0x1,
'O_RDWR': 0x2,
'O_NONBLOCK': None,
'O_APPEND': 0x8,
'O_ASYNC': None,
'O_SYNC': None,
'O_NOFOLLOW': None,
'O_CREAT': 0x100,
'O_TRUNC': 0x200,
'O_EXCL': 0x400,
'O_NOCTTY': None,
'O_DIRECTORY': None,
'O_BINARY': 0x8000,
'O_LARGEFILE': None
}

qnx_arm64_open_flags = {
'O_RDONLY' : 0x00000,
'O_WRONLY' : 0x00001,
Expand Down
4 changes: 4 additions & 0 deletions qiling/os/posix/const_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ def flag_mapping(flags, mapping_name, mapping_from, mapping_to):
f = macos_x86_open_flags
elif ql.ostype == QL_OS.FREEBSD:
f = freebsd_x86_open_flags
elif ql.ostype == QL_OS.WINDOWS:
f = windows_x86_open_flags
elif ql.ostype == QL_OS.QNX:
f = qnx_arm64_open_flags

Expand All @@ -73,6 +75,8 @@ def flag_mapping(flags, mapping_name, mapping_from, mapping_to):
t = macos_x86_open_flags
elif ql.platform_os == QL_OS.FREEBSD:
t = freebsd_x86_open_flags
elif ql.platform_os == QL_OS.WINDOWS:
t = windows_x86_open_flags

if f == t:
return flags
Expand Down