Van's House

I'm a developer at C++ team. I'm interested in everything related to C++

September, 2008

  • Van's House

    Magic behind ValueType.Equals

    • 1 Comments
    In "Effective C#", Bill Wagner says "Always create an override of ValueType.Equals() whenever you create a value type". His main consideration is the performance, because reflection is needed to compare two value types memberwisely. In fact, the framework...
  • Van's House

    Minimize the size of your program - high level

    • 1 Comments
    NOTICE: The following is not intended for real-world application. It is just an intellectual exercise to minimize the size of the program. The generated PE file may or may not be valid as it depends on behavior of specific architecture, OS and toolset...
  • Van's House

    Minimize the size of your program - low level

    • 1 Comments
    NOTICE: The following is not intended for real-world application. It is just an intellectual exercise to minimize the size of the program. The generated PE file may or may not be valid as it depends on behavior of specific architecture, OS and toolset...
  • Van's House

    Minimize the size of your program - assembly source

    • 1 Comments
    ; based on tiny.asm, modified by xiangfan ;e_cblp 2b ;tbl 1b ;hexstr 1b ;LoaderFlags 4b BITS 32 ; ; MZ header ; ; The only two fields that matter are e_magic and e_lfanew mzhdr: dw "MZ" ; e_magic dw 0 ; e_cblp UNUSED ; ; PE signature ; pesig: dd "PE"...
  • Van's House

    Play with the C++ compiler - compile nightmare

    • 1 Comments
    Playing with the compiler is interesting. One challenge for the compiler writer is compilation performance. There're many kinds of C++ code which are the nightmare for the compiler. Now let's go! 1. Preprocess a. Self Inclusion (GCC only) Normally...
  • Van's House

    Obfuscate your code

    • 1 Comments
    Obfuscation is widely used to protect your code from reverse engineering. Here is one example which takes advantage of indirected call and opcode overlap in X86: __declspec ( naked ) void Fun1() { __asm { //obfuscation chunk call LABEL1 LABEL1: pop eax...
Page 1 of 1 (6 items)