|
|
|
[求助](问题已经解决)PE文件头(顺便申请邀请码)(邀请码已经发放)
我觉得图形化的东西没有必要粘上来了吧,因为如果只是看图形化的东西没有用的,我里面用的label都是和图形文件中的基本一致的,所以我认为如果有兴趣的话大家可以网上搜一下!如果哪里还是不太明白可以跟帖讨论! 我把问题已经解决了,主要是在内存寻址上。 [BITS 32] Dos_Header: .e_magic dw 'MZ' .e_cblp dw 0 .e_cp dw 0 .e_crlc dw 0 .e_cparhdr dw 0 .e_minalloc dw 0 .e_maxalloc dw 0 .e_ss dw 0 .e_sp dw 0 .e_csum dw 0 .e_ip dw 0 .e_cs dw 0 .e_lfarlc dw 0 .e_ovno dw 0 .e_res dw 0,0,0,0 .e_oemid dw 0 .e_oeminfo dw 0 .e_res2 dw 0,0,0,0,0,0,0,0,0,0 .e_lfanew dd PE_Header PE_Header: .Signature dd 'PE' FileHeader: .Machine dw 0x14c .NumberOfSection dw 1 .TimeDataStamp dd 0 .PointerToSymbolTable dd 0 .NumberOfSymbols dd 0 .SizeOfOptionalHeader dw 0xe0 .Characteristics dw 0x10f .Magic dw 0x10b .MajorLinkerVersion db 0 .MinorLinkerVersion db 0 .SizeOfCode dd 0 .SizeOfInitializedData dd 0 .SizeOfUninitializedData dd 0 .AddressOfEntryPoint dd 0x1000-0x200+code .BaseOfCode dd 0 .BaseOfData dd 0 .ImageBase dd 0x400000 .SectionAlignment dd 0x1000 .FileAlignment dd 0x200 .MajorOperatingSystemVersion dw 0 .MinorOperatingSystemVersion dw 0 .MajorImageVersion dw 0 .MinorImageVersion dw 0 .MajorSubsystemVersion dw 4 .MinorSubsystemVersion dw 0 .Win32VersionValue dd 0 .SizeOfImage dd 0x2000 .SizeOfHeaders dd start .CheckSum dd 0 .Subsystem dw 2 .DllCharacteristics dw 0 .SizeOfStackReserve dd 0x100000 .SizeOfStackCommit dd 0x1000 .SizeOfHeapReserve dd 0x100000 .SizeOfHeapCommit dd 0x1000 .LoaderFlags dd 0 .NumberOfRvaAndSizes dd 0x10 Export: .VirtualAddress dd 0 .isize dd 0 Import: .VirtualAddress dd 0 .isize dd 0 Resource: .VirtualAddress dd 0 .isize dd 0 Exception: .VirtualAddress dd 0 .isize dd 0 Security: .VirtualAddress dd 0 .isize dd 0 BaseReloc: .VirtualAddress dd 0 .isize dd 0 Debug: .VirtualAddress dd 0 .isize dd 0 Architecture: .VirtualAddress dd 0 .isize dd 0 GlobalPtr: .VirtualAddress dd 0 .isize dd 0 Tls: .VirtualAddress dd 0 .isize dd 0 Load_Config: .VirtualAddress dd 0 .isize dd 0 Bound_Import: .VirtualAddress dd 0 .isize dd 0 Iat: .VirtualAddress dd 0 .isize dd 0 Delay_Import: .VirtualAddress dd 0 .isize dd 0 Com_Descriptor: .VirtualAddress dd 0 .isize dd 0 No_Use: .VirtualAddress dd 0 .isize dd 0 sections: .SectionName db '大屌男人' .VirtualSize dd 0x1000 .VirtualAddress dd 0x1000 .SizeOfRawData dd 0x200 .PointerToRawData dd 0x200 .PointerToRelocations dd 0 .PointerToLineNumbers dd 0 .NumberOfRelocations dw 0 .NumberOfLineNumbers dw 0 .Characteristics dd 0xe00000e0 align 0x200,db 0 start: kernel32_Address resd 1;0x401000 user32_Address resd 1;0x401004 GetProcAddress_Address resd 1;0x401008 ExitProcess_Address resd 1;0x40100c MessageBoxA_Address resd 1;0x401010 LoadLibraryA_Address resd 1;0x401014 Title db 'Hello',0;0x401018 Content db 'Hello World!',0;0x40101e GetProcAddress db 'GetProcAddress',0;0x40102b ExitProcess db 'ExitProcess',0;0x40103a LoadLibraryA db 'LoadLibraryA',0;0x401046 user32 db 'user32.dll',0;0x401053 MessageBoxA db 'MessageBoxA',0;0x40105e code: mov eax,[fs:0x30] mov eax,[eax+0xc] mov eax,[eax+0x1c] mov eax,[eax] mov eax,[eax+0x8];eax里面是kernel32的基地址 mov [0x401000],eax mov ebx,[eax+0x3c];ebx中是PE头的相对地址 mov ebx,[ebx+eax+0x78] add ebx,eax;引出表地址 mov ecx,[ebx+0x20] add ecx,eax xor edx,edx push edx CompareNext: pop edx inc edx mov edi,[ecx] add edi,eax add ecx,4 push edx mov esi,0x40102b CompareName: mov dl,[edi] mov dh,[esi] cmp dl,dh jne CompareNext inc edi inc esi cmp byte [esi],0 je GetAddress jmp CompareName GetAddress: pop edx dec edx shl edx,1 mov ecx,[ebx+0x24] add ecx,eax add ecx,edx xor edx,edx mov dx,[ecx] shl edx,2 mov ecx,[ebx+0x1c] add ecx,eax add ecx,edx add eax,[ecx];eax里面就是getprocaddress mov [0x401008],eax push 0x40103a push dword [0x401000] call eax mov [0x40100c],eax push 0x401046 push dword [0x401000] call dword [0x401008] mov [0x401014],eax push 0x401053 call eax mov [0x401004],eax push 0x40105e push eax call dword [0x401008] mov [0x401010],eax push 0 push 0x401018 push 0x40101e push 0 call eax push 0 call dword [0x40100c] align 0x200,db 0 end: |
|
[求助](问题已经解决)PE文件头(顺便申请邀请码)(邀请码已经发放)
为什么没有人理呢? |
|
[分享]动态获得API地址(申请邀请码)(邀请码已经发放)
不知道这样能不能,得到邀请码! |
|
PE结构代码[申请邀请码]
楼上的写的不错,不过如果楼上看了罗老师的win32位下的汇编的话,可能发现这个东西早就有了! |
|
[求助]罗云彬 WIN32汇编的编程环境怎么搭建
你MASM32的安装路径应该尽量往前排,以前我也有过这样的问题,因为安装了VC6。0以后系统里改了路径,后来把MASM32的路径放在了最前面就没有什么问题了!另外,还有就是用户路径和系统路径的优先问题,你看看哪里出问题了! 我现在用的是NASM还比较方便,用的是LINK做的链接器! |
|
[分享]动态获得API地址(申请邀请码)(邀请码已经发放)
声明,本人和QQ845181413是一个人,代码系个人原创! |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值