摘要: 编写test.cpp #include #include #include #include #include void terminate_handler(){ char cmdline[1024] = {0,}; sprintf(cmdline, "bash term.sh %d %d", getpid(), getppid()); // printf("executing %s\... 阅读全文
posted @ 2014-05-23 11:54 Daniel King 阅读(495) 评论(0) 推荐(0) 编辑
摘要: 参考:http://blog.chinaunix.net/uid-26207112-id-3332621.html1. 正确地创建一个包含启动分区的磁盘映像1.1 创建磁盘映像文件首先需要对磁盘的结构有一个直观的了解,参考:http://en.wikipedia.org/wiki/Cylinder-... 阅读全文
posted @ 2014-02-21 17:06 Daniel King 阅读(1224) 评论(0) 推荐(0) 编辑
摘要: 1. 背景http://stackoverflow.com/q/20418694/941650这里面临的一个核心问题是,如果MFT Reference相等,能够表明这些记录代表的是同一个文件吗?对于这个问题,我们可以采取实验的方式来验证。2. 实验环境在实验设备Windows 7操作系统下,D盘是N... 阅读全文
posted @ 2014-02-08 18:11 Daniel King 阅读(960) 评论(0) 推荐(0) 编辑
摘要: 1. 场景假设一个系统System在某一时刻的状态可以用State A来表示【State里面包含着一些元素的集合】: 1: State A = [element_0, element_1,……,element_n]系统System经过了一段时间的运行,在另一时刻,它的状态变成State B: ... 阅读全文
posted @ 2014-02-07 10:47 Daniel King 阅读(494) 评论(0) 推荐(0) 编辑
摘要: 1: unsigned long do_mmap_pgoff(struct file *file, unsigned long addr, 2: unsigned long len, unsigned long prot, 3: unsi... 阅读全文
posted @ 2014-01-20 17:51 Daniel King 阅读(1215) 评论(0) 推荐(0) 编辑
摘要: Linux对内核态内存分配请求与用户态内存分配请求处理上分别对待Linux本身信任自己,因此Linux内核请求分配多少内存,就会马上分配相同数量的内存出来。但内核本身不相信应用程序,而且通常应用程序分配了一段内存,其实只是预定,并不是马上就去访问。由于应用程序的数目比较多,那么这部分只分配了但是没有... 阅读全文
posted @ 2014-01-02 16:55 Daniel King 阅读(2696) 评论(0) 推荐(0) 编辑
摘要: 读取VDI文件SSL和TLSWindows下使用vim的最佳方案:Sublimegdb用法VMware的Guest与Host进行通信的三种方式加密与解密漫谈保护模式processing学习学习利用COM组件VS2012如何事半功倍PDF文件格式Python查看和修改当前进程的环境变量 阅读全文
posted @ 2013-11-09 14:24 Daniel King 阅读(213) 评论(0) 推荐(0) 编辑
摘要: 什么是Bochs?简单地说,Bochs是一款仿真软件,可以用软件的方式模拟硬件的工作。同类软件有Qemu,仿真软件与虚拟机(hypervisor)还不完全相同,仿真软件是完全软件模拟硬件,而虚拟机软件(比如Vmware, VirtualBox)是利用主机的硬件进行工作。Bochs的主页地址:http... 阅读全文
posted @ 2013-11-08 19:54 Daniel King 阅读(3995) 评论(0) 推荐(0) 编辑
摘要: --------------------------------------------------------------------- /** * __insert_inode_hash - hash an inode * @inode: unhashed inode ... 阅读全文
posted @ 2014-11-11 10:47 Daniel King 阅读(284) 评论(0) 推荐(0) 编辑
摘要: $ cat prettify.sed s/,/,\r\n/gs/\[/\r\n\[\r\n/gs/\]/\r\n\]\r\n/gs/{/\r\n{\r\n/gs/}/\r\n}\r\n/g$ cat prettify.awk BEGIN{ depth = 0;}/\[/ { sp... 阅读全文
posted @ 2014-10-01 21:25 Daniel King 阅读(537) 评论(0) 推荐(0) 编辑
摘要: https://github.com/rajkosto/deps-detours/tree/master/samples/syelog学习IO完成端口,最好的例子是Detours中的模块syelog,它为了高效地接收多个来源的log,创建了IO完成端口以及线程池,线程池中的线程数目为当前proces... 阅读全文
posted @ 2014-09-17 17:18 Daniel King 阅读(331) 评论(0) 推荐(0) 编辑
摘要: 1. 下载itextpdf.jar基础包:http://jaist.dl.sourceforge.net/project/itext/iText/iText5.5.2/itext-5.5.2.zip附加包:http://cznic.dl.sourceforge.net/project/itext/e... 阅读全文
posted @ 2014-08-29 16:57 Daniel King 阅读(620) 评论(0) 推荐(0) 编辑
摘要: 1. 独立存在的Font文件有三类:Type 1 FontTrueType FontOpenType FontType 1是由Adobe开发的,它是基于PostScript的Font,它通常由两个分开的文件来描述:1. Adobe Font Metrics[Adobe]/Printer Font M... 阅读全文
posted @ 2014-08-28 10:03 Daniel King 阅读(709) 评论(0) 推荐(0) 编辑
摘要: NTSYSCALLAPINTSTATUSNTAPINtCreateProcess( OUT PHANDLE ProcessHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes OPT... 阅读全文
posted @ 2014-08-26 14:50 Daniel King 阅读(968) 评论(0) 推荐(0) 编辑
摘要: 参考:http://www.codeproject.com/Articles/43586/File-System-Filter-Driver-Tutorial关键点:To perform attaching, we create a new device object with the device... 阅读全文
posted @ 2014-08-25 15:20 Daniel King 阅读(1028) 评论(0) 推荐(0) 编辑
摘要: 作为一个C++出身的程序员,好多语言看起来都很陌生,但是又十分有吸引力PythonPerlRubyLispLuaHaskellOcaml 其实学习一门语言的过程并不简单,需要花费很多的时间来与它建立亲密的关系,浅尝辄止基本上是不能领会其中的奥秘的。但是无论如何,学习的脚本不能停止。对于零碎时间的合... 阅读全文
posted @ 2014-08-25 11:27 Daniel King 阅读(253) 评论(0) 推荐(0) 编辑
摘要: ftp://ftp.tex.ac.uk/ctan/tex-archive/ftp ftp.tex.ac.ukanonymousls 阅读全文
posted @ 2014-08-24 18:36 Daniel King 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 拆解脚本header_start=0header_len=15 xref_start=$(strings -a -t d $1 | grep -e "\bxref\b" | awk '{print $1}')trailer_start=$(strings -a -t d $1 | grep -e "... 阅读全文
posted @ 2014-08-23 21:53 Daniel King 阅读(380) 评论(0) 推荐(0) 编辑
摘要: 1 Depart Process: 2 1. Grep xref and trailer binary position in file. 3 2. Dump xref table and trailer part. 4 3. Calculate every object binary o... 阅读全文
posted @ 2014-08-22 18:06 Daniel King 阅读(217) 评论(0) 推荐(0) 编辑
摘要: daniel@daniel-mint ~/latex/linux/itext/daniel $ cat asm.sh header_start=0header_len=15xref_start=$(strings -a -t d $1 | grep -e "\bxref\b" | awk '{pri... 阅读全文
posted @ 2014-08-21 17:58 Daniel King 阅读(363) 评论(0) 推荐(0) 编辑
摘要: 参考:http://stackoverflow.com/questions/14141008/grep-offset-of-ascii-string-from-binary-filestrings -a -t x filename | grep foobardaniel@daniel-mint ~/... 阅读全文
posted @ 2014-08-21 17:31 Daniel King 阅读(960) 评论(0) 推荐(0) 编辑
摘要: 1. 当返回值为STATUS_SUCCESS时,返回的字节数保存在IoStatusBlock.Information字段中;2. 如果FileName字段被指定了,那么对于同时指定的FileHandle,那么所有后续的对于该FileHandle的调用,都要根据该FileName来过滤结果。3. 如果... 阅读全文
posted @ 2014-08-21 11:10 Daniel King 阅读(1080) 评论(0) 推荐(0) 编辑
摘要: 参考:http://stackoverflow.com/questions/19177721/extract-lines-between-two-patterns-from-a-lfileawk '/pattern1/ {p=1}; p; /pattern2/ {p=0}' file 阅读全文
posted @ 2014-08-20 13:23 Daniel King 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 由Knuth Donald开发的tex.web会生成DVI文件,DVI也是Knuth自己实现的(虽然概念是其他人提出的)一种文件格式,目标是与设备无关。通过dvips程序可以将DVI格式转化成PostScript格式,而PostScript格式是Adobe公司起家的产品,也是PDF格式的前身,甚至P... 阅读全文
posted @ 2014-08-20 10:49 Daniel King 阅读(353) 评论(0) 推荐(0) 编辑
摘要: 参考:http://itextpdf.com/book/examples.phpdaniel@daniel-mint ~/latex/linux/itext/daniel $ cat HelloWorldNarrow.java import java.io.FileOutputStream;impo... 阅读全文
posted @ 2014-08-19 17:50 Daniel King 阅读(736) 评论(0) 推荐(0) 编辑
摘要: curl http://cn.bing.com/dict/search?q=spawn -s | sed -e '{s//&\n/g}' | sed -n '{//p}' | sed -e '{s///g}' | sed -e '{s///g}' 产卵;导致;引发;引起(鱼、蛙等的)卵再生侠;闪灵... 阅读全文
posted @ 2014-08-18 17:49 Daniel King 阅读(327) 评论(0) 推荐(0) 编辑
摘要: 参考:http://blog.jobbole.com/44891/搜索技巧1. 使用*快速查询当前光标所在的单词然后使用n快速找到下一个查询结果;使用N快速找到上一个查询结果2. 在.vimrc中设置set hlsearch 用来高亮所有查询结果3. 在.vimrc中设置set incsearch... 阅读全文
posted @ 2014-08-15 14:38 Daniel King 阅读(207) 评论(0) 推荐(0) 编辑
摘要: 参考:http://xw2423.byr.edu.cn/blog/archives/232http://www.pythonclub.org/linux/vim/visual-modeVim的多行编辑技巧都在"Visual Mode"里面。可以通过三种方式进入Visual Mode:1. v ... 阅读全文
posted @ 2014-08-15 13:24 Daniel King 阅读(278) 评论(0) 推荐(0) 编辑
摘要: import osimport sysimport structdef enc(path, key): path_ret = "" for i in range(0, len(path)/4): path_ret += struct.pack(">> ===========... 阅读全文
posted @ 2014-08-11 10:18 Daniel King 阅读(9024) 评论(1) 推荐(0) 编辑
摘要: 通过Everything搜索feacp.dll,然后修改其名字或者直接删除之。重启Visual Studio. 阅读全文
posted @ 2014-08-04 15:23 Daniel King 阅读(911) 评论(0) 推荐(0) 编辑
摘要: 参考:http://www.mouseos.com/windows/kernel/KiFastCallEntry.htmlhttp://www.mouseos.com/windows/kernel/%E4%B8%80%E4%BA%9B%E9%80%86%E5%90%91%E5%87%BA%E6%9D... 阅读全文
posted @ 2014-08-01 14:57 Daniel King 阅读(493) 评论(0) 推荐(0) 编辑
摘要: 参考:http://msdn.microsoft.com/en-us/library/h5w10wxs.aspx普通的函数,Compiler会自动生成prologue和epilogue,但是通过在函数定义前添加__declspec(naked) 可以提示编译器,不要生成prologue和epilo... 阅读全文
posted @ 2014-07-30 11:25 Daniel King 阅读(394) 评论(0) 推荐(0) 编辑
摘要: 参考:http://x86.renejeschke.de/html/file_module_x86_id_313.htmlhttp://msdn.microsoft.com/en-us/library/windows/hardware/ff553516(v=vs.85).aspxhttp://en.... 阅读全文
posted @ 2014-07-29 17:22 Daniel King 阅读(1254) 评论(0) 推荐(0) 编辑
摘要: 参考:http://ref.x86asm.net/http://ref.x86asm.net/coder32.html 阅读全文
posted @ 2014-07-29 16:17 Daniel King 阅读(241) 评论(0) 推荐(0) 编辑
摘要: 1. 在Guest系统里面,编辑C:\Boot.ini,注意修改只读属性[boot loader]timeout=5default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS[operating systems]multi(0)disk(0)rdisk(0... 阅读全文
posted @ 2014-07-29 15:38 Daniel King 阅读(449) 评论(0) 推荐(0) 编辑
摘要: 参考:http://msdn.microsoft.com/en-us/library/windows/hardware/ff540507(v=vs.85).aspx这是最靠谱的参考了,比.hh要直观。在Linux上稍作编辑daniel@daniel-mint ~/windbg $ awk 'BEGI... 阅读全文
posted @ 2014-07-29 13:19 Daniel King 阅读(1540) 评论(0) 推荐(0) 编辑
摘要: 1. 安装sdl2sudo apt-get install libsdl2-dev 2. 将configure文件中与SDL有关的地方改成SDL2if test -z "$sdl" ; then sdl_config="sdl2-config" sdl=no cat > $TMPC ... 阅读全文
posted @ 2014-07-25 16:09 Daniel King 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 参考:http://bitblaze.cs.berkeley.edu/papers/taintcheck-full.pdf1. 应用taint analysis需要解决三个问题a. 哪些input需要被标记为taintedb. 这些tainted的属性需要怎样被传播到其他的内存中c. 这些taint... 阅读全文
posted @ 2014-07-25 13:28 Daniel King 阅读(921) 评论(0) 推荐(0) 编辑
摘要: 下载wget http://www.vim.org/scripts/download_script.php?src_id=19574 -O taglist.zip 然后解压taglist.zip到~/.vim/目录下在vim中使用如下命令切换taglist显示:TlistToggle 使用Ctr... 阅读全文
posted @ 2014-07-24 11:41 Daniel King 阅读(541) 评论(0) 推荐(0) 编辑
摘要: 1. 编译Pspeek.cpp#include #define DANIEL_LIST_PROCESS 0x8001PDRIVER_OBJECT daniel_DriverObject;PDEVICE_OBJECT daniel_DeviceObject;NTSTATUS daniel_Dispat... 阅读全文
posted @ 2014-07-23 15:10 Daniel King 阅读(422) 评论(0) 推荐(0) 编辑
摘要: 由于网络原因,直接使用cabal update不成功,只能自己写脚本直接从网上拖包下来,自己安装。但是这样做的缺点是需要手动处理dependency,当然,也可以把脚本写的复杂些,自动来处理dependency。cabal.sh1 cat .tmp_sed_script2 s/]*>/&\n/g3 ... 阅读全文
posted @ 2014-07-16 16:06 Daniel King 阅读(385) 评论(0) 推荐(0) 编辑
摘要: 1. 复合函数操作符Prelude> :t (.)(.) :: (b -> c) -> (a -> b) -> a -> cPrelude> (.) ((+) 5) ((*) 2) 413 所以(.)操作符的作用,是将4作为参数传递给((*) 2)函数,再将结果传递给((+) 5)函数。这就是数学... 阅读全文
posted @ 2014-07-15 17:42 Daniel King 阅读(456) 评论(0) 推荐(0) 编辑
摘要: 定义新类型data EmployeeInfo = Employee Int String String [String] deriving(Read, Show, Eq, Ord) EmployeeInfo是新的类型名称,或者说是类型标识Employee是构造函数的名称*Main>... 阅读全文
posted @ 2014-07-15 11:17 Daniel King 阅读(655) 评论(0) 推荐(0) 编辑
摘要: daniel@daniel-mint /usr/lib/ghc/haskell2010-1.1.1.0 $ tree.├── Control│ └── Monad.hi├── Data│ ├── Array.hi│ ├── Bits.hi│ ├── Char.hi│ ├── Complex.hi│ ... 阅读全文
posted @ 2014-07-14 15:18 Daniel King 阅读(288) 评论(0) 推荐(0) 编辑
摘要: 参考:http://stackoverflow.com/a/9153617http://www.haskell.org/haskellwiki/How_to_write_a_Haskell_program 1 2 3 trizip :: [a] -> [b] -> [c] -> [(a,b,... 阅读全文
posted @ 2014-07-14 11:34 Daniel King 阅读(816) 评论(0) 推荐(0) 编辑
摘要: 1 trizip :: [a] -> [b] -> [c] -> [(a,b,c)] 2 trizip a b c 3 | null a = [] 4 | null b = [] 5 | null c = [] 6 trizip (x:x... 阅读全文
posted @ 2014-07-14 11:02 Daniel King 阅读(201) 评论(0) 推荐(0) 编辑
摘要: 参考:http://www.cse.unsw.edu.au/~en1000/haskell/inbuilt.htmlhttp://www.cse.unsw.edu.au/~en1000/haskell/hof.html在GHCi中,可以使用:type来查看对象的类型,与http://www.cnbl... 阅读全文
posted @ 2014-07-11 17:32 Daniel King 阅读(877) 评论(0) 推荐(0) 编辑
摘要: 参考:http://blog.jobbole.com/55327/http://blog.jobbole.com/56300/http://blog.jobbole.com/56761/1. 在交互式命令行中执行命令的内部过程当你敲下return键的时候,python完成了以下四步:词法分析、句法分... 阅读全文
posted @ 2014-07-11 14:19 Daniel King 阅读(1370) 评论(0) 推荐(0) 编辑