Skip to content

Instantly share code, notes, and snippets.

View CoolOppo's full-sized avatar
🇺🇲

Max Azoury CoolOppo

🇺🇲
View GitHub Profile
@CoolOppo
CoolOppo / jdk-make-portable.bat
Last active August 29, 2015 14:05
Converts an extracted JDK directory to actually make it run portably
for /r %%x in (*.pack) do bin\unpack200 "%%~x" "%%~dpnx.jar" && del /q /f "%%~x"
@CoolOppo
CoolOppo / Denied-vs-denied-for-dummies.diff
Last active August 29, 2015 14:05
Denied vs. denied for dummies
@@ -1 +1 @@
-Denied
+denied

This program can injects DLL into running processes using thread hijacking. No remote thread is created, only existing thread is used for injection.

 

The injector injects shellcode into the target process, and then a running thread in the target process is hijacked to execute the injected code. The injected code calls the LoadLibrary function to load the DLL.

 

Usage: ZwInjector [PID] [DLL name]

$ expr 5+4
5+4
$ expr 5 + 4
9

launch4j exec error

I was having a shit ton of problems getting launch4j to work. Simply get a recent version of MinGW's ld.exe and windres.exe files, and replace the ones in the bin folder. That seems to do the trick.

Another thing to try is using the DOS path instead of the standard Windows one when you refer to the directory containing JRE. Apparently, the tool doesn't support paths with spaces in them, although it is somewhat sporadic. I used cygpath to generate my path. The command I used is cygpath -wsa "C:\Program Files (x86)\Java\jre1.8.0_20", which resulted in C:\PROGRA~2\Java\JRE18~1.0_2 as the DOS path.

A working XML config for launch4j is below.

<?xml version="1.0" encoding="UTF-8" ?>
// ==UserScript==
// @name Sourceforge Instant Downloader
// @match *://sourceforge.net/*download*
// ==/UserScript==
(function() {
'use strict';
function exec(fn) {
var script = document.createElement('script');
script.setAttribute('type', 'application/javascript');
ftype "No Extension"=^"^%ProgramFiles^%\Sublime Text 3\sublime_text.exe^" "%1"
assoc "No Extension"\DefaultIcon=%SystemRoot%\System32\imageres.dll,-102
typedef void* (*CreateInterfaceFn)(const char *pName, int *pReturnCode);
CreateInterfaceFn EngineFactory = NULL;
IVEngineClient* g_pEngine;
EngineFactory = (CreateInterfaceFn)GetProcAddress(GetModuleHandle("engine.dll"), "CreateInterface");
g_pEngine = (IVEngineClient*)EngineFactory("VEngineClient013", NULL);
ReadProcessMemory( TOOLKIT::_HANDLE ( HL2 ), (PVOID)( dwLocalPlayer + 0xD28 ) , &m_hActiveWeapon, sizeof(unsigned long), NULL );
WeaponIndex = m_hActiveWeapon & 0xFFF;
dwWeaponAddress = GetEntityByIndex(WeaponIndex);
ReadProcessMemory( TOOLKIT::_HANDLE ( HL2 ), (PVOID)( dwWeaponAddress + 0x9A6 ) , &wPtr, sizeof(WORD), NULL );
ReadProcessMemory( TOOLKIT::_HANDLE ( HL2 ), (PVOID)( TOOLKIT::_OFFSET ( WeaponData_1 ) ) , &dwWeaponDataPtr, sizeof(DWORD), NULL );
DWORD dwWeaponDataInfo = 0x10 * wPtr + dwWeaponDataPtr + 0xC;
// Source: http://stackoverflow.com/a/23401756
var getQueryStringKey = function(key) {
return getQueryStringAsObject()[key];
};
var getQueryStringAsObject = function() {
var b, cv, e, k, ma, sk, v, r = {},
d = function(v) {
return decodeURIComponent(v).replace(/\+/g, " ");
}, // d(ecode) the v(alue)
q = window.location.search.substring(1),