Function at 0x40b570
Capabilities:
Read file on windows

Disassembly:
sub esp, 0x44c
mov eax, dword [esp + 0x450]
push ebx
push ebp
push esi
push edi
push 0x41f098
mov esi, ecx
push eax
call dword [sym.imp.MSVCRT.dll_fopen]
mov ebp, eax
add esp, 8
test ebp, ebp
mov dword [esp + 0x38], ebp
jne 0x40b5ae
pop edi
pop esi
pop ebp
mov eax, 2
pop ebx
add esp, 0x44c
ret 4
mov edi, dword [sym.imp.MSVCRT.dll_fread]
push ebp
push 1
lea ecx, [esp + 0x36]
push 2
push ecx
call edi
mov al, byte [esp + 0x3e]
add esp, 0x10
cmp al, 0x42
push ebp
je 0x40b5e7
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
pop edi
pop esi
pop ebp
mov eax, 9
pop ebx
add esp, 0x44c
ret 4
push 1
lea edx, [esp + 0x5c]
push 4
push edx
call edi
push ebp
push 1
lea eax, [esp + 0x5a]
push 4
push eax
call edi
push ebp
push 1
lea ecx, [esp + 0x6c]
push 4
push ecx
call edi
push ebp
push 1
lea edx, [esp + 0x90]
push 4
push edx
call edi
add esp, 0x40
lea eax, [esp + 0x14]
push ebp
push 1
push 4
push eax
call edi
push ebp
push 1
lea ecx, [esp + 0x30]
push 4
push ecx
call edi
push ebp
push 1
lea edx, [esp + 0x5e]
push 2
push edx
call edi
push ebp
push 1
lea eax, [esp + 0x60]
push 2
push eax
call edi
add esp, 0x40
lea ecx, [esp + 0x50]
push ebp
push 1
push 4
push ecx
call edi
push ebp
push 1
lea edx, [esp + 0x60]
push 4
push edx
call edi
push ebp
push 1
lea eax, [esp + 0x74]
push 8
push eax
call edi
push ebp
push 1
lea ecx, [esp + 0x74]
push 8
push ecx
call edi
mov ecx, dword [esp + 0x68]
add esp, 0x40
mov eax, ecx
and eax, 0xffff
dec eax
je 0x40b6a8
sub eax, 3
je 0x40b6a1
sub eax, 4
jne 0x40b6af
mov eax, 0x100
jmp 0x40b6b3
mov eax, 0x10
jmp 0x40b6b3
mov eax, 2
jmp 0x40b6b3
mov eax, dword [esp + 0x3c]
cmp cx, 0x18
je 0x40b6d2
push ebp
lea edx, [eax*4]
push 1
lea eax, [esp + 0x64]
push edx
push eax
call edi
mov ecx, dword [esp + 0x38]
add esp, 0x10
and ecx, 0xffff
mov bl, 1
mov byte [esp + 0x24], bl
lea eax, [ecx - 1]
cmp eax, 0x17
ja case.0x40b6f2.5
xor ecx, ecx
mov cl, byte [eax + 0x40baac]
jmp dword [ecx*4 + 0x40ba98]
mov eax, dword [esp + 0x14]
mov ecx, eax
shr ecx, 5
mov edx, ecx
shl edx, 5
cmp edx, eax
jne 0x40b762
shr eax, 3
jmp 0x40b769
mov eax, dword [esp + 0x14]
mov ecx, eax
shr ecx, 3
lea edx, [ecx*8]
cmp edx, eax
jne 0x40b762
shr eax, 1
jmp 0x40b769
mov ecx, dword [esp + 0x14]
mov eax, ecx
shr eax, 2
lea edx, [eax*4]
cmp edx, ecx
je 0x40b745
lea eax, [eax*4 + 4]
jmp 0x40b769
mov dword [esp + 0x10], ecx
jmp case.0x40b6f2.5
mov eax, dword [esp + 0x14]
lea eax, [eax + eax*2]
mov ecx, eax
shr ecx, 2
lea edx, [ecx*4]
cmp edx, eax
je 0x40b769
lea eax, [ecx*4 + 4]
mov dword [esp + 0x10], eax
mov ecx, dword [esp + 0x10]
push ecx
call sub.MFC42.DLL_operatornew
add esp, 4
mov dword [esp + 0x20], eax
test eax, eax
jne 0x40b794
pop edi
pop esi
pop ebp
mov eax, 8
pop ebx
add esp, 0x44c
ret 4
mov edx, dword [esp + 0x18]
mov eax, dword [esp + 0x14]
push edx
push eax
mov ecx, esi
call sym.Screen2Exe.exe_public:_long_int___thiscall_CTPImage::Create_unsigned_int__unsigned_int_
test eax, eax
jne 0x40ba88
mov ecx, dword [esp + 0x28]
mov esi, dword [esi + 8]
and ecx, 0xffff
lea eax, [ecx - 1]
cmp eax, 0x17
ja case.0x40b7ce.5
xor edx, edx
mov dl, byte [eax + 0x40bad8]
jmp dword [edx*4 + 0x40bac4]
mov eax, dword [esp + 0x18]
mov dword [esp + 0x1c], 0
test eax, eax
jbe case.0x40b7ce.5
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x20]
push ebp
push eax
push 1
push ecx
call edi
mov ecx, dword [esp + 0x20]
add esp, 0x10
cmp eax, ecx
jne 0x40b5d5
mov ecx, dword [esp + 0x14]
xor edx, edx
test ecx, ecx
jbe 0x40b881
mov eax, dword [esp + 0x18]
mov edi, dword [esp + 0x1c]
sub eax, edi
dec eax
imul eax, ecx
add eax, edx
shl eax, 2
test dl, 7
jne 0x40b83f
mov edi, dword [esp + 0x20]
mov ecx, edx
shr ecx, 3
mov bl, 0x80
mov cl, byte [ecx + edi]
mov byte [esp + 0x24], bl
mov byte [esp + 0x30], cl
mov cl, byte [esp + 0x30]
and cl, bl
sub cl, bl
neg cl
sbb ecx, ecx
and ecx, 0xfffffffc
add ecx, 4
mov bl, byte [esp + ecx + 0x5c]
mov byte [eax + esi], bl
mov bl, byte [esp + ecx + 0x5d]
mov byte [esi + eax + 1], bl
mov cl, byte [esp + ecx + 0x5e]
mov bl, byte [esp + 0x24]
mov byte [esi + eax + 2], cl
mov ecx, dword [esp + 0x14]
shr bl, 1
inc edx
mov byte [esp + 0x24], bl
cmp edx, ecx
jb 0x40b811
mov edi, dword [sym.imp.MSVCRT.dll_fread]
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x18]
inc eax
cmp eax, ecx
mov dword [esp + 0x1c], eax
jb 0x40b7e9
jmp case.0x40b7ce.5
mov eax, dword [esp + 0x18]
mov dword [esp + 0x1c], 0
test eax, eax
jbe case.0x40b7ce.5
jmp 0x40b8b7
mov edi, dword [sym.imp.MSVCRT.dll_fread]
mov edx, dword [esp + 0x10]
mov eax, dword [esp + 0x20]
push ebp
push edx
push 1
push eax
call edi
mov ecx, dword [esp + 0x20]
add esp, 0x10
cmp eax, ecx
jne 0x40b5d5
mov ecx, dword [esp + 0x14]
xor edi, edi
test ecx, ecx
jbe 0x40b956
mov eax, dword [esp + 0x18]
mov ebp, dword [esp + 0x1c]
sub eax, ebp
mov ebp, edi
dec eax
imul eax, ecx
add eax, edi
shl eax, 2
and ebp, 1
jne 0x40b90e
mov edx, dword [esp + 0x20]
mov ecx, edi
shr ecx, 1
mov bl, 0xf0
mov cl, byte [ecx + edx]
mov byte [esp + 0x24], bl
mov byte [esp + 0x30], cl
mov ecx, dword [esp + 0x30]
mov edx, dword [esp + 0x24]
and ecx, 0xff
and edx, 0xff
and ecx, edx
test ebp, ebp
jne 0x40b92b
shr ecx, 4
mov dl, byte [esp + ecx*4 + 0x5c]
mov byte [eax + esi], dl
mov dl, byte [esp + ecx*4 + 0x5d]
mov byte [esi + eax + 1], dl
mov cl, byte [esp + ecx*4 + 0x5e]
mov byte [esi + eax + 2], cl
mov ecx, dword [esp + 0x14]
shr bl, 4
inc edi
mov byte [esp + 0x24], bl
cmp edi, ecx
jb 0x40b8df
mov ebp, dword [esp + 0x38]
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x18]
inc eax
cmp eax, ecx
mov dword [esp + 0x1c], eax
jb 0x40b8b1
jmp case.0x40b7ce.5
mov eax, dword [esp + 0x18]
xor ebx, ebx
test eax, eax
jbe case.0x40b7ce.5
jmp 0x40b986
mov edi, dword [sym.imp.MSVCRT.dll_fread]
mov edx, dword [esp + 0x10]
mov eax, dword [esp + 0x20]
push ebp
push edx
push 1
push eax
call edi
mov ecx, dword [esp + 0x20]
add esp, 0x10
cmp eax, ecx
jne 0x40b5d5
mov ecx, dword [esp + 0x14]
xor edi, edi
test ecx, ecx
jbe 0x40b9e9
mov eax, dword [esp + 0x18]
mov edx, dword [esp + 0x20]
sub eax, ebx
dec eax
imul eax, ecx
xor ecx, ecx
add eax, edi
mov cl, byte [edi + edx]
shl ecx, 2
shl eax, 2
mov dl, byte [esp + ecx + 0x5c]
inc edi
mov byte [eax + esi], dl
mov dl, byte [esp + ecx + 0x5d]
mov byte [esi + eax + 1], dl
mov cl, byte [esp + ecx + 0x5e]
mov byte [esi + eax + 2], cl
mov ecx, dword [esp + 0x14]
cmp edi, ecx
jb 0x40b9ae
mov eax, dword [esp + 0x18]
inc ebx
cmp ebx, eax
jb 0x40b980
jmp case.0x40b7ce.5
mov eax, dword [esp + 0x18]
xor ebx, ebx
test eax, eax
mov dword [esp + 0x1c], ebx
jbe case.0x40b7ce.5
mov edx, dword [esp + 0x10]
mov eax, dword [esp + 0x20]
push ebp
push edx
push 1
push eax
call edi
mov ecx, dword [esp + 0x20]
add esp, 0x10
cmp eax, ecx
jne 0x40b5d5
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x14]
sub eax, ebx
xor edx, edx
dec eax
imul eax, ecx
shl eax, 2
test ecx, ecx
jbe 0x40ba65
mov ecx, dword [esp + 0x20]
lea eax, [eax + esi + 2]
add ecx, 2
mov bl, byte [ecx - 2]
inc edx
mov byte [eax - 2], bl
mov bl, byte [ecx - 1]
mov byte [eax - 1], bl
mov bl, byte [ecx]
mov byte [eax], bl
mov ebx, dword [esp + 0x14]
add ecx, 3
add eax, 4
cmp edx, ebx
jb 0x40ba42
mov ebx, dword [esp + 0x1c]
mov eax, dword [esp + 0x18]
inc ebx
cmp ebx, eax
mov dword [esp + 0x1c], ebx
jb 0x40ba02
mov edx, dword [esp + 0x20]
push edx
call sub.MFC42.DLL_operatordelete
push ebp
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x44c
ret 4