Function at 0x404d80
Capabilities:
Get file size
Parse pe header
Read file on windows
Read file via mapping
Resolve function by parsing pe exports

Disassembly:
mov eax, 0x792c
call fcn.0040b3d0
push ebx
push ebp
push esi
push edi
mov ecx, 0x19
xor eax, eax
mov edi, 0x43fb54
mov ebp, dword [esp + 0x7954]
rep stosd dword es:[edi], eax
xor ebx, ebx
mov ecx, 0x19
mov edi, 0x43faf0
push ebx
rep stosd dword es:[edi], eax
push 0x8000000
mov ecx, 0x19
mov edi, 0x43fa8c
push 3
push ebx
push 1
rep stosd dword es:[edi], eax
mov edi, dword [sym.imp.KERNEL32.dll_CreateFileA]
push 0x80000000
push ebp
mov dword [esp + 0x30], ebx
mov dword [esp + 0x2c], ebx
call edi
mov esi, eax
cmp esi, 0xffffffff
jne 0x404e20
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [esp + 0x38]
push 0x104
push eax
push ebp
call dword [sym.imp.KERNEL32.dll_GetShortPathNameA]
push ebx
push 0x8000000
push 3
push ebx
push 1
lea ecx, [esp + 0x4c]
push 0x80000000
push ecx
call edi
mov esi, eax
cmp esi, 0xffffffff
je 0x405508
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
push ebx
push ebx
push ebx
push 0x8000002
push ebx
push esi
mov dword [esp + 0x34], eax
call dword [sym.imp.KERNEL32.dll_CreateFileMappingA]
mov ebp, eax
cmp ebp, ebx
mov dword [esp + 0x34], ebp
jne 0x404e58
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x792c
ret
push ebx
push ebx
push ebx
push 4
push ebp
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov ebx, eax
test ebx, ebx
mov dword [esp + 0x30], ebx
jne 0x404e83
push eax
push eax
call dword [sym.imp.KERNEL32.dll_FlushViewOfFile]
push ebx
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
push ebp
jmp 0x4054fd
cmp word [ebx], 0x5a4d
jne 0x404eb5
mov edi, dword [ebx + 0x3c]
push 0xf8
add edi, ebx
push edi
mov dword [esp + 0x2c], edi
call dword [sym.imp.KERNEL32.dll_IsBadReadPtr]
test eax, eax
jne 0x404eb5
cmp dword [edi], 0x4550
jne 0x404eb5
mov cx, word [edi + 6]
cmp cx, 0x19
jbe 0x404ecb
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_FlushViewOfFile]
push ebx
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
push ebp
jmp 0x4054fd
xor eax, eax
lea ebp, [edi + 0xf8]
test cx, cx
jbe 0x404f10
cmp cx, 0x19
jae 0x404f10
mov edx, dword [ebp + 0xc]
add ebp, 0x28
mov dword [eax*4 + 0x43fa8c], edx
mov ecx, dword [ebp - 0x14]
mov dword [eax*4 + 0x43faf0], ecx
mov edx, dword [ebp - 0x18]
mov dword [eax*4 + 0x43fb54], edx
mov cx, word [edi + 6]
mov edx, ecx
inc eax
and edx, 0xffff
cmp eax, edx
jl 0x404ed8
sub ebp, 0x28
cmp word [edi + 6], 3
mov dword [esp + 0x28], ebp
jne 0x404f3e
cmp dword [edi + 0x104], 0x1000
jne 0x404f3e
mov eax, dword [edi + 0x108]
test eax, eax
jne 0x404f3e
mov dword [0x43f95c], 1
mov ecx, dword [edi + 0x28]
mov eax, dword [0x43fa8c]
cmp ecx, eax
jae 0x404f50
mov dword [esp + 0x18], ecx
jmp 0x404f89
mov eax, dword [edi + 0x28]
push eax
mov dword [esp + 0x24], eax
call fcn.00405520
lea ebx, [eax + eax*4]
mov eax, dword [edi + 0x28]
push eax
call fcn.00405520
lea ecx, [eax + eax*4]
mov eax, dword [edi + ebx*8 + 0x10c]
add esp, 8
mov ebx, dword [edi + ecx*8 + 0x104]
mov ecx, dword [esp + 0x20]
sub eax, ebx
add eax, ecx
mov dword [esp + 0x18], eax
cmp dword [esp + 0x18], 0xffffffff
jne 0x404f94
mov dword [esp + 0x18], ecx
mov edx, dword [esp + 0x18]
mov ebx, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
push 0
push edx
push esi
call ebx
mov edi, dword [sym.imp.KERNEL32.dll_ReadFile]
lea eax, [esp + 0x10]
push 0
push eax
push 0x3e8
push 0x4380d8
push esi
call edi
test eax, eax
je 0x404fd1
mov eax, dword [esp + 0x10]
mov dword [0x43f958], eax
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], 0
mov eax, dword [ebp + 0x14]
test eax, eax
jne 0x404fe7
mov ecx, dword [ebp + 0x10]
test ecx, ecx
je 0x40502f
push 0
push 0
push eax
push esi
call ebx
lea ecx, [esp + 0x10]
push 0
push ecx
lea edx, [esp + 0x144]
push 0x7e
push edx
push esi
call edi
test eax, eax
je 0x40502f
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
push eax
lea edx, [esp + 0x140]
push ecx
push edx
call fcn.00405560
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x20]
add esp, 0xc
add ecx, eax
mov dword [esp + 0x14], ecx
push 0
push 0
push 0x60e
push esi
mov dword [esp + 0x20], 0
call ebx
lea ecx, [esp + 0x10]
push 0
push ecx
lea edx, [esp + 0x144]
push 0xc8
push edx
push esi
call edi
test eax, eax
je 0x405086
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
push eax
lea edx, [esp + 0x140]
push ecx
push edx
call fcn.00405560
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x20]
add esp, 0xc
add ecx, eax
mov dword [esp + 0x14], ecx
mov eax, dword [esp + 0x1c]
mov dword [esp + 0x10], 0
mov ecx, dword [ebp + 0x14]
cmp eax, 0x551
push 0
push 0
jb 0x4050f3
mov edx, dword [ebp + 0x10]
lea eax, [ecx + edx - 0x551]
push eax
push esi
call ebx
lea ecx, [esp + 0x10]
push 0
push ecx
lea edx, [esp + 0x144]
push 0x551
push edx
push esi
call edi
test eax, eax
je 0x405141
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
push eax
lea edx, [esp + 0x140]
push ecx
push edx
call fcn.00405560
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x20]
add esp, 0xc
add ecx, eax
mov dword [esp + 0x14], ecx
jmp 0x405141
mov edx, dword [ebp + 0x10]
sub ecx, eax
add ecx, edx
push ecx
push esi
call ebx
mov eax, dword [esp + 0x1c]
lea edx, [esp + 0x10]
push 0
push edx
lea ecx, [esp + 0x144]
push eax
push ecx
push esi
call edi
test eax, eax
je 0x405141
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0x10]
push edx
lea ecx, [esp + 0x140]
push eax
push ecx
call fcn.00405560
mov edx, dword [esp + 0x1c]
mov eax, dword [esp + 0x20]
add esp, 0xc
add eax, edx
mov dword [esp + 0x14], eax
xor eax, eax
push eax
mov dword [esp + 0x14], eax
mov dword [esp + 0x30], eax
push eax
mov eax, dword [esp + 0x20]
inc eax
push eax
push esi
call ebx
lea ecx, [esp + 0x10]
push 0
push ecx
lea edx, [esp + 0x34]
push 4
push edx
push esi
call edi
test eax, eax
je 0x40520d
mov eax, dword [esp + 0x24]
mov ebp, dword [eax + 0x28]
mov eax, dword [esp + 0x2c]
add ebp, eax
push ebp
mov dword [esp + 0x1c], ebp
call fcn.00405520
lea edx, [eax + eax*4]
push ebp
mov dword [esp + 0x28], edx
call fcn.00405520
mov ecx, dword [esp + 0x2c]
lea edx, [eax + eax*4]
mov eax, dword [esp + 0x28]
add esp, 8
mov ebp, dword [ecx + edx*8 + 0x104]
mov edx, dword [esp + 0x1c]
mov eax, dword [ecx + eax*8 + 0x10c]
sub eax, ebp
mov ebp, dword [esp + 0x18]
add eax, ebp
lea ecx, [eax + 0x39]
cmp edx, ecx
jbe 0x405209
push 0
add eax, 5
push 0
push eax
push esi
call ebx
lea edx, [esp + 0x10]
push 0
push edx
lea eax, [esp + 0x144]
push 0x34
push eax
push esi
call edi
test eax, eax
je 0x405209
mov ebp, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
push ebp
lea edx, [esp + 0x140]
push ecx
push edx
call fcn.00405560
mov eax, dword [esp + 0x1c]
add esp, 0xc
add ebp, eax
mov dword [esp + 0x14], ebp
mov ebp, dword [esp + 0x28]
cmp dword [esp + 0x1c], 0xb93
jb 0x405263
push 0
push 0
push 0xb93
push esi
call ebx
lea eax, [esp + 0x10]
push 0
push eax
lea ecx, [esp + 0x144]
push 0x15
push ecx
push esi
call edi
test eax, eax
je 0x405263
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0x10]
push edx
lea ecx, [esp + 0x140]
push eax
push ecx
call fcn.00405560
mov edx, dword [esp + 0x1c]
mov eax, dword [esp + 0x20]
add esp, 0xc
add eax, edx
mov dword [esp + 0x14], eax
cmp dword [esp + 0x1c], 0x1998
jb 0x4052b9
push 0
push 0
push 0x1998
push esi
call ebx
lea eax, [esp + 0x10]
push 0
push eax
lea ecx, [esp + 0x144]
push 0xe
push ecx
push esi
call edi
test eax, eax
je 0x4052b9
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0x10]
push edx
lea ecx, [esp + 0x140]
push eax
push ecx
call fcn.00405560
mov edx, dword [esp + 0x1c]
mov eax, dword [esp + 0x20]
add esp, 0xc
add eax, edx
mov dword [esp + 0x14], eax
cmp dword [esp + 0x1c], 0x1954
jb 0x40530f
push 0
push 0
push 0x1954
push esi
call ebx
lea eax, [esp + 0x10]
push 0
push eax
lea ecx, [esp + 0x144]
push 0xe
push ecx
push esi
call edi
test eax, eax
je 0x40530f
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0x10]
push edx
lea ecx, [esp + 0x140]
push eax
push ecx
call fcn.00405560
mov edx, dword [esp + 0x1c]
mov eax, dword [esp + 0x20]
add esp, 0xc
add eax, edx
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x24]
mov ecx, dword [ebp + 0x14]
mov edx, dword [ebp + 0x10]
mov eax, dword [eax + 0x28]
add ecx, edx
lea edx, [eax + 0x64]
cmp edx, ecx
jae 0x405369
push 0
push 0
push eax
push esi
call ebx
lea eax, [esp + 0x10]
push 0
push eax
lea ecx, [esp + 0x144]
push 0x64
push ecx
push esi
call edi
test eax, eax
je 0x405369
mov ebp, dword [esp + 0x14]
mov edx, dword [esp + 0x10]
push ebp
lea eax, [esp + 0x140]
push edx
push eax
call fcn.00405560
mov eax, dword [esp + 0x1c]
add esp, 0xc
add ebp, eax
mov dword [esp + 0x14], ebp
mov ecx, dword [esp + 0x24]
test byte [ecx + 0x17], 0x20
je 0x4054da
mov ebp, dword [esp + 0x7954]
push ebp
call fcn.004122f8
push str.SYSTEM32_
push ebp
call fcn.00409f40
add esp, 0xc
test eax, eax
je 0x4054da
mov edx, dword [esp + 0x30]
xor ebp, ebp
push ebp
push ebp
mov eax, dword [edx + 0x3c]
mov dword [esp + 0x20], ebp
add eax, 0x78
mov dword [esp + 0x28], ebp
push eax
push esi
call ebx
lea ecx, [esp + 0x10]
push ebp
push ecx
lea edx, [esp + 0x20]
push 4
push edx
push esi
call edi
cmp dword [esp + 0x18], ebp
je 0x4054da
lea eax, [esp + 0x10]
push ebp
push eax
lea ecx, [esp + 0x28]
push 4
push ecx
push esi
call edi
cmp dword [esp + 0x20], ebp
je 0x4054da
mov edx, dword [esp + 0x18]
push edx
call fcn.00405520
lea ebp, [eax + eax*4]
mov eax, dword [esp + 0x1c]
push eax
call fcn.00405520
mov ecx, dword [esp + 0x2c]
lea edx, [eax + eax*4]
add esp, 8
mov eax, dword [ecx + ebp*8 + 0x10c]
mov ebp, dword [ecx + edx*8 + 0x104]
mov edx, dword [esp + 0x18]
sub eax, ebp
add eax, edx
cmp eax, 0xffffffff
je 0x4054da
mov ecx, dword [esp + 0x28]
mov edx, dword [ecx + 0x14]
mov ebp, dword [ecx + 0x10]
add edx, ebp
cmp eax, edx
jae 0x4054da
push 0
add eax, 0xc
push 0
push eax
push esi
call ebx
lea eax, [esp + 0x10]
push 0
push eax
lea ecx, [esp + 0x24]
push 4
push ecx
push esi
call edi
mov edx, dword [esp + 0x1c]
push edx
call fcn.00405520
lea ebp, [eax + eax*4]
mov eax, dword [esp + 0x20]
push eax
call fcn.00405520
lea ecx, [eax + eax*4]
mov eax, dword [esp + 0x2c]
add esp, 8
mov edx, dword [eax + ebp*8 + 0x10c]
mov ebp, dword [eax + ecx*8 + 0x104]
mov eax, dword [esp + 0x1c]
sub edx, ebp
add eax, edx
push 0
push 0
push eax
push esi
mov dword [esp + 0x2c], eax
call ebx
lea eax, [esp + 0x10]
push 0
push eax
lea ecx, [esp + 0x144]
push 0xc8
push ecx
push esi
call edi
test eax, eax
je 0x4054da
mov edi, dword [esp + 0x14]
mov edx, dword [esp + 0x10]
push edi
lea eax, [esp + 0x140]
push edx
push eax
call fcn.00405560
mov eax, dword [esp + 0x1c]
add esp, 0xc
add edi, eax
mov dword [esp + 0x14], edi
mov edi, dword [esp + 0x30]
mov ecx, dword [esp + 0x14]
push 0
push edi
mov dword [0x43fbb8], ecx
call dword [sym.imp.KERNEL32.dll_FlushViewOfFile]
push edi
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov edx, dword [esp + 0x34]
push edx
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call edi
push esi
call edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x792c
ret