Skip to content

Instantly share code, notes, and snippets.

View KingCprey's full-sized avatar
👌
yote

KingCprey KingCprey

👌
yote
  • England
View GitHub Profile
@KingCprey
KingCprey / vlocker_download_bookmarklet.js
Last active July 20, 2020 17:31
Vodlocker Download File Bookmarklet
//Create a bookmark, paste this as the url (tested on Chrome, not sure about other browsers)
javascript: (function() {var telem = document.getElementById("file_title");var videlems = document.getElementsByName("videourl");var velem = videlems.length > 0 ? videlems[0] : null;if (velem == null) {alert("videourl element does not exist yet");} else {var title = "v.mp4";if (telem == null) {title = document.title.substring(6);} else {title = telem.innerText.replace("Background Audio?", "").replace("Close X", "").trim();}var newa = document.createElement("a");newa.setAttribute("href", velem.getAttribute("value").replace("v.mp4", title + ".mp4"));newa.setAttribute("target","_blank");newa.click();}})();
@KingCprey
KingCprey / vlocker_download_functions.js
Created August 15, 2016 20:46
Vodlocker Download Functional
//Download URL only accessible from input element named "videourl"
//Exists after flash player has loaded (inb4 haxed through flash)
function getDownloadURL(elem_name){
var videlems=document.getElementsByName(elem_name);
if(videlems.length>0){return videlems[0].getAttribute("value");
}else{return null;}
}
//The file title is accessible either from the element id "file_title" or the document title
function getVideoNameFromID(elem_id){
var titelem=document.getElementById(elem_id);
@KingCprey
KingCprey / vlocker_geturl_bookmarklet.js
Last active August 15, 2016 20:52
Vodlocker get video url
//Video have to have loaded b4 it can be downloaded
javascript:(function(){var videlems=document.getElementsByName("videourl");var velem=videlems.length>0?videlems[0]:null;if(velem==null){alert("videourl element doesn't exist...");}else{prompt("Video URL",velem.getAttribute("value"));}})();
@KingCprey
KingCprey / shrek_python.txt
Created August 21, 2016 16:38
Shrek - Python
#Shrekghetti code
"""
_____
,-' `._
,' `. ,-.
,' \ ),.\
,. / \ /( \;
/'\\ ,o. ,ooooo. \ ,' `-')
@KingCprey
KingCprey / cpp_clearscreen.cpp
Created August 22, 2016 10:10
C++ Clear Screen (tested on Ubuntu, apparently works on Winders)
void clear(){
printf("\033[2J\033[1;1H");
}
@KingCprey
KingCprey / pysocktrans.py
Last active August 25, 2016 11:25
Functions to transfer data
#u can change the length values to be sent as 64 bit integers instead of 32 bits, I wouldn't recommend doing so unless ur sending over 4GB of data in a single buffer (would not recommend cos mem errors)
def sendByte(sock,b):
if b>=256 or b<0:raise ValueError()
else:sock.send(struct.pack("!B",b))
def sendInt16(sock,s):sock.send(struct.pack("!h",s))
def sendUInt16(sock,s):sock.send(struct.pack("!H",s))
def sendInt32(sock,i):sock.send(struct.pack("!i",i))
def sendUInt32(sock,i):sock.send(struct.pack("!I",i))
def sendInt64(sock,l):sock.send(struct.pack("!l",l))
def sendUInt64(sock,l):sock.send(struct.pack("!L",l))
@KingCprey
KingCprey / py_splitbyn.py
Created August 25, 2016 11:34
Split iterable every nth value
def yieldByN(tosplit,n):
for s in range(0,len(tosplit),n):
yield tosplit[s:s+n]
def splitByN(tosplit,n):return [v for v in yieldByN(tosplit,n)]
@KingCprey
KingCprey / registry_priorities_gtav_normal.reg
Created August 25, 2016 11:37
Changes GTAV exec priorities to Normal
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\subprocess.exe]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\subprocess.exe\PerfOptions]
"CpuPriorityClass"=dword:00000020
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\GTAVLauncher.exe]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\GTAVLauncher.exe\PerfOptions]
@KingCprey
KingCprey / py_cc_cshash.py
Created August 25, 2016 14:48
Python script to create C# Hashing Code
object_names=["md5","sha1","sha256","sha384","sha512"]
def getStrings(objname,access_modifier="public",modifier="static",include_buff=True,buffer_name="buff",include_offcount=True,buffer2_name="buff",buffer2_offset="offset",buffer2_count="count",include_strem=True,strem_name="strem",include_filepath=True,filepath_name="file_path",include_comment=True):
strs=[]
if not include_buff and include_offcount and include_strem and include_filepath:return strs
uppar=objname.upper()
if include_comment:strs.append("//%s"%uppar)
method_start="%s %s byte[] Get%s"%(access_modifier,modifier,uppar)
using_statement="using(%s %s=%s.Create())"%(uppar,objname,uppar)
if include_buff:strs.append(method_start+"(byte[] %s){%s{return %s.ComputeHash(%s);}}"%(buffer_name,using_statement,objname,buffer_name))
if include_offcount:strs.append(method_start+"(byte[] %s,int %s,int %s){%s{return %s.ComputeHash(%s,%s,%s);}}"%(buffer2_name,buffer2_offset,buffer2_count,using_statement,objname,buffer2_name,buffer2_o
@KingCprey
KingCprey / cs_hashing_quickstart.cs
Created August 25, 2016 14:51
C# code to perform hashing with MD5,SHA1,SHA256,SHA384,SHA512
//This code requires "using System.Security.Cryptography" at the top
//MD5
public static byte[] GetMD5(byte[] buff) { using (MD5 md5 = MD5.Create()) { return md5.ComputeHash(buff); } }
public static byte[] GetMD5(byte[] buff, int offset, int count) { using (MD5 md5 = MD5.Create()) { return md5.ComputeHash(buff, offset, count); } }
public static byte[] GetMD5(Stream strem) { using (MD5 md5 = MD5.Create()) { return md5.ComputeHash(strem); } }
public static byte[] GetMD5(string file_path) { using (FileStream fs = File.OpenRead(file_path)) { return GetMD5(fs); } }
//SHA1
public static byte[] GetSHA1(byte[] buff) { using (SHA1 sha1 = SHA1.Create()) { return sha1.ComputeHash(buff); } }
public static byte[] GetSHA1(byte[] buff, int offset, int count) { using (SHA1 sha1 = SHA1.Create()) { return sha1.ComputeHash(buff, offset, count); } }
public static byte[] GetSHA1(Stream strem) { using (SHA1 sha1 = SHA1.Create()) { return sha1.ComputeHash(strem); } }