问题就是上面描述的那样“fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt”,本来以为这个情况毕节特殊,后来搜索了一下却发现出现这个问题的大有人在。当然解决方案上面也提到了就是安装Visual Studio2010 sp1补丁。猛击这个链接去下载补丁安装程序:http://www.microsoft.com/zh-cn/download/details.aspx?id=23691
Visual Studio 2012正式版
今天从看雪学院下载的安装镜像,其实这个东西好久之前就看到了,但是却一直没下载。先说下那个图标,我也感觉是像一个窗户被拧了一下。蛋疼的图标啊。今天在笔记本上装这个东西,由于没有带电源适配器差点电池没电了还没装完。好在比较幸运,最后还剩了14%的电量。
开源是一种态度
对于开源我并没有什么太高深的理解,只是这两天的事情给我的一些启发而已。在这里简单的表述一下,首先要明确的第一件事情是开源不代表免费,也不代表你拥有代码的全部处置权。这里我不想对于对待的所有的权利进行说明,也不想讨论权利的问题。只是从开源代码的生命周期来看。
其实自从去年开始处理IDA的各种插件开始,接触到很多非常不错的插件,但是很多的插件都是停留在5.0-5.5的状态,并且很多的插件没有提供源代码。像这种插件就只能任由他死去。而对于另外一些开放源代码的插件则可以通过简单的sdk的修正和一些简单的修复就可以重新编译出来支持IDA Pro 6.x以上的版本。而这一些使得代码能够有更长远的生命,也能够让更多的人用到这个东西。于是在无形中代码就变得更加长命。而由于多年以前代码的托管并不是十分方便,于是很多的代码并没有托管到第三方的开源代码服务器上,只能下载到压缩包。
基于 Visual Studio 和虚拟机的驱动调试
C语言混乱代码
偶然看到的这么个东西,话说这个活动很久了。看了代码果然不一般啊,不一般。
/*
+
+
+
+
[ >i>n[t
*/ #include
/*2w0,1m2,]_r>i>=>(['0n1'0)1;
*/int/**/main(int/**/n,char**m){FILE*p,*q;int A,k,a,r,i/*
#uinndcelfu_dseti/_*/;char*d="P%" "d\n%d\40%d"/**/
"\n%d\n\00wb+",b[1024],y[]="yuriyurarararayuruyuri*daijiken**akkari~n**"
"/y*u*k/riinrarararayuruy9uriyu3riyurar_aBrMaPrOaWy^?"
"*]/f]`;hvroai+b+i>++b++>l[rb";int/**/u;for(i=0;i<101;i++)y[i*2]^="~hktrvg~dmG*eoa+%squ#l2"
":(wn\"1l))v?wM353{/Y;lgcGp`vedllwudvOK`cct~[|ju {stkjalor(stwvne\"gt\"yogYURUYURI"[
i]^y[i*2+1]^4;/*!*/p=(n>1&&(m[1][0]-'-'||m[1][1] !='\0'))?fopen(m[1],y+298):stdin;
/*y/riynrt~(^w^)],]c+h+a+r+*+*[n>)+{>f+oy++>u>>+r >+u+++y>--u---r>++i+++" < )< ;[>-m-.>a-.-i.++n.>[(w)*/!q/**/)
return+printf("Can " "not\x20open\40%s\40" "" "for\40%sing\n",m[!p?1:2],!p?/*
o=82]5< <+(+3+1+&.(+ m +-+1.)<)<|<|.6>4>-+(> m- &-1.9-2-)-|-|.28>-w-?-m.:>([28+
*/"read":"writ");for ( a=k=u= 0;y[u]; u=2 +u){y[k++ ]=y[u];}if((a=fread(b,1,1024/*
,mY/R*Y"R*/,p/*U*/)/* R*/ )>/*U{ */ 2&& b/*Y*/[0]/*U*/=='P' &&4==/*"y*r/y)r\}
*/sscanf(b,d,&k,& A,& i, &r)&& ! (k-6&&k -5)&&r==255){u=A;if(n>3){/*
]&<1<6< ?3> +:+ .1>3+++ . -m-) -;.u+=++.1<0< <; f>1,i>>1,r);u = k-5?8:4;k=3;}else
/*]>*/{(u)=/*{ p> >u >t>-]s >++(.yryr*/+( n+14>17)?8/4:8*5/
4;}for(r=i=0 ; ;){u*=6;u+= (n>3?1:0);if (y[u]&01)fputc(/*
h.a r -(-).)8+<1. >;+i.(< )< <)+{+i.f>([180*/1*
(r),q);if(y[u ]&16)k=A;if (y[u]&2)k--;if(i/*
("^w^NAMORI; { I*/==a/*" )*/){/**/i=a=(u)*11
&255;if(1&&0>= (a= fread(b,1,1024,p))&&
")]i>(w)-;} { /i-f-(-m--M1-0.)< {"
[ 8]==59/* */ )break;i=0;}r=b[i++]
;u+=(/**>> *..*&*^&%%$^**/+8&*
(y+u))?(10- r?4:2):(y[u] &4)?(k?2:4):2;u=y[u/*
49;7i\(w)/;} y}ru\=*ri[ ,mc]o;n}trientuu ren (
*/]-(int)'`';} fclose( p);k= +fclose( q);
/*] < *.na/m*o{ri{ d;^w^;} }^_^}}
" */ return k- -1+ /*\' '-`*/
( -/*}/ */0x01 ); {;{ }}
; /*^w^*/ ;}
OSX and iOS Kernel Programming
虽然有了电子版,但是还是喜欢纸质的书。习惯原始的阅读,那种书捧在手里的感觉。本来想找同学帮忙去打印的,但是话说现在不知道谁还在北京于是,就从淘宝上随便找了一个打印的地方,打印了一本。整体来说打印的质量还算不错,图片也比较清晰,但是装订的时候装订成了两本,这个感觉有点郁郁。本来以为很厚的,但是发现其实装订成一本问题也不大。另外发现了一个很郁闷的事情,有的地方的页码实在装订线那边的,仔细看了一下发现少了50页。刚开始还以为是装订漏了,后来才发现原来原书的pdf版本里面也没有50,于是后面的页面就有正有反。这个有点郁闷,不过也还好不影响阅读。
Calling IDA APIs from IDAPython with ctypes
IDAPython 提供了一些列封装好的ida sdk函数,但是由于SWIG的限制或者一切其他的原因有一部分api并没有封装到这个库中。为了能够调用在idapython中没有封装的api函数get_loader_name(),但是又不想因为调用这么一个简单的函数而编写一个插件进行测试,那么此时就可以使用ctypes 来实现了。
所有IDA API都是由ida的核心动态库来提供的,在Windows系统下这个库为ida.wll(或者ida64.wll),在linux系统下为libida[64].so,在os x系统下为libida[64].dylib. ctypes提供了一个非常好的功能来创建一个封装的Dll到处函数类,可以把他们看成一个类实例的属性来调用。下面的代码用于获取不同系统下的ida实例:
import ctypes
import sys
idaname = "ida64" if __EA64__ else "ida"
if sys.platform == "win32":
dll = ctypes.windll[idaname + ".wll"]
elif sys.platform == "linux2":
dll = ctypes.cdll["lib" + idaname + ".so"]
elif sys.platform == "darwin":
dll = ctypes.cdll["lib" + idaname + ".dylib"]
我们使用windll是因为ida的api在windows系统下是使用stdcall调用约定的(可以通过查看pro.h中队用的idaapi的定义来确定调用类型)
现在我们只需要像调用一个dll对象的一个属性一样来调用我们的函数,但是首先我们要准备好我们函数需要的参数,下面是从loader.hpp中得到的函数的定义:
idaman ssize_t ida_export get_loader_name(char *buf, size_t bufsize);
ctypes提供了一个非常方便的函数来创建字符buffer:
buf = ctypes.create_string_buffer(256)
IDA Unicode String Anylist and comment maker
早在很久之前就写过一个导入Unicode字符串注释的脚本,但是脚本操作还是有自己的局限性。每次都要通过其他的分析工具搜索定位到字符串,然后导出,在然后倒入。这是多么蛋疼的时间事情啊。 😎
(关于插图:
Augusta Ada King, Countess of Lovelace (10 December 1815 – 27 November 1852), born Augusta Ada Byron, was an English writer chiefly known for her work on Charles Babbage’s early mechanical general-purpose computer, the analytical engine. Her notes on the engine include what is recognised as the first algorithm intended to be processed by a machine; thanks to this, she is sometimes considered the “World’s First Computer Programmer”
She was the only legitimate child of the poet Lord Byron (with Anne Isabella Milbanke). She had no relationship with her father, who died when she was nine. As a young adult, she took an interest in mathematics, and in particular Babbage’s work on the analytical engine. Between 1842 and 1843, she translated an article by Italian mathematician Luigi Menabrea on the engine, which she supplemented with a set of notes of her own. These notes contain what is considered the first computer programme — that is, an algorithm encoded for processing by a machine. Though Babbage’s engine has never been built, Lovelace’s notes are important in the early history of computers. She also foresaw the capability of computers to go beyond mere calculating or number-crunching while others, including Babbage himself, focused only on these capabilities.)
到网上随便搜了搜发现hexrays曾经发布过一个处理unicode字符串的插件,猛击此处访问插件页面。插件的名字叫做unispector。并且在插件页面提供了相关的源代码下载,但是偶下载编译之后在新版的ida下无法成功加载,并且没有出现应有的效果。