Function at 0x40a480
Capabilities:
Read file on windows

Disassembly:
sub esp, 0x44c
mov eax, dword [esp + 0x450]
push ebx
push ebp
push esi
push edi
push 0x4180c0
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 0x40a4be
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 0x40a4f7
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 0x40a5b8
sub eax, 3
je 0x40a5b1
sub eax, 4
jne 0x40a5bf
mov eax, 0x100
jmp 0x40a5c3
mov eax, 0x10
jmp 0x40a5c3
mov eax, 2
jmp 0x40a5c3
mov eax, dword [esp + 0x3c]
cmp cx, 0x18
je 0x40a5e2
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.0x40a602.5
xor ecx, ecx
mov cl, byte [eax + 0x40a9bc]
jmp dword [ecx*4 + 0x40a9a8]
mov eax, dword [esp + 0x14]
mov ecx, eax
shr ecx, 5
mov edx, ecx
shl edx, 5
cmp edx, eax
jne 0x40a672
shr eax, 3
jmp 0x40a679
mov eax, dword [esp + 0x14]
mov ecx, eax
shr ecx, 3
lea edx, [ecx*8]
cmp edx, eax
jne 0x40a672
shr eax, 1
jmp 0x40a679
mov ecx, dword [esp + 0x14]
mov eax, ecx
shr eax, 2
lea edx, [eax*4]
cmp edx, ecx
je 0x40a655
lea eax, [eax*4 + 4]
jmp 0x40a679
mov dword [esp + 0x10], ecx
jmp case.0x40a602.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 0x40a679
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 0x40a6a4
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.Player.exe_public:_long_int___thiscall_CTPImage::Create_unsigned_int__unsigned_int_
test eax, eax
jne 0x40a998
mov ecx, dword [esp + 0x28]
mov esi, dword [esi + 8]
and ecx, 0xffff
lea eax, [ecx - 1]
cmp eax, 0x17
ja case.0x40a6de.5
xor edx, edx
mov dl, byte [eax + 0x40a9e8]
jmp dword [edx*4 + 0x40a9d4]
mov eax, dword [esp + 0x18]
mov dword [esp + 0x1c], 0
test eax, eax
jbe case.0x40a6de.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 0x40a4e5
mov ecx, dword [esp + 0x14]
xor edx, edx
test ecx, ecx
jbe 0x40a791
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 0x40a74f
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 0x40a721
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 0x40a6f9
jmp case.0x40a6de.5
mov eax, dword [esp + 0x18]
mov dword [esp + 0x1c], 0
test eax, eax
jbe case.0x40a6de.5
jmp 0x40a7c7
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 0x40a4e5
mov ecx, dword [esp + 0x14]
xor edi, edi
test ecx, ecx
jbe 0x40a866
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 0x40a81e
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 0x40a83b
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 0x40a7ef
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 0x40a7c1
jmp case.0x40a6de.5
mov eax, dword [esp + 0x18]
xor ebx, ebx
test eax, eax
jbe case.0x40a6de.5
jmp 0x40a896
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 0x40a4e5
mov ecx, dword [esp + 0x14]
xor edi, edi
test ecx, ecx
jbe 0x40a8f9
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 0x40a8be
mov eax, dword [esp + 0x18]
inc ebx
cmp ebx, eax
jb 0x40a890
jmp case.0x40a6de.5
mov eax, dword [esp + 0x18]
xor ebx, ebx
test eax, eax
mov dword [esp + 0x1c], ebx
jbe case.0x40a6de.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 0x40a4e5
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 0x40a975
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 0x40a952
mov ebx, dword [esp + 0x1c]
mov eax, dword [esp + 0x18]
inc ebx
cmp ebx, eax
mov dword [esp + 0x1c], ebx
jb 0x40a912
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