Function at 0x406710
Capabilities:
Read file on windows
Terminate process

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x44
push ebx
push esi
xor esi, esi
push edi
mov edi, eax
mov eax, dword [ebp + 8]
push 0x104
lea ecx, [eax + 4]
push esi
push eax
mov dword [esp + 0x40], esi
mov byte [esp + 0x18], 0
mov byte [esp + 0x19], 0
mov byte [esp + 0x1a], 0
mov dword [esp + 0x30], esi
mov dword [esp + 0x34], 1
mov dword [esp + 0x24], esi
mov dword [esp + 0x20], esi
mov dword [esp + 0x3c], ecx
mov dword [esp + 0x2c], esi
mov dword [esp + 0x1c], esi
call sub.MSVCR80.dll_memset
mov eax, dword [ebp + 0xc]
add esp, 0xc
and eax, 2
mov dword [esp + 0x3c], eax
je 0x4067ca
mov eax, edi
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x406780
sub eax, edx
lea esi, [eax + 1]
cmp esi, 0xf4240
mov dword [esp + 0x1c], esi
jb 0x4067b8
push 0x10
call fcn.00408960
add esp, 4
test eax, eax
je 0x4067b8
push esi
push str.fatal_buffer_size_error__size_lu
push 0x10
call fcn.00408640
add esp, 0xc
mov dword [esp + 0x4c], edi
mov dword [esp + 0x40], esi
mov edi, str.__INLINE__
jmp 0x4068a3
push 0x804
mov ebx, 0x800
call dword [sym.imp.MSVCR80.dll_malloc]
add esp, 4
cmp eax, esi
jne 0x4067e6
jmp fcn.00408a80
mov dword [eax], esi
lea esi, [eax + 4]
mov dword [esp + 0x34], eax
xor eax, eax
push eax
push edi
mov byte [esi], 0
mov dword [esp + 0x48], ebx
mov dword [esp + 0x4c], eax
mov dword [esp + 0x50], eax
mov dword [esp + 0x54], esi
call dword [sym.imp.MSVCR80.dll__open]
mov ebx, eax
add esp, 8
cmp ebx, 0xffffffff
jne 0x40683a
push 0x110
call fcn.00408960
add esp, 4
test eax, eax
je 0x40683a
push edi
push str.Cannot_open_file_key_file__s
push 0x110
call fcn.00408640
add esp, 0xc
push 0x800
push esi
push ebx
call dword [sym.imp.MSVCR80.dll__read]
mov esi, eax
add esp, 0xc
test esi, esi
mov dword [esp + 0x1c], esi
jge 0x406872
push 0x10
call fcn.00408960
add esp, 4
test eax, eax
je 0x406872
push edi
push str.Read_error_on_key_file___s_
push 0x10
call fcn.00408640
add esp, 0xc
cmp esi, 0x800
jne 0x406899
push 0x10
call fcn.00408960
add esp, 4
test eax, eax
je 0x406899
push esi
push edi
push str.Key_file___s__can_be_a_maximum_of__d_bytes
push 0x10
call fcn.00408640
add esp, 0x10
push ebx
call dword [sym.imp.MSVCR80.dll__close]
add esp, 4
mov edx, dword [esp + 0x4c]
xor ecx, ecx
cmp dword [esp + 0x1c], ecx
mov dword [esp + 0x2c], edx
jle 0x406ae0
mov eax, dword [esp + 0x2c]
mov bl, byte [eax]
cmp bl, 0xa
jne 0x4068d4
add dword [esp + 0x28], 1
mov dword [esp + 0x14], ecx
mov dword [esp + 0x18], ecx
jmp 0x406ac6
mov ecx, dword [esp + 0x18]
test ecx, ecx
jne 0x406908
mov eax, dword [esp + 0x10]
cmp eax, 1
jne 0x4068ef
mov dword [esp + 0x10], 2
jmp 0x4068f9
cmp eax, 2
je 0x4068f9
cmp eax, 3
jne 0x40690c
cmp bl, 0x2d
jne 0x406908
mov dword [esp + 0x10], 4
jmp 0x40695a
mov eax, dword [esp + 0x10]
test eax, eax
jne 0x40694c
cmp ecx, 0x25
jge 0x406ac1
movsx ecx, byte [ecx + str._____BEGIN_OpenVPN_Static_key_V1_____]
movzx edx, bl
cmp edx, ecx
jne 0x406ac1
mov eax, dword [esp + 0x14]
add eax, 1
cmp eax, 0x25
mov dword [esp + 0x14], eax
jne 0x406ac1
mov dword [esp + 0x10], 1
jmp 0x406ac1
cmp eax, 4
jne 0x40698d
cmp ecx, 0x23
jge 0x406ac1
movsx eax, byte [ecx + str._____END_OpenVPN_Static_key_V1_____]
movzx ecx, bl
cmp ecx, eax
jne 0x406ac1
mov eax, dword [esp + 0x14]
add eax, 1
cmp eax, 0x23
mov dword [esp + 0x14], eax
jne 0x406ac1
mov dword [esp + 0x10], 5
jmp 0x406ac1
cmp eax, 2
jne 0x406ac1
movzx esi, bl
push esi
call dword [sym.imp.MSVCR80.dll_isxdigit]
add esp, 4
test eax, eax
je 0x406a6c
mov esi, dword [esp + 0x24]
test esi, esi
jl 0x4069b8
cmp esi, 2
jl 0x4069df
push 0x10
call fcn.00408960
add esp, 4
test eax, eax
je 0x4069df
push 0x45c
push str..crypto.c
push str.Assertion_failed_at__s:_d
push 0x10
call fcn.00408640
add esp, 0x10
mov byte [esp + esi + 0xc], bl
add esi, 1
cmp esi, 2
mov dword [esp + 0x24], esi
jne 0x406ac1
lea edx, [esp + 0x38]
push edx
lea eax, [esp + 0x10]
push 0x510fb4
push eax
call dword [sym.imp.MSVCR80.dll_sscanf]
add esp, 0xc
cmp eax, 1
je 0x406a37
push 0x10
call fcn.00408960
add esp, 4
test eax, eax
je 0x406a37
push 0x461
push str..crypto.c
push str.Assertion_failed_at__s:_d
push 0x10
call fcn.00408640
add esp, 0x10
mov eax, dword [esp + 0x30]
mov cl, byte [esp + 0x38]
mov byte [eax], cl
add eax, 1
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0x20]
add eax, 1
cmp eax, 0x100
mov dword [esp + 0x24], 0
mov dword [esp + 0x20], eax
jne 0x406ac1
mov dword [esp + 0x10], 3
jmp 0x406ac1
push esi
call dword [sym.imp.MSVCR80.dll_isspace]
add esp, 4
test eax, eax
jne 0x406ac1
push 0x10
call fcn.00408960
add esp, 4
test eax, eax
je 0x406ac1
push esi
call dword [sym.imp.MSVCR80.dll_isprint]
add esp, 4
test eax, eax
mov eax, str.Non_Hex_character___c__found_at_line__d_in_key_file__s___d__d__d_bytes_found_min_max_
jne 0x406aa0
mov eax, str.Non_Hex__unprintable_character__0x_02x__found_at_line__d_in_key_file__s___d__d__d_bytes_found_min_max_
mov edx, dword [esp + 0x20]
mov ecx, dword [esp + 0x28]
push 0x100
push 0x80
push edx
push edi
push ecx
push esi
push eax
push 0x10
call fcn.00408640
add esp, 0x20
add dword [esp + 0x18], 1
mov eax, dword [esp + 0x1c]
add dword [esp + 0x2c], 1
sub eax, 1
xor ecx, ecx
cmp eax, ecx
mov dword [esp + 0x1c], eax
jg 0x4068b7
mov esi, dword [esp + 0x20]
mov ebx, dword [ebp + 8]
mov eax, esi
cdq
and edx, 0x7f
add eax, edx
sar eax, 7
mov dword [ebx], eax
js 0x406afb
cmp eax, 2
jle 0x406b22
push 0x10
call fcn.00408960
add esp, 4
test eax, eax
je 0x406b22
push 0x47c
push str..crypto.c
push str.Assertion_failed_at__s:_d
push 0x10
call fcn.00408640
add esp, 0x10
test byte [ebp + 0xc], 1
je 0x406b86
cmp dword [ebx], 0
jne 0x406b56
push 0x10
call fcn.00408960
add esp, 4
test eax, eax
je 0x406b56
push 0x100
push 0x80
push esi
push edi
push str.Insufficient_key_material_or_header_text_not_found_found_in_file__s___d__d__d_bytes_found_min_max_
push 0x10
call fcn.00408640
add esp, 0x18
cmp dword [esp + 0x10], 5
je 0x406b86
push 0x10
call fcn.00408960
add esp, 4
test eax, eax
je 0x406b86
push 0x100
push 0x80
push esi
push edi
push str.Footer_text_not_found_in_file__s___d__d__d_bytes_found_min_max_
push 0x10
call fcn.00408640
add esp, 0x18
cmp dword [esp + 0x3c], 0
jne 0x406ba5
mov eax, dword [esp + 0x40]
test eax, eax
jle 0x406ba5
mov edx, dword [esp + 0x4c]
push eax
push 0
push edx
call sub.MSVCR80.dll_memset
add esp, 0xc
mov eax, dword [esp + 0x34]
test eax, eax
je 0x406bc1
mov edi, dword [sym.imp.MSVCR80.dll_free]
mov esi, dword [eax]
push eax
call edi
add esp, 4
test esi, esi
mov eax, esi
jne 0x406bb3
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret