Function at 0x402035
Capabilities:
Read file via mapping
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
and byte [ebp - 2], 0
and byte [ebp - 1], 0
push ebx
xor ebx, ebx
cmp dword [ebp + 0xc], ebx
push esi
push edi
je 0x4022e8
cmp dword [ebp + 8], ebx
je 0x4022e8
cmp dword [ebp + 0x10], 2
jb 0x4022e8
push dword [ebp + 8]
call fcn.00405d3f
test al, al
pop ecx
je 0x4022e8
push ebx
push 0x80
push 3
push ebx
push 1
push 0x80000000
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [ebp - 0x1c], eax
je 0x4022da
cmp eax, ebx
je 0x4022e8
push ebx
push ebx
push ebx
push 2
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileMappingA]
cmp eax, 0xffffffff
mov dword [ebp - 0x18], eax
je 0x4022cc
cmp eax, ebx
je 0x4022da
push ebx
push ebx
push ebx
push 4
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov edi, eax
cmp edi, 0xffffffff
je 0x4022c1
cmp edi, ebx
je 0x4022cc
push 0x40
push edi
call dword [sym.imp.KERNEL32.dll_IsBadReadPtr]
test eax, eax
jne 0x4022c1
cmp word [edi], 0x5a4d
jne 0x4022c1
mov esi, dword [edi + 0x3c]
push 0xf8
add esi, edi
push esi
call dword [sym.imp.KERNEL32.dll_IsBadReadPtr]
test eax, eax
jne 0x4022c1
mov ax, word [esi + 4]
cmp ax, 0x8664
jne 0x402159
mov esi, dword [edi + 0x3c]
push 0x108
add esi, edi
mov byte [ebp - 1], 1
push esi
call dword [sym.imp.KERNEL32.dll_IsBadReadPtr]
test eax, eax
jne 0x4022c1
mov esi, dword [esi + 0x88]
cmp esi, ebx
je 0x4022c1
push ebx
push esi
push edi
call fcn.00401fa9
add esp, 0xc
jmp 0x402177
cmp ax, 0x14c
jne 0x4022c1
mov esi, dword [esi + 0x78]
cmp esi, ebx
je 0x4022c1
push esi
push edi
call fcn.00401f63
pop ecx
pop ecx
lea esi, [eax + edi]
cmp esi, ebx
je 0x4022c1
push 0x28
push esi
call dword [sym.imp.KERNEL32.dll_IsBadReadPtr]
test eax, eax
jne 0x4022c1
cmp byte [ebp - 1], al
je 0x4021b1
push ebx
push dword [esi + 0xc]
push edi
call fcn.00401fa9
push ebx
push dword [esi + 0x20]
push edi
call fcn.00401fa9
add esp, 0x18
jmp 0x4021c6
push dword [esi + 0xc]
push edi
call fcn.00401f63
push dword [esi + 0x20]
push edi
call fcn.00401f63
add esp, 0x10
push dword [esi + 0x24]
add eax, edi
mov dword [ebp - 0x20], eax
push edi
call fcn.00401f63
push dword [esi + 0x1c]
mov ebx, eax
add ebx, edi
push edi
call fcn.00401f63
add esp, 0x10
add eax, edi
cmp byte [ebp - 1], 0
je 0x40220b
push 0
push dword [esi + 0x24]
push edi
call fcn.00401fa9
push 0
mov ebx, eax
push dword [esi + 0x1c]
add ebx, edi
push edi
call fcn.00401fa9
add esp, 0x18
add eax, edi
xor ecx, ecx
cmp dword [esi + 0x14], ecx
mov dword [ebp + 8], ecx
jbe 0x4022bf
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x10]
cmp dword [eax], ecx
je 0x4022ac
cmp dword [esi + 0x18], ecx
mov dword [ebp - 0xc], ecx
jbe 0x4022ac
mov eax, dword [ebp - 0x20]
mov dword [ebp - 8], ebx
mov dword [ebp - 0x14], eax
mov ecx, dword [ebp - 8]
movzx ecx, word [ecx]
cmp ecx, dword [ebp + 8]
jne 0x402292
cmp byte [ebp - 1], 0
je 0x402258
push 0
push dword [eax]
push edi
call fcn.00401fa9
add esp, 0xc
jmp 0x402262
push dword [eax]
push edi
call fcn.00401f63
pop ecx
pop ecx
add eax, edi
push 1
push eax
mov dword [ebp - 0x24], eax
call dword [sym.imp.KERNEL32.dll_IsBadReadPtr]
test eax, eax
jne 0x402292
push dword [ebp - 0x24]
mov eax, dword [ebp + 0x10]
add eax, 0xfffffffe
push 0x4081c4
push eax
push dword [ebp + 0xc]
call fcn.0040200e
add esp, 0x10
mov byte [ebp - 2], 1
inc dword [ebp - 0xc]
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0xc]
add dword [ebp - 8], 2
add eax, 4
cmp ecx, dword [esi + 0x18]
mov dword [ebp - 0x14], eax
jb 0x402238
xor ecx, ecx
inc dword [ebp + 8]
add dword [ebp - 0x10], 4
mov eax, dword [ebp + 8]
cmp eax, dword [esi + 0x14]
jb 0x40221c
xor ebx, ebx
cmp edi, ebx
je 0x4022cc
push edi
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
cmp dword [ebp - 0x18], ebx
je 0x4022da
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x1c], ebx
je 0x4022e8
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov al, byte [ebp - 2]
pop edi
pop esi
pop ebx
leave
ret