Function at 0x405100
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x120
mov eax, dword [0x4012d4]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push esi
mov esi, dword [ebp + 0xc]
push edi
mov edi, dword [ebp + 0x10]
push 0x4013b4
push eax
call sub.api_ms_win_crt_stdio_l1_1_0.dll_fopen
add esp, 8
mov dword [ebp - 0x11c], eax
test eax, eax
je 0x4054e4
push eax
push 0x36
lea eax, [ebp - 0x104]
push 1
push eax
call sub.api_ms_win_crt_stdio_l1_1_0.dll_fread
add esp, 0x10
cmp eax, 0x36
jne 0x4054da
cmp byte [ebp - 0x104], 0x42
jne 0x4054da
cmp byte [ebp - 0x103], 0x4d
jne 0x4054da
cmp byte [ebp - 0xe8], 0x18
jne 0x4054da
movzx edx, byte [ebp - 0xf1]
mov ebx, pe_nt_image_headers32
movzx ecx, byte [ebp - 0xed]
movzx eax, byte [ebp - 0xf2]
imul edx, ebx
imul ecx, ebx
add dx, ax
movzx eax, byte [ebp - 0xee]
add cx, ax
mov word [0x40a522], dx
mov word [0x40a520], cx
mov word [esi], dx
movzx eax, word [0x40a520]
mov word [edi], ax
mov ax, word [0x40a522]
test al, 7
je 0x4051db
shr ax, 3
inc ax
shl ax, 3
movzx ebx, ax
mov ax, word [0x40a520]
mov dword [ebp - 0x110], ebx
test al, 7
je 0x4051f8
shr ax, 3
inc ax
shl ax, 3
movzx eax, ax
mov dword [ebp - 0x118], eax
movzx eax, ax
movzx edi, bx
imul eax, edi
mov dword [ebp - 0x114], edi
lea eax, [eax + eax*2]
push eax
call sub.api_ms_win_crt_heap_l1_1_0.dll_malloc
mov edx, eax
add esp, 4
mov dword [0x40a524], edx
test edx, edx
je 0x4054ee
mov ax, word [0x40a522]
movzx ecx, ax
and ecx, 3
mov dword [ebp - 0x108], ecx
je 0x40524a
mov cl, 4
sub cl, byte [ebp - 0x108]
jmp 0x40524c
xor cl, cl
xor edi, edi
xor esi, esi
cmp di, word [0x40a520]
mov edi, dword [ebp - 0x114]
jae 0x405339
movzx ecx, cl
mov dword [ebp - 0x108], ecx
nop dword [eax]
movzx ebx, si
imul ebx, edi
mov edi, dword [ebp - 0x11c]
movzx eax, ax
push edi
mov dword [ebp - 0x120], ebx
lea eax, [eax + eax*2]
push eax
lea eax, [edx + ebx*2]
add eax, ebx
push 1
push eax
call sub.api_ms_win_crt_stdio_l1_1_0.dll_fread
push edi
push dword [ebp - 0x108]
lea eax, [ebp - 0x104]
push 1
push eax
call sub.api_ms_win_crt_stdio_l1_1_0.dll_fread
movzx ecx, word [0x40a522]
add esp, 0x20
mov edx, dword [0x40a524]
add ecx, ebx
lea eax, [edx + ecx*2]
mov di, word [ecx + eax - 3]
mov bl, byte [ecx + eax - 1]
mov ax, word [0x40a522]
movzx ecx, ax
mov dword [ebp - 0x10c], ecx
mov ecx, dword [ebp - 0x110]
cmp word [ebp - 0x10c], cx
jae 0x40531f
mov eax, dword [ebp - 0x10c]
movzx eax, ax
add eax, dword [ebp - 0x120]
sub ecx, dword [ebp - 0x10c]
movzx ecx, cx
lea eax, [eax + eax*2]
mov word [eax + edx], di
lea eax, [eax + 3]
mov byte [eax + edx - 1], bl
mov edx, dword [0x40a524]
sub ecx, 1
jne 0x405303
mov ax, word [0x40a522]
mov edi, dword [ebp - 0x114]
inc esi
cmp si, word [0x40a520]
jb 0x405270
mov ebx, dword [ebp - 0x110]
lea eax, [ebx + ebx*2]
mov word [0x40a522], bx
movzx ebx, ax
push ebx
mov dword [ebp - 0x10c], ebx
call sub.api_ms_win_crt_heap_l1_1_0.dll_malloc
mov edi, eax
add esp, 4
mov dword [ebp - 0x114], edi
test edi, edi
je 0x4054f8
mov si, word [0x40a520]
mov dword [ebp - 0x110], 0
lea eax, [esi - 1]
movzx ecx, ax
mov dword [ebp - 0x108], ecx
test cx, cx
je 0x40543b
nop dword [eax + eax]
movzx eax, word [0x40a522]
mov esi, dword [0x40a524]
movzx ecx, cx
imul ecx, eax
push ebx
lea edi, [esi + ecx*2]
add edi, ecx
push edi
push dword [ebp - 0x114]
call sub.VCRUNTIME140.dll_memcpy
mov eax, dword [ebp - 0x110]
push dword [ebp - 0x10c]
movzx ebx, ax
movzx eax, word [0x40a522]
mov ecx, ebx
imul ecx, eax
lea eax, [esi + ecx*2]
add eax, ecx
push eax
push edi
call sub.VCRUNTIME140.dll_memcpy
movzx ecx, word [0x40a522]
mov eax, dword [0x40a524]
push dword [ebp - 0x10c]
mov edi, dword [ebp - 0x114]
imul ecx, ebx
push edi
lea eax, [eax + ecx*2]
add eax, ecx
push eax
call sub.VCRUNTIME140.dll_memcpy
mov ecx, dword [ebp - 0x108]
add esp, 0x24
mov eax, dword [ebp - 0x110]
add ecx, 0xffff
mov ebx, dword [ebp - 0x10c]
inc eax
mov dword [ebp - 0x108], ecx
mov dword [ebp - 0x110], eax
cmp cx, ax
ja 0x405390
mov si, word [0x40a520]
movzx eax, si
dec eax
push ebx
lea ecx, [eax + eax*2]
movzx eax, word [0x40a522]
imul ecx, eax
add ecx, dword [0x40a524]
push ecx
push edi
call sub.VCRUNTIME140.dll_memcpy
mov eax, dword [ebp - 0x118]
add esp, 0xc
movzx ecx, si
cmp cx, ax
jae 0x4054af
sub eax, ecx
mov esi, ecx
movzx eax, ax
mov dword [ebp - 0x108], eax
nop dword [eax + eax]
movzx ecx, word [0x40a522]
mov eax, dword [0x40a524]
imul ecx, esi
push ebx
push edi
lea eax, [eax + ecx*2]
add eax, ecx
push eax
call sub.VCRUNTIME140.dll_memcpy
add esp, 0xc
inc esi
sub dword [ebp - 0x108], 1
jne 0x405480
mov eax, dword [ebp - 0x118]
push edi
mov word [0x40a520], ax
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
push dword [ebp - 0x11c]
call sub.api_ms_win_crt_stdio_l1_1_0.dll_fclose
mov ecx, dword [ebp - 4]
add esp, 8
xor ecx, ebp
pop edi
pop esi
pop ebx
call fcn.00406597
mov esp, ebp
pop ebp
ret
push 0x4013e4
call fcn.00404940
push 0x4013b8
call fcn.00404940
push 0x401404
call fcn.00404940
push 0x4013a0
call fcn.00404940
int3