The binary tag has no usage guidance.
2
votes
1answer
26 views
Building a .deb package reproducibly
This comes from how to apply patch in a debian package? . Now after building the packages, I have no idea whether the packages got built correctly or not. I did see this in the parent directory -
┌─[...
0
votes
1answer
38 views
How does x86 / x64 binary compatibility work on Linux? [duplicate]
On Windows, x64 versions of the OS can run both x86 and x64 binaries.
However, x86 Windows can only run x86 binaries. Even if the underlying CPU is 64-bit capable, it cannot run x64 binaries.
Is the ...
1
vote
2answers
30 views
What is the proper way to use an alternative binary
I am on Linux Mint 18 Cinnamon 64-bit.
I have these binaries of 7z and their versions on my system:
/usr/bin/7z
7-Zip [64] 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18
and
/usr/local/...
1
vote
1answer
45 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 ...
0
votes
2answers
56 views
binary files Linux /var/log/wtmp [closed]
why are some files in Linux binary ? For example the /var/log/wtmp log? More precisely why is the log in binary form.
15
votes
7answers
4k views
Are binaries portable across different CPU architectures?
I am a newbie on Linux and my goal is to be able to develop for embedded Linux. I have experience on bare-metal embedded systems using ARM.
I have some general questions about developing for ...
0
votes
1answer
35 views
Deploy personal programs and scripts
I have a git project containing useful programs and scripts. Hierarchy looks like this:
$ git clone https://github.com/myaccount/myutils.git
$ tree myutils
.
├── bash
│ ├── do-this.sh
│ ├── do-...
-3
votes
1answer
53 views
Check the frequncy of a character's consecutive occurences [closed]
I need a way (in Bash) to check the consecutive occurrences of a character, however it also needs to be capable of having a limit of occurrences before it is considered to be a second variable, in ...
0
votes
0answers
69 views
Questions on /dev/mem, dumping using dd, and .bin and .rom formats
Following @ack 's answer on How to dump BIOS data to a file I would like to know:
1) when one is dumping memory from /dev/mem, is the file data in binary or some other format?
I have done a dump ...
4
votes
1answer
69 views
Decode binary output from Fortran program created on Sun Sparc system
I have one f77 file,which was created on SunSparc machine.I know that each record contains 5 reals and one integer.Is there any way how I could unpack that file on my Ubuntu 16.04 Intel little-endian ...
4
votes
1answer
51 views
Binary diff of two folders
Let's say I have two folders: before and after.
./before:
bash
./after:
bash
The bash in the before folder differs from the bash in after.
Using bsdiff or a similar program, is there a way to ...
2
votes
4answers
93 views
How to check which binaries depend on certain files in /lib?
I know that if I do the command ldd <name> on a binary file in /bin or /sbin I can see which libraries it uses. How do I do the reverse? I.e. do a command on a file in /lib and see what binaries ...
2
votes
4answers
763 views
Execute binary code
I have a binary code and I want to run it.
01001000 01100101 01101100 01101100 01101111 00100000 01010111 01101111 01110010 01101100 01100100
How can I create a file "application/x-executable" and ...
19
votes
10answers
22k views
How to view a binary file?
From what I understand, a compiler makes a binary file that consists of 1's and 0's that a CPU can read. I have a binary file but how do I open it to see the 1's and 0's that are there? A text editor ...
3
votes
1answer
62 views
0
votes
2answers
100 views
What can cause my shell to look like this? [duplicate]
I'm currently developing a home automation framework for my apartment. This involves getting JSON over Serial from an Arduino. When the JSON can't be parsed (usually only on startup) I log it as an ...
11
votes
3answers
716 views
How can I work with binary in bash, to copy bytes verbatim without any conversion?
I am ambitiously trying to translate a c++ code into bash for a myriad of reasons.
This code reads and manipulates a file type specific to my sub-field that is written and structured completely in ...
1
vote
2answers
153 views
What's the POSIX way to read an exact number of bytes from a file?
Just hit this problem, and learned a lot from the chosen answer: Create random data with dd and get "partial read warning". Is the data after the warning now really random?
Unfortunately ...
3
votes
2answers
107 views
Why does “head /bin/ls” reset the terminal
If you do something silly like cat /var/log/wtmp your terminal can get messed up as shown in the screenshot. I know there are a number of ways of fixing this. One of the ways not mentioned on that ...
0
votes
1answer
44 views
Possible problems deleting /tools in LFS
I recently made a Linux From Scratch and now I want to delete the /tools directory. But before rushing through it, I ran
ldd /bin/* | grep '/tools'
Which gave me this
liblzma.so.5 => /tools/lib/...
0
votes
1answer
120 views
Install Java 1.4.2 on recent Amazon Linux [duplicate]
I need Java 1.4.2 on a up-to-date Amazon Linux 2015.09 server. I've tried to install j2sdk-1_4_2_19-linux-ia64-rpm.bin. When I execute this file, I get an error message:
line 442: ./install.sfx.12314:...
3
votes
2answers
268 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 ...
1
vote
1answer
64 views
Find all files (including libraries) a binary depends on
I'd like to find all files a binary depends on (including libraries, configuration files, basically all files referenced in the binary).
I know, that you can find shared libraries with objdump, ldd, ...
-2
votes
1answer
80 views
how to fix potentially infected binary files? [closed]
when I installed the updates on my computer (Ubuntu 14.04), I typed the password, thinking that it was asked for regular updating , but when I noticed some strange behavior and crash at this moment, I ...
0
votes
1answer
63 views
Convert line of ASCII file to binary packet for NetCat
I have an ASCII file, which looks like this:
36,36,0,1
36,36,0,2
...
What I want to do is to send every row of it as one binary TCP segment's payload with NetCat.
To convert the number from file to ...
4
votes
2answers
378 views
Trace a binary stream from a device file
I'm debugging a binary stream that is coming from a device file.
I would like to have the output printed out in real time as hex values.
So far I've used tail -f /dev/ttyAPP2 | hexdump -C but after ...
5
votes
2answers
355 views
Create the same PNG with ImageMagick 2 times: Binaries differ
I create two images that should be identical, but their binaries are different:
$ convert -size 1x1 xc:white out1/w.png
$ sleep 1
$ convert -size 1x1 xc:white out2/w.png
$ diff out1/w.png out2/w.png
...
4
votes
1answer
78 views
Finding out binary's compiling computer name
We have recently in our workplace stumbled upon a really old binary file that originates from unknown old computer. However in order to run this binary we need to get some local resources and ...
2
votes
1answer
50 views
Is there a way to create endless stream with custom character?
I need to create an endless stream of characters like /dev/zero but I need it to spam custom character (like 'a') instead of 0x00. Is there a way to do it?
1
vote
1answer
650 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 ...
0
votes
1answer
59 views
How to recognize binaries installed in `~/bin`? [duplicate]
I am trying to execute some binaries manually installed in a bin directory in my $HOME (normal user).
Files are present in /home/user/bin and have exec permission:
$ ls -la ~/bin/
total 120
drwxr-...
2
votes
1answer
260 views
How do I repair binaries?
So, basically I was messing up with minix and qemu and I messed up too much.
me@meplepl ~ $ which
bash: /usr/bin/which: cannot execute binary file: Exec format error
me@meplepl ~ $ file /bin/which
...
3
votes
2answers
41 views
How to set binary installed by package manager as default?
I installed a newer version of tcpdump via MacPorts and would like to make it the default binary.
$ which -a tcpdump
/usr/sbin/tcpdump
/opt/local/sbin/tcpdump
For now I set an alias, but that of ...
1
vote
1answer
106 views
Find longest matching portion with in two binary files
Say I've got two binary files, each roughly 50MB, that may contain a digitally-identical portion. Is there an easy way to compare these two files, find the longest identical portion, and save that to ...
1
vote
2answers
625 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 ...
5
votes
3answers
130 views
How does grep decide that a file is binary?
I have a large utf-8 text file which I frequently search with grep. Recently grep began reporting that it was a binary file. I can continue to search it with grep -a, but I was wondering what change ...
0
votes
1answer
109 views
What's the fastest way of writing 1s to a hard disk? [duplicate]
I'm currently writing 1s to a file using the following:
tr '\0' '\377' < /dev/zero > /dev/sdb
But this is a really slow method when I want to fill a 500GB disk. Is there a quicker way?
4
votes
3answers
351 views
Handling NULL characters in shell
Is there a portable way of handling NULL characters in shell?
A typical example would be splitting the output of find ... -print0 with shell (and shell only) either in a pipe or in a command ...
1
vote
2answers
56 views
Viewing Binary not Hex
Debian jess 64
Alright let me start out by saying this maybe a very stupid,uninformed question due to my lack of understanding of binary, but I guess that's what this site is for, questions.
That ...
1
vote
0answers
2k views
How do I create generalized binary tarballs for SageMath?
I would like to create a generalized binary tarball (i.e., a tar-compressed archive that contains an executable shell script for a wide range of different Linux distributions. It must be first ...
0
votes
1answer
152 views
Grep all strings from several binary files into one txt file
I've decided to play around dumping all process memory of couple utilities in order to find out, how much trace of sensitive info an attacker could theoretically obtain from app's memory.
I've found ...
2
votes
3answers
5k views
is there a way to run a linux binary on OS X
Is there a way to run a linux binary in OS X?
I tried to run a binary but it said it isn't executable.
2
votes
3answers
470 views
Split binary data of fixed byte offset by byte position?
I have binary data which I review by xxd -ps in hex format.
I notice that the byte distance is 48300 (=805*60) bytes between two headers where the separator is fafafafa.
There is the beginning of ...
4
votes
4answers
430 views
How can I convert two-valued text data to binary (bit-representation)
I have a text file with two (2) only possible characters (and maybe new lines \n). Example:
ABBBAAAABBBBBABBABBBABBB
(Size 24 bytes)
How can I convert this to a binary file, meaning a bit ...
2
votes
2answers
68 views
Workaround for busybox head that drops NUL from data
TL;DR: Latest busybox (1.23.2) provided head is buggy and will happily drop NUL characters in the provided data. Replacing the binaries is not an option. I'm using head -[nc] -X in my scripts, is ...
3
votes
2answers
17k views
Convert binary mode to text mode and the reverse option
By the following way I convert a simple binary file into a text file
od –t x1 Check.tar | cut –c8- > Check.txt
Which gives a content similar to:
64 65 76 2f 6e 75 6c 6c 00 00 00 00 00 00 00 00
...
2
votes
2answers
1k views
How to obtain a plain (raw) binary dump of any file in Unix/Linux?
I have read many similar question on the Stack Exchange community but none of them address a 'clean' binary dump. I have used: xxd and sed combinations to try to obtain a clean binary dump from any ...
1
vote
2answers
532 views
ls or find option to exclude binary files
How can I list only files that aren't compiled code in the current directory?
I'm reviewing the custom scripts and code on several HPUX and Linux servers before transferring them to a newer system. ...
-2
votes
2answers
142 views
How can I identify if a binary file is set-user-ID? [closed]
In Linux, how can I identify if a binary file is set-user-ID?
Can I use ls -l?
0
votes
1answer
426 views
How do i write a shell script so that when i compile my c++ program it will put the binary into the Binary Directory
I have a directory called Binary and bunch of source files:
./
├── Binary/
├── lesson02.cpp
├── lesson04.cpp
└── lesson06.cpp
when I compile the source code
g++ lesson01.cpp -o lesson01
I want ...