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

Disassembly:
push ebp
sub esp, 0x2b4
lea ebp, [esp - 4]
mov eax, dword [0x5af640]
xor eax, ebp
mov dword [ebp + 0x2b4], eax
push 0x54
mov eax, 0x547c29
call fcn.00522f6b
mov eax, dword [ebp + 0x2c4]
xor ebx, ebx
cmp eax, ebx
jne 0x508603
call fcn.004f3748
push eax
lea ecx, [ebp + 0x230]
call fcn.004f8f09
mov dword [ebp - 4], ebx
call fcn.004f374e
mov ecx, eax
call fcn.004f8c7c
test al, al
je 0x508526
push dword [ebp + 0x2c0]
lea ecx, [ebp + 0x230]
call fcn.004f8d0c
push ebx
push 0x80
push 3
push ebx
push 1
push SysReAllocString
lea ecx, [ebp + 0x230]
call fcn.004f8b0a
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x10], eax
cmp eax, 0xffffffff
jne 0x5084e1
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp + 0x230]
call fcn.004f8b57
jmp 0x508678
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, eax
cmp esi, ebx
je 0x5084cd
push esi
mov dword [ebp - 0x28], ebx
call fcn.004508c5
pop ecx
push ebx
mov edi, eax
lea eax, [ebp - 0x28]
push eax
push esi
push edi
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_ReadFile]
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x28], esi
je 0x5085f2
push edi
call fcn.004508d0
pop ecx
jmp 0x5084cd
call fcn.004f374e
push eax
lea ecx, [ebp + 0x230]
call fcn.004f8cf2
call fcn.004f3754
test al, al
je 0x508547
call fcn.004f375a
jmp 0x50855e
push 2
push ebx
lea ecx, [ebp + 0x230]
call fcn.004f8b0a
push eax
call fcn.00503bb8
add esp, 0xc
mov dword [ebp - 0x10], eax
cmp eax, ebx
je 0x5084cd
lea eax, [ebp]
push eax
lea eax, [ebp - 0x20]
push eax
push 1
push dword [ebp + 0x2c0]
push dword [ebp - 0x10]
call fcn.005022b6
add esp, 0x14
test eax, eax
jne 0x5084cd
mov esi, dword [ebp + 0x22c]
cmp esi, ebx
je 0x5084cd
push esi
call fcn.004508c5
push 3
push esi
mov edi, eax
push edi
push dword [ebp - 0x20]
push dword [ebp - 0x10]
call fcn.00503c15
add esp, 0x18
cmp eax, ebx
je 0x5085e0
cmp eax, 0x600
je 0x5085e0
push edi
call fcn.004508d0
pop ecx
call fcn.004f3754
test al, al
jne 0x5084cd
push dword [ebp - 0x10]
call fcn.00503c4f
jmp 0x508523
call fcn.004f3754
test al, al
jne 0x5085f2
push dword [ebp - 0x10]
call fcn.00503c4f
pop ecx
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp + 0x230]
call fcn.004f8b57
jmp 0x508674
push eax
push dword [ebp + 0x2c0]
call fcn.004f3739
push eax
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov esi, eax
mov dword [ebp - 0x24], esi
cmp esi, ebx
je 0x508678
push esi
call fcn.004f3739
push eax
call dword [sym.imp.KERNEL32.dll_LoadResource]
mov dword [ebp - 0x20], eax
push esi
cmp eax, ebx
jne 0x50863c
call dword [sym.imp.KERNEL32.dll_FreeResource]
jmp 0x508678
call fcn.004f3739
push eax
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov esi, eax
cmp esi, ebx
je 0x508678
push esi
call fcn.004508c5
pop ecx
push esi
push dword [ebp - 0x20]
mov edi, eax
call dword [sym.imp.KERNEL32.dll_LockResource]
push eax
push edi
call fcn.00523990
add esp, 0xc
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.dll_FreeResource]
cmp edi, ebx
jne 0x5086e8
push ebx
push 0x80
push 3
push ebx
push 1
push SysReAllocString
push dword [ebp + 0x2c0]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x10], eax
cmp eax, 0xffffffff
je 0x5086e1
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, eax
cmp esi, ebx
je 0x5086e1
push esi
mov dword [ebp - 0x24], ebx
call fcn.004508c5
pop ecx
push ebx
mov edi, eax
lea eax, [ebp - 0x24]
push eax
push esi
push edi
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_ReadFile]
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x24], esi
je 0x5086dd
push edi
call fcn.004508d0
pop ecx
xor edi, edi
cmp edi, ebx
jne 0x5086e8
xor eax, eax
jmp 0x508885
push 4
lea eax, [ebp - 0x34]
push eax
lea eax, [ebp - 0x1c]
push eax
lea eax, [ebp - 0x2c]
push eax
push esi
push edi
call fcn.00521828
mov esi, eax
push edi
mov dword [ebp - 0x30], esi
call fcn.004508d0
add esp, 0x1c
cmp esi, ebx
je 0x5086e1
push 0x2c
lea eax, [ebp - 0x60]
push ebx
push eax
call fcn.00523080
mov eax, dword [ebp - 0x2c]
mov ecx, dword [ebp - 0x1c]
mov dword [ebp - 0x5c], eax
imul eax, dword [ebp - 0x1c]
add esp, 0xc
neg ecx
mov dword [ebp - 0x58], ecx
push 0x20
xor ecx, ecx
inc ecx
mov word [ebp - 0x54], cx
pop ecx
push ebx
shl eax, 2
push ebx
mov dword [ebp - 0x4c], eax
lea eax, [ebp - 0x18]
push eax
push ebx
lea eax, [ebp - 0x60]
push eax
push ebx
mov dword [ebp - 0x60], 0x28
mov word [ebp - 0x52], cx
mov dword [ebp - 0x50], ebx
mov byte [ebp - 0x11], bl
mov dword [ebp - 0x18], ebx
call dword [sym.imp.GDI32.dll_CreateDIBSection]
mov dword [ebp - 0x28], eax
cmp eax, ebx
je 0x5086e1
mov eax, dword [ebp - 0x2c]
imul eax, dword [ebp - 0x1c]
mov dword [ebp - 0x10], ebx
test eax, eax
jle 0x50883e
add esi, 3
mov ecx, dword [ebp - 0x10]
mov al, byte [esi]
mov edx, dword [ebp - 0x18]
shl ecx, 2
mov byte [ecx + edx + 3], al
mov eax, dword [ebp - 0x18]
lea edi, [ecx + eax]
cmp byte [edi + 3], 0xff
mov dword [ebp - 0x20], edi
jae 0x5087e5
movzx edx, byte [esi]
movzx eax, byte [esi - 1]
imul eax, edx
xor edx, edx
mov edi, 0xff
div edi
mov edx, dword [ebp - 0x20]
mov byte [ebp - 0x11], 1
mov byte [edx], al
movzx edx, byte [esi]
movzx eax, byte [esi - 2]
imul eax, edx
xor edx, edx
div edi
mov edx, dword [ebp - 0x18]
mov byte [ecx + edx + 1], al
movzx edx, byte [esi]
movzx eax, byte [esi - 3]
imul eax, edx
xor edx, edx
div edi
jmp 0x5087f7
mov al, byte [esi - 1]
mov byte [edi], al
mov al, byte [esi - 2]
mov edx, dword [ebp - 0x18]
mov byte [ecx + edx + 1], al
mov al, byte [esi - 3]
mov edx, dword [ebp - 0x18]
mov byte [ecx + edx + 2], al
mov eax, dword [ebp - 0x18]
add eax, ecx
mov edx, dword [eax]
cmp edx, dword [ebp + 0x2c8]
jne 0x508828
mov byte [eax], bl
mov eax, dword [ebp - 0x18]
mov byte [ecx + eax + 1], bl
mov eax, dword [ebp - 0x18]
mov byte [ecx + eax + 2], bl
mov eax, dword [ebp - 0x18]
mov byte [ecx + eax + 3], bl
mov byte [ebp - 0x11], 1
mov eax, dword [ebp - 0x2c]
imul eax, dword [ebp - 0x1c]
inc dword [ebp - 0x10]
add esi, 4
cmp dword [ebp - 0x10], eax
jl 0x508786
push dword [ebp - 0x30]
call fcn.0051af5b
push 0x98
call fcn.00450896
pop ecx
mov esi, eax
pop ecx
mov dword [ebp - 0x30], esi
mov dword [ebp - 4], 1
cmp esi, ebx
je 0x50886c
lea ecx, [esi + 0x10]
call fcn.004f8b32
mov ebx, esi
mov eax, dword [ebp - 0x28]
mov dword [ebx], eax
mov eax, dword [ebp - 0x2c]
mov dword [ebx + 4], eax
mov eax, dword [ebp - 0x1c]
mov dword [ebx + 8], eax
mov al, byte [ebp - 0x11]
mov byte [ebx + 0xc], al
mov eax, ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x2b4]
xor ecx, ebp
call fcn.00522f5c
add ebp, 0x2b8
leave
ret