Function at 0x51a5f3
Capabilities:
Extract resource via kernel32 functions
Get file size
Read file on windows

Disassembly:
push 0x14
mov eax, 0x5720a7
call fcn.00549b98
mov esi, ecx
mov edi, dword [ebp + 0xc]
xor ebx, ebx
cmp edi, ebx
jne 0x51a611
xor al, al
jmp 0x51a899
push dword [ebp + 0x14]
mov byte [ebp - 0xd], bl
call fcn.00519fdb
pop ecx
cmp eax, ebx
je 0x51a6ae
push eax
push dword [ebp + 8]
push dword [esi + 4]
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov dword [ebp + 0xc], eax
cmp eax, ebx
je 0x51a883
push eax
push dword [esi + 4]
call dword [sym.imp.KERNEL32.dll_LoadResource]
cmp eax, ebx
je 0x51a6a0
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
push dword [ebp + 0xc]
mov ebx, eax
push dword [esi + 4]
call dword [sym.imp.KERNEL32.dll_SizeofResource]
test ebx, ebx
je 0x51a6a0
lea ecx, [eax - 1]
cmp ecx, 0xffffff
ja 0x51a6a0
mov ecx, dword [ebp + 0x10]
mov dword [ecx], eax
inc eax
push eax
call fcn.004f4318
mov ecx, dword [ebp + 0x10]
mov dword [edi], eax
mov ecx, dword [ecx]
inc ecx
push ecx
push 0
push eax
call fcn.0053ef70
mov eax, dword [ebp + 0x10]
push dword [eax]
push ebx
push dword [edi]
call fcn.0053e160
add esp, 0x1c
mov byte [ebp - 0xd], 1
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_FreeResource]
jmp 0x51a87b
mov edi, 0x5bfe14
push edi
lea ecx, [ebp - 0x14]
call fcn.0040eeb0
push dword [ebp + 8]
lea eax, [ebp - 0x14]
push 0x587240
push eax
mov dword [ebp - 4], ebx
call fcn.004ea900
add esp, 0xc
lea ecx, [ebp - 0x14]
call fcn.004a5b10
push edi
lea ecx, [ebp - 0x18]
call fcn.0040eeb0
mov eax, dword [ebp - 0x14]
add eax, 0xfffffff0
push eax
mov byte [ebp - 4], 1
mov dword [ebp - 0x20], eax
call fcn.0041d700
add eax, 0x10
pop ecx
mov dword [ebp + 0x14], eax
mov byte [ebp - 4], 2
cmp dword [ebp + 0x18], ebx
jne 0x51a72b
lea edi, [esi + 0xbc]
push edi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp + 0x18]
push eax
lea ecx, [esi + 0xc]
call fcn.005183d4
mov eax, dword [eax]
cmp eax, dword [esi + 0x10]
jmp 0x51a753
cmp dword [ebp + 0x18], 1
jne 0x51a768
lea edi, [esi + 0xec]
push edi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp + 0x18]
push eax
lea ecx, [esi + 0x1c]
call fcn.005183d4
mov eax, dword [eax]
cmp eax, dword [esi + 0x20]
je 0x51a761
add eax, 0x10
push eax
lea ecx, [ebp + 0x14]
call fcn.0041d040
push edi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push dword [ebp + 0x14]
lea eax, [ebp - 0x18]
push dword [esi]
push str._s_s
push eax
call fcn.004ea900
mov edi, dword [sym.imp.KERNEL32.dll_CreateFileW]
add esp, 0x10
push ebx
push 0x80
push 3
push ebx
push 1
mov ebx, SysReAllocString
push ebx
push dword [ebp - 0x18]
call edi
mov dword [ebp + 0x18], eax
cmp eax, 0xffffffff
jne 0x51a7bd
push 0
push 0x80
push 3
push 0
push 1
push ebx
push dword [ebp + 8]
call edi
mov dword [ebp + 0x18], eax
cmp eax, 0xffffffff
je 0x51a821
xor ebx, ebx
push ebx
push dword [ebp + 0x18]
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edi, dword [ebp + 0x10]
mov dword [edi], eax
cmp eax, ebx
jbe 0x51a826
cmp eax, 0x1000000
ja 0x51a826
inc eax
push eax
call fcn.004f4318
mov ecx, dword [ebp + 0xc]
mov dword [ecx], eax
mov ecx, dword [edi]
inc ecx
push ecx
push ebx
push eax
call fcn.0053ef70
add esp, 0x10
push ebx
lea eax, [ebp - 0x1c]
push eax
push dword [edi]
mov eax, dword [ebp + 0xc]
push dword [eax]
mov dword [ebp - 0x1c], ebx
push dword [ebp + 0x18]
call dword [sym.imp.KERNEL32.dll_ReadFile]
push dword [ebp + 0x18]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x1c]
cmp eax, dword [edi]
jne 0x51a826
mov byte [ebp - 0xd], 1
jmp 0x51a85a
mov edi, dword [ebp + 0x10]
xor ebx, ebx
cmp dword [esi + 8], ebx
je 0x51a85a
mov ecx, dword [ebp + 0x14]
cmp dword [ecx - 4], 1
jle 0x51a842
push dword [ecx - 0xc]
lea ecx, [ebp + 0x14]
call fcn.0041d1b0
mov ecx, dword [ebp + 0x14]
push ebx
push ecx
mov eax, esp
mov dword [ebp + 0x18], esp
mov dword [eax], ecx
mov ecx, dword [esi + 8]
mov eax, dword [ecx]
push edi
push dword [ebp + 0xc]
call dword [eax + 8]
mov byte [ebp - 0xd], al
mov ecx, dword [ebp + 0x14]
add ecx, 0xfffffff0
call fcn.0040f780
mov ecx, dword [ebp - 0x18]
add ecx, 0xfffffff0
call fcn.0040f780
mov ecx, dword [ebp - 0x20]
call fcn.0040f780
mov edi, dword [ebp + 0xc]
cmp byte [ebp - 0xd], 0
jne 0x51a896
xor ebx, ebx
mov eax, dword [ebp + 0x10]
mov dword [eax], ebx
mov edi, dword [edi]
cmp edi, ebx
je 0x51a896
push edi
mov ecx, esi
call fcn.00515e14
mov al, byte [ebp - 0xd]
call fcn.00549c70
ret 0x14