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

Disassembly:
push 0x30c
mov eax, 0x5f621c
call fcn.00450c37
mov edi, dword [ebp + 0xc]
xor ebx, ebx
xor esi, esi
mov dword [ebp - 0x314], edi
inc ebx
test edi, edi
jne 0x422308
call fcn.00413ca0
push eax
lea ecx, [ebp - 0xc0]
call fcn.0041194b
and dword [ebp - 4], esi
call fcn.00413ca6
mov ecx, eax
call fcn.00412046
test al, al
je 0x422218
push dword [ebp + 8]
lea ecx, [ebp - 0xc0]
call fcn.00411b42
push esi
push 0x80
push 3
push esi
push ebx
push SysReAllocStringLen
lea ecx, [ebp - 0xc0]
call fcn.00411b22
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x2fc], eax
cmp eax, 0xffffffff
jne 0x4221c1
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0xc0]
call fcn.00411a22
jmp 0x42239f
push 0
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, eax
test esi, esi
je 0x4221ad
and dword [ebp - 0x300], 0
push esi
call fcn.0045041a
pop ecx
push 0
mov edi, eax
lea eax, [ebp - 0x300]
push eax
push esi
push edi
push dword [ebp - 0x2fc]
call dword [sym.imp.KERNEL32.dll_ReadFile]
push dword [ebp - 0x2fc]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x300], esi
je 0x4222f4
push edi
call fcn.00450415
pop ecx
jmp 0x4221ad
call fcn.00413ca6
push eax
lea ecx, [ebp - 0xc0]
call fcn.00411b25
call fcn.00413e69
test al, al
je 0x422239
call fcn.00413cac
jmp 0x422251
push 2
push 0
lea ecx, [ebp - 0xc0]
call fcn.00411b22
push eax
call fcn.00425c1b
add esp, 0xc
mov dword [ebp - 0x2fc], eax
test eax, eax
je 0x4221ad
lea ecx, [ebp - 0x2f0]
push ecx
lea ecx, [ebp - 0x304]
push ecx
push ebx
push dword [ebp + 8]
push eax
call fcn.0042565b
add esp, 0x14
test eax, eax
jne 0x4221ad
mov esi, dword [ebp - 0xc4]
test esi, esi
je 0x4221ad
push esi
call fcn.0045041a
push 3
push esi
mov edi, eax
push edi
push dword [ebp - 0x304]
push dword [ebp - 0x2fc]
call fcn.00425ff2
add esp, 0x18
test eax, eax
je 0x4222df
cmp eax, 0x600
je 0x4222df
push edi
call fcn.00450415
pop ecx
call fcn.00413e69
test al, al
jne 0x4221ad
push dword [ebp - 0x2fc]
call fcn.004254b7
jmp 0x422215
call fcn.00413e69
test al, al
jne 0x4222f4
push dword [ebp - 0x2fc]
call fcn.004254b7
pop ecx
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0xc0]
call fcn.00411a22
jmp 0x42239b
push str.COLOR
push edi
call fcn.005d5d2f
pop ecx
pop ecx
test eax, eax
jne 0x422321
inc eax
mov edi, eax
jmp 0x42241c
push edi
push dword [ebp + 8]
call fcn.00413c91
push eax
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov esi, eax
mov dword [ebp - 0x300], esi
test esi, esi
je 0x42239f
push esi
call fcn.00413c91
push eax
call dword [sym.imp.KERNEL32.dll_LoadResource]
mov dword [ebp - 0x304], eax
push esi
test eax, eax
jne 0x42235d
call dword [sym.imp.KERNEL32.dll_FreeResource]
jmp 0x42239f
call fcn.00413c91
push eax
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov esi, eax
test esi, esi
je 0x42239f
push esi
call fcn.0045041a
pop ecx
push esi
push dword [ebp - 0x304]
mov edi, eax
call dword [sym.imp.KERNEL32.dll_LockResource]
push eax
push edi
call fcn.005c6940
add esp, 0xc
push dword [ebp - 0x300]
call dword [sym.imp.KERNEL32.dll_FreeResource]
test edi, edi
jne 0x422419
push 0
push 0x80
push 3
push 0
push ebx
push SysReAllocStringLen
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x4226ed
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, eax
test esi, esi
je 0x4226ed
and dword [ebp - 0x2fc], 0
push esi
call fcn.0045041a
pop ecx
push 0
mov edi, eax
lea eax, [ebp - 0x2fc]
push eax
push esi
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x2fc], esi
je 0x422411
push edi
call fcn.00450415
pop ecx
xor edi, edi
test edi, edi
je 0x4226ed
xor eax, eax
inc eax
mov dword [ebp - 0x30c], eax
xor ebx, ebx
mov dword [ebp - 0x310], eax
mov eax, dword [ebp - 0x314]
test eax, eax
je 0x422445
push str.COLOR
push eax
call fcn.005d5d2f
pop ecx
pop ecx
test eax, eax
je 0x422476
push 4
lea eax, [ebp - 0x318]
push eax
lea eax, [ebp - 0x310]
push eax
lea eax, [ebp - 0x30c]
push eax
push esi
push edi
call fcn.00439df0
push edi
mov ebx, eax
call fcn.00450415
add esp, 0x1c
test ebx, ebx
je 0x4226ed
push 0x2c
lea eax, [ebp - 0x3c]
push 0
push eax
call fcn.005c7440
mov edx, dword [ebp - 0x310]
add esp, 0xc
mov ecx, dword [ebp - 0x30c]
mov eax, edx
and dword [ebp - 0x2c], 0
neg eax
mov dword [ebp - 0x34], eax
xor edi, edi
push 0x20
pop eax
imul edx, ecx
inc edi
mov dword [ebp - 0x38], ecx
xor ecx, ecx
push ecx
push ecx
mov word [ebp - 0x2e], ax
lea eax, [ebp - 0x2f8]
push eax
push ecx
lea eax, [ebp - 0x3c]
shl edx, 2
push eax
push ecx
mov dword [ebp - 0x3c], 0x28
mov word [ebp - 0x30], di
mov dword [ebp - 0x28], edx
mov byte [ebp - 0x2f1], cl
mov dword [ebp - 0x2f8], ecx
call dword [sym.imp.GDI32.dll_CreateDIBSection]
mov dword [ebp - 0x300], eax
test eax, eax
je 0x4226ed
and dword [ebp - 0x308], 0
mov eax, dword [ebp - 0x314]
test eax, eax
je 0x422564
push str.COLOR
push eax
call fcn.005d5d2f
pop ecx
pop ecx
test eax, eax
jne 0x422564
and dword [ebp - 0x304], eax
mov eax, dword [ebp + 8]
cmp word [eax], 0x23
jne 0x422527
push eax
call dword [sym.imp.USER32.dll_CharNextW]
push 0x10
lea ecx, [ebp - 0x304]
push ecx
push eax
call fcn.005d0eee
mov ecx, eax
mov byte [ebp - 0x306], al
shr ecx, 0x18
lea ebx, [ebp - 0x308]
mov byte [ebp - 0x305], cl
add esp, 0xc
mov ecx, eax
shr ecx, 8
shr eax, 0x10
mov byte [ebp - 0x307], cl
mov byte [ebp - 0x308], al
mov eax, dword [ebp - 0x310]
xor esi, esi
imul eax, dword [ebp - 0x30c]
test eax, eax
jle 0x42266d
mov edx, 0xff
mov eax, dword [ebp - 0x2f8]
mov cl, byte [ebx + esi*4 + 3]
mov byte [eax + esi*4 + 3], cl
mov edi, dword [ebp - 0x2f8]
cmp byte [edi + esi*4 + 3], dl
jae 0x4225f8
movzx ecx, byte [ebx + esi*4 + 3]
xor edx, edx
movzx eax, byte [ebx + esi*4 + 2]
imul eax, ecx
mov ecx, 0xff
mov byte [ebp - 0x2f1], 1
div ecx
xor edx, edx
mov byte [edi + esi*4], al
mov edi, 0xff
movzx ecx, byte [ebx + esi*4 + 3]
movzx eax, byte [ebx + esi*4 + 1]
imul eax, ecx
mov ecx, dword [ebp - 0x2f8]
div edi
xor edx, edx
mov byte [ecx + esi*4 + 1], al
movzx ecx, byte [ebx + esi*4 + 3]
movzx eax, byte [ebx + esi*4]
imul eax, ecx
mov ecx, dword [ebp - 0x2f8]
div edi
mov edx, edi
mov byte [ecx + esi*4 + 2], al
jmp 0x42261a
mov al, byte [ebx + esi*4 + 2]
mov byte [edi + esi*4], al
mov eax, dword [ebp - 0x2f8]
mov cl, byte [ebx + esi*4 + 1]
mov byte [eax + esi*4 + 1], cl
mov eax, dword [ebp - 0x2f8]
mov cl, byte [ebx + esi*4]
mov byte [eax + esi*4 + 2], cl
mov eax, dword [ebp - 0x2f8]
mov ecx, dword [ebp + 0x10]
cmp dword [eax + esi*4], ecx
jne 0x422654
mov byte [eax + esi*4], 0
mov eax, dword [ebp - 0x2f8]
mov byte [ebp - 0x2f1], 1
mov byte [eax + esi*4 + 1], 0
mov eax, dword [ebp - 0x2f8]
mov byte [eax + esi*4 + 2], 0
mov eax, dword [ebp - 0x2f8]
mov byte [eax + esi*4 + 3], 0
mov eax, dword [ebp - 0x310]
inc esi
imul eax, dword [ebp - 0x30c]
cmp esi, eax
jl 0x422580
xor edi, edi
inc edi
mov eax, dword [ebp - 0x314]
test eax, eax
je 0x422688
push str.COLOR
push eax
call fcn.005d5d2f
pop ecx
pop ecx
test eax, eax
je 0x42268f
push ebx
call fcn.00439deb
pop ecx
push 0xa0
call fcn.004503c2
mov esi, eax
pop ecx
mov dword [ebp - 0x304], esi
mov dword [ebp - 4], edi
test esi, esi
je 0x4226b3
lea ecx, [esi + 0x18]
call fcn.00411994
jmp 0x4226b5
xor esi, esi
mov eax, dword [ebp - 0x300]
mov dword [esi], eax
mov ecx, dword [ebp - 0x2f8]
mov al, byte [ebp - 0x2f1]
mov dword [esi + 4], ecx
mov ecx, dword [ebp - 0x30c]
mov dword [esi + 0xc], ecx
mov ecx, dword [ebp - 0x310]
and dword [esi + 8], 0
mov byte [esi + 0x14], al
mov eax, esi
mov dword [esi + 0x10], ecx
mov byte [esi + 0x15], 0
jmp 0x4226ef
xor eax, eax
call fcn.00450be1
ret