Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Added Python 3.13 support#295

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
D3vil0p3r wants to merge4 commits intocalebstewart:master
base:master
Choose a base branch
Loading
fromD3vil0p3r:patch-1
Open
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Update __init__.py
  • Loading branch information
@D3vil0p3r
D3vil0p3r authoredApr 3, 2025
commit37f9d5eb28071dbc7591efcef3d7647e2f8966bd
48 changes: 22 additions & 26 deletionspwncat/commands/__init__.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -34,47 +34,43 @@ class Command(CommandDefinition):
def run(self, manager: "pwncat.manager.Manager", args: "argparse.Namespace"):
manager.log("we ran a custom command!")
"""

import argparse
import fcntl
import importlib
import os
import pkgutil
import re
import sys
import tty
import fcntl
import shlex
importpkgutil
importsys
import termios
import argparse
import importlib
from io import TextIOWrapper
import tty
from enum import Enum, auto
from typing import Dict, List, Type, Callable, Iterable
from functools import partial
from io import TextIOWrapper
from typing import Callable, Dict, Iterable, List, Type

import rich.text
from pygments import token
from prompt_toolkit import ANSI, PromptSession
from pygments.lexer import RegexLexer
from pygments.styles import get_style_by_name
from prompt_toolkit.lexers import PygmentsLexer
from prompt_toolkit.styles import Style, merge_styles
from prompt_toolkit.history import History
from prompt_toolkit.application.current import get_app
from prompt_toolkit.auto_suggest import AutoSuggestFromHistory
from prompt_toolkit.completion import (CompleteEvent, Completer, Completion,
WordCompleter, merge_completers)
from prompt_toolkit.document import Document
from prompt_toolkit.completion import (
Completer,
Completion,
CompleteEvent,
WordCompleter,
merge_completers,
)
from prompt_toolkit.history import History
from prompt_toolkit.key_binding import KeyBindings
from prompt_toolkit.auto_suggest importAutoSuggestFromHistory
from prompt_toolkit.lexers importPygmentsLexer
from prompt_toolkit.patch_stdout import patch_stdout
from prompt_toolkit.styles import Style, merge_styles
from prompt_toolkit.styles.pygments import style_from_pygments_cls
from prompt_toolkit.application.current import get_app
from pygments import token
from pygments.lexer import RegexLexer
from pygments.styles import get_style_by_name

import pwncat
import pwncat.db
from pwncat.util import console
from pwncat.channel import ChannelClosed
from pwncat.util import console


class Complete(Enum):
Expand DownExpand Up@@ -446,7 +442,6 @@ def __init__(self, manager: "pwncat.manager.Manager"):
# Saved terminal state to support switching between raw and normal mode.
self.saved_term_state = None


def setup_prompt(self):
"""This needs to happen after __init__ when the database is fully
initialized."""
Expand DownExpand Up@@ -787,7 +782,8 @@ def restore_term(self, new_line=True):

class CommandLexer(RegexLexer):
"""Implements a Regular Expression based pygments lexer for dynamically highlighting
the pwncat prompt during typing. The tokens are generated from command definitions."""
the pwncat prompt during typing. The tokens are generated from command definitions.
"""

tokens = {}

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp