Function at 0x40c260
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
mov ecx, dword [0x468ec0]
xor eax, eax
mov word [ebp - 8], 2
cmp word [ebp - 8], 2
push ebx
sete al
push esi
mov esi, dword [ebp + 8]
push edi
mov edi, dword [sym.imp.MSVCR100.dll_fread]
mov dword [ebp - 0x1c], eax
lea eax, [esi*8]
sub eax, esi
add eax, eax
add eax, eax
add eax, eax
mov ebx, dword [eax + ecx]
push ebx
push 1
lea esi, [esi + esi*8]
push 0xb
shl esi, 4
push 0x472ac0
mov dword [ebp - 0x14], eax
mov dword [esi + 0x468d04], 0
call edi
push ebx
call dword [sym.imp.MSVCR100.dll_rewind]
add esp, 0x14
push 0xb
push str._stata_dta_
push 0x472ac0
call dword [sym.imp.MSVCR100.dll__strnicmp]
add esp, 0xc
test eax, eax
jne 0x40c2f2
mov edx, dword [ebp + 8]
push edx
call fcn.0040c680
add esp, 4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push ebx
push 1
lea eax, [ebp - 1]
push 1
push eax
call edi
mov al, byte [ebp - 1]
add esp, 0x10
cmp al, 0x6c
jge 0x40c32b
mov ecx, dword [ebp + 8]
push str.Stata
inc ecx
push ecx
push str.The_level__d_file_does_not_seem_to_be_a__s_file__n
call dword [sym.imp.MSVCR100.dll_printf]
add esp, 0xc
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
jne 0x40c336
mov dword [ebp - 0x10], 6
jmp 0x40c38b
cmp al, 0x6e
jne 0x40c343
mov dword [ebp - 0x10], 7
jmp 0x40c38b
cmp al, 0x71
je 0x40c384
cmp al, 0x6f
je 0x40c384
cmp al, 0x72
jne 0x40c358
mov dword [ebp - 0x10], 0xa
jmp 0x40c38b
cmp al, 0x73
jne 0x40c365
mov dword [ebp - 0x10], 0xb
jmp 0x40c38b
push str.HCM2
push str.So_sorry__but__s_cannot_read_this_version_of_stata._n
call dword [sym.imp.MSVCR100.dll_printf]
add esp, 8
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov dword [ebp - 0x10], 8
mov edx, dword [ebp - 0x10]
push ebx
push 1
lea eax, [ebp - 1]
push 1
push eax
mov dword [esi + 0x468d18], edx
call edi
mov al, byte [ebp - 1]
add esp, 0x10
cmp al, 1
jne 0x40c478
cmp dword [ebp - 0x1c], 0
jne 0x40c48a
push ebx
push 1
lea ecx, [ebp - 1]
push 1
push ecx
call edi
push ebx
push 1
lea edx, [ebp - 1]
push 1
push edx
call edi
push ebx
push 1
lea eax, [ebp - 8]
push 2
push eax
call edi
mov ax, word [ebp - 8]
mov edx, dword [0x468ec0]
movsx ecx, ax
push ebx
mov word [esi + 0x468d08], ax
mov eax, dword [ebp - 0x14]
push 1
mov dword [eax + edx + 4], ecx
lea ecx, [esi + 0x468d00]
push 4
push ecx
call edi
add esp, 0x40
push 1
push 0
push 0x63
push ebx
call dword [sym.imp.MSVCR100.dll__fseeki64]
movsx eax, word [ebp - 8]
mov edi, eax
shl edi, 4
add edi, eax
add esp, 0x10
add edi, edi
call fcn.00409ea0
movsx ecx, word [ebp - 8]
lea edx, [ecx + eax]
lea edi, [ecx*4]
mov dword [esi + 0x468d0c], eax
mov dword [esi + 0x468d1c], edx
call fcn.00409ea0
mov cx, word [ebp - 8]
mov edi, dword [esi + 0x468d1c]
mov dword [esi + 0x468d14], eax
movsx eax, cx
test eax, eax
je 0x40c4a4
push ebx
push 1
push eax
mov eax, dword [esi + 0x468d0c]
mov esi, dword [sym.imp.MSVCR100.dll_fread]
push eax
call esi
mov cx, word [ebp - 8]
add esp, 0x10
jmp 0x40c4aa
cmp al, 2
jne 0x40c3b7
cmp dword [ebp - 0x1c], 0
jne 0x40c3b7
push str.This_file_seems_to_have_been_created_on_a_different_platform__n
call dword [sym.imp.MSVCR100.dll_printf]
add esp, 4
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, dword [sym.imp.MSVCR100.dll_fread]
cmp dword [ebp - 0x10], 7
jl 0x40c4cc
movsx edx, cx
mov eax, edx
shl eax, 5
add eax, edx
je 0x40c4fe
push ebx
push 1
push eax
push edi
call esi
mov cx, word [ebp - 8]
add esp, 0x10
jmp 0x40c4fe
xor eax, eax
xor edx, edx
mov dword [ebp - 0x18], eax
cmp dx, cx
jge 0x40c4fe
mov ecx, eax
push ebx
shl ecx, 5
push 1
add ecx, edi
add ecx, eax
push 9
push ecx
call esi
mov cx, word [ebp - 8]
mov eax, dword [ebp - 0x18]
movsx edx, cx
inc eax
add esp, 0x10
mov dword [ebp - 0x18], eax
cmp eax, edx
jl 0x40c4d8
xor eax, eax
xor edx, edx
mov dword [ebp - 0x14], eax
cmp dx, cx
jge 0x40c57b
mov dword [ebp - 0x1c], eax
mov esi, edi
mov eax, esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40c514
sub eax, edx
cmp eax, 8
ja 0x40c592
mov eax, esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40c527
sub eax, edx
mov dword [ebp - 0x18], eax
cmp eax, 0x21
jge 0x40c552
mov ecx, dword [ebp - 0x1c]
mov edx, 0x21
sub edx, eax
push edx
add ecx, eax
add ecx, edi
push 0
push ecx
call sub.MSVCR100.dll_memset
add esp, 0xc
mov eax, 8
call fcn.00409670
mov cx, word [ebp - 8]
mov eax, dword [ebp - 0x14]
add dword [ebp - 0x1c], 0x21
movsx edx, cx
inc eax
add esi, 0x21
mov dword [ebp - 0x14], eax
cmp eax, edx
jl 0x40c50f
mov esi, dword [sym.imp.MSVCR100.dll_fread]
mov edx, dword [ebp - 0x10]
movsx eax, cx
lea ecx, [eax + eax + 2]
cmp edx, 0xa
jge 0x40c5ac
lea edi, [eax + eax*2]
lea ecx, [ecx + edi*4]
jmp 0x40c5b3
push str.Stata_may_allow_for_variable_name_lengths___8__but_not_the_HLMs__n
call dword [sym.imp.MSVCR100.dll_printf]
add esp, 4
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edi, eax
imul edi, edi, 0x31
add ecx, edi
cmp edx, 7
jl 0x40c5c3
mov edx, eax
shl edx, 5
add edx, ecx
add eax, edx
jmp 0x40c5c8
add ecx, eax
lea eax, [ecx + eax*8]
mov edi, dword [sym.imp.MSVCR100.dll__fseeki64]
cdq
push 1
push edx
push eax
push ebx
call edi
movsx eax, word [ebp - 8]
imul eax, eax, 0x51
cdq
push 1
push edx
push eax
push ebx
call edi
add esp, 0x20
mov dword [ebp - 0x14], 0
nop
push ebx
push 1
lea edx, [ebp - 1]
push 1
push edx
call esi
add esp, 0x10
cmp dword [ebp - 0x10], 7
push ebx
push 1
jl 0x40c624
lea eax, [ebp - 0x18]
push 4
push eax
call esi
mov eax, dword [ebp - 0x18]
add esp, 0x10
cmp byte [ebp - 1], 0
jne 0x40c644
test eax, eax
jne 0x40c644
inc dword [ebp - 0x14]
jmp 0x40c64f
lea ecx, [ebp - 0xc]
push 2
push ecx
call esi
mov ax, word [ebp - 0xc]
add esp, 0x10
cmp byte [ebp - 1], 0
jne 0x40c643
test ax, ax
jne 0x40c643
inc dword [ebp - 0x14]
jmp 0x40c64f
cwde
cdq
push 1
push edx
push eax
push ebx
call edi
add esp, 0x10
cmp dword [ebp - 0x14], 0
je 0x40c5f0
push ebx
call dword [sym.imp.MSVCR100.dll__ftelli64]
mov ecx, dword [ebp + 8]
add esp, 4
pop edi
pop esi
mov dword [ecx*8 + 0x468aa0], eax
mov dword [ecx*8 + 0x468aa4], edx
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret