Skip to main content

Results of strings.exe to pandas DataFrame

pip install strings2df

Tested against Windows 10 / Python 3.10 / Anaconda

The utility leverages multiprocessing techniques to extract strings from files concurrently (with Microsoft's strings.exe), utilizing the available system resources efficiently.

It can handle large volumes of files or folders with configurable parameters, such as buffer size and maximum threads, ensuring optimal performance.

Users have the flexibility to extract strings from individual files or entire folders by specifying the desired file paths or folder paths. They can also define additional criteria, such as allowed file extensions or minimum string length, to filter the extracted strings.

The extracted strings are returned as a pandas DataFrame, a powerful data manipulation tool. Users can apply various pandas functions to filter, transform, or analyze the extracted strings, enabling in-depth exploration and further processing.

Unicode and ASCII Support: The utility provides options to extract either Unicode strings, ASCII strings, or both, allowing users to handle different types of text data present in files accurately.

By combining efficiency, flexibility, and data manipulation capabilities, this utility simplifies the process of extracting strings from files, empowering users to derive valuable insights from text data efficiently.

Please note that the provided information is for illustrative purposes only, and the utility's usefulness may vary depending on specific use cases and requirements.

To extract strings from individual files:

from strings2df import extract_strings_from_files
df = extract_strings_from_files(
    allfiles=[
        r"C:\Users\hansc\Desktop\create_new_anaconda_env - Copy.bat",
        r"C:\cygwinxx\bin\etags.exe",
        r"C:\cygwinxx\bin\apt",
    ],
    minimum_string_len=5,
    unicode_ascii_both="both",
    bufsize=100000,
    timeout=1000000,
    max_threads=5,
    timeout_check_sleep=1,
    convert_to_string=False,
)
# print(df[:5].to_string())
#    aa_fileindex  aa_offset                                                                aa_string              aa_file
# 0             0          0                                                           b'#!/bin/bash'  C:\cygwinxx\bin\apt
# 1             0         12  b'        # apt-cyg: install tool for Cygwin similar to debian apt-get'  C:\cygwinxx\bin\apt
# 2             0         81                                                             b'        #'  C:\cygwinxx\bin\apt
# 3             0         91                                       b'        # The MIT License (MIT)'  C:\cygwinxx\bin\apt
# 4             0        123                                                             b'        #'  C:\cygwinxx\bin\apt

To extract strings from files within folders:

from strings2df import get_strings_from_all_files_in_folders

df2 = get_strings_from_all_files_in_folders(
    folders=[
        r"C:\ProgramData\BlueStacks_nxt",
    ],
    allowed_extensions=(".exe", ".cfg"),
    maxsubfolders=-1,
    minimum_string_len=5,
    unicode_ascii_both="both",
    bufsize=100000,
    timeout=1000000,
    max_threads=5,
    timeout_check_sleep=1,
    convert_to_string=True,
)
# print(df2[:5].to_string())
#    aa_fileindex  aa_offset                                   aa_string                                                         aa_file
# 0             0          0  DesktopShortcutFileName = BlueStacks 5.lnk  C:\ProgramData\BlueStacks_nxt\Engine\Nougat64\oem_Nougat64.cfg
# 1             0         43      ControlPanelDisplayName = BlueStacks 5  C:\ProgramData\BlueStacks_nxt\Engine\Nougat64\oem_Nougat64.cfg
# 2             0         82             IsPixelParityToBeIgnored = true  C:\ProgramData\BlueStacks_nxt\Engine\Nougat64\oem_Nougat64.cfg
# 3             0        114                                   OEM = nxt  C:\ProgramData\BlueStacks_nxt\Engine\Nougat64\oem_Nougat64.cfg
# 4             0        124           IsCreateDesktopIconForApp = false  C:\ProgramData\BlueStacks_nxt\Engine\Nougat64\oem_Nougat64.cfg

# The extracted strings will be returned as a pandas DataFrame (df in the above examples) with columns representing the file index, offset, string, and file path.

# You can manipulate and filter the DataFrame using pandas functions. For example:


# You can work with binaries like with strings:
# Just use Series.s_str() # included in this module - https://github.com/hansalemaos/a_pandas_ex_fastloc
# df.loc[df.aa_string.s_str().contains(b'xml',regex=True, flags=regex.I)]

Metadata

Release files for strings2df 0.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for strings2df 0.10
File Size Uploaded Provenance Actions
strings2df-0.10.tar.gz 576.5 kB Without provenance Details for strings2df-0.10.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for strings2df 0.10
File Interpreter ABI Platform Actions
strings2df-0.10-py3-none-any.whl Python 3 none any Details for strings2df-0.10-py3-none-any.whl

Total release size: 1.2 MB

Release files / strings2df-0.10.tar.gz

Download URL strings2df-0.10.tar.gz
Size 576.5 kB
Tags Source
SHA-256 checksum
How to use checksums
5ee11eca70cc458134b86411359bb432154d28c1583cd4bde447b313c98aa1be
BLAKE2b-256 checksum
How to use checksums
a2342cb254bd983b046d9ebff000316cfcdc028834b4342d96d488f1560c63a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.10

Release files / strings2df-0.10-py3-none-any.whl

Download URL strings2df-0.10-py3-none-any.whl
Size 576.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
53cbfc241d7539278579ad718cc99735a74e9825a478d3ab6e85ea8452f25320
BLAKE2b-256 checksum
How to use checksums
c21f15125ab531017dc0c9d983a9720cc110a038af11b92c289f22952f3b8748
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.10

Security for strings2df 0.10

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.10 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page