摘要: 一个简单的堆排序,不知道有没有BUG。~~= =代码:void Swap(DWORD& a, DWORD& b){ if(a != b) { a = a^b; b = a^b; a = a^b; }}void AdjustHeap(DWORD* dwArray, int i, int nLenth){ int nChild = i*2 + 1; while(nChild < nLenth) { //nChild指向较大的节点 if(nChild < nLenth - 1 && dwArray[nChild] < dwArray[nChild+1 阅读全文
posted @ 2012-08-30 20:24 Kevin!=NULL 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 使用set来构建一个索引树。用来查找指定文件名。暂时不知道有没有BUG,还在测,不过内存泄露应该不会有吧,IndexTree_release(), IndexTree_Destory() 应该能保证所有节点被释放。使用过程中的临时节点也被释放了。看代码:IndexTree.h: 1 #ifndef IndexTree_h__ 2 #define IndexTree_h__ 3 4 #include <tchar.h> 5 #include <set> 6 using namespace std; 7 8 class IndexTreeNode; 9 struct Ind 阅读全文
posted @ 2012-08-08 17:13 Kevin!=NULL 阅读(296) 评论(0) 推荐(0) 编辑
摘要: 用了stl的c++工程用gcc编译不通过。在链接的时候会显示很多未定义的符号,这是因为gcc默认不会和C++库进行链接。一般可以使用g++进行链接。当然,如果要使用gcc链接也可以,不过要使用-lstdc++将c++库链接进来。example:gcc -c stl.cppgcc stl.o -lstdc++ -o stl.exe一些使用资料:http://wiki.ubuntu.org.cn/index.php?title=Gcchowto&variant=zh-cn 阅读全文
posted @ 2012-07-26 16:15 Kevin!=NULL 阅读(385) 评论(0) 推荐(0) 编辑
摘要: 还是国外论坛找答案给力~ 唉~http://stackoverflow.com/questions/7912595/initialization-for-stl-priority-queue我太低端了 一直没搞懂priority_queue的第三个参数, 写了下终于懂了。 1 #include <iostream> 2 #include <string> 3 #include <vector> 4 #include <queue> 5 using namespace std; 6 7 8 struct processor 9 {10 int pr 阅读全文
posted @ 2012-07-25 18:00 Kevin!=NULL 阅读(387) 评论(0) 推荐(0) 编辑
摘要: Detours Express 3.0 makefile编译直接用nmake 编译出现错误 “cl.EXE: 返回代码 0xc0000135”这是环境变量的问题解决方案是在使用nmake之前运行vcvarsall.bat,这个必须在cmd窗口内运行,因为运行后只是临时改变当前的session内的环境变量。然后再执行 nmake /F MakeFile也可以自己写个bat 更方便d:\Program Files\Microsoft Visual Studio 10.0\Common7\Tools\vcvarsall.bat ::路径自己改啊~~nmake /F MakeFilePS:nmake. 阅读全文
posted @ 2012-07-12 11:45 Kevin!=NULL 阅读(683) 评论(0) 推荐(0) 编辑
摘要: // -------------------------------------------------------------------------// 函数 : BM_SearchPackSign// 功能 : // 返回值 : PBYTE // 参数 : PBYTE pBuf// 参数 : int nBufLen// 参数 : BYTE *pbySignBuf// 参数 : int nSignSize// 参数 : BYTE Mask// 附注 : // --------------------------------------------------... 阅读全文
posted @ 2012-07-05 14:56 Kevin!=NULL 阅读(310) 评论(0) 推荐(0) 编辑
摘要: 关于vimrc:"空格代替tabset ts=4set expandtab"显示行号set numberset nocompatiblefiletype on"语法高亮syntax on"设置匹配模式set showmatchset rulerset tabstop=4set softtabstop=4set shiftwidth=4"自动缩进set autoindent"将系统剪切板作为默认的regset clipboard=unnamedplusset fileencoding=utf-8,gbksome tips:对于已保存的文 阅读全文
posted @ 2012-07-05 00:53 Kevin!=NULL 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 抄歌词 嘿嘿 有人问我我就会讲 但是无人来 我期待到无奈有话要讲 得不到装载 我的心情犹像樽盖等被揭开 嘴巴却在养青苔 人潮内愈文静愈变得不受理睬 自己要搞出意外 像突然地高歌任何地方也像开四面台 着最闪的衫扮十分感慨 有人来拍照要记住插袋 你当我是浮夸吧 夸张只因我很怕 似木头似石头的话得到注意吗 其实怕被忘记至放大来演吧 很不安怎去优雅 世上还赞颂沉默吗 不够爆炸怎么有话题 让我夸做大娱乐家 那年十八母校舞会 站着如喽罗 那时候我含泪发誓各位 必须看到我 在世间平凡又普通的路太多 屋村你住哪一座 情爱中工作中受过的忽视太多 自尊已饱经跌... 阅读全文
posted @ 2012-03-27 19:54 Kevin!=NULL 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 把DLL插进去 T T , 传说中的硬编码。 我真懒得写全了 意思一下就好了。 1 #include "stdafx.h" 2 #include <windows.h> 3 4 5 BOOL InjectProcess(DWORD dwProcessId, char* szLibName) 6 { 7 BOOL bOK = FALSE; 8 HANDLE hProcess = NULL; 9 HANDLE hThread = NULL;... 阅读全文
posted @ 2012-03-25 18:17 Kevin!=NULL 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 1 #include "stdafx.h" 2 #include "apihook.h" 3 #include <Windows.h> 4 using namespace std; 5 6 typedef int (WINAPI *PFNCREATEFILE)(LPCTSTR , DWORD, DWORD, LPSECURITY_ATTRIBUTES, DWORD , DWORD, HANDLE); 7 FARPROC g_OriginalProc = (FARPROC)CreateFileA; 8 FARPROC g_NewProc = ( 阅读全文
posted @ 2012-03-25 16:37 Kevin!=NULL 阅读(258) 评论(0) 推荐(0) 编辑