Function at 0x401ffb
Capabilities:
Extract resource via kernel32 functions
Read file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x524da0
push eax
mov dword fs:[0], esp
sub esp, 0x2c
push ebx
xor ebx, ebx
push esi
cmp dword [edi + 8], ebx
jne 0x40230b
mov eax, dword [edi + 4]
mov esi, 0xffff
cmp eax, esi
jb 0x40205d
push eax
lea ecx, [esp + 0x18]
call fcn.00401f01
lea eax, [esp + 0x14]
mov dword [esp + 0x3c], ebx
call fcn.004019f2
or dword [esp + 0x3c], 0xffffffff
mov ecx, dword [esp + 0x14]
add ecx, 0xfffffff0
mov byte [edi + 0x17], al
call fcn.0040297c
mov al, byte [edi + 0x17]
cmp al, 2
jne 0x402097
mov eax, dword [edi + 4]
cmp eax, esi
jae 0x40207f
push 0x2000
push ebx
push ebx
movzx eax, ax
push ebx
push eax
push dword [0x56f130]
jmp 0x402089
push 0x2010
push ebx
push ebx
push ebx
push eax
push ebx
call dword [sym.imp.USER32.dll_LoadImageW]
mov dword [edi + 8], eax
jmp 0x4022b8
mov ecx, dword [edi + 4]
mov dword [esp + 8], ebx
cmp ecx, esi
jae 0x4021af
mov dword [esp + 0xc], ebx
mov dword [esp + 0x3c], 1
cmp al, 4
jne 0x402100
push ecx
movzx ecx, cx
mov eax, esp
mov dword [esp + 0x18], esp
push ecx
mov dword [eax], ecx
mov eax, esp
lea esi, [esp + 0x10]
mov dword [esp + 0x1c], esp
mov dword [eax], 0x536fb4
call fcn.00401f5e
cmp al, bl
je 0x402100
lea eax, [esp + 0x10]
push eax
push 0x1a
mov dword [esp + 0x18], ebx
call fcn.00460cd7
lea ecx, [esp + 0x18]
lea eax, [esp + 0x10]
mov byte [esp + 0x3c], 2
call fcn.00435802
jmp 0x402155
cmp byte [edi + 0x17], 3
jne 0x402196
mov eax, dword [edi + 4]
push ecx
movzx eax, ax
mov ecx, esp
mov dword [esp + 0x18], esp
push ecx
mov dword [ecx], eax
mov eax, esp
lea esi, [esp + 0x10]
mov dword [esp + 0x1c], esp
mov dword [eax], 0x536fbc
call fcn.00401f5e
cmp al, bl
je 0x402196
lea eax, [esp + 0x10]
push eax
push 0x1b
mov dword [esp + 0x18], ebx
call fcn.00460cd7
lea ecx, [esp + 0x18]
lea eax, [esp + 0x10]
mov byte [esp + 0x3c], 3
call fcn.00435802
push dword [esp + 0xc]
mov esi, dword [eax]
push dword [0x56f130]
call dword [sym.imp.KERNEL32.dll_SizeofResource]
push dword [esp + 8]
mov dword [esp + 0x18], eax
call dword [sym.imp.KERNEL32.dll_LockResource]
push dword [esp + 0x14]
mov ecx, dword [esi]
push eax
push esi
call dword [ecx + 0x10]
mov dword [edi + 8], eax
mov byte [esp + 0x3c], 1
mov eax, dword [esp + 0x10]
cmp eax, ebx
je 0x402196
mov ecx, dword [eax]
push eax
call dword [ecx + 8]
cmp dword [esp + 8], ebx
je 0x4022b8
push dword [esp + 8]
call dword [sym.imp.KERNEL32.dll_FreeResource]
jmp 0x4022b8
push 0x536fac
push ecx
lea eax, [esp + 0x10]
push eax
call fcn.004e9a53
add esp, 0xc
test eax, eax
jne 0x4022b8
cmp dword [esp + 8], ebx
je 0x4022b8
push 2
push ebx
push dword [esp + 0x10]
call fcn.004e96fd
add esp, 0xc
push dword [esp + 8]
call fcn.004e991f
pop ecx
push ebx
push ebx
push dword [esp + 0x10]
mov esi, eax
call fcn.004e96fd
add esp, 0xc
push esi
call fcn.004e7db0
pop ecx
mov dword [esp + 0x10], eax
cmp eax, ebx
je 0x4022ae
push dword [esp + 8]
push esi
push 1
push eax
call fcn.004e9656
mov ecx, dword [esp + 0x20]
push esi
call fcn.00401f9a
add esp, 0x14
mov byte [edi + 0x17], al
cmp al, 4
jne 0x402258
lea eax, [esp + 0x14]
push eax
push 0x1a
mov dword [esp + 0x1c], ebx
call fcn.00460cd7
lea ecx, [esp + 0x18]
lea eax, [esp + 0x14]
mov dword [esp + 0x3c], 4
call fcn.00435802
jmp 0x402281
cmp al, 3
jne 0x4022a4
lea eax, [esp + 0x14]
push eax
push 0x1b
mov dword [esp + 0x1c], ebx
call fcn.00460cd7
lea ecx, [esp + 0x18]
lea eax, [esp + 0x14]
mov dword [esp + 0x3c], 5
call fcn.00435802
mov eax, dword [eax]
mov ecx, dword [eax]
push esi
push dword [esp + 0x14]
push eax
call dword [ecx + 0x10]
or dword [esp + 0x3c], 0xffffffff
mov dword [edi + 8], eax
mov eax, dword [esp + 0x14]
cmp eax, ebx
je 0x4022a4
mov ecx, dword [eax]
push eax
call dword [ecx + 8]
push dword [esp + 0x10]
call fcn.004e93ab
pop ecx
push dword [esp + 8]
call fcn.004e932f
pop ecx
mov eax, dword [edi + 8]
cmp eax, ebx
jne 0x4022c7
mov dword [edi + 0xc], ebx
mov dword [edi + 0x10], ebx
jmp 0x40230b
lea ecx, [esp + 0x18]
push ecx
push 0x18
push eax
call dword [sym.imp.GDI32.dll_GetObjectW]
movzx ecx, word [edi + 0x14]
cmp cx, bx
jbe 0x4022eb
mov eax, dword [esp + 0x1c]
movzx esi, cx
cdq
idiv esi
mov dword [edi + 0xc], eax
mov eax, dword [esp + 0x20]
mov dword [edi + 0x10], eax
movzx eax, cx
imul eax, dword [edi + 0xc]
cmp eax, dword [esp + 0x1c]
jne 0x40230b
cmp word [esp + 0x2a], 0x20
sete al
mov byte [edi + 0x16], al
mov ecx, dword [esp + 0x34]
pop esi
mov dword fs:[0], ecx
pop ebx
mov esp, ebp
pop ebp
ret