Skip to content

Instantly share code, notes, and snippets.

@Romern
Romern / studydrive_download_new.py
Created February 18, 2024 18:34
Download Studydrive course files
import hashlib
import requests
# app hat ratelimiting für session:
# 'x-ratelimit-limit': '30', 'x-ratelimit-remaining': '0', 'retry-after': '56', 'x-ratelimit-reset': '1708281174'
# from de.veedapp.veed.api_clients.getDocumentStorageUrl
download_secret = "studydrive-app-download-7>%jsc"
base_url = "https://gateway.production-01.studydrive.net"
@Romern
Romern / whatsapp_override_dismiss.js
Created February 11, 2024 19:03
Frida script to use WhasApp after the login has failed. This way messages can still be read even if the whatsapp login has been transfered
Java.enumerateClassLoaders({
onMatch: function(loader){
Java.classFactory.loader = loader;
// Hook the class if found, else try next classloader.
try{
//Override OnDismiss, so we can dismiss the login error dialog without the app closing
LoginFailedDialogFragment = Java.use("com.whatsapp.DisplayExceptionDialogFactory$LoginFailedDialogFragment");
LoginFailedDialogFragment.onDismiss.implementation = function() {};
}catch(error){
%!PS-Adobe-3.0 EPSF-3.0
%%Pages: 1
%%BoundingBox: 36 36 576 756
%%LanguageLevel: 1
%%EndComments
%%BeginProlog
%%EndProlog
% (a) (b) -> (ab)
% https://stackoverflow.com/questions/12378904/postscript-concatenate-two-strings
@Romern
Romern / embedfile.ps
Last active November 3, 2023 15:27
PostScript function to embed files in a PDF easily using pdfmark (by defaults dumps /tmp/* ) (e.g. ```gs -sDEVICE=pdfwrite -o foo.pdf embedfile.ps```). Python script extracts the files.
%!PS
%%%%%%%%%%%%%%%%%%%Helper Functions
% (a) (b) -> (ab)
/concatstrings { exch dup length
2 index length add string
dup dup 4 2 roll copy length
4 -1 roll putinterval
} bind def
@Romern
Romern / svgpdfpolzglot.svg
Last active April 5, 2025 07:52
svg pdf polyglot imagemagick/ghostscript mit command execution
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Romern
Romern / base64.ps
Created August 14, 2023 20:55
base64 encoder in postscript
/base64EncodingTable [
(A) (B) (C) (D) (E) (F) (G) (H) (I) (J)
(K) (L) (M) (N) (O) (P) (Q) (R) (S) (T)
(U) (V) (W) (X) (Y) (Z) (a) (b) (c) (d)
(e) (f) (g) (h) (i) (j) (k) (l) (m) (n)
(o) (p) (q) (r) (s) (t) (u) (v) (w) (x)
(y) (z) (0) (1) (2) (3) (4) (5) (6) (7)
(8) (9) (+) (/)
] def
@Romern
Romern / README.md
Created April 19, 2023 16:32
socks 2 http proxy

Relays all TCP traffic to a HTTP proxy. Useful for using Burp and Android, my setup:

@Romern
Romern / README.md
Created February 18, 2023 12:52
wp6003 BLE to MQTT and integration for home assistant

ble2mqtt was very unstable for me and I only use the wp6003 sensor anyway, so I wrote this small python script. based on https://github.com/zu2/wp6003 add configuration.yaml to home assistants configuration.yaml.

Requirements: bleak paho click

@Romern
Romern / scan.sh
Last active April 8, 2022 11:52
Script to poll for the buttons on a scanner and run a script if pressed. Currently just checks if any button is pressed, but could be easily adjustable.
#!/bin/bash -e
FOLDER="/home/roman/Scanned/"
PORT="$(lsusb | grep CanoScan | pcregrep -o1 "Bus ([0-9]*)")"
DEVICE="$(lsusb | grep CanoScan | pcregrep -o1 "Device ([0-9]*)")"
SCANBD_DEVICE="genesys:libusb:${PORT}:${DEVICE}"
scanimage --format jpeg -d ${SCANBD_DEVICE} --source Flatbed --resolution 300 -o /tmp/scan.jpg
@Romern
Romern / gambleLink.py
Created September 2, 2021 15:19
simple web app which serves as a link shortener, which can give another link based on chance