Function at 0x406000
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
mov ecx, dword [0x42fb48]
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 0x430260
mov dword [ebp - 0x14], eax
mov dword [esi + 0x42fa24], 0
call edi
push ebx
call dword [sym.imp.MSVCR100.dll_rewind]
add esp, 0x14
push 0xb
push str._stata_dta_
push 0x430260
call dword [sym.imp.MSVCR100.dll__strnicmp]
add esp, 0xc
test eax, eax
jne 0x406092
mov edx, dword [ebp + 8]
push edx
call fcn.00406420
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 0x4060cb
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 0x4060d6
mov dword [ebp - 0x10], 6
jmp 0x40612b
cmp al, 0x6e
jne 0x4060e3
mov dword [ebp - 0x10], 7
jmp 0x40612b
cmp al, 0x71
je 0x406124
cmp al, 0x6f
je 0x406124
cmp al, 0x72
jne 0x4060f8
mov dword [ebp - 0x10], 0xa
jmp 0x40612b
cmp al, 0x73
jne 0x406105
mov dword [ebp - 0x10], 0xb
jmp 0x40612b
push str.HMLM
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 + 0x42fa38], edx
call edi
mov al, byte [ebp - 1]
add esp, 0x10
cmp al, 1
jne 0x406218
cmp dword [ebp - 0x1c], 0
jne 0x40622a
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 [0x42fb48]
movsx ecx, ax
push ebx
mov word [esi + 0x42fa28], ax
mov eax, dword [ebp - 0x14]
push 1
mov dword [eax + edx + 4], ecx
lea ecx, [esi + 0x42fa20]
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.00404140
movsx ecx, word [ebp - 8]
lea edx, [ecx + eax]
lea edi, [ecx*4]
mov dword [esi + 0x42fa2c], eax
mov dword [esi + 0x42fa3c], edx
call fcn.00404140
mov cx, word [ebp - 8]
mov edi, dword [esi + 0x42fa3c]
mov dword [esi + 0x42fa34], eax
movsx eax, cx
test eax, eax
je 0x406244
push ebx
push 1
push eax
mov eax, dword [esi + 0x42fa2c]
mov esi, dword [sym.imp.MSVCR100.dll_fread]
push eax
call esi
mov cx, word [ebp - 8]
add esp, 0x10
jmp 0x40624a
cmp al, 2
jne 0x406157
cmp dword [ebp - 0x1c], 0
jne 0x406157
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 0x40626c
movsx edx, cx
mov eax, edx
shl eax, 5
add eax, edx
je 0x40629e
push ebx
push 1
push eax
push edi
call esi
mov cx, word [ebp - 8]
add esp, 0x10
jmp 0x40629e
xor eax, eax
xor edx, edx
mov dword [ebp - 0x18], eax
cmp dx, cx
jge 0x40629e
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 0x406278
xor eax, eax
xor edx, edx
mov dword [ebp - 0x14], eax
cmp dx, cx
jge 0x40631b
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 0x4062b4
sub eax, edx
cmp eax, 8
ja 0x406332
mov eax, esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4062c7
sub eax, edx
mov dword [ebp - 0x18], eax
cmp eax, 0x21
jge 0x4062f2
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.00403be0
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 0x4062af
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 0x40634c
lea edi, [eax + eax*2]
lea ecx, [ecx + edi*4]
jmp 0x406353
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 0x406363
mov edx, eax
shl edx, 5
add edx, ecx
add eax, edx
jmp 0x406368
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 0x4063c4
lea eax, [ebp - 0x18]
push 4
push eax
call esi
mov eax, dword [ebp - 0x18]
add esp, 0x10
cmp byte [ebp - 1], 0
jne 0x4063e4
test eax, eax
jne 0x4063e4
inc dword [ebp - 0x14]
jmp 0x4063ef
lea ecx, [ebp - 0xc]
push 2
push ecx
call esi
mov ax, word [ebp - 0xc]
add esp, 0x10
cmp byte [ebp - 1], 0
jne 0x4063e3
test ax, ax
jne 0x4063e3
inc dword [ebp - 0x14]
jmp 0x4063ef
cwde
cdq
push 1
push edx
push eax
push ebx
call edi
add esp, 0x10
cmp dword [ebp - 0x14], 0
je 0x406390
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 + 0x42f9d0], eax
mov dword [ecx*8 + 0x42f9d4], edx
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret