Function at 0x40f535
Capabilities:
Read file via mapping

Disassembly:
mov eax, 0x41e40c
call fcn.0041c860
sub esp, 0x58
push ebx
push esi
push edi
xor ebx, ebx
mov dword [ebp - 0x10], esp
mov edi, edx
mov dword [ebp - 0x20], ecx
push ebx
push 0x3a
mov ecx, edi
call fcn.004102fc
mov esi, eax
cmp esi, ebx
jge 0x40f564
call fcn.0040e754
lea eax, [ebp - 0x64]
push esi
push eax
mov ecx, edi
call fcn.004076fc
inc esi
lea eax, [ebp - 0x40]
push esi
push eax
mov ecx, edi
mov dword [ebp - 4], ebx
call fcn.0040762c
push ebx
push 0x3a
lea ecx, [ebp - 0x40]
mov byte [ebp - 4], 1
call fcn.004102fc
mov esi, eax
cmp esi, ebx
jge 0x40f59a
call fcn.0040e754
lea eax, [ebp - 0x58]
push esi
push eax
lea ecx, [ebp - 0x40]
call fcn.004076fc
inc esi
lea eax, [ebp - 0x4c]
push esi
push eax
lea ecx, [ebp - 0x40]
mov byte [ebp - 4], 2
call fcn.0040762c
mov ecx, dword [ebp - 0x58]
xor edx, edx
mov byte [ebp - 4], 3
call fcn.004084c9
mov esi, eax
mov dword [ebp - 0x24], edx
mov dword [ebp - 0x18], ebx
lea edx, [ebp - 0x64]
lea ecx, [ebp - 0x34]
mov byte [ebp - 4], 4
call fcn.0040c74a
push dword [eax]
push ebx
push 4
call dword [sym.imp.KERNEL32.dll_OpenFileMappingA]
cmp eax, ebx
mov dword [ebp - 0x18], eax
je 0x40f5f4
xor eax, eax
jmp 0x40f5fa
call dword [sym.imp.KERNEL32.dll_GetLastError]
push dword [ebp - 0x34]
cmp eax, ebx
setne byte [ebp - 0x11]
call fcn.00407d58
cmp byte [ebp - 0x11], bl
pop ecx
je 0x40f618
mov ecx, str.Can_not_open_mapping
call fcn.0040e75f
push esi
push ebx
push ebx
push 4
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov edi, eax
cmp edi, ebx
mov dword [ebp - 0x24], edi
jne 0x40f639
mov ecx, str.MapViewOfFile_error
call fcn.0040e75f
cmp word [edi], bx
mov byte [ebp - 4], 5
je 0x40f64c
mov ecx, str.Incorrect_mapping_data
call fcn.0040e75f
shr esi, 1
push 3
lea ecx, [ebp - 0x34]
mov dword [ebp - 0x1c], esi
mov dword [ebp - 0x34], ebx
mov dword [ebp - 0x30], ebx
mov dword [ebp - 0x2c], ebx
call fcn.00401615
push 1
mov byte [ebp - 4], 6
pop esi
cmp esi, dword [ebp - 0x1c]
jae 0x40f6a1
mov ax, word [edi + esi*2]
cmp ax, bx
jne 0x40f695
push dword [ebp + 0xc]
mov ecx, dword [ebp - 0x20]
lea edx, [ebp - 0x34]
push dword [ebp + 8]
call fcn.0040f220
mov eax, dword [ebp - 0x34]
mov dword [ebp - 0x30], ebx
mov word [eax], bx
jmp 0x40f69e
push eax
lea ecx, [ebp - 0x34]
call fcn.004056a5
inc esi
jmp 0x40f66b
cmp dword [ebp - 0x30], ebx
je 0x40f6b0
mov ecx, str.data_error
call fcn.0040e75f
push dword [ebp - 0x34]
call fcn.00407d58
pop ecx
mov dword [ebp - 4], 4
push edi
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
cmp dword [ebp - 0x18], ebx
je 0x40f6d5
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp + 0xc], ebx
lea edx, [ebp - 0x4c]
lea ecx, [ebp - 0x34]
mov byte [ebp - 4], 8
call fcn.0040c74a
push dword [eax]
push ebx
push 2
call dword [sym.imp.KERNEL32.dll_OpenEventA]
cmp eax, ebx
mov dword [ebp + 0xc], eax
je 0x40f6fd
xor esi, esi
jmp 0x40f705
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
push dword [ebp - 0x34]
call fcn.00407d58
cmp esi, ebx
pop ecx
jne 0x40f71a
lea ecx, [ebp + 0xc]
call fcn.0041c6d0
lea ecx, [ebp + 0xc]
call fcn.0041c660
push dword [ebp - 0x4c]
call fcn.00407d58
push dword [ebp - 0x58]
call fcn.00407d58
push dword [ebp - 0x40]
call fcn.00407d58
push dword [ebp - 0x64]
call fcn.00407d58
mov ecx, dword [ebp - 0xc]
add esp, 0x10
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
leave
ret 8