Skip to content

Commit b22998a

Browse files
committed
Re-export toplevel imports in pwn
Help linters to know what to expect when importing `from pwn import *`
1 parent d41db1f commit b22998a

1 file changed

Lines changed: 50 additions & 50 deletions

File tree

pwn/toplevel.py

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
# Get all the modules from pwnlib
2-
import collections
3-
import logging
4-
import math
5-
import operator
6-
import os
7-
import platform
8-
import re
9-
import socks
10-
import signal
11-
import string
12-
import struct
13-
import subprocess
14-
import sys
15-
import tempfile
16-
import threading
17-
import time
2+
import collections as collections
3+
import logging as logging
4+
import math as math
5+
import operator as operator
6+
import os as os
7+
import platform as platform
8+
import re as re
9+
import socks as socks
10+
import signal as signal
11+
import string as string
12+
import struct as struct
13+
import subprocess as subprocess
14+
import sys as sys
15+
import tempfile as tempfile
16+
import threading as threading
17+
import time as time
1818

1919
try:
2020
import colored_traceback
@@ -31,66 +31,66 @@
3131
# available on all platforms (e.g. Windows).
3232
pass
3333

34-
from pprint import pprint
34+
from pprint import pprint as pprint
3535

36-
import pwnlib
36+
import pwnlib as pwnlib
3737
from pwnlib import *
3838
from pwnlib.asm import *
39-
from pwnlib.context import Thread
40-
from pwnlib.context import context, LocalContext
41-
from pwnlib.dynelf import DynELF
39+
from pwnlib.context import Thread as Thread
40+
from pwnlib.context import context as context, LocalContext as LocalContext
41+
from pwnlib.dynelf import DynELF as DynELF
4242
from pwnlib.encoders import *
43-
from pwnlib.elf.corefile import Core, Corefile, Coredump
44-
from pwnlib.elf.elf import ELF, load
43+
from pwnlib.elf.corefile import Core as Core, Corefile as Corefile, Coredump as Coredump
44+
from pwnlib.elf.elf import ELF as ELF, load as load
4545
from pwnlib.encoders import *
46-
from pwnlib.exception import PwnlibException
47-
from pwnlib.gdb import attach, debug_assembly, debug_shellcode
46+
from pwnlib.exception import PwnlibException as PwnlibException
47+
from pwnlib.gdb import attach as attach, debug_assembly as debug_assembly, debug_shellcode as debug_shellcode
4848
from pwnlib.filepointer import *
4949
from pwnlib.filesystem import *
5050
from pwnlib.flag import *
51-
from pwnlib.fmtstr import FmtStr, fmtstr_payload, fmtstr_split
51+
from pwnlib.fmtstr import FmtStr as FmtStr, fmtstr_payload as fmtstr_payload, fmtstr_split as fmtstr_split
5252
from pwnlib.log import getLogger
53-
from pwnlib.memleak import MemLeak, RelativeMemLeak
53+
from pwnlib.memleak import MemLeak as MemLeak, RelativeMemLeak as RelativeMemLeak
5454
from pwnlib.regsort import *
5555
from pwnlib.replacements import *
56-
from pwnlib.rop import ROP
57-
from pwnlib.rop.call import AppendedArgument
58-
from pwnlib.rop.srop import SigreturnFrame
59-
from pwnlib.rop.ret2dlresolve import Ret2dlresolvePayload
56+
from pwnlib.rop import ROP as ROP
57+
from pwnlib.rop.call import AppendedArgument as AppendedArgument
58+
from pwnlib.rop.srop import SigreturnFrame as SigreturnFrame
59+
from pwnlib.rop.ret2dlresolve import Ret2dlresolvePayload as Ret2dlresolvePayload
6060
from pwnlib.runner import *
61-
from pwnlib.term.readline import str_input
62-
from pwnlib.timeout import Timeout
63-
from pwnlib.tubes.listen import listen
64-
from pwnlib.tubes.process import process, PTY, PIPE, STDOUT
65-
from pwnlib.tubes.remote import remote, tcp, udp, connect
66-
from pwnlib.tubes.serialtube import serialtube
67-
from pwnlib.tubes.server import server
68-
from pwnlib.tubes.ssh import ssh
69-
from pwnlib.tubes.tube import tube
61+
from pwnlib.term.readline import str_input as str_input
62+
from pwnlib.timeout import Timeout as Timeout
63+
from pwnlib.tubes.listen import listen as listen
64+
from pwnlib.tubes.process import process as process, PTY as PTY, PIPE as PIPE, STDOUT as STDOUT
65+
from pwnlib.tubes.remote import remote as remote, tcp as tcp, udp as udp, connect as connect
66+
from pwnlib.tubes.serialtube import serialtube as serialtube
67+
from pwnlib.tubes.server import server as server
68+
from pwnlib.tubes.ssh import ssh as ssh
69+
from pwnlib.tubes.tube import tube as tube
7070
from pwnlib.ui import *
71-
from pwnlib.util import crc
72-
from pwnlib.util import iters
73-
from pwnlib.util import net
74-
from pwnlib.util import proc
75-
from pwnlib.util import safeeval
76-
from pwnlib.util.crc import BitPolynom
71+
from pwnlib.util import crc as crc
72+
from pwnlib.util import iters as iters
73+
from pwnlib.util import net as net
74+
from pwnlib.util import proc as proc
75+
from pwnlib.util import safeeval as safeeval
76+
from pwnlib.util.crc import BitPolynom as BitPolynom
7777
from pwnlib.util.cyclic import *
7878
from pwnlib.util.fiddling import *
7979
from pwnlib.util.getdents import *
8080
from pwnlib.util.hashes import *
8181
from pwnlib.util.lists import *
8282
from pwnlib.util.misc import *
8383
from pwnlib.util.packing import *
84-
from pwnlib.util.proc import pidof
85-
from pwnlib.util.sh_string import sh_string, sh_prepare, sh_command_with
84+
from pwnlib.util.proc import pidof as pidof
85+
from pwnlib.util.sh_string import sh_string as sh_string, sh_prepare as sh_prepare, sh_command_with as sh_command_with
8686
from pwnlib.util.splash import *
8787
from pwnlib.util.web import *
8888
from pwnlib.libc import *
8989

9090
# Promote these modules, so that "from pwn import *" will let you access them
9191

92-
import pickle
93-
from io import BytesIO, StringIO
92+
import pickle as pickle
93+
from io import BytesIO as BytesIO, StringIO as StringIO
9494

9595
log = getLogger("pwnlib.exploit")
9696
error = log.error

0 commit comments

Comments
 (0)