Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while Running Qiling in window #33

Closed
neoz opened this issue Nov 15, 2019 · 8 comments
Closed

Error while Running Qiling in window #33

neoz opened this issue Nov 15, 2019 · 8 comments

Comments

@neoz
Copy link

neoz commented Nov 15, 2019

$ python hello_x86_linux.py
Traceback (most recent call last):
File "hello_x86_linux.py", line 14, in
from qiling import *
File "..\qiling_init_.py", line 1, in
from .core import *
File "..\qiling\core.py", line 17, in
from qiling.os.posix.filestruct import *
File "..\qiling\os\posix\filestruct.py", line 14, in
import fcntl
ModuleNotFoundError: No module named 'fcntl'

@xwings
Copy link
Member

xwings commented Nov 15, 2019

hi,

i dont think we have fcntl in windows. u can try to run it in WSL. please do taka note WSL2 might work better.

@0xjacklove
Copy link

@xwings
Copy link
Member

xwings commented Nov 18, 2019

as @0x1shyboy1 mention. yes, Windows does not comes with fcntl

@xwings xwings closed this as completed Nov 18, 2019
@xwings
Copy link
Member

xwings commented Nov 18, 2019

Well,

being said, we need to find a way to work around it. Any suggestion?

@xwings xwings reopened this Nov 18, 2019
@0xjacklove
Copy link

Windows : Create fcntl.py in the Lib directory of Python.
##fcntl.py
def fcntl(fd, op, arg=0):
return 0

def ioctl(fd, op, arg=0, mutable_flag=True):
if mutable_flag:
return 0
else:
return ""

def flock(fd, op):
return

def lockf(fd, operation, length=0, start=0, whence=0):
return


It work for me !!
however,if i run the example of linux,i will get
Traceback (most recent call last):
File "hello_x8664_linux.py", line 18, in
ql = Qiling(["rootfs/x8664_linux/bin/x8664_hello"], "rootfs/x8664_linux")
File "C:\ProgramData\Anaconda3\lib\site-packages\qiling-0.9-py3.7.egg\qiling\core.py", line 176, in init
self.run_exec()
File "C:\ProgramData\Anaconda3\lib\site-packages\qiling-0.9-py3.7.egg\qiling\core.py", line 184, in run_exec
loader_file = self.build_os_execution("loader_file")
File "C:\ProgramData\Anaconda3\lib\site-packages\qiling-0.9-py3.7.egg\qiling\core.py", line 179, in build_os_execution
self.runtype = ql_get_os_module_function(self.ostype, self.arch, "runner")
File "C:\ProgramData\Anaconda3\lib\site-packages\qiling-0.9-py3.7.egg\qiling\utils.py", line 31, in ql_get_os_module_function
return ql_get_module_function(module_name, function_name)
File "C:\ProgramData\Anaconda3\lib\site-packages\qiling-0.9-py3.7.egg\qiling\utils.py", line 60, in ql_get_module_function
raise QlErrorModuleNotFound(f"Unable to import module {module_name}")
qiling.exception.QlErrorModuleNotFound: Unable to import module qiling.os.linux.x8664

any example running on Ubuntu is normal.

@xwings
Copy link
Member

xwings commented Nov 18, 2019

Hi,

If you able to solve it. PR is appriciated

@xwings
Copy link
Member

xwings commented Dec 13, 2019

Just a note

This issue is related to issue #24

@xwings
Copy link
Member

xwings commented Dec 13, 2019

closed and conversation moved to issue #24

@xwings xwings closed this as completed Dec 13, 2019
xwings pushed a commit that referenced this issue Aug 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants