Function at 0x476a50
Capabilities:
Get file size
Parse pe header

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4a5de3
mov eax, dword fs:[0]
push eax
push ecx
push ebx
push esi
push edi
mov eax, dword [0x4cfc64]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, dword [ebp + 8]
mov dword [ebp - 4], 0
lea ebx, [esi + 0x2c]
call fcn.00480035
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x476a9d
push 0x80004005
call fcn.00420000
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [ebx], eax
mov byte [ebp - 4], 1
mov ecx, dword [ebp + 0xc]
mov edi, dword [ebx]
lea eax, [ecx - 0x10]
sub edi, 0x10
cmp eax, edi
je 0x476b08
cmp dword [edi + 0xc], 0
jl 0x476af9
mov edx, dword [eax]
cmp edx, dword [edi]
jne 0x476af9
push eax
call fcn.00421e21
mov dword [ebp - 0x10], eax
add esp, 4
lea eax, [edi + 0xc]
or ecx, 0xffffffff
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x476aef
mov ecx, dword [edi]
mov edx, dword [ecx]
mov eax, dword [edx + 4]
push edi
call eax
mov ecx, dword [ebp - 0x10]
add ecx, 0x10
mov dword [ebx], ecx
jmp 0x476b05
mov eax, dword [ecx - 0xc]
push eax
push ecx
mov ecx, ebx
call fcn.00421168
mov ecx, dword [ebp + 0xc]
mov edi, dword [ebp + 0x10]
push 0
push 0x80
push 3
mov edx, edi
neg edx
sbb edx, edx
push 0
and edx, 0x116
push 1
add edx, 0x120089
push edx
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [esi], eax
cmp eax, 0xffffffff
jne 0x476b4e
push 0x4c58ec
lea eax, [ebp + 0x10]
push eax
mov dword [ebp + 0x10], str.Cant_open_file
call fcn.004934bc
push 0
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ecx, dword [esi]
mov dword [esi + 0x30], eax
cmp eax, 0x40
jae 0x476b7d
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x4c58ec
lea edx, [ebp + 0x10]
push edx
mov dword [ebp + 0x10], str.Incorrect_PE_file__too_small_
call fcn.004934bc
xor eax, eax
test edi, edi
push 0
setne al
push 0
push 0
lea eax, [eax + eax + 2]
push eax
push 0
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileMappingW]
mov dword [esi + 4], eax
test eax, eax
jne 0x476bbd
mov edx, dword [esi]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x4c58ec
lea eax, [ebp + 0x10]
push eax
mov dword [ebp + 0x10], str.Cant_create_file_mapping
call fcn.004934bc
xor ecx, ecx
test edi, edi
setne cl
push 0
push 0
push 0
lea ecx, [ecx + ecx + 4]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [esi + 0x34], eax
test eax, eax
jne 0x476c03
mov edx, dword [esi + 4]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push edx
call edi
mov eax, dword [esi]
push eax
call edi
push 0x4c58ec
lea ecx, [ebp + 0x10]
push ecx
mov dword [ebp + 0x10], str.Cant_create_map_file_view
call fcn.004934bc
mov edx, 0x5a4d
mov dword [esi + 0x38], edi
mov dword [esi + 0x10], eax
cmp word [eax], dx
je 0x476c43
mov eax, dword [esi + 4]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push eax
call edi
mov ecx, dword [esi]
push ecx
call edi
mov edx, dword [esi + 0x34]
push edx
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
push 0x4c58ec
lea eax, [ebp + 0x10]
push eax
mov dword [ebp + 0x10], str.Incorrect_PE_file__e_magic___IMAGE_DOS_SIGNATURE_
call fcn.004934bc
mov ecx, dword [eax + 0x3c]
cmp ecx, dword [esi + 0x30]
jl 0x476c7b
mov ecx, dword [esi + 4]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push ecx
call edi
mov edx, dword [esi]
push edx
call edi
mov eax, dword [esi + 0x34]
push eax
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
push 0x4c58ec
lea ecx, [ebp + 0x10]
push ecx
mov dword [ebp + 0x10], str.Incorrect_PE_file__header___filesize_
call fcn.004934bc
add ecx, eax
mov dword [esi + 0x14], ecx
cmp dword [ecx], 0x4550
je 0x476cb8
mov edx, dword [esi + 4]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push edx
call edi
mov eax, dword [esi]
push eax
call edi
mov ecx, dword [esi + 0x34]
push ecx
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
push 0x4c58ec
lea edx, [ebp + 0x10]
push edx
mov dword [ebp + 0x10], str.Incorrect_PE_file__incorrect_signature_
call fcn.004934bc
add ecx, 0x18
xor ebx, ebx
mov dword [esi + 0x20], ecx
mov edx, 0x20b
cmp word [ecx], dx
sete bl
mov ecx, ebx
mov dword [esi + 8], ecx
test ecx, ecx
je 0x476ce7
mov ecx, dword [eax + 0x3c]
add eax, ecx
mov dword [esi + 0x18], eax
mov edx, dword [esi + 0x18]
add eax, 0x18
mov dword [esi + 0x24], eax
jmp 0x476cea
mov edx, dword [esi + 0x14]
mov ax, word [edx + 6]
mov ecx, edx
add ecx, 4
cmp dword [esi + 8], 0
mov dword [esi + 0x1c], ecx
mov word [esi + 0xc], ax
je 0x476d08
mov eax, dword [esi + 0x24]
add eax, 0x70
jmp 0x476d0e
mov eax, dword [esi + 0x20]
add eax, 0x60
mov dword [esi + 0x28], eax
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp + 0xc]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x476d37
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc