https://github.com/akurtz87/ascii-control-chars-remover-from-binary-files
https://github.com/akurtz87/ascii-control-chars-remover-from-binary-files
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/akurtz87/ascii-control-chars-remover-from-binary-files
- Owner: AKurtz87
- Created: 2023-03-10T09:51:40.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-03-10T10:03:16.000Z (about 2 years ago)
- Last Synced: 2025-02-13T19:39:21.862Z (4 months ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ASCII-Control-Chars-Remover-from-Binary-Files
This is a Node.js script that reads a binary file and converts its content into ASCII text. It does so by first replacing specific characters (defined in the charsToReplace array) with a space character, then converting the resulting buffer to ASCII text and formatting it with a maximum of 50 characters per line.
The script also generates a random image of ASCII characters using ANSI escape codes to colorize them, which is printed to the console before and after the conversion process.
To use this script, you would need to run it from the command line and provide the path to the input binary file as the first argument. The output file will be created in the same directory as the script with the name "asciiFile.txt".
# Requirements
To run this script, you will need:
- Node.js v10 or higher
- A binary file to convert to ASCII# Usage
To use this script, run the following command from the command line:
> node ascii_remove_control_chars_from_file.js filename
Where inputFilePath is the path to the binary file you want to convert.
The output file will be created in the same directory as the script with the name "asciiFile.txt".
The script will also generate a random image of ASCII characters, which is printed to the console before and after the conversion process.# Customization
By default, the script removes the control ASCII characters contained in the following array:
const charsToReplace = ["\x00", ...];
# Purpose
The purpose of this Node.js script is to convert binary files to ASCII text and remove control ASCII characters. This allows for the identification of strings of interest for YARA rules.