Skip to content

Commit

Permalink
Add stubs for radare.py
Browse files Browse the repository at this point in the history
  • Loading branch information
nitanmarcel authored and trufae committed Oct 2, 2024
1 parent ada0bf9 commit ca77ea2
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 0 deletions.
15 changes: 15 additions & 0 deletions python/stubs/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[tool.poetry]
name = "radare-stubs"
version = "0.1.0"
description = "Stubs for radare core api"
authors = ["radareorg <pancake@nopcode.org>"]
readme = "../../README.md"
packages = [{include = "radare_stubs.py"}]

[tool.poetry.dependencies]
python = "^3.6"


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
74 changes: 74 additions & 0 deletions python/stubs/radare_stubs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
from typing import Optional, List, Dict, Union

def hex2bin(s: str) -> bytes: ...
def bin2hex(binstr: bytes) -> bytes: ...
def slurp_hexpair(file: str) -> str: ...
def slurp(file: str) -> bytes: ...
def analyze_opcode(addr: Optional[int] = None) -> Dict[str, Union[int, str]]: ...
def analyze_block(addr: Optional[int] = None) -> Dict[str, Union[int, str]]: ...
def endian_set(big: bool) -> None: ...
def write(hexpair: str) -> None: ...
def write_asm(opcode: str) -> None: ...
def write_string(s: str) -> None: ...
def write_wide_string(s: str) -> None: ...
def write_from_file(file: str) -> None: ...
def write_from_hexpair_file(file: str) -> None: ...
def seek_undo() -> None: ...
def seek_redo() -> None: ...
def seek_history() -> List[Dict[str, str]]: ...
def seek_history_reset() -> None: ...
def write_undo(num: int) -> str: ...
def write_redo(num: int) -> str: ...
def write_history() -> List[Dict[str, Union[int, str]]]: ...
def flag_space_set(name: str) -> None: ...
def flag_list(mask: str) -> List[Dict[str, Union[int, str]]]: ...
def flag_set(name: str, addr: Optional[int] = None) -> None: ...
def flag_rename(old_name: str, new_name: str) -> None: ...
def flag_unset(name: str) -> None: ...
def flag_get(name: str) -> str: ...
def meta_comment_add(msg: str) -> None: ...
def type_code(length: int) -> None: ...
def type_data(length: int) -> None: ...
def type_string(length: int) -> None: ...
def copy(num: int, addr: Optional[int] = None) -> None: ...
def paste(num: int, addr: Optional[int] = None) -> None: ...
def asm(opcode: str) -> str: ...
def dis(num: int, addr: Optional[int] = None) -> str: ...
def str(addr: Optional[int] = None) -> str: ...
def dword(num: int, addr: Optional[int] = None) -> str: ...
def word(num: int, addr: Optional[int] = None) -> str: ...
def half(num: int, addr: Optional[int] = None) -> str: ...
def hex(num: int, addr: Optional[int] = None) -> str: ...
def eval_get(key: str) -> str: ...
def eval_set(key: str, value: str) -> None: ...
def eval_hash_get() -> Dict[str, str]: ...
def eval_hash_set(hash: Dict[str, str]) -> None: ...
def get_byte(addr: int) -> str: ...
def write_to_files(file: str, size: int) -> None: ...
def seek(addr: Union[int, str]) -> None: ...
def cmp(hexpairs: str, addr: int) -> None: ...
def cmp_file(file: str, addr: int) -> None: ...
def dbg_attach(pid: int) -> None: ...
def dbg_detach(pid: int) -> None: ...
def dbg_continue() -> None: ...
def dbg_step(num: int) -> None: ...
def dbg_step_over(num: int) -> None: ...
def dbg_jmp(addr: str) -> None: ...
def dbg_call(addr: str) -> None: ...
def dbg_bp_set(addr: str, type: str) -> None: ...
def dbg_bp_unset(addr: str, type: str) -> None: ...
def dbg_alloc(size: str) -> str: ...
def dbg_free(addr: str) -> None: ...
def dbg_backtrace() -> List[Dict[str, int]]: ...
def dbg_dump(name: str) -> None: ...
def dbg_restore(name: str) -> None: ...
def dbg_register_get(name: str) -> None: ...
def dbg_register_set(name: str, value: str) -> None: ...
def trace_at(addr: str) -> Dict[str, str]: ...
def trace_list() -> List[str]: ...
def trace_reset() -> None: ...
def trace_ranges() -> List[str]: ...
def hash(algo: str, size: int) -> str: ...
def graph(addr: Optional[str] = None) -> None: ...
def cmd(s: str) -> str: ...
def quit() -> None: ...

0 comments on commit ca77ea2

Please sign in to comment.