首页
社区
课程
招聘
[分享]如何在Vs2019 x64开发环境中使用汇编
2022-1-19 10:55 8663

[分享]如何在Vs2019 x64开发环境中使用汇编

2022-1-19 10:55
8663

前言:

众所周知,微软在Vs中只支持x86汇编,不支持x64汇编,具体原因?x64不需要汇编!

嘶,好像也挺合理的,但我们真的不会在x64中使用汇编吗?答案显然是否定的。

应用场景一般是:

今天Pu某免费了,兴冲冲的开发了一款优秀的作弊软件(千万不要模仿),起名绝影(太俗了吧)。正要加个验证上架,哎我擦,【一键加验证不支持非易语言程序】【一键加验证不支持x64程序】,顿时慌了神,想到多年前放弃这世界上最好的语言(当然是易语言),有几分懊悔。但总得自力更生吧,对接APi接口,加个VMP壳不就完了吗~想法很美好,问题来了:

开始:怎么置入VMP标志?

于是你兴冲冲的在网上翻到了:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
插入代码
```#define VMP_BEGINV \
_asm _emit 0xEB \
_asm _emit 0x10 \
_asm _emit 0x56 \
_asm _emit 0x4D \
_asm _emit 0x50 \
_asm _emit 0x72 \
_asm _emit 0x6F \
_asm _emit 0x74 \
_asm _emit 0x65 \
_asm _emit 0x63 \
_asm _emit 0x74 \
_asm _emit 0x20 \
_asm _emit 0x62 \
_asm _emit 0x65 \
_asm _emit 0x67 \
_asm _emit 0x69 \
_asm _emit 0x6E \
_asm _emit 0x01
 
#define VMP_BEGINM \
_asm _emit 0xEB \
_asm _emit 0x10 \
_asm _emit 0x56 \
_asm _emit 0x4D \
_asm _emit 0x50 \
_asm _emit 0x72 \
_asm _emit 0x6F \
_asm _emit 0x74 \
_asm _emit 0x65 \
_asm _emit 0x63 \
_asm _emit 0x74 \
_asm _emit 0x20 \
_asm _emit 0x62 \
_asm _emit 0x65 \
_asm _emit 0x67 \
_asm _emit 0x69 \
_asm _emit 0x6E \
_asm _emit 0x02
 
 
#define VMP_BEGINU \
_asm _emit 0xEB \
_asm _emit 0x10 \
_asm _emit 0x56 \
_asm _emit 0x4D \
_asm _emit 0x50 \
_asm _emit 0x72 \
_asm _emit 0x6F \
_asm _emit 0x74 \
_asm _emit 0x65 \
_asm _emit 0x63 \
_asm _emit 0x74 \
_asm _emit 0x20 \
_asm _emit 0x62 \
_asm _emit 0x65 \
_asm _emit 0x67 \
_asm _emit 0x69 \
_asm _emit 0x6E \
_asm _emit 0x03
 
#define VMP_BEGIN \
_asm _emit 0xEB \
_asm _emit 0x10 \
_asm _emit 0x56 \
_asm _emit 0x4D \
_asm _emit 0x50 \
_asm _emit 0x72 \
_asm _emit 0x6F \
_asm _emit 0x74 \
_asm _emit 0x65 \
_asm _emit 0x63 \
_asm _emit 0x74 \
_asm _emit 0x20 \
_asm _emit 0x62 \
_asm _emit 0x65 \
_asm _emit 0x67 \
_asm _emit 0x69 \
_asm _emit 0x6E \
_asm _emit 0x00
 
#define VMP_END \
_asm _emit 0xEB \
_asm _emit 0x0E \
_asm _emit 0x56 \
_asm _emit 0x4D \
_asm _emit 0x50 \
_asm _emit 0x72 \
_asm _emit 0x6F \
_asm _emit 0x74 \
_asm _emit 0x65 \
_asm _emit 0x63 \
_asm _emit 0x74 \
_asm _emit 0x20 \
_asm _emit 0x65 \
_asm _emit 0x6E \
_asm _emit 0x64 \
_asm _emit 0x00

按照江湖规矩,放在函数首尾:

x64大大滴报错
换到x86,编译通过

尴尬的能扣个三室一厅,我用c++不是为了追求x64吗?x86的话为啥不用国民语言【易语言】(c++更是信仰),你开始寻找解决办法:

进一步:了解并使用LLVM-clang平台工具集

两种解决办法:1.换编译器 2.换平台工具集(换个支持x64汇编的)

在网站一搜索,很容易找到:LLVM,但下载方法很恶心,动手能力不行的就已经放弃了(像我,Qt静态库都不会安装)

于是探索出了新的方法:

1.打开Visual Studio Installer

选择修改,然后点击单个组件

搜索,出来的两个结果都要下载

下载后回到项目,修改项目属性---->配置属性---->常规---->平台工具集

选择刚刚下载好的LLVM-clang,编译

编译成功,放到VMP里看看能识别吗?

说明全部搞定啦~

后语:

Clang有一定缺陷,比如使用中文字符串明文会划红线(不影响使用),汇编部分一点点不支持,但满足了我们x64置入VMP标志的需求,还是很好用的,有一点必须要提,报错是英文~建议最后再加标志换工具集哦

看雪新人,多多指教~


[CTF入门培训]顶尖高校博士及硕士团队亲授《30小时教你玩转CTF》,视频+靶场+题目!助力进入CTF世界

收藏
点赞2
打赏
分享
最新回复 (4)
雪    币: 660
活跃值: (136)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
Axinger 2022-1-19 11:17
2
0
666学到了
雪    币: 5069
活跃值: (4374)
能力值: ( LV5,RANK:65 )
在线值:
发帖
回帖
粉丝
gamehack 2022-1-20 01:02
3
0
虽然不用VS,但是也先收藏了!
雪    币: 345
能力值: ( LV1,RANK:0 )
在线值:
发帖
回帖
粉丝
AlphaYang 2022-1-20 01:08
4
0
cout输出的字符串不会影响,但是printf好像会有一点点影响哦
雪    币: 1174
活跃值: (1172)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
cmputer 2022-1-20 16:18
5
0
楼主诚不欺我
游客
登录 | 注册 方可回帖
返回