Skip to content

Instantly share code, notes, and snippets.

@alastorid
alastorid / RTF8217-E
Created May 18, 2024 13:14
RTF8217-E
/proc # cat version
Linux version 3.18.21 (asp@RTF8207W-R82XXR231123) (gcc version 4.6.3 (Buildroot 2015.08.1) ) #18 SMP Thu Nov 23 06:07:07 UTC 2023
/proc # cat cpuinfo
system type : EcoNet EN7528 SOC
machine : econet,en751221
processor : 0
cpu model : MIPS 1004Kc V2.15
BogoMIPS : 591.87
wait instruction : yes
microsecond timers : yes
@alastorid
alastorid / gist:412788f845de28133ee91a8d1ed28382
Created April 7, 2024 16:59
App keeps bringing itself to foreground?
Check these APIs
user32.dll
# IsWindowEnabled
# IsWindowVisible
# EnableWindow
# SwitchToThisWindow
# SetForegroundWindow
# LockSetForegroundWindow
# BringWindowToTop
# GetForegroundWindow
@alastorid
alastorid / f.cmd
Created January 5, 2024 07:38
Fix Windows Mouse Wheel.cmd
rem This script will try fix your mouse wheel upside down problem
set QueryString=reg query HKLM\SYSTEM\CurrentControlSet\Enum\HID /s /v FlipFlopWheel^^^|find ^"HKEY^"
for /f "delims=" %%i in ('%QueryString%') do @(
reg add "%%i" /v FlipFlopWheel /t REG_DWORD /d 1 /f
)
for /f "tokens=6 delims=\" %%i in ('%QueryString%') do @(
wmic path Win32_PnPEntity where "DeviceID like 'HID\\%%%%i%%'" call Disable
wmic path Win32_PnPEntity where "DeviceID like 'HID\\%%%%i%%'" call Enable
@alastorid
alastorid / gist:4302a078e357100472723095cbef68d5
Created January 4, 2024 05:49
ida "The input file was linked with debug information"
[autohidden] The input file was linked with debug information
and the symbol filename is:
"...\dll.pdb"
Do you want to look for this file at the specified path
and the Microsoft Symbol Server?
-> No
What to change to yes?
HKCU\Software\Hex-Rays\IDA\Hidden Messages
@alastorid
alastorid / sayGoodbyeToTrash.js
Last active December 2, 2023 17:51
sayGoodbyeToTrash: AdBlocker Blocker Blocker
function calcEntropy(str) {
const uniqChars = [...new Set(str)];
const totalCount = str.length;
let entropy = 0;
for (const char of uniqChars) {
const charCount = str.split(char).length - 1;
const probability = charCount / totalCount;
entropy -= probability * Math.log2(probability);
}
@alastorid
alastorid / lifesaver.js
Created October 23, 2023 07:06
lifesaver.js
function clickthat(s, t)
{
var a = Array.from(document.querySelectorAll(s));
var intervalId = setInterval(() => {
if (a.length > 0) {
a.shift().click();
} else {
clearInterval(intervalId);
console.log('bye');
@alastorid
alastorid / totp.js
Last active September 28, 2023 22:42
Simple TOTP calculator in JS, use it at your own risk
function sha1(data) {
var K = [0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xCA62C1D6];
var H = [0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0];
var words = [];
var data_len = data.length;
data.push(0x80);
while (data.length % 64 !== 56) {
data.push(0);
}
@alastorid
alastorid / genTotp.js
Last active September 26, 2023 09:54
use it at your own risk #rfc6238
function genTotp(s) {
const a = 'abcdefghijklmnopqrstuvwxyz234567', t = BigInt(Math.floor(Date.now() / 30000)), b = new Uint8Array(8);
let bits = '', bytes = new Uint8Array(s.length * 5 / 8);
for (let c of s) bits += a.indexOf(c).toString(2).padStart(5, '0');
for (let i = 0, j = 0; i + 8 <= bits.length; i += 8, j++) bytes[j] = parseInt(bits.substr(i, 8), 2);
for (let i = 0; i < 8; i++) b[7 - i] = Number(t >> (BigInt(i) * 8n));
return crypto.subtle.importKey("raw", bytes.buffer, { name: "HMAC", hash: "SHA-1" }, false, ["sign"]).then(k =>
crypto.subtle.sign("HMAC", k, b)
@alastorid
alastorid / gist:d3a24f10844b4573e4826c3a32dcfc3e
Created September 5, 2023 06:41
Freebsd kldload if_ixv.ko: file has no contents
kldload: /boot/kernel/if_ixv.ko: file has no contents
linker_load_file: /boot/kernel/if_ixv.ko - unsupported file type
Are you using ixv-1.5.34?
Use any version but ixv-1.5.34.
# run it at the host
Get-VMSwitch|? SwitchType -eq External | ft Name,NetAdapterInterfaceDescription, Iov* -Wrap
# sample output, SRIOV not working on vswitch e-base
````
Name NetAdapterInterfaceDescription IovEnabled IovSupport IovSupportReasons IovQueuePairCount IovQueuePairsInUse IovVirtualFunctionCount IovVirt
ualFunc
tionsIn
Use
---- ------------------------------ ---------- ---------- ----------------- ----------------- ------------------ ----------------------- -------