Skip to content

Instantly share code, notes, and snippets.

View DankRank's full-sized avatar

Egor DankRank

  • Ukraine
View GitHub Profile
@DankRank
DankRank / dsound.c
Created July 14, 2018 23:42
dsound wrapper dll
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#define enum_dsound(_helper) \
_helper(DirectSoundCreate) \
_helper(DirectSoundEnumerateA) \
_helper(DirectSoundEnumerateW) \
_helper(DllCanUnloadNow) \
_helper(DllGetClassObject) \
_helper(DirectSoundCaptureCreate) \
@DankRank
DankRank / findfile.cpp
Created January 9, 2017 10:06
_findfirst/_findnext wrapper
class FindFile {
std::vector<_finddata_t> data;
typedef std::vector<_finddata_t>::iterator iterator;
public:
explicit FindFile(std::string s) {
data = std::vector<_finddata_t>();
_finddata_t d;
intptr_t ptr = _findfirst(s.c_str(), &d);
if (ptr != -1) {
@DankRank
DankRank / wiiload.reg
Created December 15, 2016 02:37
wiiload registry patch
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.dol\shell\Send to Wii\command]
@="wiiload \"%1\""
[HKEY_CLASSES_ROOT\.elf\shell\Send to Wii\command]
@="wiiload \"%1\""
[HKEY_CLASSES_ROOT\7-Zip.zip\shell\Send to Wii\command]
@="wiiload \"%1\""

Keybase proof

I hereby claim:

  • I am dankrank on github.
  • I am egor (https://keybase.io/egor) on keybase.
  • I have a public key whose fingerprint is B80D 348E 866B 22FE 9491 5E8F 08C3 10BE FFA8 8B87

To claim this, I am signing this object:

@DankRank
DankRank / CameraSwitch.cpp
Created November 18, 2016 03:19
CameraSwitch mod for SADX
#include <SADXModLoader.h>
#define EXPORT __declspec(dllexport)
FunctionPointer(void, SetCameraLock, (bool), 0x004348A0);
FunctionPointer(bool, GetCameraLock, (void), 0x004348E0);
FunctionPointer(void, SetCameraMode, (bool), 0x004348F0);
FunctionPointer(bool, GetCameraMode, (void), 0x00434930);
extern "C"{
EXPORT void OnFrame(){
//Thanks to SF94 for disassembling pause menu options thingy
if( (!IsGamePaused())
@DankRank
DankRank / chuchu.cpp
Last active November 1, 2016 12:06
windows bash runner that modifies PATH before running - fixes path/cmake/git for windows/visual studio/git_version.sh fuckery
#define UNICODE
#define _UNICODE
#include <windows.h>
#include <wchar.h>
#include <string.h>
#define MAX_VAR 32767
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow){
wchar_t path[MAX_VAR];
GetEnvironmentVariable(L"PATH",path,MAX_VAR);
wcsncat(path,L";C:\\Program Files\\Git\\usr\\bin",MAX_VAR);
@DankRank
DankRank / touch.c
Created September 27, 2016 01:04
a simple touch for djgpp
#include <stdio.h>
int main(int argc,char **argv){
while(--argc){
FILE *f = fopen(argv[argc],"a");
fclose(f);
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ParserCalculator
{
enum TokenType
{
@DankRank
DankRank / nvmd.asm
Created July 10, 2016 01:59
novert mouse driver
ORG 100h
USE16
JMP SHORT start
oldaddr DW 0h
oldseg DW 0h
;------------------------------
tsr:
CMP AH,99h ;Installation Check
JZ SHORT tsr_check
@DankRank
DankRank / moveosrs.cpp
Last active July 10, 2016 02:09
MoveOSRS - fullscreen for oldschool runescape
#define WIN32_LEAN_AND_MEAN
#define WINVER 0x0500
#define _WIN32_WINNT 0x0500
#include <windows.h>
#include <tchar.h>
#define ADSIZE 96
int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) {
HWND hw = FindWindow(nullptr, _T("Old School RuneScape"));
if (hw == nullptr) {