All Questions
Tagged with binary shell-script
22 questions
2
votes
1
answer
228
views
Replacing the domain string in the compiled binary file with an IP address
Just in theory: is it possible to replace the domain string in the compiled binary file with an IP address by editing a binary file in place with sed? (IP address belongs to a different domain, but ...
10
votes
3
answers
12k
views
How do I create binary file with certain value?
I need to create a binary file that is filled only with 11111111.
I only know how to create zero-filled binary with
dd if=/dev/zero bs=18520 count=1
Could you please say to me what a command in ...
4
votes
1
answer
3k
views
How to disassembly multiple functions using Linux utility objdump?
After a program is compiled and the binary file is generated, we can use objdump to disassemble the binary file and extract the assembly code and a lot of information.
However, using -j .text with ...
2
votes
1
answer
2k
views
How can we perform an arithmetic operation on a register using GDB? [closed]
I want to inject a bit-flip fault into a running program. For this purpose, I'm using gdb to insert a breakpoint into the target program and then flipping a single bit in a random-selected register. ...
10
votes
1
answer
7k
views
How to fix onedrive corrupt zips with a bash script
Currently onedrive generates zip files that are broken to most software.
https://www.bitsgalore.org/2020/03/11/does-microsoft-onedrive-export-large-ZIP-files-that-are-corrupt
As we can see here, the ...
2
votes
0
answers
260
views
How Can I Use shc to Convert Scripts that contain `wget` Into Binaries? [closed]
I have a bash script that I wish to convert into a binary using shc. It includes the line wget www.google.com.
If I run shc -f myscript.sh to convert it into ./myscript.sh.x (the resulting program), ...
0
votes
1
answer
819
views
bash file contain executable/binary code
I found this tool and when I downloaded it is a bash executable that contains binary code.
First of all I didn't know this is possible. Does anyone know who this can be done? Also I am not sure how ...
0
votes
1
answer
2k
views
Simple Binary Replacement
I tried using bbe as below
bbe -e 's/01110011/01111000/' test.txt
All I'm trying to accomplish in this example is to read the file as if it's a binary file, and replacing the letter s with x.
I'm ...
0
votes
1
answer
2k
views
Shell - Read binary file character by character as hex
I'm trying to read serial input(/dev/tty*) character by character. I need this to parse the data following the corresponding protocol. My current method is as follows:
while read -rs -n 1 c; do
...
0
votes
0
answers
301
views
Automated way to periodically move files of a specific file-extension to cloud folder (mounted as local directory)
I am currently working on a large project (Phd thesis) using git for version control. My source files are processed by latex which are just plain-text, naturally suited to version control.
The ...
3
votes
1
answer
3k
views
Can i modify this search command to ignore binary files?
I have this command which gets generated by a little script i wrote called "scan", which I use all the time to look for specific content (variable names etc) inside text files:
find "." \
| awk '{...
1
vote
1
answer
628
views
How can I remove x number of zeros from the beginning of a file?
So I made a decimal to binary converter but currently it doesn't chop off the zeros in the beginning. If I entered 64 for $1 it would start with 13 zeros which is rather unsightly but I don't know how ...
3
votes
2
answers
392
views
Alter certain bytes in many files
I need a large number of damaged .png files in order to test my project. To that end, I need to set all bytes from the 0x054-th to the 0xa00-th to 0.
.png files contain chunks with checksums, I want ...
2
votes
1
answer
11k
views
Apply SHA256 and Base64 to string in script
I'm trying to apply SHA256 and then Base64 encode a string inside a shell script. Got it working with PHP:
php -r 'echo base64_encode(hash("sha256", "asdasd", false));'. But I'm trying to get rid of ...
3
votes
2
answers
4k
views
Extract data between two matched patterns in a binary file
I am trying to extract a jpeg image from a binary text file. I want to extract all data between 0xFF 0xD8 (start of image) and 0xFF 0xD9 (end of image) inclusive. Earlier, I have successfully run the ...