Tag Info

New answers tagged

0

You can display the contents of a file with cat, but with binary files that will often result in "garbage". For binary files you can use od -x (or xxd): od -x file.bin that makes everything byte readable as hex words for any file (understanding what that means is more difficult and dependent on the program that wrote the file, but fortunately that is not ...


4

openssl's stdin is a byte stream. The contents of $user is a sequence of non-0 bytes (which may or may not form valid characters in UTF-8 or other character set/encoding). printf %s "$user"'s stdout is a byte stream. printf %s "$user" | openssl dgst -sha256 –binary Will connect printf's stdout with openssl's stdin. openssl's stdout is another byte ...


1

You can do something like: #! /usr/bin/env python device = '/dev/sdi' old_pattern = "MyPassWord" new_pattern = "XXXXXXXXXX" assert len (old_pattern) == len(new_pattern) BS = 1024 ** 2 # 1 Mb buffer # read a few bytes more to account for occurences of the pattern on the edge READSIZE = BS + len(old_pattern) offset = 0 with open(device, 'r+b') as fp: ...


5

You can't store binary data (binary data generally refers to data with arbitrary byte values, not only byte values that form valid characters but is not special otherwise) in bash variables as bash doesn't support storing the 0 byte value in its variables (and remember you can't pass such strings in arguments to commands as those are NUL delimited strings). ...


7

I thought I could download the tarball, extract it and just run the binary, but I am not sure how to do that. You do occasionally see an app on Unix/Linux where someone has gone to the effort to make it portable (in the USB memory stick sense), but this is uncommon in the Unix world. In this specific case, RStudio is miles away from being portable on ...


1

grep --binary-files=text pattern file another solution : strings -a file | grep pattern


2

Yes and no. Yes, you can (usually) take older source code and combine it with newer one. That is what for example CyanogenMod is doing (apart from other things). No, you can't decompile the built image, extract sources, drop those verbatim into newer sources and recompile. It's just not that simple, for couple of reasons, mainly: Decompilation is just ...



Top 50 recent answers are included