Function at 0x404689
Capabilities:
Read file on windows

Disassembly:
push 0xffffffffffffffff
push 0x411028
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x64
push ebx
push esi
mov esi, ecx
push edi
push 0x4180c0
mov dword [esp + 0x10], esi
lea eax, [esi + 0x38]
push eax
call dword [sym.imp.MSVCRT.dll_fopen]
mov ebx, eax
xor edi, edi
add esp, 8
lea ecx, [esp + 0x28]
mov dword [esp + 0x14], ebx
mov dword [esi + 0x238], edi
mov dword [esi + 0x14bb4], edi
mov dword [esi + 0x14be4], edi
mov dword [esi + 0x14bb8], edi
call sym.Player.exe_public:_void___thiscall_CTPImage::constructor_void_
cmp ebx, edi
mov dword [esp + 0x78], edi
je 0x404d9a
mov eax, dword [esi + 0xc]
mov ecx, dword [esi + 8]
cmp eax, eax
push ebp
mov edx, eax
je 0x4046f3
mov ebp, dword [edx]
add edx, 4
mov dword [ecx], ebp
add ecx, 4
cmp edx, eax
jne 0x4046e5
mov edx, dword [esi + 0xc]
lea ebp, [esi + 0x14bd4]
mov dword [esi + 0xc], ecx
mov dword [esp + 0x20], edx
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 4]
cmp eax, eax
mov dword [esp + 0x14], ecx
mov edx, eax
je 0x404738
mov edi, dword [esp + 0x14]
mov ecx, 0xc
mov esi, edx
add edx, 0x30
rep movsd dword es:[edi], dword [esi]
mov edi, dword [esp + 0x14]
add edi, 0x30
cmp edx, eax
mov dword [esp + 0x14], edi
jne 0x404713
mov esi, dword [esp + 0x10]
xor edi, edi
mov edx, dword [ebp + 8]
mov eax, dword [esp + 0x14]
push 2
push edi
mov edi, dword [sym.imp.MSVCRT.dll_fseek]
push ebx
mov dword [esp + 0x2c], edx
mov dword [ebp + 8], eax
call edi
push ebx
call dword [sym.imp.MSVCRT.dll_ftell]
mov ecx, dword [esi + 0x23c]
mov dword [esi + 0x238], 0
sub eax, ecx
push 0
mov dword [esi + 0x14bb4], eax
mov ecx, dword [0x4187cc]
push ecx
push ebx
call edi
add esp, 0x1c
jmp 0x40478a
mov ebx, dword [esp + 0x18]
mov esi, dword [esp + 0x10]
push ebx
mov byte [esp + 0x48], 0x53
mov dword [esp + 0x74], 0
call dword [sym.imp.MSVCRT.dll_ftell]
mov edi, dword [sym.imp.MSVCRT.dll_fread]
push ebx
push 1
lea edx, [esp + 0x50]
push 5
push edx
mov dword [esi + 0x238], eax
call edi
add esp, 0x14
test eax, eax
je 0x404d50
cmp byte [esp + 0x44], 0x53
jne 0x404d50
mov eax, dword [esp + 0x45]
and eax, 0x3f
jne 0x4047ee
push ebx
push 1
lea eax, [esp + 0x51]
push 4
push eax
call edi
add esp, 0x10
test eax, eax
je 0x404d50
jmp 0x4047f2
mov dword [esp + 0x49], eax
push ebx
call dword [sym.imp.MSVCRT.dll_ftell]
mov ecx, dword [esp + 0x49]
mov dword [esp + 0x54], eax
shr ecx, 6
and ecx, 7
add esp, 4
lea eax, [ecx - 3]
cmp eax, 4
ja case.default.0x404816
jmp dword [eax*4 + 0x404dc0]
push ebx
push 1
lea edx, [esp + 0x5c]
push 4
push edx
call edi
add esp, 0x10
mov edi, eax
test edi, edi
je 0x404d50
push ebx
call dword [sym.imp.MSVCRT.dll_ftell]
mov ecx, dword [esi + 0x14bb4]
add esp, 4
cmp eax, ecx
jge 0x404d50
mov edx, dword [esp + 0x45]
and edx, 0x1c0
cmp edx, 0x40
jne 0x404b05
mov eax, dword [ebp + 4]
test eax, eax
jne 0x40497f
mov dword [esp + 0x14], eax
jmp 0x404999
mov eax, dword [esp + 0x49]
push ebx
push 1
lea ecx, [esi + 0x14bec]
push eax
push ecx
call edi
xor ecx, ecx
add esp, 0x10
mov cl, byte [esi + 0x14cdc]
mov edi, eax
cmp ecx, 0x10
ja case.0x4048a0.4
xor edx, edx
mov dl, byte [ecx + 0x404de8]
jmp dword [edx*4 + 0x404dd4]
xor eax, eax
mov dword [0x41c7bc], 1
mov dword [0x4187d0], eax
mov dword [0x4187d4], eax
jmp case.0x4048a0.4
mov dword [0x4187d0], 0
mov dword [0x4187d4], 0x1f40
jmp case.0x4048a0.4
mov dword [0x4187d0], 0
mov dword [0x4187d4], 0x2b11
jmp case.0x4048a0.4
mov dword [0x4187d0], 1
mov dword [0x4187d4], 0x3e80
jmp case.0x4048a0.4
push ebx
push 1
lea eax, [esp + 0x60]
push 0x10
push eax
call edi
add esp, 0x10
mov byte [esp + 0x68], 1
jmp 0x404836
push ebx
push 1
lea ecx, [esp + 0x70]
push 1
push ecx
call edi
push ebx
push 1
lea edx, [esp + 0x70]
push 0x10
push edx
call edi
add esp, 0x20
jmp 0x404836
mov eax, dword [esi + 0x14bb8]
push 1
inc eax
mov dword [esi + 0x14bb8], eax
mov eax, dword [esp + 0x4d]
push eax
push ebx
call dword [sym.imp.MSVCRT.dll_fseek]
add esp, 0xc
jmp 0x404836
mov ecx, dword [esp + 0x49]
push 1
push ecx
push ebx
call dword [sym.imp.MSVCRT.dll_fseek]
add esp, 0xc
jmp 0x404836
mov ecx, dword [ebp + 8]
sub ecx, eax
mov eax, 0x2aaaaaab
imul ecx
sar edx, 3
mov eax, edx
shr eax, 0x1f
add edx, eax
mov dword [esp + 0x14], edx
mov eax, dword [esi + 0xc]
mov ecx, dword [esi + 0x10]
add esi, 4
sub ecx, eax
sar ecx, 2
cmp ecx, 1
mov edi, eax
jae 0x404a65
mov ecx, dword [esi + 4]
test ecx, ecx
je 0x4049ce
sub eax, ecx
sar eax, 2
cmp eax, 1
jbe 0x4049ce
mov ecx, esi
call fcn.00405650
mov ebx, eax
jmp 0x4049d3
mov ebx, 1
mov ecx, esi
call fcn.00405650
add eax, ebx
mov dword [esp + 0x20], eax
jns 0x4049e4
xor eax, eax
lea edx, [eax*4]
push edx
call sub.MFC42.DLL_operatornew
add esp, 4
mov ebx, eax
mov eax, dword [esi + 4]
mov ecx, esi
push ebx
push edi
push eax
call fcn.004056e0
lea ecx, [esp + 0x14]
mov dword [esp + 0x1c], eax
push ecx
push 1
push eax
mov ecx, esi
call fcn.00405710
mov edx, dword [esp + 0x1c]
mov eax, dword [esi + 8]
add edx, 4
mov ecx, esi
push edx
push eax
push edi
call fcn.004056e0
mov ecx, dword [esi + 8]
mov edx, dword [esi + 4]
push ecx
push edx
mov ecx, esi
call fcn.004056d0
mov eax, dword [esi + 4]
push eax
call sub.MFC42.DLL_operatordelete
mov ecx, dword [esp + 0x24]
add esp, 4
lea edx, [ebx + ecx*4]
mov ecx, esi
mov dword [esi + 0xc], edx
call fcn.00405650
lea eax, [ebx + eax*4 + 4]
mov dword [esi + 4], ebx
mov dword [esi + 8], eax
jmp 0x404b05
mov ecx, eax
sub ecx, edi
sar ecx, 2
cmp ecx, 1
jae 0x404aba
lea ecx, [edi + 4]
push ecx
push eax
push edi
mov ecx, esi
call fcn.004056e0
mov eax, dword [esi + 8]
lea edx, [esp + 0x14]
mov ecx, eax
push edx
sub ecx, edi
mov edx, 1
sar ecx, 2
sub edx, ecx
mov ecx, esi
push edx
push eax
call fcn.00405710
mov esi, dword [esi + 8]
cmp edi, esi
je 0x404ab1
mov eax, dword [esp + 0x14]
mov dword [edi], eax
add edi, 4
cmp edi, esi
jne 0x404aa4
mov ecx, dword [esp + 0x10]
lea eax, [ecx + 4]
jmp 0x404b01
lea ecx, [eax - 4]
push eax
push eax
mov dword [esp + 0x28], ecx
push ecx
mov ecx, esi
call fcn.004056e0
mov esi, dword [esi + 8]
lea eax, [esi - 4]
cmp edi, eax
je 0x404ae4
mov edx, dword [eax - 4]
sub eax, 4
sub esi, 4
cmp eax, edi
mov dword [esi], edx
jne 0x404ad5
lea ecx, [edi + 4]
mov eax, edi
cmp edi, ecx
je 0x404afa
mov edx, dword [esp + 0x14]
mov dword [eax], edx
add eax, 4
cmp eax, ecx
jne 0x404aed
mov eax, dword [esp + 0x10]
add eax, 4
add dword [eax + 8], 4
mov ecx, dword [ebp + 8]
mov edx, dword [ebp + 0xc]
sub edx, ecx
mov eax, 0x2aaaaaab
imul edx
sar edx, 3
mov eax, edx
mov ebx, ecx
shr eax, 0x1f
add edx, eax
cmp edx, 1
jae 0x404be6
mov eax, dword [ebp + 4]
test eax, eax
je 0x404b4a
sub ecx, eax
mov eax, 0x2aaaaaab
imul ecx
sar edx, 3
mov ecx, edx
shr ecx, 0x1f
add edx, ecx
cmp edx, 1
mov esi, edx
ja 0x404b4f
mov esi, 1
mov ecx, ebp
call fcn.004056a0
mov edi, eax
add edi, esi
mov eax, edi
jns 0x404b60
xor eax, eax
lea edx, [eax + eax*2]
shl edx, 4
push edx
call sub.MFC42.DLL_operatornew
add esp, 4
mov esi, eax
mov eax, dword [ebp + 4]
mov ecx, ebp
push esi
push ebx
push eax
call fcn.00405740
lea ecx, [esp + 0x44]
mov dword [esp + 0x20], eax
push ecx
push 1
push eax
mov ecx, ebp
call fcn.00405780
mov edx, dword [esp + 0x20]
mov eax, dword [ebp + 8]
add edx, 0x30
mov ecx, ebp
push edx
push eax
push ebx
call fcn.00405740
mov ecx, dword [ebp + 8]
mov edx, dword [ebp + 4]
push ecx
push edx
mov ecx, ebp
call fcn.004056d0
mov eax, dword [ebp + 4]
push eax
call sub.MFC42.DLL_operatordelete
lea ecx, [edi + edi*2]
add esp, 4
shl ecx, 4
add ecx, esi
mov dword [ebp + 0xc], ecx
mov ecx, ebp
call fcn.004056a0
inc eax
mov dword [ebp + 4], esi
lea edx, [eax + eax*2]
shl edx, 4
add edx, esi
mov dword [ebp + 8], edx
jmp 0x404ca6
mov edx, ecx
mov eax, 0x2aaaaaab
sub edx, ebx
imul edx
sar edx, 3
mov eax, edx
shr eax, 0x1f
add edx, eax
cmp edx, 1
jae 0x404c57
lea edx, [ebx + 0x30]
push edx
push ecx
push ebx
mov ecx, ebp
call fcn.00405740
mov esi, dword [ebp + 8]
lea eax, [esp + 0x44]
mov ecx, esi
push eax
sub ecx, ebx
mov eax, 0x2aaaaaab
imul ecx
sar edx, 3
mov ecx, edx
mov eax, 1
shr ecx, 0x1f
add edx, ecx
mov ecx, ebp
sub eax, edx
push eax
push esi
call fcn.00405780
mov eax, dword [ebp + 8]
cmp ebx, eax
je 0x404ca2
mov edi, ebx
add ebx, 0x30
mov ecx, 0xc
lea esi, [esp + 0x44]
cmp ebx, eax
rep movsd dword es:[edi], dword [esi]
jne 0x404c41
jmp 0x404ca2
lea eax, [ecx - 0x30]
push ecx
push ecx
push eax
mov ecx, ebp
mov dword [esp + 0x2c], eax
call fcn.00405740
mov edx, dword [ebp + 8]
lea eax, [edx - 0x30]
cmp ebx, eax
je 0x404c87
sub eax, 0x30
sub edx, 0x30
mov ecx, 0xc
mov esi, eax
mov edi, edx
cmp eax, ebx
rep movsd dword es:[edi], dword [esi]
jne 0x404c72
lea eax, [ebx + 0x30]
cmp ebx, eax
je 0x404ca2
mov edi, ebx
add ebx, 0x30
mov ecx, 0xc
lea esi, [esp + 0x44]
cmp ebx, eax
rep movsd dword es:[edi], dword [esi]
jne 0x404c8e
add dword [ebp + 8], 0x30
mov ecx, dword [esp + 0x10]
mov edi, dword [ecx + 0x34]
test edi, edi
je 0x404782
mov eax, dword [esp + 0x45]
and eax, 0x1c0
cmp eax, 0x40
je 0x404cce
cmp eax, 0x80
jne 0x404782
mov esi, dword [esp + 0x10]
mov dword [esp + 0x28], 0
mov eax, dword [esi + 0x14bb0]
mov edx, dword [esi + 0x240]
inc eax
push edx
mov edx, dword [esi + 0x23c]
mov dword [esi + 0x14bb0], eax
mov eax, dword [esp + 0x54]
sub eax, edx
mov dword [esp + 0x28], eax
fild qword [esp + 0x28]
fidiv dword [esi + 0x14bb4]
fmul qword [0x412740]
call sub.MSVCRT.dll__ftol
push eax
push 1
call edi
mov eax, dword [esp + 0x55]
mov ecx, dword [esi + 0x14be4]
add esp, 0xc
cmp ecx, eax
jae 0x404782
mov ecx, dword [esp + 0x45]
and ecx, 0x1c0
cmp ecx, 0x80
jne 0x404782
mov edx, esi
mov dword [edx + 0x14be4], eax
jmp 0x404782
push ebx
call dword [sym.imp.MSVCRT.dll_ftell]
push ebx
mov dword [esi + 0x238], eax
call dword [sym.imp.MSVCRT.dll_fclose]
mov eax, dword [esi + 0x238]
add esp, 8
test eax, eax
pop ebp
jle 0x404d9a
lea ecx, [esp + 0x28]
mov dword [esp + 0x78], 0xffffffff
call sym.Player.exe_public_virtual:_void___thiscall_CTPImage::destructor_void_
pop edi
pop esi
mov eax, 1
pop ebx
mov ecx, dword [esp + 0x64]
mov dword fs:[0], ecx
add esp, 0x70
ret
lea ecx, [esp + 0x28]
mov dword [esp + 0x78], 0xffffffff
call sym.Player.exe_public_virtual:_void___thiscall_CTPImage::destructor_void_
mov ecx, dword [esp + 0x70]
pop edi
pop esi
xor eax, eax
pop ebx
mov dword fs:[0], ecx
add esp, 0x70
ret