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

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x648
mov eax, dword [0x42d0b4]
xor eax, ebp
mov dword [ebp - 8], eax
mov eax, dword [ebp + 8]
push ebx
push esi
mov esi, dword [0x443cc4]
mov ebx, 1
mov dword [ebp - 0x640], eax
mov dword [ebp - 0x618], 0
mov dword [ebp - 0x62c], ebx
mov dword [ebp - 0x624], esi
push edi
test esi, esi
je 0x41c150
mov ecx, dword [eax + 0x3c]
test ecx, ecx
je 0x41c12f
push ebx
push ecx
lea edx, [ebp - 0x20c]
call fcn.004068d9
mov eax, dword [esi + 8]
mov ecx, esi
mov dword [ebp - 0x644], eax
call fcn.00410662
mov edi, eax
mov dword [ebp - 0x620], edi
cmp edi, 0xffffffff
je 0x41c150
push 0
push edi
call dword [sym.imp.msvcrt.dll__get_osfhandle]
add esp, 4
push eax
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_GetFileSize]
mov ecx, dword [ebp - 0x640]
mov dword [ebp - 0x63c], eax
mov ecx, dword [ecx + 0x3c]
call fcn.0040def9
cmp byte [0x443cc9], 0
mov esi, eax
je 0x406a50
push 4
push 0x4021ac
push esi
call dword [sym.imp.msvcrt.dll__wcsnicmp]
add esp, 0xc
test eax, eax
je 0x406e16
mov edi, edi
cmp dword [0x42d544], 0
jne 0x41c157
push 1
push 0
push 0
push edi
call dword [sym.imp.msvcrt.dll__get_osfhandle]
add esp, 4
push eax
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_SetFilePointer]
mov esi, dword [ebp - 0x624]
mov dword [esi + 8], eax
cmp eax, dword [ebp - 0x644]
jl 0x406a8d
test ebx, ebx
je 0x406efc
push edi
call dword [sym.imp.msvcrt.dll__get_osfhandle]
add esp, 4
mov ebx, eax
mov dword [ebp - 0x634], ebx
push ebx
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_GetFileType]
and eax, 0xffff7fff
cmp eax, 2
je 0x41c161
push 1
push 0
push 0
push ebx
mov edi, 0x42d620
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_SetFilePointer]
push 0x447f20
mov dword [ebp - 0x630], eax
call dword [sym.imp.api_ms_win_core_synch_l1_1_0.dll_AcquireSRWLockShared]
push 0
lea eax, [ebp - 0x618]
push eax
push 0x200
push edi
push ebx
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_ReadFile]
push 0x447f20
mov esi, eax
call dword [sym.imp.api_ms_win_core_synch_l1_1_0.dll_ReleaseSRWLockShared]
mov ecx, dword [ebp - 0x618]
test esi, esi
je 0x41c185
mov dword [ebp - 0x61c], ecx
test ecx, ecx
je 0x406ebc
cmp dword [0x433854], 0xfde9
mov esi, ecx
mov dword [ebp - 0x628], esi
mov ebx, ecx
je 0x41c18c
mov edx, edi
mov dword [ebp - 0x638], edx
test ebx, ebx
jle 0x406bad
lea esp, [esp]
cmp esi, 3
jl 0x406b53
mov al, byte [edi]
cmp al, 0xa
je 0x41c1e4
cmp al, 0xd
je 0x406b77
movzx eax, byte [edi]
cmp byte [eax + 0x447f30], 0
jne 0x41c1f3
dec esi
mov eax, 1
add edi, eax
mov dword [ebp - 0x628], esi
test esi, esi
jg 0x406b40
jmp 0x406bad
cmp byte [edi + 1], 0xa
jne 0x406b53
mov eax, dword [ebp - 0x630]
mov byte [edi + 2], 0
sub edi, edx
push 0
add edi, 2
push 0
add eax, edi
mov dword [ebp - 0x61c], edi
push eax
push dword [ebp - 0x634]
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_SetFilePointer]
mov ecx, edi
mov edx, dword [ebp - 0x638]
mov ebx, dword [0x433854]
cmp ebx, 0x2b
jb 0x41c25a
cmp ebx, 0xc42c
jae 0x41c25a
mov eax, 1
push 0x200
lea esi, [ebp - 0x614]
push esi
push ecx
push edx
push eax
push ebx
call dword [sym.imp.api_ms_win_core_string_l1_1_0.dll_MultiByteToWideChar]
mov ecx, eax
mov dword [ebp - 0x618], ecx
mov edi, dword [ebp - 0x620]
mov esi, dword [ebp - 0x624]
test eax, eax
je 0x406ec3
test ecx, ecx
je 0x406ecb
cmp ecx, 0xffffffff
je 0x406ec3
cmp word [ebp - 0x614], 0
je 0x406ec3
cmp word [ebp - 0x20c], 0
je 0x406ec3
lea eax, [ecx + ecx]
cmp eax, 0x402
jae 0x406f04
xor ecx, ecx
mov word [ebp + eax - 0x614], cx
lea eax, [ebp - 0x614]
push 0x3a
push eax
call dword [sym.imp.msvcrt.dll_wcschr]
mov ebx, dword [ebp - 0x62c]
add esp, 8
test eax, eax
je 0x406a50
mov esi, eax
add eax, 2
mov dword [ebp - 0x61c], eax
cmp word [esi], 0xa
je 0x406c88
lea ecx, [ebp - 0x614]
cmp esi, ecx
je 0x406c88
sub esi, 2
cmp word [esi], 0xa
jne 0x406c75
cmp word [esi], 0x3a
je 0x406c91
add esi, 2
mov edi, esi
test esi, esi
je 0x406cd8
jmp 0x406ca0
movzx ebx, word [edi]
push ebx
call dword [sym.imp.msvcrt.dll_iswspace]
add esp, 4
test eax, eax
je 0x406cbb
cmp ebx, 0xa
je 0x406cbb
add edi, 2
jmp 0x406ca0
push ebx
push 0x402100
call dword [sym.imp.msvcrt.dll_wcschr]
add esp, 8
test eax, eax
jne 0x41c2d4
mov eax, dword [ebp - 0x61c]
cmp word [edi], 0x3a
je 0x406d14
test eax, eax
je 0x406cf6
push 0x3a
push eax
call dword [sym.imp.msvcrt.dll_wcschr]
add esp, 8
test eax, eax
jne 0x406c64
mov edi, dword [ebp - 0x620]
cmp byte [0x42d590], 1
je 0x406e38
mov ebx, dword [ebp - 0x62c]
jmp 0x406a50
test esi, esi
je 0x41c2e2
push 0xa
push esi
call dword [sym.imp.msvcrt.dll_wcschr]
add esp, 8
mov dword [ebp - 0x61c], eax
test eax, eax
je 0x41c2ea
movzx esi, word [edi]
push esi
call dword [sym.imp.msvcrt.dll_iswspace]
add esp, 4
test eax, eax
jne 0x41c37c
push esi
push 0x402100
call dword [sym.imp.msvcrt.dll_wcschr]
add esp, 8
test eax, eax
jne 0x41c386
movzx eax, word [edi]
cmp eax, 0x3a
jne 0x41c397
add edi, 2
test edi, edi
je 0x406da1
movzx esi, word [edi]
push esi
call dword [sym.imp.msvcrt.dll_iswspace]
add esp, 4
test eax, eax
jne 0x41c3a5
push esi
push 0x402100
call dword [sym.imp.msvcrt.dll_wcschr]
add esp, 8
test eax, eax
jne 0x41c3af
xor ebx, ebx
movzx esi, word [edi]
push esi
push 0x4020e4
call dword [sym.imp.msvcrt.dll_wcschr]
add esp, 8
test eax, eax
jne 0x406de6
push esi
push 0x4020f4
call dword [sym.imp.msvcrt.dll_wcschr]
add esp, 8
test eax, eax
jne 0x406de6
cmp esi, 0x5e
je 0x41c3c0
mov word [ebp + ebx*2 - 0x10c], si
inc ebx
add edi, 2
cmp ebx, 0x7f
jb 0x406da3
xor eax, eax
mov word [ebp + ebx*2 - 0x10c], ax
lea eax, [ebp - 0x10c]
push eax
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.msvcrt.dll__wcsicmp]
add esp, 8
test eax, eax
je 0x406e56
mov eax, dword [ebp - 0x61c]
jmp 0x406cde
movzx eax, word [esi + 8]
test ax, ax
jne 0x406ea5
mov ecx, dword [ebp - 0x624]
mov eax, dword [ebp - 0x63c]
mov byte [0x42d590], bl
mov dword [ecx + 8], eax
xor esi, esi
mov ecx, edi
call fcn.0040db92
mov eax, esi
mov ecx, dword [ebp - 8]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00416fd0
mov esp, ebp
pop ebp
ret 4
mov eax, dword [ebp - 0x640]
test byte [eax + 0x40], 1
je 0x41c3d4
mov al, 1
mov byte [0x42d590], al
call fcn.004068b5
mov cl, al
mov eax, dword [ebp - 0x61c]
test eax, eax
je 0x41c3db
test cl, cl
lea ecx, [ebp - 0x614]
jne 0x41c3ef
sub eax, ecx
add eax, 2
sar eax, 1
mov ecx, dword [ebp - 0x624]
add dword [ecx + 8], eax
jmp 0x406cf6
push eax
call dword [sym.imp.msvcrt.dll_iswspace]
add esp, 4
test eax, eax
jne 0x406e23
jmp 0x406a50
xor eax, eax
jmp 0x406beb
test ecx, ecx
jne 0x41c424
cmp dword [ebp - 0x62c], 0
je 0x41c424
push 0
push 0
push 0
push edi
call dword [sym.imp.msvcrt.dll__get_osfhandle]
add esp, 4
push eax
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_SetFilePointer]
xor ebx, ebx
mov dword [ebp - 0x62c], ebx
jmp 0x406a50
mov ecx, dword [ebp - 0x618]
jmp 0x406ec3
call fcn.0041711d
int3
mov ecx, esi
call fcn.0040abed
mov eax, dword [esi + 0x110]
push 0
push 0x2330
mov dword [0x443cc4], eax
call fcn.0040c5a2
add esp, 8
mov eax, ebx
jmp 0x406e43
call fcn.0042921a
jmp 0x406a5d
lea eax, [ebp - 0x618]
mov ecx, ebx
push eax
push 0x200
lea edx, [ebp - 0x614]
call fcn.00423506
mov ecx, dword [ebp - 0x618]
jmp 0x406bf7
xor eax, eax
jmp 0x406beb
cmp dword [ebp - 0x630], 0
jne 0x406b30
push 3
push 0x403270
push 0x42d620
call sub.msvcrt.dll_memcmp
add esp, 0xc
mov ecx, ebx
test eax, eax
jne 0x406b30
add ecx, 0xfffffffd
mov dword [ebp - 0x630], 3
mov esi, ecx
mov dword [ebp - 0x61c], ecx
mov edi, 0x42d623
mov dword [ebp - 0x618], ecx
mov dword [ebp - 0x628], esi
mov ebx, ecx
jmp 0x406b30
cmp byte [edi + 1], 0xd
je 0x406b7d
jmp 0x406b53
cmp esi, 1
je 0x41c205
add esi, 0xfffffffe
mov eax, 2
jmp 0x406b69
push 0x447f20
call dword [sym.imp.api_ms_win_core_synch_l1_1_0.dll_AcquireSRWLockShared]
push 0
lea eax, [ebp - 0x628]
push eax
push 1
lea eax, [edi + 1]
push eax
push dword [ebp - 0x634]
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_ReadFile]
push 0x447f20
mov esi, eax
call dword [sym.imp.api_ms_win_core_synch_l1_1_0.dll_ReleaseSRWLockShared]
test esi, esi
je 0x41c251
cmp dword [ebp - 0x628], 0
je 0x41c251
mov ecx, dword [ebp - 0x61c]
inc ecx
jmp 0x406ba7
xor ecx, ecx
xor eax, eax
jmp 0x406be5
cmp ebx, 0xc435
ja 0x41c299
je 0x41c2cd
cmp ebx, 0xc431
ja 0x41c28c
je 0x41c2cd
cmp ebx, 0x2a
je 0x41c2cd
cmp ebx, 0xc42b
jbe 0x406bc8
cmp ebx, 0xc42e
jbe 0x41c2cd
jmp 0x406bc8
cmp ebx, 0xc433
je 0x41c2cd
jmp 0x406bc8
cmp ebx, 0xdeb3
ja 0x41c2be
cmp ebx, 0xdeaa
jae 0x41c2cd
cmp ebx, 0xcec8
je 0x41c2cd
cmp ebx, 0xd698
je 0x41c2cd
jmp 0x406bc8
lea eax, [ebx - 0xfde8]
cmp eax, 1
ja 0x406bc8
xor eax, eax
jmp 0x406bcd
test bx, bx
je 0x406cd2
jmp 0x406cb6
xor eax, eax
mov dword [ebp - 0x61c], eax
push 1
push 0
push 0
push dword [ebp - 0x620]
call dword [sym.imp.msvcrt.dll__get_osfhandle]
add esp, 4
push eax
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_SetFilePointer]
cmp eax, dword [ebp - 0x63c]
je 0x406d36
mov ecx, dword [ebp - 0x618]
cmp ecx, 0x200
je 0x406d36
lea eax, [ebp - 0x614]
sub esi, eax
sar esi, 1
sub ecx, esi
call fcn.004068b5
test al, al
je 0x41c359
push 0
push 0
push 0
push 0
push ecx
lea eax, [ebp - 0x614]
push eax
push 0
push dword [0x433854]
call dword [sym.imp.api_ms_win_core_string_l1_1_0.dll_WideCharToMultiByte]
mov ecx, eax
mov edi, dword [ebp - 0x620]
neg ecx
push 1
push 0
push ecx
push edi
call dword [sym.imp.msvcrt.dll__get_osfhandle]
add esp, 4
push eax
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_SetFilePointer]
jmp 0x406cfc
cmp esi, 0xa
jne 0x41c38f
jmp 0x406d4b
test si, si
je 0x406d62
add edi, 2
jmp 0x406d36
cmp eax, 0x2b
jne 0x406d71
jmp 0x406d6e
cmp esi, 0xa
jne 0x41c3b8
jmp 0x406d8a
test si, si
je 0x406da1
add edi, 2
jmp 0x406d75
mov ax, word [edi + 2]
add edi, 2
mov word [ebp + ebx*2 - 0x10c], ax
jmp 0x406ddd
xor al, al
jmp 0x406e68
test cl, cl
je 0x41c419
push 0
push 0
push 0
push 0
push dword [ebp - 0x618]
jmp 0x41c3ff
push 0
push 0
sub eax, ecx
push 0
add eax, 2
push 0
sar eax, 1
push eax
lea eax, [ebp - 0x614]
push eax
push 0
push dword [0x433854]
call dword [sym.imp.api_ms_win_core_string_l1_1_0.dll_WideCharToMultiByte]
jmp 0x406e97
mov eax, dword [ebp - 0x618]
jmp 0x406e97
mov ecx, esi
call fcn.0040abed
mov eax, dword [esi + 0x110]
mov dword [0x443cc4], eax
lea eax, [ebp - 0x20c]
push eax
push 1
push 0x400023ab
call fcn.0040c5a2
add esp, 0xc
mov esi, 1
jmp 0x406e3a