Function at 0x407a62
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x104
push ebx
push esi
push edi
push 0x8c
call fcn.0040ce9c
mov esi, eax
xor ebx, ebx
cmp esi, ebx
pop ecx
jne 0x407aaa
cmp byte [0x422358], bl
je 0x407d32
push ebx
push str.Error
push str.Out_of_memory.
call dword [sym.imp.USER32.dll_GetFocus]
push eax
call dword [sym.imp.USER32.dll_MessageBoxA]
jmp 0x407d32
cmp dword [ebp + 0xc], ebx
push ebx
push ebx
push 3
push ebx
push 1
push 0x80000000
push dword [ebp + 8]
je 0x407ac6
call dword [sym.imp.KERNEL32.dll_CreateFileW]
jmp 0x407acc
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [esi + 0x6c], eax
jne 0x407b26
cmp dword [ebp + 0xc], ebx
push dword [ebp + 8]
je 0x407ae3
push str.Failed_to_open_image_file__ws._n
jmp 0x407ae8
push str.Failed_to_open_image_file__s._n
lea eax, [ebp - 0x104]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
cmp byte [0x422358], bl
je 0x407b1a
push ebx
lea eax, [ebp - 0x104]
push str.Error
push eax
call dword [sym.imp.USER32.dll_GetFocus]
push eax
call dword [sym.imp.USER32.dll_MessageBoxA]
push esi
call fcn.0040cc89
pop ecx
jmp 0x407d32
lea ecx, [ebp - 4]
push ebx
push ecx
push 0xc
push esi
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov ax, word [esi]
cmp ax, 0xda01
jne 0x407d3b
mov ax, word [esi + 2]
xor ecx, ecx
mov cl, ah
mov ch, al
mov ax, word [esi + 4]
mov word [esi + 2], cx
xor ecx, ecx
mov ch, al
mov cl, ah
mov ax, word [esi + 6]
mov word [esi + 4], cx
xor ecx, ecx
mov cl, ah
mov ch, al
mov ax, word [esi + 8]
mov word [esi + 6], cx
xor ecx, ecx
mov cl, ah
mov ch, al
mov ax, word [esi + 0xa]
mov word [esi + 8], cx
xor ecx, ecx
mov ch, al
mov cl, ah
mov word [esi + 0xa], cx
movzx eax, word [esi + 6]
shl eax, 8
push eax
call fcn.0040ce9c
mov dword [esi + 0x70], eax
pop ecx
movzx eax, word [esi + 6]
shl eax, 8
push eax
call fcn.0040ce9c
mov dword [esi + 0x74], eax
pop ecx
movzx eax, word [esi + 6]
shl eax, 8
push eax
call fcn.0040ce9c
mov dword [esi + 0x78], eax
pop ecx
movzx eax, word [esi + 6]
shl eax, 8
push eax
call fcn.0040ce9c
cmp dword [esi + 0x70], ebx
pop ecx
mov dword [esi + 0x7c], eax
je 0x407d0c
cmp dword [esi + 0x74], ebx
je 0x407d0c
cmp dword [esi + 0x78], ebx
je 0x407d0c
cmp eax, ebx
je 0x407d0c
mov ax, word [esi + 2]
and ax, 0xff00
cmp ax, 0x100
jne 0x407cfe
movzx edi, word [esi + 8]
movzx eax, word [esi + 0xa]
imul edi, eax
shl edi, 2
push edi
call fcn.0040ce9c
pop ecx
mov dword [esi + 0x84], eax
push edi
call fcn.0040ce9c
cmp dword [esi + 0x84], ebx
pop ecx
mov dword [esi + 0x88], eax
je 0x407d02
cmp eax, ebx
je 0x407d02
push ebx
push ebx
push 0x200
lea eax, [edi + edi + 0x200]
push dword [esi + 0x6c]
mov dword [esi + 0x80], eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
lea eax, [ebp - 4]
push ebx
push eax
push edi
push dword [esi + 0x84]
push dword [esi + 0x6c]
call dword [sym.imp.KERNEL32.dll_ReadFile]
lea eax, [ebp - 4]
push ebx
push eax
push edi
push dword [esi + 0x88]
push dword [esi + 0x6c]
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp word [esi], 0xda01
jne 0x407cfe
mov ecx, dword [esi + 0x84]
mov edx, dword [esi + 0x88]
shr edi, 2
mov eax, edi
dec edi
test eax, eax
je 0x407cfe
inc edi
mov dword [ebp + 8], edi
mov eax, dword [ecx]
mov edi, eax
mov ebx, eax
and edi, 0xff00
shl ebx, 0x10
or edi, ebx
mov ebx, eax
shr ebx, 0x10
and eax, 0xff0000
or ebx, eax
shl edi, 8
shr ebx, 8
or edi, ebx
mov dword [ecx], edi
mov eax, dword [edx]
mov edi, eax
mov ebx, eax
and edi, 0xff00
add ecx, 4
shl ebx, 0x10
or edi, ebx
mov ebx, eax
shr ebx, 0x10
and eax, 0xff0000
or ebx, eax
shl edi, 8
shr ebx, 8
or edi, ebx
mov dword [edx], edi
add edx, 4
dec dword [ebp + 8]
jne 0x407ca5
mov eax, esi
jmp 0x407d34
cmp byte [0x422358], bl
je 0x407d2c
jmp 0x407d14
cmp byte [0x422358], bl
je 0x407d2c
push ebx
push str.Error
push str.Out_of_memory.
call dword [sym.imp.USER32.dll_GetFocus]
push eax
call dword [sym.imp.USER32.dll_MessageBoxA]
push esi
call fcn.00407d5a
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret 8
cmp ax, 0x1da
je 0x407b88
cmp byte [0x422358], bl
je 0x407d2c
push ebx
push str.Error
push str.Invalid_rgb_file.
jmp 0x407d1f