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
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 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 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 |
OlderNewer