Function at 0x4061c0
Capabilities:
Read file on windows

Disassembly:
push 0xffffffffffffffff
push 0x4665f9
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x40
mov eax, dword [esp + 0x58]
push ebx
push ebp
mov ebp, ecx
push esi
mov dword [eax], 0
mov edx, dword [ebp + 0x10]
lea ecx, [esp + 0x28]
push edi
push ecx
push edx
mov dword [esp + 0x20], ebp
call dword [sym.imp.MSVCRT.dll__stat]
add esp, 8
test eax, eax
je 0x40620b
mov ax, 0x405
jmp 0x40651d
mov edi, dword [esp + 0x40]
cmp edi, 0xc
mov dword [esp + 0x14], edi
jl 0x406519
mov eax, dword [ebp + 0xd0]
test eax, eax
je 0x406239
push eax
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
mov dword [ebp + 0xd0], 0
push edi
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
mov dword [ebp + 0xd0], eax
mov dword [ebp + 0xd4], edi
mov ebx, eax
mov eax, dword [ebp + 0x10]
push 0x4879dc
push eax
call dword [sym.imp.MSVCRT.dll_fopen]
mov esi, eax
add esp, 0xc
test esi, esi
je 0x406519
push esi
push edi
push 1
push ebx
call dword [sym.imp.MSVCRT.dll_fread]
push esi
mov edi, eax
call dword [sym.imp.MSVCRT.dll_fclose]
mov eax, dword [esp + 0x28]
add esp, 0x14
cmp edi, eax
jne 0x406519
mov eax, dword [ebx]
cmp eax, 0xa501
mov dword [ebp + 8], eax
je 0x4062bb
cmp eax, 0xa502
je 0x4062bb
cmp eax, 0xa504
je 0x4062bb
mov al, byte [esp + 0x6c]
test al, al
je 0x406514
mov ax, 0x405
jmp 0x40651d
mov eax, dword [ebx + 4]
cmp eax, 1
mov dword [ebp + 0xc], eax
jb 0x406519
cmp eax, 3
ja 0x406519
mov esi, 8
jne 0x406328
mov edx, dword [ebx + 8]
xor eax, eax
test edx, edx
mov esi, 0xc
jbe 0x40630a
mov ecx, dword [esp + 0x60]
cmp eax, dword [esp + 0x64]
jge 0x4062ff
mov di, word [esi + ebx]
mov word [ecx], di
mov edi, dword [esp + 0x68]
inc dword [edi]
add esi, 2
inc eax
add ecx, 2
cmp eax, edx
jb 0x4062ec
cmp eax, dword [esp + 0x64]
jge 0x406328
mov ecx, dword [esp + 0x60]
lea edi, [ecx + eax*2]
mov ecx, dword [esp + 0x64]
sub ecx, eax
xor eax, eax
shr ecx, 1
rep stosd dword es:[edi], eax
adc ecx, ecx
rep stosw word es:[edi], ax
mov eax, dword [esi + ebx]
mov ecx, dword [esp + 0x14]
add esi, 4
lea edi, [eax + esi]
cmp edi, ecx
ja 0x406519
cmp dword [ebp + 0xc], 2
jne 0x4063f9
cmp esi, edi
mov dword [esp + 0x10], edi
jge 0x4063b5
lea edi, [ebp + 0x20]
mov dl, byte [esi + ebx]
mov eax, dword [sym.imp.MSVCP60.dll_unsigned_int_const_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::npos]
mov byte [esp + 0x6c], dl
mov edx, dword [edi + 8]
mov ecx, dword [eax]
sub ecx, edx
cmp ecx, 1
ja 0x406370
call dword [sym.imp.MSVCP60.dll_void___cdecl_std::_Xlen_void_]
mov ebp, dword [edi + 8]
push 0
inc ebp
mov ecx, edi
push ebp
call dword [sym.imp.MSVCP60.dll_private:_bool___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Grow_unsigned_int__bool_]
test al, al
je 0x40639e
movsx edx, byte [esp + 0x6c]
mov eax, dword [edi + 4]
mov ecx, dword [edi + 8]
add eax, ecx
mov dh, dl
mov byte [eax], dl
mov edx, dword [edi + 4]
mov dword [edi + 8], ebp
mov byte [edx + ebp], 0
mov al, byte [esp + 0x6c]
inc esi
test al, al
je 0x4063ad
cmp esi, dword [esp + 0x10]
jl 0x406352
mov edi, dword [esp + 0x10]
mov ebp, dword [esp + 0x18]
cmp byte [esi + ebx], 0
jne 0x4063c4
mov al, byte [esi + ebx + 1]
inc esi
test al, al
je 0x4063bb
mov ecx, dword [esp + 0x64]
test ecx, ecx
jle 0x40646e
mov eax, dword [esp + 0x60]
mov edx, ecx
cmp esi, edi
jge 0x4063ec
mov cx, word [esi + ebx]
add esi, 2
mov word [eax], cx
mov ecx, dword [esp + 0x68]
inc dword [ecx]
jmp 0x4063f1
mov word [eax], 0
add eax, 2
dec edx
jne 0x4063d6
jmp 0x40646e
mov dl, byte [esp + 0x6c]
xor ecx, ecx
add esi, ebx
mov dword [esp + 0x20], ecx
mov dword [esp + 0x24], ecx
mov dword [esp + 0x28], ecx
push eax
push esi
lea ecx, [esp + 0x24]
mov byte [esp + 0x24], dl
call dword [sym.imp.MSVCP60.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char______thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::assign_char_const___unsigned_int_]
mov eax, dword [sym.imp.MSVCP60.dll_unsigned_int_const_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::npos]
lea edx, [esp + 0x1c]
mov dword [esp + 0x58], 0
mov ecx, dword [eax]
push ecx
push 0
push edx
lea ecx, [ebp + 0x20]
call dword [sym.imp.MSVCP60.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char______thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::assign_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char___const___unsigned_int__unsigned_int_]
mov eax, dword [esp + 0x20]
mov dword [esp + 0x58], 0xffffffff
test eax, eax
je 0x40646a
lea ecx, [eax - 1]
mov al, byte [eax - 1]
test al, al
je 0x406461
cmp al, 0xff
je 0x406461
dec al
mov byte [ecx], al
jmp 0x40646a
push ecx
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
mov dword [esp + 0x10], edi
mov eax, dword [ebp + 8]
cmp eax, 0xa501
je 0x406498
cmp eax, 0xa502
je 0x406498
mov eax, dword [esp + 0x14]
mov edx, ebx
add edx, eax
mov dword [ebp + 0x18], eax
mov dword [ebp + 0x14], ebx
mov dword [ebp + 0x1c], edx
xor ax, ax
jmp 0x40651d
lea ecx, [esp + 0x6c]
add ebx, edi
push ecx
push ebx
mov byte [ebp + 4], 1
mov dword [esp + 0x74], 0
call fcn.004011a0
add esp, 8
test ax, ax
jne 0x406519
mov eax, dword [ebp + 0xc4]
mov esi, dword [esp + 0x6c]
test eax, eax
je 0x4064da
push eax
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
mov dword [ebp + 0xc4], 0
push esi
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
mov edx, eax
mov dword [ebp + 0xc4], eax
mov eax, dword [esp + 0x70]
mov ecx, edx
push ecx
mov dword [ebp + 0xc8], esi
push ebx
mov dword [ebp + 0x14], edx
mov dword [ebp + 0x18], eax
call fcn.00401230
add esp, 0xc
test ax, ax
jne 0x406519
mov edx, dword [ebp + 0x14]
mov eax, dword [ebp + 0x18]
add edx, eax
mov dword [ebp + 0x1c], edx
xor ax, ax
jmp 0x40651d
mov ax, 0x404
mov ecx, dword [esp + 0x50]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x4c
ret 0x10