Function at 0x406ad0
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
mov ecx, dword [0x437c5c]
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 0x4385a0
mov dword [ebp - 0x14], eax
mov dword [esi + 0x437a84], 0
call edi
push ebx
call dword [sym.imp.MSVCR100.dll_rewind]
add esp, 0x14
push 0xb
push str._stata_dta_
push 0x4385a0
call dword [sym.imp.MSVCR100.dll__strnicmp]
add esp, 0xc
test eax, eax
jne 0x406b62
mov edx, dword [ebp + 8]
push edx
call fcn.00406ef0
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 0x406b9b
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 0x406ba6
mov dword [ebp - 0x10], 6
jmp 0x406bfb
cmp al, 0x6e
jne 0x406bb3
mov dword [ebp - 0x10], 7
jmp 0x406bfb
cmp al, 0x71
je 0x406bf4
cmp al, 0x6f
je 0x406bf4
cmp al, 0x72
jne 0x406bc8
mov dword [ebp - 0x10], 0xa
jmp 0x406bfb
cmp al, 0x73
jne 0x406bd5
mov dword [ebp - 0x10], 0xb
jmp 0x406bfb
push str.HMLM2
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 + 0x437a98], edx
call edi
mov al, byte [ebp - 1]
add esp, 0x10
cmp al, 1
jne 0x406ce8
cmp dword [ebp - 0x1c], 0
jne 0x406cfa
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 [0x437c5c]
movsx ecx, ax
push ebx
mov word [esi + 0x437a88], ax
mov eax, dword [ebp - 0x14]
push 1
mov dword [eax + edx + 4], ecx
lea ecx, [esi + 0x437a80]
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.00404b60
movsx ecx, word [ebp - 8]
lea edx, [ecx + eax]
lea edi, [ecx*4]
mov dword [esi + 0x437a8c], eax
mov dword [esi + 0x437a9c], edx
call fcn.00404b60
mov cx, word [ebp - 8]
mov edi, dword [esi + 0x437a9c]
mov dword [esi + 0x437a94], eax
movsx eax, cx
test eax, eax
je 0x406d14
push ebx
push 1
push eax
mov eax, dword [esi + 0x437a8c]
mov esi, dword [sym.imp.MSVCR100.dll_fread]
push eax
call esi
mov cx, word [ebp - 8]
add esp, 0x10
jmp 0x406d1a
cmp al, 2
jne 0x406c27
cmp dword [ebp - 0x1c], 0
jne 0x406c27
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 0x406d3c
movsx edx, cx
mov eax, edx
shl eax, 5
add eax, edx
je 0x406d6e
push ebx
push 1
push eax
push edi
call esi
mov cx, word [ebp - 8]
add esp, 0x10
jmp 0x406d6e
xor eax, eax
xor edx, edx
mov dword [ebp - 0x18], eax
cmp dx, cx
jge 0x406d6e
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 0x406d48
xor eax, eax
xor edx, edx
mov dword [ebp - 0x14], eax
cmp dx, cx
jge 0x406deb
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 0x406d84
sub eax, edx
cmp eax, 8
ja 0x406e02
mov eax, esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x406d97
sub eax, edx
mov dword [ebp - 0x18], eax
cmp eax, 0x21
jge 0x406dc2
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.004045b0
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 0x406d7f
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 0x406e1c
lea edi, [eax + eax*2]
lea ecx, [ecx + edi*4]
jmp 0x406e23
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 0x406e33
mov edx, eax
shl edx, 5
add edx, ecx
add eax, edx
jmp 0x406e38
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 0x406e94
lea eax, [ebp - 0x18]
push 4
push eax
call esi
mov eax, dword [ebp - 0x18]
add esp, 0x10
cmp byte [ebp - 1], 0
jne 0x406eb4
test eax, eax
jne 0x406eb4
inc dword [ebp - 0x14]
jmp 0x406ebf
lea ecx, [ebp - 0xc]
push 2
push ecx
call esi
mov ax, word [ebp - 0xc]
add esp, 0x10
cmp byte [ebp - 1], 0
jne 0x406eb3
test ax, ax
jne 0x406eb3
inc dword [ebp - 0x14]
jmp 0x406ebf
cwde
cdq
push 1
push edx
push eax
push ebx
call edi
add esp, 0x10
cmp dword [ebp - 0x14], 0
je 0x406e60
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 + 0x437c40], eax
mov dword [ecx*8 + 0x437c44], edx
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret