Skip to content

Instantly share code, notes, and snippets.

@Temptationx
Temptationx / gist:7170016
Last active December 26, 2015 14:59
dlopen, dlsym
#include <stdio.h>
#include <dlfcn.h>
void ppp()
{
}
int main(int argc, const char * argv[])
{
// For UUID
#include <Rpc.h>
#pragma comment(lib, "Rpcrt4.lib")
int _tmain(int argc, _TCHAR* argv[])
{
// Create a new uuid
UUID uuid;
RPC_STATUS ret_val = ::UuidCreate(&uuid);
class viewWeb;
class view{
public:
virtual ~view() {}
static view* creat();
protected:
view() { }
};
class viewWeb : public view{
public:
@Temptationx
Temptationx / remove border.c
Last active January 1, 2016 04:19
remove window border win32api
LONG lStyle = GetWindowLong(hwnd, GWL_STYLE);
lStyle &= ~(WS_CAPTION | WS_THICKFRAME | WS_MINIMIZE | WS_MAXIMIZE | WS_SYSMENU);
SetWindowLong(hwnd, GWL_STYLE, lStyle);
LONG lExStyle = GetWindowLong(hwnd, GWL_EXSTYLE);
lExStyle &= ~(WS_EX_DLGMODALFRAME | WS_EX_CLIENTEDGE | WS_EX_STATICEDGE);
SetWindowLong(hwnd, GWL_EXSTYLE, lExStyle);
SetWindowPos(hwnd, NULL, 0,0,0,0, SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOOWNERZORDER);
import zlib
from glob import glob
def zipstreams(filename):
"""Return all zip streams and their positions in file."""
with open(filename, 'rb') as fh:
data = fh.read()
i = 0
while i < len(data):
try:
import cookielib
import requests
index = sys.argv[1]
g_cookie = []
gs = []
def prepare():
#include "stdafx.h"
#include <Windows.h>
#include <iostream>
#define steps_per_second 100;
int _tmain(int argc, _TCHAR* argv[])
{
unsigned int skip_ticks = 1000/steps_per_second;
int max_script_steps_skip = 10;
bool running = true;
unsigned int next_step = GetTickCount();
class singleton
{
private static singleton *_instance = null;
protected:
singleton()
{
if(_instance)
{
throw std::logic_error("ss");
}
@Temptationx
Temptationx / 0_reuse_code.js
Created December 28, 2013 03:11
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
线程ID
指定ID为0x080为开始,是否有必要?这是否跟ID的范围有关系
指定ID最大值为400h,0x080~0x400的范围内必然存在GDI线程?(俺用Kernel Detective看过确实必然至少有一个GDI线程)
从问题2引出的问题,GDI线程和非GDI线程的ID是否有固定的ID值范围?系统分配这个ID
值是否存在某些规律(俺听某人说是随机的,如果是随机的话,这种方法太大偶然性了)
还有代码中的ID递增方式是add dwThreadId, 4,通过观察,ID值确实有这样的规律,但是
不懂,这是固定的还是怎么样的?俺有没有必要去了解?
PVOID PsGetThreadWin32Thread(KTHREAD* Thread);这个返回KTHREAD后面的Wind2Thread指针,win32Thread保存线程有关GUI的一些信息,如果这个不为空就是GUI的线程了