Function at 0x40d137
Capabilities:
Enumerate pe sections
Get file size
Read file on windows
Write file on windows

Disassembly:
sub esp, 0x18
push ebx
push ebp
push esi
push edi
mov edi, ecx
push 1
call fcn.005e203f
xor esi, esi
lea ecx, [edi + 0x5c]
push esi
push 0x20
push 3
push esi
push 1
push 0xc0000000
push esi
call fcn.005e3b80
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
push esi
mov dword [esp + 0x1c], eax
push esi
jne 0x40d182
push str.CreateFile
mov ecx, edi
call fcn.005e13c8
jmp 0x40d295
push esi
push 4
push esi
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileMappingA]
mov ebx, eax
push esi
cmp ebx, esi
mov dword [esp + 0x28], ebx
push esi
jne 0x40d1ac
push str.CreateFileMapping
mov ecx, edi
call fcn.005e13c8
xor bl, bl
jmp 0x40d31e
push esi
push 0xf001f
push ebx
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
cmp eax, esi
mov dword [esp + 0x20], eax
jne 0x40d1d8
push esi
push esi
push 0x69de1c
mov ecx, edi
call fcn.005e13c8
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40d1a5
mov esi, dword [eax + 0x3c]
push 6
add esi, eax
push str..code
movzx eax, word [esi + 6]
mov ebx, dword [esi + 0x3c]
lea eax, [eax + eax*4]
lea ebp, [esi + eax*8 + 0xd0]
mov eax, dword [esi + 0x38]
mov dword [esp + 0x24], eax
lea edi, [ebp + 0x28]
push edi
call fcn.00473fd0
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp + 8]
add eax, ecx
mov ecx, dword [esp + 0x28]
xor edx, edx
mov dword [esp + 0x1c], eax
div ecx
mov eax, dword [esp + 0x1c]
add esp, 0xc
test edx, edx
je 0x40d22c
xor edx, edx
div ecx
inc eax
imul eax, ecx
mov dword [edi + 0xc], eax
mov dword [edi + 8], ecx
mov eax, dword [ebp + 0x14]
mov edx, dword [ebp + 0x10]
lea ebp, [eax + edx]
xor edx, edx
mov eax, ebp
div ebx
test edx, edx
je 0x40d254
mov eax, ebp
xor edx, edx
div ebx
inc eax
imul eax, ebx
mov dword [edi + 0x14], eax
jmp 0x40d257
mov dword [edi + 0x14], ebp
mov eax, dword [edi + 0xc]
push dword [esp + 0x20]
mov ebp, dword [edi + 0x14]
add eax, ecx
mov dword [edi + 0x10], ebx
mov dword [edi + 0x24], 0x60000020
inc word [esi + 6]
mov dword [esi + 0x50], eax
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
push dword [esp + 0x24]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [esp + 0x18]
push 0
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
cmp eax, ebp
jge 0x40d29c
xor al, al
jmp 0x40d32a
mov edi, eax
sub edi, ebp
push edi
call fcn.0047447d
pop ecx
mov dword [esp + 0x10], eax
push 0
push 0
push ebp
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
lea eax, [esp + 0x14]
push 0
push eax
push edi
push dword [esp + 0x1c]
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
push 0
push 0
push ebp
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push ebx
call fcn.0047447d
mov ebp, eax
push ebx
push 0
push ebp
call fcn.00473f70
add esp, 0x10
lea eax, [esp + 0x14]
push 0
push eax
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_WriteFile]
push ebp
push esi
call ebx
lea eax, [esp + 0x14]
push 0
push eax
push edi
push dword [esp + 0x1c]
push esi
call ebx
push ebp
call fcn.00474394
push dword [esp + 0x14]
call fcn.00474394
pop ecx
mov bl, 1
pop ecx
push dword [esp + 0x18]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov al, bl
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret