首页 > Windows开发 > 详细

x64内联汇编调用API(需intel编译器,vc不支持x64内联汇编)

时间:2017-01-23 22:45:35      阅读:414      评论:0      收藏:0      [点我收藏+]
[cpp] view plain copy
 
 技术分享技术分享
  1. #include "stdafx.h"  
  2. #include <windows.h>  
  3.   
  4. STARTUPINFOW StartInfo  = {0};  
  5. PROCESS_INFORMATION pi = {0};  
  6. TCHAR szCommandLine[MAX_PATH] = TEXT("C:\\Windows\\NOTEPAD.EXE D:\\parallel_studio_xe_2013_update4_for_windows.txt");  
  7.   
  8. int _tmain(int argc, _TCHAR* argv[])  
  9. {  
  10.     StartInfo .cb = sizeof(StartInfo);  
  11.   
  12.     __asm  
  13.     {  
  14.         sub rsp, 80  
  15.         lea rax, pi  
  16.         mov qword ptr [rsp+72], rax  
  17.         lea rax, StartInfo  
  18.         mov qword ptr [rsp+64], rax  
  19.         mov qword ptr [rsp+56], 0  
  20.         mov qword ptr [rsp+48], 0  
  21.         mov qword ptr [rsp+40], 0  
  22.         mov qword ptr [rsp+32], 0  
  23.         xor r9, r9  
  24.         xor r8, r8  
  25.         lea rax, szCommandLine  
  26.         mov rdx, rax  
  27.         xor rcx, rcx  
  28.         mov  rsi, qword ptr CreateProcessW  
  29.         call rsi  
  30.         add rsp, 80  
  31.     }  
  32.     //CreateProcess(0, szCommandLine, NULL, NULL, FALSE, 0, NULL, NULL, &StartInfo, &pi);  
  33.     return 0;  

 

http://blog.csdn.net/zwfgdlc/article/details/17467453

x64内联汇编调用API(需intel编译器,vc不支持x64内联汇编)

原文:http://www.cnblogs.com/findumars/p/6345023.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!