Skip to content

Instantly share code, notes, and snippets.

View platomav's full-sized avatar

Plato Mavropoulos platomav

View GitHub Profile
@platomav
platomav / cabextract.py
Created June 1, 2024 22:48
Microsoft CAB Archive Extractor (Python-based)
#!/usr/bin/env python3
# coding=utf-8
"""
Microsoft CAB Archive Extractor (Python-based)
Usage: cabextract.py [-h] [-o OUTPUT_DIR] [paths ...]
Copyright (c) 2024 Plato Mavropoulos
"""
@platomav
platomav / duplicates_encodings.py
Created February 27, 2024 17:47
Duplicate file encoding finder (and optionally deleter), for Posix/NT, written in Python 3
#!/usr/bin/env python3
# coding=utf-8
import hashlib
import os
import json
from argparse import ArgumentParser, Namespace
from chardet.universaldetector import UniversalDetector as ChardetDetector
@platomav
platomav / Lenovo_ME_Grab.md
Created September 6, 2022 22:07
Lenovo Engine Link Grabber

Lenovo Engine Link Grabber

Description

Given a user list of Intel ME/TXE-related Lenovo update download links, this script automatically checks if any new versions of those updates/packages have been uploaded to Lenovo's download site since last run. This works because Lenovo's versioning is usually consecutive/linear so the new update links can be guessed and retrieved automatically, sometimes even a bit before they appear on the official support page for a given model. For example: 5xme25ww.exe is followed by 5xme26ww.exe, 5xme27ww.exe etc. The script saves all newer (since last run) Intel ME/TXE-related download links into a text file. It ignores false positives, removes duplicate links, sorts them in alphabetical order for easy comparison afterwards and automatically updates the DB with the last found version of a given update/package.

Usage

The DB (i.e. Lenovo_ME_Grab.txt file) consists of all currently known (user-provided) Intel ME/TXE-related Lenovo update download links.

@platomav
platomav / MSI_BIOS_Grab.md
Created September 6, 2022 22:06
MSI LiveUpdate BIOS Grabber

MSI LiveUpdate BIOS Grabber

Description

Parses MSI LiveUpdate BIOS update catalogs and saves all newer (since last run) download links into a text file. It removes any catalog formatting, ignores false positives, removes duplicate links and sorts them in alphabetical order for easy comparison afterwards.

Usage

The DB (i.e. MSI_BIOS_Grab.txt file) consists of all MSI LiveUpdate BIOS update catalog download links which have been gathered so far across all runs. Note that some of them may not work (e.g. 404), which is probably due to MSI mistakes/typos.

@platomav
platomav / Apple_EFI_Grab.md
Last active August 15, 2023 03:57
Apple EFI Package Grabber

Apple EFI Package Grabber

Description

Parses user-provided (DB) list of Apple Software Update CatalogURL .sucatalog links and saves all newer (since last run) EFI firmware package links into a text file. It removes any xml formatting, ignores false positives, removes duplicate links and sorts them in alphabetical order for easy comparison afterwards.

Usage

@platomav
platomav / Binary_Text_Extract.py
Created July 14, 2022 21:10 — forked from williballenthin/strings.py
Extract ASCII and Unicode strings using Python.
#!/usr/bin/env python3
#coding=utf-8
"""
Binary Text Extract
Binary ASCII/Unicode Extractor
Copyright (C) 2021 Plato Mavropoulos
Based on https://gist.github.com/williballenthin/8e3913358a7996eab9b96bd57fc59df2 by Willi Ballenthin
"""
@platomav
platomav / duplicates.py
Last active February 13, 2024 12:26 — forked from ntjess/duplicates.py
Fast duplicate file/link finder (and optionally deleter), for Posix/NT, written in Python 3
#!/usr/bin/env python3
# coding=utf-8
# pylint: disable=C0301,R0902,R0903,R0913,W0703
"""
Fast duplicate file/link finder (and deleter)
Usage: duplicates.py [-h] [-d] [-a HASH_ALGORITHM] [-c CHUNK_SIZE] [-m MAX_SIZE] [-l LOG_LEVEL] [paths ...]
Based on https://stackoverflow.com/a/36113168/300783 by Todor Minakov
@platomav
platomav / uefitool_compile_script_win.bat
Created August 21, 2019 16:47
UEFITool Compile Script for Windows
@echo off
echo -----------------------
echo UEFITool Compile Script
echo -----------------------
echo.
echo Checking requirements...
for %%R in (mingw49_32_release_static, mingw492_32, UEFITool-new_engine) do (