Function at 0x4021a0
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5298b8
mov eax, dword fs:[0]
push eax
sub esp, 0x50
mov eax, dword [0x58c920]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 0xc]
push 0
push 0x80
push 3
push 0
push 0
push SysReAllocStringLen
push eax
mov dword [ebp - 0x2c], ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
mov dword [ebp - 0x3c], esi
cmp esi, 0xffffffff
jne 0x402216
push str.Open_IconFile_Failed_
push 0x594b70
call fcn.00401c00
push eax
call fcn.00402040
add esp, 0xc
xor al, al
jmp 0x402565
xor eax, eax
push eax
lea edx, [ebp - 0x5c]
push edx
mov dword [ebp - 0x44], eax
mov word [ebp - 0x40], ax
push 6
lea eax, [ebp - 0x44]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
xor edi, edi
xor ebx, ebx
xor eax, eax
mov dword [ebp - 0x58], edi
mov dword [ebp - 0x54], ebx
mov dword [ebp - 0x50], eax
xor ecx, ecx
mov dword [ebp - 4], eax
mov dword [ebp - 0x30], eax
cmp cx, word [ebp - 0x40]
jae 0x402368
push 0
lea edx, [ebp - 0x5c]
push edx
push 0x10
lea eax, [ebp - 0x20]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
lea ecx, [ebp - 0x20]
cmp ecx, ebx
jae 0x4022e7
mov edx, ecx
cmp edi, edx
ja 0x4022e7
mov esi, ecx
mov ecx, dword [ebp - 0x50]
sub esi, edi
cmp ebx, ecx
jne 0x4022c3
mov eax, ebx
sub eax, edi
sar eax, 4
cmp eax, 0xffffffe
ja 0x402393
sub ecx, edi
inc eax
sar ecx, 4
cmp eax, ecx
jbe 0x4022c3
mov edx, ecx
shr edx, 1
mov edi, 0xfffffff
sub edi, edx
cmp edi, ecx
jae 0x4022ac
xor ecx, ecx
jmp 0x4022ae
add ecx, edx
cmp ecx, eax
jae 0x4022b4
mov ecx, eax
push ecx
lea ecx, [ebp - 0x58]
call fcn.004020a0
mov ebx, dword [ebp - 0x54]
mov edi, dword [ebp - 0x58]
and esi, 0xfffffff0
add esi, edi
test ebx, ebx
je 0x4022e2
mov eax, dword [esi]
mov dword [ebx], eax
mov ecx, dword [esi + 4]
mov dword [ebx + 4], ecx
mov edx, dword [esi + 8]
mov dword [ebx + 8], edx
mov eax, dword [esi + 0xc]
mov dword [ebx + 0xc], eax
mov esi, dword [ebp - 0x3c]
jmp 0x40234f
mov ecx, dword [ebp - 0x50]
cmp ebx, ecx
jne 0x402334
mov eax, ebx
sub eax, edi
sar eax, 4
cmp eax, 0xffffffe
ja 0x402393
sub ecx, edi
inc eax
sar ecx, 4
cmp eax, ecx
jbe 0x402334
mov edx, ecx
shr edx, 1
mov edi, 0xfffffff
sub edi, edx
cmp edi, ecx
jae 0x40231d
xor ecx, ecx
jmp 0x40231f
add ecx, edx
cmp ecx, eax
jae 0x402325
mov ecx, eax
push ecx
lea ecx, [ebp - 0x58]
call fcn.004020a0
mov ebx, dword [ebp - 0x54]
mov edi, dword [ebp - 0x58]
test ebx, ebx
je 0x40234f
mov ecx, dword [ebp - 0x20]
mov dword [ebx], ecx
mov edx, dword [ebp - 0x1c]
mov dword [ebx + 4], edx
mov eax, dword [ebp - 0x18]
mov dword [ebx + 8], eax
mov ecx, dword [ebp - 0x14]
mov dword [ebx + 0xc], ecx
mov eax, dword [ebp - 0x30]
movzx edx, word [ebp - 0x40]
inc eax
add ebx, 0x10
mov dword [ebp - 0x54], ebx
mov dword [ebp - 0x30], eax
cmp eax, edx
jl 0x402252
mov eax, dword [ebp - 0x2c]
sub ebx, edi
push 0
sar ebx, 4
push eax
mov dword [ebp - 0x34], ebx
call dword [sym.imp.KERNEL32.dll_BeginUpdateResourceW]
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x38], 0
test ebx, ebx
je 0x4024c6
add edi, 0xc
jmp 0x4023a3
push str.vector_T__too_long
call fcn.005270bb
lea ecx, [ecx]
mov ebx, dword [ebp - 0x34]
cmp ebx, dword [ebp - 0x38]
jbe 0x4024bc
mov ebx, dword [edi - 4]
push ebx
call fcn.0041a269
mov ecx, dword [edi]
mov edx, dword [ebp - 0x3c]
add esp, 4
push 0
push 0
push ecx
mov esi, eax
push edx
mov dword [ebp - 0x30], esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ecx, dword [ebp - 0x3c]
push 0
lea eax, [ebp - 0x5c]
push eax
push ebx
push esi
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov dx, word [ebp - 0x40]
mov ecx, dword [edi - 4]
xor eax, eax
mov dword [ebp - 0x24], eax
mov word [ebp - 0x24], dx
mov edx, dword [edi - 0xc]
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x14], eax
mov eax, dword [edi - 8]
mov dword [ebp - 0x20], edx
xor edx, edx
push 0x18
mov dword [ebp - 0x28], 0x10000
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x18], ecx
mov word [ebp - 0x14], dx
mov dword [ebp - 0x48], 0x18
call fcn.0041a269
mov ecx, dword [ebp - 0x24]
mov edx, dword [ebp - 0x20]
mov esi, eax
mov eax, dword [ebp - 0x28]
mov dword [esi], eax
mov eax, dword [ebp - 0x1c]
mov dword [esi + 4], ecx
mov ecx, dword [ebp - 0x18]
add esp, 4
mov dword [esi + 8], edx
mov edx, dword [ebp - 0x14]
push 0x18
mov dword [esi + 0xc], eax
push esi
mov dword [esi + 0x10], ecx
mov eax, str.IDI_ICON1
push 0x409
movzx ecx, ax
push ecx
mov dword [esi + 0x14], edx
mov edx, dword [ebp - 0x2c]
push 3
push edx
call dword [sym.imp.KERNEL32.dll_UpdateResourceW]
mov ecx, dword [ebp - 0x38]
mov eax, dword [ebp - 0x30]
push ebx
push eax
mov eax, dword [ebp - 0x2c]
inc ecx
push 0x409
movzx edx, cx
push edx
push 3
push eax
call dword [sym.imp.KERNEL32.dll_UpdateResourceW]
mov ecx, dword [ebp - 0x34]
dec ecx
cmp dword [ebp - 0x38], ecx
je 0x4024a7
push esi
call fcn.0041a274
mov edx, dword [ebp - 0x30]
push edx
call fcn.0041a274
add esp, 8
mov eax, dword [ebp - 0x38]
inc eax
add edi, 0x10
mov dword [ebp - 0x38], eax
cmp eax, dword [ebp - 0x34]
jb 0x4023a0
jmp 0x4024cc
push str.invalid_vector_T__subscript
call fcn.00527108
mov ebx, dword [ebp - 0x48]
mov esi, dword [ebp - 0x48]
xor edi, edi
mov edi, edi
mov ecx, dword [ebp - 0x34]
cmp ecx, 0xa
ja 0x4024e1
mov eax, 0xa
sub eax, ecx
jmp 0x4024e4
lea eax, [ecx - 0xa]
cmp edi, eax
jae 0x40252b
mov eax, dword [ebp - 0x48]
push eax
mov eax, dword [ebp - 0x2c]
push esi
mov ecx, str.IDI_ICON1
push 0x409
movzx edx, cx
push edx
push 3
push eax
call dword [sym.imp.KERNEL32.dll_UpdateResourceW]
mov edx, dword [ebp - 0x34]
mov ecx, dword [ebp - 0x30]
push ebx
push ecx
lea eax, [edx + edi + 1]
mov edx, dword [ebp - 0x2c]
push 0x409
movzx ecx, ax
push ecx
push 3
push edx
call dword [sym.imp.KERNEL32.dll_UpdateResourceW]
inc edi
jmp 0x4024d0
push esi
call fcn.0041a274
mov eax, dword [ebp - 0x30]
push eax
call fcn.0041a274
mov ecx, dword [ebp - 0x2c]
add esp, 8
push 0
push ecx
call dword [sym.imp.KERNEL32.dll_EndUpdateResourceW]
mov edx, dword [ebp - 0x3c]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x58]
test eax, eax
je 0x402563
push eax
call fcn.0041a274
add esp, 4
mov al, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.005090f3
mov esp, ebp
pop ebp
ret