Skip to content

Instantly share code, notes, and snippets.

@okumura
okumura / mw32getpebldrdata.c
Created October 26, 2013 19:49
Get PEB_LDR_DATA for Windows.
typedef struct PEB_LDR_DATA {
ULONG Length;
BOOLEAN Initialized;
PVOID SsHandle;
LIST_ENTRY InLoadOrderModuleList;
LIST_ENTRY InMemoryOrderModuleList;
LIST_ENTRY InInitializationOrderModuleList;
} PEB_LDR_DATA, *PPEB_LDR_DATA;
PPEB_LDR_DATA mw32GetPebLdrData() {
@okumura
okumura / mw32getpeb.c
Last active January 31, 2024 09:57
Get PEB for Windows.
LPVOID mw32GetPeb() {
#if defined(_WIN64)
UINT64 uiPeb = __readgsqword(0x60);
return (LPVOID) (UINT_PTR) uiPeb;
#else
UINT32 uiPeb = __readfsdword(0x30);
return (LPVOID) (UINT_PTR) uiPeb;
#endif
}
@okumura
okumura / mw32getpid.c
Last active December 26, 2015 15:29
Get Process ID for Windows.
unsigned int mw32GetPID() {
#if defined(_M_X64)
return __readgsdword(0x40);
#else
return __readfsdword(0x20);
#endif
}
@okumura
okumura / mw32gettid.c
Last active December 26, 2015 15:29
Get Thread ID for Windows.
unsigned int mw32GetTID() {
#if defined(_M_X64)
return __readgsdword(0x48);
#else
return __readfsdword(0x24);
#endif
}
@okumura
okumura / setup-emeditor-for-win.bat
Last active December 26, 2015 15:29
Setup EmEditor for Windows.
rem EmEditor (x64)
wget http://www.emeditor.com/pub/emed64_13.0.6.exe
start /wait emed64_13.0.6.exe /exenoui /passive NOTRAYICON=1 REGKEY=xxxxxx
rem EmEditor (x86)
wget http://www.emeditor.com/pub/emed32_13.0.6.exe
start /wait emed32_13.0.6.exe /exenoui /passive NOTRAYICON=1 REGKEY=xxxxxx
@okumura
okumura / setup-python-for-win.bat
Last active December 26, 2015 14:39
Setup Python 2.7 for Windows.
rem python 2.7.6 (x64)
start /wait msiexec /i http://www.python.org/ftp/python/2.7.6/python-2.7.6.amd64.msi /passive
setx PATH /m "%PATH%;C:\Python27"
exit
@okumura
okumura / setup-scm-for-win.bat
Last active December 26, 2015 14:39
Setup SCM for Windows.
rem TortoiseGit (x64)
start /wait msiexec /i http://download.tortoisegit.org/tgit/1.8.6.0/TortoiseGit-1.8.6.0-64bit.msi /passive
rem TortoiseSVN (x64)
start /wait msiexec /i http://downloads.sourceforge.net/project/tortoisesvn/1.8.2/Application/TortoiseSVN-1.8.2.24708-x64-svn-1.8.3.msi /passive
rem TortoiseSVN (x64) 1.6.x
start /wait msiexec /i http://downloads.sourceforge.net/project/tortoisesvn/1.6.16/Application/TortoiseSVN-1.6.16.21511-x64-svn-1.6.17.msi/passive
rem TortoiseGit (x86)
@okumura
okumura / setup-git-for-win.bat
Last active December 26, 2015 14:39
Setup Git for Windows.
rem git
wget --no-check-certificate https://msysgit.googlecode.com/files/Git-1.9.0-preview20140217.exe -O git-setup.exe
start /wait git-setup.exe /verysilent
@okumura
okumura / wget-win.md
Created October 26, 2013 10:12
wget for win32 install guide.
# .ssh/config
Host github.com
User git
Port 22
Hostname github.com
IdentityFile ~/.ssh_github/id_rsa
TCPKeepAlive yes
IdentitiesOnly yes