小编hcf*_*hcf的帖子

防止Visual C++内联函数

我用c ++写了一个简单的程序:

#include <stdio.h>

const signed char pass[] = "\x70\x61\x73\x73\x77\x6F\x72\x64";

bool __stdcall check_password(const signed char * str)
{
    unsigned int i;
    for(i=0;i<8;++i)
        if(str[i]!=pass[i])
            return false;
    return true;
}

int main(int argc, char * argv[])
{
    signed char buf[20];
    printf("please enter the password: ");
    scanf("%s",buf);
    printf((check_password(buf)) ? "correct!\n" : "incorrect.\nPress any key to exit..\n");
    getchar();
    return 0;
} 
Run Code Online (Sandbox Code Playgroud)


并使用visual studio express 2010编译它.
我在OllyDbg中打开了结果,这就是我所看到的:

Address   Hex dump            Command                                          Comments
00FF1011  ³.  8B35 A020FF00   MOV ESI,DWORD PTR DS:[<&MSVCR100.printf>]
00FF1017  ³.  68 0021FF00     PUSH …
Run Code Online (Sandbox Code Playgroud)

c++ assembly compiler-optimization ollydbg dll-injection

1
推荐指数
1
解决办法
456
查看次数