This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The file is read in Fortran as "unstructured" binary. The data is encoded in little endian format, while the size is encoded in big endian format. | |
# The first four bytes denote a block length (0x00009600 = 38400, 0x00037000 = 225280, 0x00002080 = 8320, 0x00019A00 = 104960, 0x00012480 = 74880 ) | |
# The rest of the block consists of 64-bit floats | |
# Each block is succeeded by the size value (the same as in the beginning) again and this is the offset the block length at the beginning points to | |
# The individual blocks (complete with the block length prepended and appended to it) are concatenated together into a single file | |
# This is consistent with the FORTRAN "unformatted" file saving convention described e.g. in https://www.mathworks.com/matlabcentral/answers/97118-how-do-i-read-a-fortran-unformatted-binary-data-file-into-matlab#answer_106468 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gzip, os, platform, shutil, sqlite3 | |
from datetime import datetime | |
# The paths are somewhat different on Linux and Windows | |
if platform.system()=="Windows": | |
destdir="D:\\FF backups" | |
srcdir=os.environ["APPDATA"]+"\\Mozilla\\Firefox\\Profiles" | |
elif platform.system()=="Linux": | |
destdir="/media/backup" | |
srcdir=os.environ["HOME"]+"/.mozilla/firefox" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The following steps are meant either to complement the wonderful book titled "The IoT Hacker’s Handbook A Practical Guide to Hacking the Internet of Things" by Aditya Gupta or to act as a generic aid in firmware exploiting and pentesting for Win10 users. | |
1. Clone akx's branch of binwalk: | |
git clone -b packaging-fixes https://github.com/akx/binwalk.git | |
2. Change to this newly-created directory and install the module: | |
cd C:\Path\to\binwalk | |
pip3 install . | |
3. Download squashfs for Windows: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ctypes | |
lib=ctypes.windll.LoadLibrary("C:\\Path\\to\\hdf5.dll") | |
#lib=ctypes.cdll.LoadLibrary("/usr/lib/libhdf5.so") | |
length = 1 | |
majnum = ctypes.cast(ctypes.create_string_buffer(length), ctypes.POINTER(ctypes.c_uint)) | |
minnum = ctypes.cast(ctypes.create_string_buffer(length), ctypes.POINTER(ctypes.c_uint)) | |
relnum = ctypes.cast(ctypes.create_string_buffer(length), ctypes.POINTER(ctypes.c_uint)) | |
lib.H5get_libversion.argtypes = [ ctypes.POINTER(ctypes.c_uint), ctypes.POINTER(ctypes.c_uint), ctypes.POINTER(ctypes.c_uint)] | |
lib.H5get_libversion(majnum, minnum, relnum) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
wget http://download-ib01.fedoraproject.org/pub/fedora/linux/releases/31/Everything/source/tree/Packages/b/bindfs-1.14.1-2.fc31.src.rpm | |
cat > Dockerfile <<"EOF" | |
FROM centos:8 | |
RUN mkdir -p /root/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS} && mkdir -p /bindfs | |
RUN dnf -y --nogpgcheck install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm wget zip unzip bzip2 gcc gcc-c++ rpm-build make ruby valgrind fuse-devel |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mkdir docker-eccodes; cd docker-eccodes | |
wget https://dl.fedoraproject.org/pub/epel/8/Everything/SRPMS/Packages/e/eccodes-2.14.1-1.el8.src.rpm | |
wget https://confluence.ecmwf.int/download/attachments/45757960/eccodes-2.15.0-Source.tar.gz | |
rpm2cpio ./eccodes-*.src.rpm | cpio -dium |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eccodes#!/bin/bash | |
mkdir docker-curl; cd docker-curl | |
wget http://vault.centos.org/8.0.1905/BaseOS/Source/SPackages/curl-7.61.1-8.el8.src.rpm | |
rpm2cpio ./curl-*.src.rpm | cpio -dium | |
cat > curl-spec.patch <<"EOF" | |
--- curl.spec.orig 2019-05-16 08:57:52.000000000 +0200 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM centos:8 | |
RUN mkdir -p /root/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS} | |
RUN dnf -y --nogpgcheck install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm wget zip unzip bzip2 gcc gcc-c++ rpm-build make krb5-devel perl-interpreter zlib-devel lksctp-tools-devel perl-podlators perl-Test-Harness perl-Math-BigInt perl-Module-Load-Conditional perl-File-Temp perl-Time-HiRes perl-CPAN perl-Test-Simple | |
# The src.rpm can be obtained e.g. from http://vault.centos.org/8.0.1905/BaseOS/Source/SPackages/openssl-1.1.1-8.el8.src.rpm | |
COPY openssl-1.1.1-8.el8.src.rpm /root/rpmbuild/ | |
RUN cd /root/rpmbuild/ && \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mkdir docker-jasper; cd docker-jasper | |
wget https://downloads.redhat.com/redhat/rhel/rhel-8-beta/appstream/source/Packages/jasper-2.0.14-4.el8.src.rpm | |
rpm2cpio ./jasper-*.src.rpm | cpio -dium | |
cat > jasper-spec.patch <<"EOF" | |
--- jasper.spec.orig 2018-08-12 14:44:42.000000000 +0200 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mkdir docker-libjpeg-turbo && cd docker-libjpeg-turbo | |
wget http://vault.centos.org/8.0.1905/AppStream/Source/SPackages/libjpeg-turbo-1.5.3-7.el8.src.rpm | |
rpm2cpio ./libjpeg-turbo-*.src.rpm | cpio -dium | |
cat > libjpeg-turbo-spec.patch <<"EOF" | |
--- libjpeg-turbo.spec.orig 2019-05-14 03:36:19.000000000 +0200 |
NewerOlder