Skip to content

Instantly share code, notes, and snippets.

@throwaway96
throwaway96 / winmerge-vswhere.md
Created March 26, 2024 01:13
WinMerge "Visual Studio not installed" error with "Disassemble IL Code" and "Disassemble Native Code"

Introduction

WinMerge's Compare As > Disassemble IL Code and Disassemble Native Code options appear to be almost completely undocumented, so when I came across the error message Visual Studio not installed I wasn't able to find any relevant information online. I'm hoping this document will help anyone who runs into the same problem in the future.

If you don't care about the explanation, you should be able to solve the problem by opening the Visual Studio "Developer Command Prompt" and running this:

mkdir "%APPDATA%\WinMerge\Commands\ildasm" "%APPDATA%\WinMerge\Commands\dumpbin"
where.exe ildasm.exe >"%APPDATA%\WinMerge\Commands\ildasm\ildasm.txt"
where.exe dumpbin.exe >"%APPDATA%\WinMerge\Commands\dumpbin\dumpbinpath.txt"
@throwaway96
throwaway96 / findpy.md
Last active February 28, 2024 04:57
How to make a Python script work with multiple potential interpreter names (polyglot Python/shell script)

The Python interpreter on webOS 1‒6 is python (Python 2.7), while on webOS 7+ it's python3. To make a Python script that can be run on any version of webOS, I added a bit of shell script at the top that figures out the name of the Python interpreter and uses that to re-execute itself:

#!/bin/sh
''''command -v -- python3 >/dev/null && exec python3 -- "$0" "$@" || exec python -- "$0" "$@" # '''

Python ignores this because it just sees a docstring (idea from here), and the shell is no longer running after exec. I'm sure someone else has already done this, but I didn't really know what to search for. (Edit: Found this. It's more thorough, but a lot longer.)

@throwaway96
throwaway96 / localdb-rm-triggers.md
Created January 30, 2024 06:34
How to fix MSSQL LocalDB "Logon failed ... due to trigger execution" error

Fixing a Microsoft SQL Server LocalDB trigger error

This is a note on how I fixed a relatively minor issue with Microsoft SQL Server Express LocalDB. The solution was a bit difficult to find. Therefore I'm writing this in the hope that it will be found by other people who have the same problem and Google the error message text. This is based on a StackOverflow answer by Yennefer. I've added a bit more detail and an alternative way to delete the triggers. I'm leaving out most of my mistakes, several dead ends, etc.

I'm certainly no expert on anything in this document. I'm just sharing what worked for me.

The error

When I opened Microsoft's Volume Activation Management Tool (VAMT) and tried to connect to my LocalDB instance as usual, I got this error:

@throwaway96
throwaway96 / wta.md
Last active April 15, 2024 17:43
LG WTA backdoor/vulnerability guide

WTA backdoor/vulnerability

Overview

There is a vulnerability/backdoor in webOS 5+ that allows you to easily run arbitrary commands as root during the boot process. The easiest way to exploit it simply involves putting a file on a USB drive and having it connected to your TV while it boots. There are two other methods that are more complex and require additional exploits.

@throwaway96
throwaway96 / setup-cert-overlay.sh
Last active February 28, 2024 21:12
Script to add a certificate to various stores on webOS (probably 3.5+ only)
#!/bin/sh
# by throwaway96
# licensed under AGPLv3+
# https://gist.github.com/throwaway96/bb31a17562eec4d8325020dee8c7e6b5
cert=/home/root/something.crt
name=lol_hax
file="${name}.pem"
tmp="/tmp/tempcert.pem.${$}"
@throwaway96
throwaway96 / components.md
Last active December 17, 2023 02:01
Electronic component identification
@throwaway96
throwaway96 / _webos-scripts.md
Last active February 28, 2024 20:07
Little webOS scripts

This is a collection of a few of my smaller webOS scripts.

License: AGPL v3 or later

@throwaway96
throwaway96 / 50-customca
Last active December 5, 2023 05:28 — forked from Informatic/50-customca
Let's Encrypt fix for webOS. Tested on 3.8 only, put this into /var/lib/webosbrew/init.d and you should be probably done.
#!/bin/sh
# Directory to store overlays in (one directory structure is created per overlay configured down below)
OVERLAY_BASE=/var/lib/webosbrew/customca
overlay() {
set -e
overlay_id="$(echo $1 | sed 's;/;__;g')"
unset TARGET SOURCE FSTYPE OPTIONS
eval $(findmnt -P $1)
@throwaway96
throwaway96 / win32-port-notify.c
Created November 19, 2023 03:58
Create hidden window to listen for ports (dis)appearing on Windows
#define STRICT
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#pragma warning(push)
#pragma warning(disable:4820)
#include <dbt.h>
#pragma warning(pop)
#include <stdlib.h>
@throwaway96
throwaway96 / bashrc_id.sh
Created November 16, 2023 01:03 — forked from zeph1e/bashrc_id.sh
bashrc_id.sh
#!/bin/bash
export CRED=root@id
SSH=$(whereis ssh | awk '{print $2}')
JQ=$(whereis jq | awk '{print $2}')
SCP=$(whereis scp | awk '{print $2}')
if [ -z "$SSH" ]; then
echo "Unable to find ssh" 1>&2
return 1