Skip to main content

symparsepy is a Rust-based Python package for parsing symbols from PDB files. This package leverages the pyo3 library to create Python bindings for Rust code.

Project description

symparsepy

symparsepy is a Rust-based Python package for parsing symbols from PDB files. This package leverages the pyo3 library to create Python bindings for Rust code.

Installation

To install symparsepy, you need to build the package into a wheel file and then install it using pip. Follow these steps:

  1. Install Maturin:

    pip install maturin
    
  2. Build the Wheel: Run the following command in your terminal to build the wheel file:

    maturin build
    

    This will generate a .whl file in the target/wheels directory.

  3. Install the Wheel: You can install the generated wheel file using pip:

    pip install target/wheels/symparsepy-0.1.0-cp39-cp39-win_amd64.whl
    

Usage

Here is an example of how to use symparsepy in your Python code:

Parsing PDB Files

The parse_pdb function parses symbols from a PDB file and returns a list of dictionaries, each containing the parsed symbol information.

import symparsepy

# Example usage
result = symparsepy.parse_pdb("path_to_pdb_file.pdb")
for symbol in result:
    print(symbol)

Each dictionary includes the following keys:

  • offset: The offset value of the symbol.
  • section: The section value of the symbol.
  • name: The name of the symbol.
  • code: Indicates if the symbol is code.
  • msil: Indicates if the symbol is MSIL.
  • function: Indicates if the symbol is a function.

Example Output

[
    {
        "offset": "421376",
        "section": "1",
        "name": "symbol_name",
        "code": "true",
        "msil": "false",
        "function": "true"
    },
    ...
]

Searching Symbols

The search_symbols function searches for symbols in a PDB file that match a given regex pattern and returns a list of dictionaries with the matching symbols.

import symparsepy

# Example usage
pattern = r"some_regex_pattern"
result = symparsepy.search_symbols("path_to_pdb_file.pdb", pattern)
for symbol in result:
    print(symbol)

Each dictionary includes the same keys as in the parse_pdb function.

Development

To contribute to this project, follow these steps:

  1. Clone the repository:

    git clone https://github.com/P1tt1cus/SymparsePy
    cd SymparsePy
    
  2. Install the development dependencies:

    pip install maturin
    
  3. Build the project:

    maturin build
    

License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

symparsepy-0.1.1.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

symparsepy-0.1.1-cp312-cp312-manylinux_2_34_x86_64.whl (976.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

File details

Details for the file symparsepy-0.1.1.tar.gz.

File metadata

  • Download URL: symparsepy-0.1.1.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.7.4

File hashes

Hashes for symparsepy-0.1.1.tar.gz
Algorithm Hash digest
SHA256 038b7b17274a5275ee3aec32cf507d53519774e1a0da99f8450bd2133c439a48
MD5 fb57229bd4755df03c3bcf87ea5ec2ef
BLAKE2b-256 c8055a939a70ef52a852e27e91e654376bf33eb4a91628f2b178145b3628ddc7

See more details on using hashes here.

File details

Details for the file symparsepy-0.1.1-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for symparsepy-0.1.1-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 1804290ee45b21cc71f70f60638b131e0605921edde5fb0de570d565b71c9298
MD5 481d223b44a0b8d3209a1b78f9d4aa2d
BLAKE2b-256 52b2d0ea69eea2dbc2af55fe478262984a1384e7394441835bfa9f59f8ab70b0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page