根据Joel的抽象渗漏法则,所有重大的抽象机制在某种程度上都是有漏洞的。Joel举过一个例子: C++字符串类型应该能让你假装字符串是个基本类型,它们尝试“字串很难处理”这个事实抽象掉,让它使用上象整型一样容易,几乎所有C++字串类型都会重载加号运算符,才能把字串连接写成s + "bar"。不过你知 Read More
posted @ 2016-03-16 22:05 findumars Views(640) Comments(0) Diggs(0)
检测内存泄漏的主要工具是调试器和 CRT 调试堆函数。若要启用调试堆函数,请在程序中包括以下语句: 通过包括 crtdbg.h,将 malloc 和 free 函数映射到其“Debug”版本 _malloc_dbg 和 _free_dbg,这些函数将跟踪内存分配和释放。此映射只在调试版本(在其中定义 Read More
posted @ 2016-03-16 21:45 findumars Views(3078) Comments(0) Diggs(0)
Delphi is one of the greatest RAD tools on the market, but it in this currently C++-dominated world, it can sometimes be hard to find a Delphi or Pasc Read More
posted @ 2016-03-16 21:27 findumars Views(2669) Comments(0) Diggs(0)
http://stackoverflow.com/questions/760513/where-can-i-find-information-on-the-structure-of-the-delphi-vmt Read More
posted @ 2016-03-16 21:22 findumars Views(285) Comments(0) Diggs(0)
Every Delphi class is defined internally by its vmt—​its virtual-method table. The vmt contains a list of pointers to a class’s virtual methods. It al Read More
posted @ 2016-03-16 21:16 findumars Views(1533) Comments(0) Diggs(0)
http://hallvards.blogspot.fr/2006/03/hack-8-explicit-vmt-calls.html http://www.deltics.co.nz/blog/posts/307 Read More
posted @ 2016-03-16 21:14 findumars Views(214) Comments(0) Diggs(0)
下载了一个小程序,它的功能并不需要管理员权限。但是在Win7下面它的图标上出现了一个“小盾牌”,这意味着运行它需要提升权限……果然,双击时弹出了UAC对话框。用二进制编辑器打开这个EXE,发现它没有内嵌manifest。 百思不得其解,偶然发现它的资源中的Version里的描述文字是“XXXX In Read More
posted @ 2016-03-16 19:07 findumars Views(1847) Comments(0) Diggs(0)
posted @ 2016-03-16 18:57 findumars Views(2026) Comments(1) Diggs(0)
下面是一段常见的的Delphi代码,在过程的开头声明本过程所需要的全部局部变量: C++程序员会以为obj这个变量就是TObject对象实例本身,会以为这一句是在栈上声明并构造了TObject类的一个对象实例,他们会与下面的C++代码混淆: 牢记一点,在Delphi里,永远不可能在栈上构造一个对象, Read More
posted @ 2016-03-16 18:31 findumars Views(2001) Comments(0) Diggs(0)
检测用户是否具有administrator权限const SECURITY_NT_AUTHORITY: TSIDIdentifierAuthority = (Value: (0, 0, 0, 0, 0, 5)); SECURITY_BUILTIN_DOMAIN_RID = $00000020; DO Read More
posted @ 2016-03-16 03:07 findumars Views(2134) Comments(0) Diggs(0)
QSqlDatabase::addDatabase第一次运行的时候,生成SQLite文件的同时会产生一个默认连接: QSqlDatabase database = QSqlDatabase::addDatabase("QSQLITE"); QString myconn = m_createname Read More
posted @ 2016-03-16 01:25 findumars Views(2901) Comments(0) Diggs(0)