-
Notifications
You must be signed in to change notification settings - Fork 747
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
AttributeError when setup in qilingida.py, because sys.stdin is None at idapython in windows. #1362
Comments
i checkout last release tag:1.4.5 , and sys.stdin is None too. but ida plugin work well. maybe bug after this commit b3de208 Line 63 in 1706049
let me just use 1.4.5 now 😉 and i still don't know why stdin is None, maybe it is None in linux version too? |
I wasn't familiar with the fact that IDA does not define As a short term workaround, however, you could set |
did you solved the problem? |
two way in my comment #1362 (comment) way1: use 1.4.5
way2: case AttributeErrorif ur qiling version > b3de208 diff --git "a/C:\\Python\\Python3-10-5\\lib\\site-packages\\qiling\\os\\os.p_" "b/C:\\Python\\Python3-10-5\\lib\\site-packages\\qiling\\os\\os.py"
index 6d759bf..6018310 100755
--- "a/C:\\Python\\Python3-10-5\\lib\\site-packages\\qiling\\os\\os.p_"
+++ "b/C:\\Python\\Python3-10-5\\lib\\site-packages\\qiling\\os\\os.py"
@@ -61,7 +61,7 @@ class QlOs:
# such as fileno(). here we use this to determine how we are going to use
# the environment standard streams
sys.stdin.fileno()
- except UnsupportedOperation:
+ except (UnsupportedOperation, AttributeError):
# Qiling is used on an interactive shell or embedded python interpreter.
# if the internal stream buffer is accessible, we should use it
self._stdin = getattr(sys.stdin, 'buffer', sys.stdin) i think this is not the best way to fix, because self._stdin = getattr(sys.stdin, 'buffer', sys.stdin)
self._stdout = getattr(sys.stdout, 'buffer', sys.stdout)
self._stderr = getattr(sys.stderr, 'buffer', sys.stderr) Because qiling set them like this before 1.4.6, but this commit (b3de208) disrupts the original logic. I haven't closed this issue because it remains unresolved, and I'm uncertain about any potential unintended consequences of my modifications. Now, I believe it's better to use assert to check if |
Covered by #1482 |
error
AttributeError: 'NoneType' object has no attribute 'fileno'
, when callsys.stdin.fileno()
atsetup
inqilingida.py
ida 7.7😉
windows 11
python 3.10.5
qiling version: 1706049
target is arm elf file.
ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV)
i check sys.stdin is None
and i know
$IDAdir/python/3/init.py
set stdout and stderr but not set stdintry to fix this and find #475 (comment), same problem but not helpful.
no idea why sys.stdin is None in idapython, and no idea how to fix this.
any idea? thanks.
The text was updated successfully, but these errors were encountered: