Function at 0x406980
Capabilities:
Get file size
Read file on windows

Disassembly:
sub esp, 0x438
push ebx
push ebp
push esi
push edi
mov edi, ecx
push 0x10002
call sub.MFC42.DLL_operatornew
mov ebx, eax
xor ebp, ebp
add esp, 4
cmp ebx, ebp
mov dword [esp + 0x20], ebp
mov dword [esp + 0x18], ebp
mov dword [esp + 0x2c], ebp
mov byte [esp + 0x12], 0
mov byte [esp + 0x11], 0
jne 0x4069f6
mov eax, dword [esp + 0x450]
push eax
call fcn.0043ab80
add esp, 4
lea esi, [edi + 4]
mov ecx, esi
push ebp
push 0x472b1c
call fcn.00402490
mov ecx, esi
call fcn.00402460
mov eax, 2
mov dword [edi + 0xf544], eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x438
ret 8
mov ecx, dword [esp + 0x44c]
push ebp
push 0x8000080
push 3
mov esi, 1
push ebp
push esi
push 0x80000000
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ecx, eax
cmp ecx, 0xffffffff
mov dword [esp + 0x28], ecx
jne 0x406a71
push ebx
call sub.MFC42.DLL_operatordelete
push 0xffffffffffffffff
call fcn.0044c500
mov dword [edi + 0xf544], eax
mov edx, dword [esp + 0x458]
push edx
call fcn.0043ab80
add esp, 0xc
lea esi, [edi + 4]
mov ecx, esi
push 0
push 0x472b1c
call fcn.00402490
mov ecx, esi
call fcn.00402460
mov eax, dword [edi + 0xf544]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x438
ret 8
mov eax, dword [esp + 0x450]
mov dword [esp + 0x30], esi
mov dword [esp + 0x24], esi
mov dword [esp + 0x1c], esi
xor esi, esi
cmp eax, esi
setg al
test al, al
mov byte [esp + 0x13], al
je 0x406b5e
lea eax, [esp + 0x1c]
mov dword [esp + 0x1c], esi
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ecx, eax
mov eax, dword [esp + 0x1c]
cmp eax, esi
mov dword [esp + 0x30], ecx
je 0x406b09
mov ecx, dword [esp + 0x450]
push ecx
call fcn.0043ab80
add esp, 4
lea esi, [edi + 4]
mov ecx, esi
push 0
push 0x472b1c
call fcn.00402490
mov ecx, esi
call fcn.00402460
mov edx, dword [esp + 0x28]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebx
call sub.MFC42.DLL_operatordelete
mov eax, 6
add esp, 4
mov dword [edi + 0xf544], eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x438
ret 8
cmp ecx, 0x10000
jae 0x406b18
mov byte [esp + 0x13], 0
jmp 0x406b5a
cmp ecx, 0x100000
jae 0x406b29
shr ecx, 2
mov dword [esp + 0x24], ecx
jmp 0x406b5a
cmp ecx, 0xa00000
jae 0x406b3d
mov eax, 0xcccccccd
mul ecx
shr edx, 3
jmp 0x406b56
cmp ecx, 0x6400000
mov eax, 0x51eb851f
jae 0x406b51
mul ecx
shr edx, 3
jmp 0x406b56
mul ecx
shr edx, 5
mov dword [esp + 0x24], edx
mov dword [esp + 0x1c], esi
mov eax, dword [esp + 0x2c]
xor esi, esi
cmp eax, esi
jne 0x406f2a
mov ecx, dword [esp + 0x28]
lea eax, [esp + 0x14]
push esi
push eax
push 0x10000
push ebx
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x406f12
mov edx, dword [esp + 0x14]
cmp edx, 0x10000
jge 0x406b9c
mov byte [esp + 0x11], 1
mov al, byte [esp + 0x13]
test al, al
je 0x406bfc
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x24]
add eax, edx
cmp eax, ecx
jbe 0x406bf8
mov ecx, dword [esp + 0x20]
mov dword [esp + 0x3c], esi
add edx, ecx
mov dword [esp + 0x1c], edx
mov edx, dword [esp + 0x30]
fild dword [esp + 0x1c]
mov dword [esp + 0x38], edx
fmul qword [0x464c68]
fild qword [esp + 0x38]
fdivp st(1)
call sub.MSVCRT.dll__ftol
push eax
mov eax, dword [esp + 0x454]
push eax
call fcn.0043ab50
mov edx, dword [esp + 0x1c]
add esp, 8
mov dword [esp + 0x1c], esi
jmp 0x406bfc
mov dword [esp + 0x1c], eax
cmp edx, esi
je 0x406e96
xor esi, esi
mov dword [edi + 0xf544], esi
mov ecx, dword [esp + 0x20]
add ecx, edx
cmp edx, esi
mov dword [esp + 0x20], ecx
jle 0x406e96
mov al, byte [esi + ebx]
lea ecx, [esi + ebx]
test al, al
jne 0x406c47
mov byte [edi + 0xf580], 1
mov al, byte [0x4758eb]
inc esi
test al, al
jne 0x406e70
mov byte [esp + ebp + 0x40], 0x80
jmp 0x406d9d
cmp al, 0xd
je 0x406c59
cmp al, 0xa
je 0x406c59
mov byte [esp + ebp + 0x40], al
inc esi
jmp 0x406d9d
lea eax, [edx - 2]
cmp esi, eax
jl 0x406cce
mov al, byte [esp + 0x11]
test al, al
jne 0x406cca
sub edx, esi
push edx
push ecx
push ebx
call dword [sym.imp.MSVCRT.dll_memmove]
mov eax, dword [esp + 0x20]
mov edx, dword [esp + 0x34]
add esp, 0xc
sub eax, esi
xor esi, esi
lea ecx, [esp + 0x34]
mov dword [esp + 0x14], eax
push esi
push ecx
add eax, ebx
push 2
push eax
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x406e7a
mov eax, dword [esp + 0x34]
cmp eax, 1
jl 0x406e7a
cmp eax, 2
jg 0x406e7a
mov edx, dword [esp + 0x14]
mov ecx, dword [esp + 0x20]
add edx, eax
add ecx, eax
mov dword [esp + 0x14], edx
mov dword [esp + 0x20], ecx
mov ebp, dword [esp + 0x18]
lea ecx, [edx - 1]
cmp esi, ecx
jge 0x406d97
mov al, byte [esi + ebx]
cmp al, 0xd
jne 0x406d24
cmp byte [ebx + esi + 1], 0xa
jne 0x406d24
inc esi
cmp esi, ecx
jge 0x406d0e
mov al, byte [ebx + esi + 1]
cmp al, 0xa
mov eax, dword [edi + 0xf570]
jne 0x406d14
test eax, eax
jne 0x406d08
mov dword [edi + 0xf570], 5
inc esi
jmp 0x406d97
mov eax, dword [edi + 0xf570]
test eax, eax
jne 0x406d97
mov dword [edi + 0xf570], 1
jmp 0x406d97
cmp al, 0xa
jne 0x406d83
cmp byte [ebx + esi + 1], 0xd
jne 0x406d69
inc esi
cmp esi, ecx
jge 0x406d53
mov al, byte [ebx + esi + 1]
cmp al, 0xd
mov eax, dword [edi + 0xf570]
jne 0x406d59
test eax, eax
jne 0x406d50
mov dword [edi + 0xf570], 6
inc esi
jmp 0x406d97
mov eax, dword [edi + 0xf570]
test eax, eax
jne 0x406d97
mov dword [edi + 0xf570], 4
jmp 0x406d97
cmp al, 0xa
jne 0x406d83
mov eax, dword [edi + 0xf570]
test eax, eax
jne 0x406d97
mov dword [edi + 0xf570], 2
jmp 0x406d97
mov eax, dword [edi + 0xf570]
test eax, eax
jne 0x406d97
mov dword [edi + 0xf570], 3
inc esi
mov byte [esp + ebp + 0x40], 0
cmp esi, edx
jne 0x406dbb
mov al, byte [esp + 0x11]
test al, al
je 0x406dbb
mov al, byte [esp + ebp + 0x40]
test al, al
je 0x406dc3
inc ebp
mov dword [esp + 0x18], ebp
mov byte [esp + ebp + 0x40], 0
mov al, byte [esp + ebp + 0x40]
test al, al
jne 0x406e28
mov eax, dword [esp + 0x18]
lea ecx, [esp + 0x40]
lea ebp, [edi + 4]
push eax
push ecx
mov ecx, ebp
call fcn.00402490
test al, al
jne 0x406dec
mov edx, dword [edi + 0x84]
mov dword [edi + 0xf544], edx
mov byte [esp + 0x11], 1
mov edx, dword [esp + 0x14]
cmp esi, edx
jne 0x406e1a
mov al, byte [esp + 0x11]
test al, al
je 0x406e1a
mov al, byte [esi + ebx - 1]
cmp al, 0xd
je 0x406e08
cmp al, 0xa
jne 0x406e1a
push 0
push 0x472b1c
mov ecx, ebp
call fcn.00402490
mov edx, dword [esp + 0x14]
mov dword [esp + 0x18], 0
mov ebp, dword [esp + 0x18]
jmp 0x406e70
cmp ebp, 0x3ff
jne 0x406e6b
lea eax, [esp + 0x40]
push 0x400
push eax
lea ecx, [edi + 4]
mov byte [esp + 0x448], 0
call fcn.00402490
test al, al
jne 0x406e5f
mov ecx, dword [edi + 0x84]
mov dword [edi + 0xf544], ecx
mov byte [esp + 0x11], 1
mov edx, dword [esp + 0x14]
xor ebp, ebp
mov dword [esp + 0x18], ebp
jmp 0x406e70
inc ebp
mov dword [esp + 0x18], ebp
cmp esi, edx
jl 0x406c1e
jmp 0x406e96
push 0xffffffffffffffff
call fcn.0044c500
add esp, 4
mov dword [edi + 0xf544], eax
mov ebp, dword [esp + 0x18]
mov dword [esp + 0x2c], 1
mov al, byte [esp + 0x12]
test al, al
jne 0x406efa
cmp dword [edi + 0x70], 0x7d0
jle 0x406efa
mov eax, dword [edi + 0xdb98]
cmp eax, 1
jg 0x406eb7
mov eax, 0xff
mov edx, dword [edi + 0xa4]
mov dword [edi + 0xdb98], eax
mov byte [esp + 0x12], 1
mov al, byte [edx + 0x48]
test al, al
jne 0x406ee4
push 1
call dword [sym.imp.KERNEL32.dll_Sleep]
mov eax, dword [edi + 0xa4]
mov cl, byte [eax + 0x48]
test cl, cl
je 0x406ecf
mov ecx, dword [edi + 0xa4]
push 0
push 0
push 0xf
mov edx, dword [ecx + 0x20]
push edx
call dword [sym.imp.USER32.dll_PostMessageA]
mov al, byte [edi + 0xf582]
test al, al
jne 0x406f2a
mov al, byte [esp + 0x11]
test al, al
je 0x406b5e
jmp 0x406f2a
push 0xffffffffffffffff
call fcn.0044c500
add esp, 4
mov dword [edi + 0xf544], eax
mov dword [esp + 0x2c], 1
mov eax, dword [esp + 0x28]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov al, byte [esp + 0x11]
test al, al
je 0x406f72
mov eax, dword [esp + 0x2c]
test eax, eax
jne 0x406f72
mov eax, dword [edi + 0x70]
test eax, eax
jne 0x406f72
mov eax, dword [edi + 0x74]
test eax, eax
jne 0x406f72
push 0
push 0x472b1c
lea ecx, [edi + 4]
call fcn.00402490
test al, al
jne 0x406f72
mov ecx, dword [edi + 0x84]
mov dword [edi + 0xf544], ecx
lea ecx, [edi + 4]
call fcn.00402460
mov eax, dword [edi + 0xe134]
push ebx
mov dword [edi + 0xdc04], eax
mov dword [edi + 0xdbf8], eax
dec eax
mov dword [edi + 0xdc00], eax
call sub.MFC42.DLL_operatordelete
mov edx, dword [esp + 0x454]
push edx
call fcn.0043ab80
add esp, 8
mov ecx, edi
call fcn.00419490
mov eax, dword [edi + 0xf544]
cmp eax, 0xffffffff
jne 0x406fd0
xor eax, eax
mov dword [edi + 0xf544], eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x438
ret 8
mov eax, dword [edi + 0xf544]
mov dword [edi + 0xf544], eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x438
ret 8