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

ipi doesn't work with multiline inputs #1221

Closed
disconnect3d opened this issue Oct 4, 2022 · 2 comments
Closed

ipi doesn't work with multiline inputs #1221

disconnect3d opened this issue Oct 4, 2022 · 2 comments
Labels

Comments

@disconnect3d
Copy link
Member

TL;DR:
image

pwndbg> ipi

In [1]: from ctypes import *

In [2]: class A(LittleEndianStructure):
   ...:     a = LittleEndianStructure
   ...:
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-2-814bd2a1d7ec> in <module>
----> 1 class A(LittleEndianStructure):
      2     a = LittleEndianStructure
      3

<ipython-input-2-814bd2a1d7ec> in A()
      1 class A(LittleEndianStructure):
----> 2     a = LittleEndianStructure
      3

NameError: name 'LittleEndianStructure' is not defined

In [3]: ctypes
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-3-8c9cdb26e3f3> in <module>
----> 1 ctypes

NameError: name 'ctypes' is not defined

In [4]: LittleEndianStructure
Out[4]: _ctypes.Structure

In [5]: def foo():
   ...:     return LittleEndianStructure
   ...:

In [6]: foo()
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-6-c19b6d9633cf> in <module>
----> 1 foo()

<ipython-input-5-0b19aa36e370> in foo()
      1 def foo():
----> 2     return LittleEndianStructure
      3

NameError: name 'LittleEndianStructure' is not defined

In [7]:
@disconnect3d
Copy link
Member Author

Whereas this works in pure GDB python interpreter:

pwndbg> pi
>>> from ctypes import *
>>> class A(LittleEndianStructure):
...   a = LittleEndianStructure
...
>>> A.a
<class '_ctypes.Structure'>
>>>

@disconnect3d
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant