我有这么一段代码,我使用的是VS2010IDE,直接编译Release模式,开O2,谁能猜到编译器怎么给我编的

 typedef HRESULT (__stdcall *FTSHGetFolderLocation)(HWND hwndOwner,
int nFolder,
HANDLE hToken,
DWORD dwReserved,
void *ppidl
);
typedef HRESULT (__stdcall *FTSHGetFolderPathW)(
_In_ HWND hwndOwner,
_In_ int nFolder,
_In_ HANDLE hToken,
_In_ DWORD dwFlags,
_Out_ LPTSTR pszPath
);
typedef BOOL (__stdcall *FTSHGetPathFromIDListW)(
_In_ void *pidl,
_Out_ LPTSTR pszPath
);
typedef void (__stdcall *FTILFree)(
_In_ VOID *pidl
);
typedef BOOL (WINAPI *FTGetFileAttributesExW)(
__in LPCWSTR lpFileName,
__in GET_FILEEX_INFO_LEVELS fInfoLevelId,
__out LPVOID lpFileInformation
);
typedef BOOL (WINAPI *FTCreateDirectoryA)(
__in LPCSTR lpPathName,
__in LPSECURITY_ATTRIBUTES lpSecurityAttributes
);
typedef DWORD (WINAPI *FTGetTempPathA)(
_In_ DWORD nBufferLength,
_Out_ LPSTR lpBuffer
); typedef WINADVAPI LSTATUS (APIENTRY *FTRegOpenKeyExW) (
__in HKEY hKey,
__in_opt LPCWSTR lpSubKey,
__reserved DWORD ulOptions,
__in REGSAM samDesired,
__out PHKEY phkResult
); typedef WINADVAPI
LSTATUS
(APIENTRY *FTRegQueryValueExW)(
__in HKEY hKey,
__in_opt LPCWSTR lpValueName,
__reserved LPDWORD lpReserved,
__out_opt LPDWORD lpType,
__out_bcount_part_opt(*lpcbData, *lpcbData) __out_data_source(REGISTRY) LPBYTE lpData,
__inout_opt LPDWORD lpcbData
); typedef WINADVAPI
LSTATUS
(APIENTRY *FTRegCloseKey)(
__in HKEY hKey
); typedef HRESULT (__stdcall* FTCoInitialize)(
_In_opt_ LPVOID pvReserved
); typedef HRESULT (__stdcall* FTCoCreateInstance)(
__in REFCLSID rclsid,
__in_opt LPUNKNOWN pUnkOuter,
__in DWORD dwClsContext,
__in REFIID riid,
__deref_out LPVOID FAR* ppv); typedef void (__stdcall* FTCoUninitialize)(void); typedef BOOL (__stdcall* FTPathRemoveFileSpecW)(
__inout LPWSTR pszPath
); typedef BOOL (WINAPI* FTDeleteFileW)(
_In_ LPCWSTR lpFileName
); #define START_FUNC_ARRAY() \
struct FunctionArray \
{ \
long size
#define ADD_FUN_ARRAY(_M_, _N_) \
FT ## _N_ p ## _N_
#define END_FUNC_ARRAY() \
} #define GET_MODE_PROC_ADDRESS(_M_, _F_, _T_, _V_) \
do \
{ \
_V_ = (_T_)GetProcAddress(::LoadLibraryA(_M_), _F_); \
if (_V_ == NULL) \
{ \
ErrorLog(); \
return FALSE; \
} \
} while (FALSE) #define GET_PROC_ADDRESS(__M_, __F_) \
GET_MODE_PROC_ADDRESS(__M_, #__F_, FT ## __F_, g_funArray.p ## __F_) #define CALL(_F_) \
g_funArray.p ## _F_ START_FUNC_ARRAY();
ADD_FUN_ARRAY("shell32.dll", SHGetFolderLocation);
ADD_FUN_ARRAY("shell32.dll", SHGetFolderPathW);
ADD_FUN_ARRAY("shell32.dll", SHGetPathFromIDListW);
ADD_FUN_ARRAY("shell32.dll", ILFree); ADD_FUN_ARRAY("Kernel32.dll", GetFileAttributesExW);
ADD_FUN_ARRAY("Kernel32.dll", CreateDirectoryA);
ADD_FUN_ARRAY("Kernel32.dll", GetTempPathA);
ADD_FUN_ARRAY("Kernel32.dll", DeleteFileW); ADD_FUN_ARRAY("Advapi32.dll", RegOpenKeyExW);
ADD_FUN_ARRAY("Advapi32.dll", RegQueryValueExW);
ADD_FUN_ARRAY("Advapi32.dll", RegCloseKey); ADD_FUN_ARRAY("Ole32.dll", CoInitialize);
ADD_FUN_ARRAY("Ole32.dll", CoCreateInstance);
ADD_FUN_ARRAY("Ole32.dll", CoUninitialize); ADD_FUN_ARRAY("Shlwapi.dll", PathRemoveFileSpecW);
END_FUNC_ARRAY(); FunctionArray g_funArray = {sizeof(FunctionArray)}; BOOL InitFunction()
{
GET_PROC_ADDRESS("shell32.dll" , SHGetFolderLocation);
GET_PROC_ADDRESS("shell32.dll" , SHGetFolderPathW);
GET_PROC_ADDRESS("shell32.dll" , SHGetPathFromIDListW);
GET_PROC_ADDRESS("shell32.dll" , ILFree); GET_PROC_ADDRESS("Kernel32.dll" , GetFileAttributesExW);
GET_PROC_ADDRESS("Kernel32.dll" , CreateDirectoryA);
GET_PROC_ADDRESS("Kernel32.dll" , GetTempPathA);
GET_PROC_ADDRESS("Kernel32.dll" , DeleteFileW); GET_PROC_ADDRESS("Advapi32.dll" , RegOpenKeyExW);
GET_PROC_ADDRESS("Advapi32.dll" , RegQueryValueExW);
GET_PROC_ADDRESS("Advapi32.dll" , RegCloseKey); GET_PROC_ADDRESS("Ole32.dll" , CoInitialize);
GET_PROC_ADDRESS("Ole32.dll" , CoCreateInstance);
GET_PROC_ADDRESS("Ole32.dll" , CoUninitialize); GET_PROC_ADDRESS("Shlwapi.dll" , PathRemoveFileSpecW);
return TRUE;
}

先猜猜看,猜不到的往下看

 ; __int64 Initialize(void)
?Initialize@@YAHXZ proc near ; CODE XREF: DllMain+51p
; DATA XREF: .pdata:000000018000E060o
sub rsp, 28h
lea rcx, LibFileName ; "shell32.dll"
call cs:LoadLibraryA
lea rdx, ProcName ; "SHGetFolderLocation"
mov rcx, rax ; hModule
call cs:GetProcAddress
mov cs:qword_18000CED0, rax
test rax, rax
jnz short loc_180002154 loc_18000214D: ; CODE XREF: Initialize(void)+5Bj
; Initialize(void)+84j ...
xor eax, eax
add rsp, 28h
retn
; --------------------------------------------------------------------------- loc_180002154: ; CODE XREF: Initialize(void)+2Bj
lea rcx, LibFileName ; "shell32.dll"
call cs:LoadLibraryA
lea rdx, aShgetfolderpat ; "SHGetFolderPathW"
mov rcx, rax ; hModule
call cs:GetProcAddress
mov cs:qword_18000CED8, rax
test rax, rax
jz short loc_18000214D
lea rcx, LibFileName ; "shell32.dll"
call cs:LoadLibraryA
lea rdx, aShgetpathfromi ; "SHGetPathFromIDListW"
mov rcx, rax ; hModule
call cs:GetProcAddress
mov cs:qword_18000CEE0, rax
test rax, rax
jz short loc_18000214D
lea rcx, LibFileName ; "shell32.dll"
call cs:LoadLibraryA
lea rdx, aIlfree ; "ILFree"
mov rcx, rax ; hModule
call cs:GetProcAddress
mov cs:qword_18000CEE8, rax
test rax, rax
jz loc_18000214D
lea rcx, aKernel32_dll_0 ; "Kernel32.dll"
call cs:LoadLibraryA
lea rdx, aGetfileattribu ; "GetFileAttributesExW"
mov rcx, rax ; hModule
call cs:GetProcAddress
mov cs:qword_18000CEF0, rax
test rax, rax
jz loc_18000214D
lea rcx, aKernel32_dll_0 ; "Kernel32.dll"
call cs:LoadLibraryA
lea rdx, aCreatedirector ; "CreateDirectoryA"
mov rcx, rax ; hModule
call cs:GetProcAddress
mov cs:qword_18000CEF8, rax
test rax, rax
jz loc_18000214D
lea rcx, aKernel32_dll_0 ; "Kernel32.dll"
call cs:LoadLibraryA
lea rdx, aGettemppatha ; "GetTempPathA"
mov rcx, rax ; hModule
call cs:GetProcAddress
mov cs:qword_18000CF00, rax
test rax, rax
jz loc_18000214D
lea rcx, aKernel32_dll_0 ; "Kernel32.dll"
call cs:LoadLibraryA
lea rdx, aDeletefilew ; "DeleteFileW"
mov rcx, rax ; hModule
call cs:GetProcAddress
mov cs:qword_18000CF40, rax
test rax, rax
jz loc_18000214D
lea rcx, aAdvapi32_dll ; "Advapi32.dll"
call cs:LoadLibraryA
lea rdx, aRegopenkeyexw ; "RegOpenKeyExW"
mov rcx, rax ; hModule
call cs:GetProcAddress
mov cs:qword_18000CF08, rax
test rax, rax
jz loc_18000214D
lea rcx, aAdvapi32_dll ; "Advapi32.dll"
call cs:LoadLibraryA
lea rdx, aRegqueryvaluee ; "RegQueryValueExW"
mov rcx, rax ; hModule
call cs:GetProcAddress
mov cs:qword_18000CF10, rax
test rax, rax
jz loc_18000214D
lea rcx, aAdvapi32_dll ; "Advapi32.dll"
call cs:LoadLibraryA
lea rdx, aRegclosekey ; "RegCloseKey"
mov rcx, rax ; hModule
call cs:GetProcAddress
mov cs:qword_18000CF18, rax
test rax, rax
jz loc_18000214D
lea rcx, aOle32_dll ; "Ole32.dll"
call cs:LoadLibraryA
lea rdx, aCoinitialize ; "CoInitialize"
mov rcx, rax ; hModule
call cs:GetProcAddress
mov cs:qword_18000CF20, rax
test rax, rax
jz loc_18000214D
lea rcx, aOle32_dll ; "Ole32.dll"
call cs:LoadLibraryA
lea rdx, aCocreateinstan ; "CoCreateInstance"
mov rcx, rax ; hModule
call cs:GetProcAddress
mov cs:qword_18000CF28, rax
test rax, rax
jz loc_18000214D
lea rcx, aOle32_dll ; "Ole32.dll"
call cs:LoadLibraryA
lea rdx, aCouninitialize ; "CoUninitialize"
mov rcx, rax ; hModule
call cs:GetProcAddress
mov cs:qword_18000CF30, rax
test rax, rax
jz loc_18000214D
lea rcx, aShlwapi_dll ; "Shlwapi.dll"
call cs:LoadLibraryA
lea rdx, aPathremovefile ; "PathRemoveFileSpecW"
mov rcx, rax ; hModule
call cs:GetProcAddress
xor ecx, ecx
test rax, rax
mov cs:qword_18000CF38, rax
setnz cl
mov eax, ecx
add rsp, 28h
retn
?Initialize@@YAHXZ endp ; ---------------------------------------------------------------------------

谁说编译器不SB的更多相关文章

  1. String解析

    常量池(Constant Pool):指的是在编译期被确定,并被保存在已编译的.class文件中的一些数据.JVM虚拟机为每个被装载的类型维护一个常量池.常量池就是该类型所用到常量的一个有序集和,包括 ...

  2. Java面向对象-方法的重载

    Java面向对象-方法的重载 所谓方法的重载, 类里面有两个或者多个重名的方法,但是方法的参数个数.类型.顺序至少有一个不一样,这时候局构成方法重载: 上代码: package com.java123 ...

  3. 创建String对象过程的内存分配

      转载自  https://blog.csdn.net/xiabing082/article/details/49759071       常量池(Constant Pool):指的是在编译期被确定 ...

  4. VS2005下开发PPC2003和WM50编译器一些设置

    1.vs2005开发WM5时,编译器和linker的选项配合问题 链接:http://www.mivi.name/blog/index_en.php?itemid=258 首先说ARM4 ARM4T ...

  5. 警惕Java编译器中那些“蜜糖”陷阱

    一.前言 随着Java编译器不断地向前发展,它为程序员们提供了越来越多的“蜜糖”(compiler suger),极大地方便了程序的开发,例如,foreach的增强模式,自动拆箱与装箱以及字符串的连接 ...

  6. JSP编译成Servlet(五)JDT Compiler编译器

    通过JSP编译器编译后生成了对应的java文件,接下去要把Java文件编译成class文件.对于这部分完全没有必要重新造轮子,常见的优秀编译工具有Eclipse JDT Java编译器和Ant编译器. ...

  7. .Net拾忆:CodeDom动态源代码生成器和编译器

    代码文档模型CodeDom命名空间下主要有两个,很明显第一个代码逻辑分析,第二个负责代码的编译 using System.CodeDom; using System.CodeDom.Compiler; ...

  8. gcc, g++ - GNU 工程的 C 和 C++ 编译器 (egcs-1.1.2)

    总览 (SYNOPSIS) gcc [ option | filename ]... g++ [ option | filename ]... 警告 (WARNING) 本手册页 内容 摘自 GNU ...

  9. C# 编译器 和 反编译器,你要哪个(歪头)? 我全都要(捏拳)!

    前言 从 C# 6.0 开始,C# 编译器就从以前由 C++ 实现的 csc.exe 换成了用 C# 重新实现的开放式 API 式编译服务 Roslyn.这个编译器到现在已经替代了老式编译器,从前 W ...

随机推荐

  1. 最新版本IntelliJ IDEA 2019.3 (Ultimate Edition) 激活及汉化

    附:官网idea下载地址 以下有两种破解方式,推荐方式二: =============================破解方式1==================================== ...

  2. 41-python基础-python3-字符串-转义字符

    转义字符包含一个倒斜杠(\),紧跟着是想要添加到字符串中的字符.(尽管它包含两个字符,但大家公认它是一个转义字符.) 实例1: Python 知道,因为 Bob\'s 中的单引号有一个倒斜杠,所以它不 ...

  3. 我爱Linux

    这道题卡了好久,题是一张图片,打开看到看提示以为是用哪个Linux命令处理,直到后来知道后面是python序列化文件的数据,将FF D9后保存出来,将序列化文件读出来写脚本把它画出来 import p ...

  4. JavaScript_DOM(文件对象模型)

    DOM(文档对象模型)是针对 HTML 和 XML 文档的一个 API(应用程序编程接口). DOM 描绘了一个层次化的节点树,允许开发人员添加.移除和修改页面的某一部分. DOM1 级将 HTML ...

  5. ionic3 emoj表情包插件 emoji-picker

    1.效果演示: 2.安装扩展包依赖 npm i @ionic-tools/emoji-picker --save 3.app.module.ts中导入插件 import { EmojiPickerMo ...

  6. myeclipse中出现The method xxx of type must override or implement a supertype

    出现问题提示:The method xxx of type must override or implement a supertype? annotation:@Override的原因 查阅了一下资 ...

  7. webpack配置(使用react,es6的项目)

    const path = require('path');const webpack = require('webpack');const HtmlWebpackPlugin = require('h ...

  8. js获取url参数值的几种方式

    一.原生js获取URL参数值: 比如当前URL为:http://localhost:8080/#/page2?id=100&name=guanxy <template> <d ...

  9. java中文乱码转换

    String str=URLDecoder.decode(String, "UTF-8")

  10. php操作redis--集合(set)篇

    常用函数:sAdd,sMembers,sPop,sUnion等 应用场景:与list类型类似,是一个列表的功能,不同的是set可以自动排重,提供了一个判断某一个成员是否存在一个set集合内的重要接口. ...