首页
社区
课程
招聘
[求助]smc加密
2022-5-10 21:58 3499

[求助]smc加密

2022-5-10 21:58
3499

节表数的输出一直是零,不知道为什么

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
#include<iostream>
#include<tchar.h>
#include<windows.h>
#include <iostream>
using namespace std;
 
 
#pragma code_seg(".SMC");
 
void smc()
{
    for (int i = 0; i < 10; i++)
    {
        cout << i;
    }
 
}
#pragma code_seg()
#pragma comment(linker,"/section:.SMC,ERW")
 
 
int main()
{
    const char* section_name = ".SMC";
    int section_number;
    LPVOID pmoudle = GetModuleHandle(0);
    PIMAGE_DOS_HEADER pdosheader = (PIMAGE_DOS_HEADER)pmoudle;
    PIMAGE_NT_HEADERS32 pntheader = (PIMAGE_NT_HEADERS32)(pdosheader + pdosheader->e_lfanew);
    section_number = pntheader->FileHeader.NumberOfSections;
    PIMAGE_SECTION_HEADER section_header = (PIMAGE_SECTION_HEADER)(sizeof(IMAGE_NT_HEADERS) + pdosheader->e_lfanew);
    //节表起始位置
    //printf("name:%s", section_header->Name);
    /*
        for (int i; i < section_number; i++)
        {
            if (strcmp((char*)section_header->Name, section_name) == 0)
            {
                int sectioner_size;
                char* sectioner_address;
                sectioner_size = section_header->SizeOfRawData;
                sectioner_address = (char*)section_header->VirtualAddress;
                for (int j = 0; j < sectioner_size; j++)
                {
                    *(sectioner_address + i) = *(sectioner_address + i) ^ 2;
                }
 
 
            }
        }*/
}

阿里云助力开发者!2核2G 3M带宽不限流量!6.18限时价,开 发者可享99元/年,续费同价!

收藏
点赞0
打赏
分享
最新回复 (0)
游客
登录 | 注册 方可回帖
返回