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

Disassembly:
push 0x308
mov eax, 0x662bed
call fcn.0065df0b
mov eax, dword [ebp + 0xc]
xor ebx, ebx
test eax, eax
jne 0x4c8995
call fcn.004afff1
push eax
lea ecx, [ebp - 0xc0]
call fcn.004b4620
mov dword [ebp - 4], ebx
call fcn.004afff7
mov ecx, eax
call fcn.004b50ee
test al, al
je 0x4c88a6
push dword [ebp + 8]
lea ecx, [ebp - 0xc0]
call fcn.004b4a84
push ebx
push 0x80
push 3
xor ecx, ecx
push ebx
inc ecx
push ecx
push accept
lea ecx, [ebp - 0xc0]
call fcn.0041fc50
push eax
call dword [sym.imp.KERNEL32.DLL_CreateFileW]
mov dword [ebp - 0x2f8], eax
cmp eax, 0xffffffff
jne 0x4c8852
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0xc0]
call fcn.004b474b
jmp 0x4c8a17
push ebx
push eax
call dword [sym.imp.KERNEL32.DLL_GetFileSize]
mov esi, eax
test esi, esi
je 0x4c883e
push esi
mov dword [ebp - 0x30c], ebx
call fcn.0065e055
pop ecx
push ebx
mov edi, eax
lea eax, [ebp - 0x30c]
push eax
push esi
push edi
push dword [ebp - 0x2f8]
call dword [sym.imp.KERNEL32.DLL_ReadFile]
push dword [ebp - 0x2f8]
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
cmp dword [ebp - 0x30c], esi
je 0x4c8984
push edi
call fcn.004aadd5
pop ecx
jmp 0x4c883e
call fcn.004afff7
push eax
lea ecx, [ebp - 0xc0]
call fcn.004b49ff
call fcn.004b021b
test al, al
je 0x4c88c7
call fcn.004affff
jmp 0x4c88de
push 2
push ebx
lea ecx, [ebp - 0xc0]
call fcn.0041fc50
push eax
call fcn.004d1a9a
add esp, 0xc
mov dword [ebp - 0x2f8], eax
test eax, eax
je 0x4c883e
lea ecx, [ebp - 0x2f0]
push ecx
lea ecx, [ebp - 0x300]
push ecx
xor ecx, ecx
inc ecx
push ecx
push dword [ebp + 8]
push eax
call fcn.004d1189
add esp, 0x14
test eax, eax
jne 0x4c883e
mov esi, dword [ebp - 0xc4]
test esi, esi
je 0x4c883e
push esi
call fcn.0065e055
push 3
push esi
mov edi, eax
push edi
push dword [ebp - 0x300]
push dword [ebp - 0x2f8]
call fcn.004d1e7b
add esp, 0x18
test eax, eax
je 0x4c896f
cmp eax, 0x600
je 0x4c896f
push edi
call fcn.004aadd5
pop ecx
call fcn.004b021b
test al, al
jne 0x4c883e
push dword [ebp - 0x2f8]
call fcn.004d0f64
jmp 0x4c88a3
call fcn.004b021b
test al, al
jne 0x4c8984
push dword [ebp - 0x2f8]
call fcn.004d0f64
pop ecx
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0xc0]
call fcn.004b474b
jmp 0x4c8a0f
push eax
push dword [ebp + 8]
call fcn.004affdc
push eax
call dword [sym.imp.KERNEL32.DLL_FindResourceW]
mov esi, eax
mov dword [ebp - 0x310], esi
test esi, esi
je 0x4c8a17
push esi
call fcn.004affdc
push eax
call dword [sym.imp.KERNEL32.DLL_LoadResource]
mov dword [ebp - 0x300], eax
push esi
test eax, eax
jne 0x4c89d1
call dword [sym.imp.KERNEL32.DLL_FreeResource]
jmp 0x4c8a17
call fcn.004affdc
push eax
call dword [sym.imp.KERNEL32.DLL_SizeofResource]
mov esi, eax
test esi, esi
je 0x4c8a17
push esi
call fcn.0065e055
pop ecx
push esi
push dword [ebp - 0x300]
mov edi, eax
call dword [sym.imp.KERNEL32.DLL_LockResource]
push eax
push edi
call fcn.005f40c0
add esp, 0xc
push dword [ebp - 0x310]
call dword [sym.imp.KERNEL32.DLL_FreeResource]
test edi, edi
jne 0x4c8a9d
push ebx
push 0x80
push 3
push ebx
xor eax, eax
inc eax
push eax
push accept
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.DLL_CreateFileW]
mov dword [ebp - 0x2f8], eax
cmp eax, 0xffffffff
je 0x4c8cb5
push ebx
push eax
call dword [sym.imp.KERNEL32.DLL_GetFileSize]
mov esi, eax
test esi, esi
je 0x4c8cb5
push esi
mov dword [ebp - 0x310], ebx
call fcn.0065e055
pop ecx
push ebx
mov edi, eax
lea eax, [ebp - 0x310]
push eax
push esi
push edi
push dword [ebp - 0x2f8]
call dword [sym.imp.KERNEL32.DLL_ReadFile]
push dword [ebp - 0x2f8]
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
cmp dword [ebp - 0x310], esi
je 0x4c8a95
push edi
call fcn.004aadd5
pop ecx
mov edi, ebx
test edi, edi
je 0x4c8cb5
push 4
lea eax, [ebp - 0x314]
push eax
lea eax, [ebp - 0x304]
push eax
lea eax, [ebp - 0x308]
push eax
push esi
push edi
call fcn.004faef3
push edi
mov dword [ebp - 0x2f8], eax
call fcn.004aadd5
mov edi, dword [ebp - 0x2f8]
add esp, 0x1c
test edi, edi
je 0x4c8cb5
push 0x2c
lea eax, [ebp - 0x3c]
push ebx
push eax
call fcn.005f46f0
mov eax, dword [ebp - 0x304]
add esp, 0xc
mov ecx, dword [ebp - 0x308]
neg eax
mov dword [ebp - 0x34], eax
xor eax, eax
inc eax
mov dword [ebp - 0x38], ecx
imul ecx, dword [ebp - 0x304]
push 0x20
mov word [ebp - 0x30], ax
pop eax
push ebx
push ebx
mov word [ebp - 0x2e], ax
lea eax, [ebp - 0x2fc]
push eax
push ebx
lea eax, [ebp - 0x3c]
shl ecx, 2
push eax
push ebx
mov dword [ebp - 0x3c], 0x28
mov dword [ebp - 0x2c], ebx
mov dword [ebp - 0x28], ecx
mov byte [ebp - 0x2f1], bl
mov dword [ebp - 0x2fc], ebx
call dword [sym.imp.GDI32.dll_CreateDIBSection]
mov dword [ebp - 0x30c], eax
test eax, eax
je 0x4c8cb5
mov eax, dword [ebp - 0x308]
mov esi, ebx
imul eax, dword [ebp - 0x304]
test eax, eax
jle 0x4c8c63
mov edx, 0xff
mov eax, dword [ebp - 0x2fc]
mov cl, byte [edi + esi*4 + 3]
mov byte [eax + esi*4 + 3], cl
mov ecx, dword [ebp - 0x2fc]
cmp byte [ecx + esi*4 + 3], dl
jae 0x4c8bee
movzx ecx, byte [edi + esi*4 + 3]
xor edx, edx
movzx eax, byte [edi + esi*4 + 2]
imul eax, ecx
mov ecx, 0xff
div ecx
mov ecx, dword [ebp - 0x2fc]
xor edx, edx
mov byte [ecx + esi*4], al
movzx ecx, byte [edi + esi*4 + 3]
movzx eax, byte [edi + esi*4 + 1]
imul eax, ecx
mov ecx, 0xff
div ecx
mov ecx, dword [ebp - 0x2fc]
xor edx, edx
mov byte [ecx + esi*4 + 1], al
movzx ecx, byte [edi + esi*4 + 3]
movzx eax, byte [edi + esi*4]
imul eax, ecx
mov ecx, 0xff
div ecx
mov ecx, dword [ebp - 0x2fc]
xor edx, edx
inc edx
mov byte [ebp - 0x2f1], dl
mov byte [ecx + esi*4 + 2], al
jmp 0x4c8c13
mov al, byte [edi + esi*4 + 2]
xor edx, edx
mov byte [ecx + esi*4], al
inc edx
mov eax, dword [ebp - 0x2fc]
mov cl, byte [edi + esi*4 + 1]
mov byte [eax + esi*4 + 1], cl
mov eax, dword [ebp - 0x2fc]
mov cl, byte [edi + esi*4]
mov byte [eax + esi*4 + 2], cl
mov eax, dword [ebp - 0x2fc]
mov ecx, dword [ebp + 0x10]
cmp dword [eax + esi*4], ecx
jne 0x4c8c48
mov byte [eax + esi*4], bl
mov eax, dword [ebp - 0x2fc]
mov byte [ebp - 0x2f1], dl
mov byte [eax + esi*4 + 1], bl
mov eax, dword [ebp - 0x2fc]
mov byte [eax + esi*4 + 2], bl
mov eax, dword [ebp - 0x2fc]
mov byte [eax + esi*4 + 3], bl
mov eax, dword [ebp - 0x308]
inc esi
imul eax, dword [ebp - 0x304]
mov edx, 0xff
cmp esi, eax
jl 0x4c8b6b
push edi
call fcn.004fadbe
push 0x98
call fcn.004aab32
pop ecx
pop ecx
mov dword [ebp - 0x300], eax
xor ecx, ecx
inc ecx
mov dword [ebp - 4], ecx
test eax, eax
je 0x4c8c8e
mov ecx, eax
call fcn.004ae109
mov ebx, eax
mov eax, dword [ebp - 0x30c]
mov dword [ebx], eax
mov eax, dword [ebp - 0x308]
mov dword [ebx + 4], eax
mov eax, dword [ebp - 0x304]
mov dword [ebx + 8], eax
mov al, byte [ebp - 0x2f1]
mov byte [ebx + 0xc], al
mov eax, ebx
jmp 0x4c8cb7
xor eax, eax
call fcn.0065deb5
ret