随笔分类 -  写写代码

摘要:mstring.h 1 /* 2 ** Copyright (C) 1998-2002 Martin Roesch 3 ** 4 ** This program is free software; you can redistribute it and/or modify 5 ** it under the terms of the GNU General Public License as published by 6 ** the Free Software Foundation; either version 2 of the License, or 7 ** (at your opt. 阅读全文
posted @ 2013-08-15 10:07 Kevin!=NULL 阅读(578) 评论(0) 推荐(0)
摘要:http://blog.csdn.net/cwqbuptcwqbupt/article/details/7591818 阅读全文
posted @ 2013-03-22 09:49 Kevin!=NULL 阅读(996) 评论(0) 推荐(0)
摘要:对不起,我又挫B了,居然连这个方法都不知道。转载一下:http://blog.w4kfu.com/tag/duqu还有好多要学的东西啊! 路漫漫其修远兮~样本里的一些东西:ZwQueryInformationProcess ProcessDebugPort 查看是否被调试ZwSetInformationThread ThreadInformationClass 0x11 是否被调试GetShellWindow GetWindowThreadProcessId 拿到explorer进程ID 阅读全文
posted @ 2013-03-15 16:26 Kevin!=NULL 阅读(1777) 评论(0) 推荐(0)
摘要:http://deeplearning.net/tutorial/ 阅读全文
posted @ 2012-12-05 16:35 Kevin!=NULL 阅读(110) 评论(0) 推荐(0)
摘要:实在没动力写下去了,先存个档。 读档时间未定~ 一两天, 一两个月 , 或者一辈子。Huffman.cpp 1 #include "stdafx.h" 2 #include "Huffman.h" 3 #include <iostream> 4 #include <math.h> 5 #include <queue> 6 #include <stack> 7 using namespace std; 8 9 10 HuffmanTree::HuffmanTree():m_root(NULL), m_nNod 阅读全文
posted @ 2012-10-28 11:20 Kevin!=NULL 阅读(346) 评论(0) 推荐(0)
摘要:写了个HashTable的模板类, 因为C++不是很专业所以写的有点挫, 模仿SGI STL的HashTable写的。SGI STL用的vector, 我木有用, 主要是想锻炼下。~在数据增长到千万级的时候,内存占用居然达到了坑爹的1.2G, 我一直以为是内存泄露,结果实测以后发现确实就是要占用这么多空间~。。希望能找到什么优化方法。~模板类:/************************************************************************* @file : HashTable.h* @author : kevin <zhangt... 阅读全文
posted @ 2012-09-06 22:07 Kevin!=NULL 阅读(740) 评论(0) 推荐(0)
摘要:一个简单的堆排序,不知道有没有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 阅读(149) 评论(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 阅读(399) 评论(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 阅读(399) 评论(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 阅读(710) 评论(0) 推荐(0)
摘要:// -------------------------------------------------------------------------// 函数 : BM_SearchPackSign// 功能 : // 返回值 : PBYTE // 参数 : PBYTE pBuf// 参数 : int nBufLen// 参数 : BYTE *pbySignBuf// 参数 : int nSignSize// 参数 : BYTE Mask// 附注 : // --------------------------------------------------... 阅读全文
posted @ 2012-07-05 14:56 Kevin!=NULL 阅读(323) 评论(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 阅读(173) 评论(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 阅读(184) 评论(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 阅读(264) 评论(0) 推荐(0)