2013年6月24日

摘要: #include #include #include int main(){ FILE *fp1;//定义文件流指针,用于打开读取的文件 FILE *fp2;//定义文件流指针,用于打开写操作的文件 fp1 = fopen("C:\\log.txt","w"); //只读方式打开文件a.txt fp2 = fopen("C:\\djcheats.txt","r"); //写方式打开文件a.txt printf("fp1 %X, fp2 %X", fp1, fp2); system("p 阅读全文
posted @ 2013-06-24 19:06 All IN 阅读(334) 评论(0) 推荐(0)

2013年6月19日

摘要: #include <Windows.h>#include <TlHelp32.h>#include <stdio.h>void Log(const char* format, ...){ char Buf[1024]; va_list vList; va_start(vList, format); vsprintf(Buf, format, vList); va_end(vList); OutputDebugStringA(Buf);}int main(){ HANDLE hMap = OpenFileMappingA(FILE_MAP_ALL_AC... 阅读全文
posted @ 2013-06-19 20:35 All IN 阅读(167) 评论(0) 推荐(0)

2013年4月18日

摘要: #include <Windows.h>#include <stdio.h>DWORD __stdcall WorkThread();void log(const char* format, ...);#define LOGON 1#if LOGON#define Log log#else#define Log //#endifint main(){DWORD dwThreadID = 0;HANDLE hSetForeThread = CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)WorkThread, NULL, 阅读全文
posted @ 2013-04-18 20:26 All IN 阅读(171) 评论(0) 推荐(0)

2013年4月3日

摘要: namespace ltl{template <class T>void swap(T &a, T &b) { T c = a; a = b; b = c; }class CSize : public SIZE{public:CSize() {}CSize(int lx, int ly) { cx = lx, cy = ly; }void Set(int lx, int ly) { cx = lx, cy = ly; }operator += (const SIZE &sz) { cx += sz.cx, cy += sz.cy; }operator -= 阅读全文
posted @ 2013-04-03 10:27 All IN 阅读(341) 评论(0) 推荐(0)

2013年4月1日

摘要: #include <Windows.h>#include <stdlib.h>#include <stdio.h>#include "RepProc.h"typedef struct _WND_INFO{ HWND hWnd; DWORD dwProcessId;}WNDINFO, *LPWNDINFO;void log(const char* format, ...);HWND GetProcessMainWnd();BOOL CALLBACK MyEnumWndProc(HWND hWnd,LPARAM lParam);void Be 阅读全文
posted @ 2013-04-01 07:37 All IN 阅读(255) 评论(0) 推荐(0)

2013年3月30日

摘要: BOOL CALLBACK MyEnumWndProc(HWND hWnd,LPARAM lParam){ DWORD dwProcessId; GetWindowThreadProcessId(hWnd, &dwProcessId); LPWNDINFO pInfo = (LPWNDINFO)lParam; if(dwProcessId == pInfo->dwProcessId) { bool isWindowVisible = IsWindowVisible(hWnd); if(isWindowVisible == true)... 阅读全文
posted @ 2013-03-30 17:38 All IN 阅读(153) 评论(0) 推荐(0)

2013年3月25日

摘要: #include <ntddk.h>#include <stdio.h>#include <stdlib.h>#include "helloworld.h"NTSTATUS DriverEntry(PDRIVER_OBJECT pDriObj, PUNICODE_STRING theRegisterPath){ int i = 0; UNICODE_STRING uDevice; UNICODE_STRING uW32Dev; PDEVICE_OBJECT pDevObj = NULL; NTSTATUS status; DbgPrint 阅读全文
posted @ 2013-03-25 21:03 All IN 阅读(295) 评论(0) 推荐(0)

2013年3月22日

摘要: SOCKET API和TCP STATE的对应关系__三次握手(listen,accept,connect)__四次挥手close及TCP延迟确认(调用一次setsockopt函数,设置TCP_QUICKACK)__长连接API小心“窜包”问题2011-09-13 21:08:15|分类:Linux网络编程|字号订阅在我们学习网络基础时,传输层的协议有TCP和UDP;在Linux网络编程中,我们使用socket API,实现网络通信。那么: socket API 和 TCP 协议中各个状态是如何对应的呢?我们可以通过下图来看:在socket系统调用中,如何完成三次握手和四次挥手:SOCK_DG 阅读全文
posted @ 2013-03-22 09:44 All IN 阅读(823) 评论(0) 推荐(0)

2013年3月21日

摘要: 实验室IP和MAC绑定,而且经常来回于各个实验室和宿舍,频繁的地址切换,带来了相当的烦恼。想做这样一个工具是很久以前的想法,可到现在都没有做;没有行动的想法都是空谈,抱着锻炼自己行动力的决心,完成了这个小工具。一.工具介绍 工具界面展示: 本工具主要功能: (1)能够找出所有的网卡适配器,并显示适配器的IP、MAC等信息 (2)能够修改IP、DNS、MAC等地址信息 (3)能够通过配置文件增加/删除网卡信息配置方案,并且能够根据方案进行地址切换,配置文件如下图所示: 二.IP、DNS、MAC的显示功能2.1如何获取IP、DNS、MAC信息主要利用Iphlpapi库获取网卡信息,Ip... 阅读全文
posted @ 2013-03-21 19:04 All IN 阅读(755) 评论(0) 推荐(0)

2013年3月14日

摘要: 1,判断dll的基地址是不是固定 查看是不是有重定位快2.外挂分析 1,判断外挂的注入游戏的类型 2. 判断外挂的动力。。 WM_TIMER? THread?SetWindowLong, CallWindowProc 3,判断外挂代码在内存中的存在方式:可执行模块存在;无可执行模块,只有代码。4.判断外挂的变成类型 E: VB: DE: VC 主要分析字符串,节名5,寻找外挂的入口模块 :PE结构定位,根据外挂的行为,条件断点。3,外挂的种类a.键盘模拟b,读写内存c,网络封包Delphi子过程参数传递默认调用方式Register,传递参数的顺序前三个为al,dl,cl / ax,dx,cx. 阅读全文
posted @ 2013-03-14 15:35 All IN 阅读(938) 评论(0) 推荐(1)

2013年3月13日

摘要: #include <Windows.h>#include <stdio.h>#include <Psapi.h>#pragma comment(lib, "psapi.lib")#include <varargs.h>#define LOGON 1#if LOGON#define Log log#else#define Log //#endifvoid log(const char* format, ...){ char Buf[1024]; va_list vList; va_start(vList, format); vs 阅读全文
posted @ 2013-03-13 15:53 All IN 阅读(286) 评论(0) 推荐(0)

2013年3月7日

摘要: 解析VC++ Name Mangling机制摘要在C++中,Name Mangling是为了支持重载而加入的一项技术,目前C++ Name Mangling并没有统一的标准,也没有较完整的中文文档化资料,所以本篇文章在VS2005环境中,解析C++ Name Mangling的技术细节,以及怎样将VC Name Mangling后的名称还原为可读的形式。目录lName Mangling简介lVC环境中Name ManglingnVC环境中C语言的Name ManglingnVC环境中C++语言中的Name Manglingl将Name Mangling后的名称还原为可读的形式Name Mang 阅读全文
posted @ 2013-03-07 09:56 All IN 阅读(403) 评论(0) 推荐(0)
摘要: #include <varargs.h>#define LOGON 1#if LOGON#define Log log#else#define Log //#endifvoid log(const char* format, ...){ char Buf[1024]; va_list vList; va_start(vList, format); vsprintf(Buf, format, vList); va_end(vList); OutputDebugString(Buf);} 阅读全文
posted @ 2013-03-07 00:03 All IN 阅读(135) 评论(0) 推荐(0)

2013年3月6日

摘要: /*******************************************************************文件名 : ReadWrite.cpp创建者 : 孙勇创建时间 : 2013/3/6 20:22:28功能描述 : 临界区 g_cs读者-读者不互斥读者-写者互斥 ** 写者-写者互斥临界区 g_csRead读者-读者互斥临界区 g_csWriter写者 写者互斥******************************************************************/#include <stdio.h> #inc... 阅读全文
posted @ 2013-03-06 21:04 All IN 阅读(161) 评论(0) 推荐(0)

2013年3月5日

摘要: #include <windows.h>#include <tlhelp32.h>#include <stdio.h>BOOL EnumThreadList ();int main(){ EnumThreadList(); return 0;}BOOL EnumThreadList () { HANDLE hThreadSnap = NULL; BOOL bRet = FALSE; THREADENTRY32 te32 = {0}; // Take a snapshot of all thr... 阅读全文
posted @ 2013-03-05 20:43 All IN 阅读(274) 评论(0) 推荐(0)

2013年3月3日

该文被密码保护。 阅读全文
posted @ 2013-03-03 18:17 All IN 阅读(1) 评论(0) 推荐(0)
摘要: #include <Windows.h>#include <stdio.h>int main(){ void * pBuf = VirtualAlloc(NULL, 0x200, MEM_COMMIT, PAGE_READWRITE); if(pBuf == 0) { return 1; } MEMORY_BASIC_INFORMATION mbi; VirtualQuery(pBuf, &mbi, sizeof(MEMORY_BASIC_INFORMATION)); DWORD old; VirtualProtect(mbi.Ba... 阅读全文
posted @ 2013-03-03 14:12 All IN 阅读(510) 评论(0) 推荐(0)

2013年2月26日

摘要: //dll project.hView Code #ifdef __cplusplusextern"C"{#endif#ifdef DLL_DECL#define DLL_DECLSPEC __declspec(dllexport)#else#define DLL_DECLSPEC __declspec(dllimport)#endif DLL_DECLSPEC int Add(int, int); #ifdef __cplusplus}#endif.cpp & .defView Code #include <Windows.h>#include < 阅读全文
posted @ 2013-02-26 01:17 All IN 阅读(174) 评论(0) 推荐(0)

2013年2月25日

摘要: //dll project.hView Code #ifdef DLL_TEST1_EXPORT#define DLL_DECLSPEC __declspec(dllexport)#else#define DLL_DECLSPEC __declspec(dllimport)#endifextern "C" DLL_DECLSPEC int WINAPI Add(int, int);DLL中导出函数的声明有两种方式:一种为4.1节例子中给出的在函数声明中加上__declspec(dllexport),这里不再举例说明;另外一种方式是采用模块定义(.def) 文件声明,.def 阅读全文
posted @ 2013-02-25 01:08 All IN 阅读(298) 评论(0) 推荐(0)
摘要: //static library projectlib.hView Code extern "C" int __cdecl Add(int, int);lib.cppView Code #include "lib.h"int __cdecl Add(int a, int b){ return a + b;}//App projectView Code #include <stdio.h>#include "..\\staticdll\\lib.h"#pragma comment(lib, "..\\debug\\ 阅读全文
posted @ 2013-02-25 00:15 All IN 阅读(130) 评论(0) 推荐(0)

2013年2月21日

摘要: View Code #include <Windows.h>#include <stdio.h>void Foo();int main(){ while(1) { Foo(); }}void Foo(){ static DWORD dwStartT = 0; DWORD dwCurT = GetTickCount(); if(dwCurT - dwStartT < 5000) { return ; } dwStartT = dwCurT; printf("foo call \n");} 阅读全文
posted @ 2013-02-21 18:26 All IN 阅读(221) 评论(0) 推荐(0)

2013年2月20日

摘要: View Code #include <windows.h>#include <stdio.h>int main(){ CHAR szAtom[32] = "ApexDingdianweifeng"; ATOM a1 = FindAtom(szAtom); if(a1 == 0) { printf("now the local not add\n"); } else { printf("now the local added\n"); } ATOM aLable = AddAtom(szAtom); ... 阅读全文
posted @ 2013-02-20 18:27 All IN 阅读(129) 评论(0) 推荐(0)
摘要: View Code 1 #include <Windows.h> 2 3 #include <stdio.h> 4 5 template <typename ToType, typename FromType> 6 void GetMemberFuncAddr_VC6(ToType& addr,FromType f) 7 { 8 union 9 {10 FromType _f;11 ToType _t;12 }ut;13 ut._f = f;14 addr = ut._t;15 }16 17 class A18 ... 阅读全文
posted @ 2013-02-20 01:28 All IN 阅读(216) 评论(0) 推荐(0)

2013年2月3日

摘要: Robert Kuster,20 Aug 2003Download entire package - 157.31 KBDownload WinSpy - 20 KB(demo application)ContentsIntroductionWindows HooksThe CreateRemoteThread & LoadLibrary TechniqueInterprocess CommunicationsThe CreateRemoteThread & WriteProcessMemory TechniqueHow to Subclass a Remote Control 阅读全文
posted @ 2013-02-03 18:01 All IN 阅读(414) 评论(0) 推荐(0)

2013年2月1日

摘要: bool EnableDebugPrivilege() { HANDLE hToken; LUID sedebugnameValue; TOKEN_PRIVILEGES tkp; if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken)) { return FALSE; } if (!LookupPrivilegeValue(NULL, SE_DEBUG_NAME,... 阅读全文
posted @ 2013-02-01 01:16 All IN 阅读(932) 评论(0) 推荐(0)
摘要: #include <stdio.h>typedef union { char cVar; unsigned int iVar;}unionInt;int main(){ unionInt tmp; tmp.iVar = 0x12345678; if(tmp.cVar == 0x78) { printf("least significant byte\n"); } else if(tmp.cVar == 0x12) { printf(("most significant byte\n")); } ret... 阅读全文
posted @ 2013-02-01 00:31 All IN 阅读(173) 评论(0) 推荐(0)

2013年1月31日

摘要: View Code void WalkUserSpace(){ SYSTEM_INFO stSysInf; MEMORY_BASIC_INFORMATION st_MemBasicInfor; memset(&stSysInf, 0, sizeof(SYSTEM_INFO)); memset(&st_MemBasicInfor, 0, sizeof(MEMORY_BASIC_INFORMATION)); GetSystemInfo(&stSysInf); DWORD dwUserAd... 阅读全文
posted @ 2013-01-31 09:11 All IN 阅读(147) 评论(0) 推荐(0)

导航