Skip to content

Commit 54dcf4a

Browse files
Merge branch 'qilingframework:dev' into dev
2 parents 7b8e99f + 38564fd commit 54dcf4a

File tree

15 files changed

+302
-381
lines changed

15 files changed

+302
-381
lines changed

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,20 @@ This file details the changelog of Qiling Framework.
22

33
------------------------------------
44
[Version 1.4.1]: Nov Xth, 2021
5+
56
- Clean and tidy up core utils module (WIP)
67
- Clean and tidy up path module
78
- Other small adjustments so support the above changes
89
- Rearranged the code to be more Pythonic and more readable
910
- Removed unused members and methods
1011
- Added typing annotations
12+
- Added ql.platform_os and ql.platform_arch
13+
- update ql.os.posix.const_mapping with more os/arch match
1114

1215

1316
------------------------------------
1417
[Version 1.4.0]: Oct 20th, 2021
18+
1519
- Added MCU Engine
1620
- Bug fix for qdb
1721
- Bug fix for debugger

qiling/core.py

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ def __init__(
3434
rootfs=None,
3535
env=None,
3636
code=None,
37-
shellcoder=None,
3837
ostype=None,
3938
archtype=None,
4039
bigendian=False,
@@ -67,9 +66,9 @@ def __init__(
6766
self._rootfs = rootfs
6867
self._env = env if env else {}
6968
self._code = code
70-
self._shellcoder = shellcoder
7169
self._ostype = ostype
7270
self._archtype = archtype
71+
self._noneos = None,
7372
self._archendian = None
7473
self._archbit = None
7574
self._pointersize = None
@@ -82,7 +81,8 @@ def __init__(
8281
self._log_override = log_override
8382
self._log_plain = log_plain
8483
self._filter = filter
85-
self._platform = ostype_convert(platform.system().lower())
84+
self._platform_os = ostype_convert(platform.system().lower())
85+
self._platform_arch = arch_convert(platform.machine().lower())
8686
self._internal_exception = None
8787
self._uc = None
8888
self._stop_options = QlStopOptions(stackpointer=stop_on_stackpointer, exit_trap=stop_on_exit_trap)
@@ -114,10 +114,6 @@ def __init__(
114114
# Shellcode? #
115115
##############
116116

117-
# for Legacy
118-
if self._shellcoder:
119-
self._code = self._shellcoder
120-
121117
if self._code or (self._archtype and type(self._archtype) == str):
122118
if (self._archtype and type(self._archtype) == str):
123119
self._archtype= arch_convert(self._archtype.lower())
@@ -476,20 +472,36 @@ def targetname(self) -> str:
476472
return self._targetname
477473

478474
@property
479-
def platform(self):
480-
""" Specify current platform where Qiling runs on.
475+
def platform_os(self):
476+
""" Specify current platform os where Qiling runs on.
477+
478+
Type: int
479+
Values: All possible values from platform.system()
480+
"""
481+
return self._platform_os
482+
483+
@platform_os.setter
484+
def platform_os(self, value):
485+
if type(value) is str:
486+
self._platform_os = ostype_convert(value.lower())
487+
else:
488+
self._platform_os = value
489+
490+
@property
491+
def platform_arch(self):
492+
""" Specify current platform arch where Qiling runs on.
481493
482494
Type: int
483495
Values: All possible values from platform.system()
484496
"""
485-
return self._platform
497+
return self._platform_arch
486498

487-
@platform.setter
488-
def platform(self, value):
499+
@platform_arch.setter
500+
def platform_arch(self, value):
489501
if type(value) is str:
490-
self._platform = ostype_convert(value.lower())
502+
self._platform_arch = arch_convert(value.lower())
491503
else:
492-
self._platform = value
504+
self._platform_arch = value
493505

494506
@property
495507
def internal_exception(self) -> Exception:

qiling/os/linux/const.py

Lines changed: 0 additions & 4 deletions
This file was deleted.

qiling/os/path.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def convert_for_native_os(rootfs: Union[str, Path], cwd: str, path: str) -> Path
107107

108108
def convert_path(self, rootfs: Union[str, Path], cwd: str, path: str) -> Path:
109109
emulated_os = self.ql.ostype
110-
hosting_os = self.ql.platform
110+
hosting_os = self.ql.platform_os
111111

112112
# emulated os and hosting platform are of the same type
113113
if (emulated_os == hosting_os) or (emulated_os in QL_OS_POSIX and hosting_os in QL_OS_POSIX):

0 commit comments

Comments
 (0)