Function at 0x406660
Capabilities:
Read file on windows

Disassembly:
sub esp, 0x4a0
push ebx
push ebp
mov ebp, ecx
push esi
push edi
mov eax, dword [ebp + 0x40]
test eax, eax
je 0x406683
push eax
call fcn.00408ece
add esp, 4
mov dword [ebp + 0x40], 0
push 0x2fa
call fcn.00408ed9
mov dword [ebp + 0x40], eax
mov eax, dword [str.godata_]
mov ecx, dword [0x413598]
mov dl, byte [0x414358]
mov dword [esp + 0xa8], ecx
mov dword [esp + 0xa4], eax
mov ecx, 0x3f
xor eax, eax
lea edi, [esp + 0xac]
mov byte [esp + 0x2ac], dl
rep stosd dword es:[edi], eax
mov ecx, 0x40
lea edi, [esp + 0x2ad]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov eax, dword [ebp]
or ecx, 0xffffffff
add esp, 4
lea edx, [esp + 0xa0]
lea eax, [eax + eax*8]
mov byte [esp + 0x13], 0
lea edi, [eax*2 + str.ash1]
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov ebx, ecx
mov esi, edi
or ecx, 0xffffffff
mov edi, edx
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
lea edx, [esp + 0x2a8]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edi, [esp + 0xa0]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
lea edx, [esp + 0xa0]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, 0x413590
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
lea edx, [esp + 0x2a8]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, str..txt
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
push eax
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
lea eax, [esp + 0x1c]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
mov edi, dword [sym.imp.KERNEL32.dll_OpenFile]
lea ecx, [esp + 0xa8]
push ecx
call edi
mov esi, eax
lea edx, [esp + 0x18]
push 0
lea eax, [esp + 0x2ac]
push edx
push eax
call edi
mov ebx, dword [sym.imp.KERNEL32.dll_ReadFile]
cmp esi, 0xffffffff
mov edi, eax
je 0x4068bb
cmp edi, 0xffffffff
je 0x4068bb
push 2
push 0
push 0
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ecx, eax
mov eax, 0xa0a0a0a1
imul ecx
add edx, ecx
sar edx, 6
mov ecx, edx
shr ecx, 0x1f
add edx, ecx
cmp edx, 0x3e8
jle 0x406813
mov edx, 0x3e8
mov ecx, dword [ebp + 0x14]
cmp ecx, edx
jge 0x4068a3
mov eax, ecx
push 0
shl eax, 4
add eax, ecx
push 0
lea edx, [eax + eax*2]
shl edx, 1
push edx
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ecx, dword [ebp + 0x40]
lea eax, [esp + 0x14]
push 0
push eax
add ecx, 0x169
push 0x64
push ecx
push edi
call ebx
mov edx, dword [ebp + 0x40]
push 0
push 0
mov byte [edx + 0x1cd], 0
mov ecx, dword [ebp + 0x14]
mov eax, ecx
shl eax, 5
add eax, ecx
lea eax, [eax + eax*4]
lea ecx, [ecx + eax*4]
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [ebp + 0x40]
lea edx, [esp + 0x14]
push 0
push edx
push 0x169
push eax
push esi
call ebx
mov edx, dword [ebp + 0x40]
lea ecx, [esp + 0x14]
push 0
push ecx
add edx, 0x1ce
push 0x12c
push edx
push esi
call ebx
mov byte [esp + 0x13], 1
push esi
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
push edi
call esi
mov al, byte [esp + 0x13]
test al, al
jne 0x406ab2
mov ecx, dword [ebp]
inc ecx
mov edx, ecx
mov dword [ebp], ecx
cmp edx, 6
jge 0x406b0e
mov dword [ebp + 0x14], 0
mov eax, dword [str.godata_]
mov ecx, dword [0x413598]
mov dword [esp + 0x1a4], eax
mov dword [esp + 0x1a8], ecx
mov ecx, 0x3f
xor eax, eax
lea edi, [esp + 0x1ac]
rep stosd dword es:[edi], eax
mov al, byte [0x414358]
mov ecx, 0x40
mov byte [esp + 0x3ac], al
xor eax, eax
lea edi, [esp + 0x3ad]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea ecx, [edx + edx*8]
lea edx, [esp + 0x1a4]
stosb byte es:[edi], al
lea edi, [ecx*2 + str.ash1]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea edx, [esp + 0x3ac]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edi, [esp + 0x1a4]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
lea edx, [esp + 0x1a4]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, 0x413590
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea edx, [esp + 0x3ac]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, str..txt
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
push eax
and ecx, 3
lea eax, [esp + 0x1c]
rep movsb byte es:[edi], byte [esi]
mov edi, dword [sym.imp.KERNEL32.dll_OpenFile]
lea ecx, [esp + 0x1a8]
push eax
push ecx
call edi
mov esi, eax
lea edx, [esp + 0x18]
push 0
lea eax, [esp + 0x3b0]
push edx
push eax
call edi
cmp esi, 0xffffffff
mov edi, eax
je 0x406a9e
cmp edi, 0xffffffff
je 0x406a9e
mov ecx, dword [ebp + 0x14]
push 0
mov eax, ecx
push 0
shl eax, 4
add eax, ecx
lea ecx, [eax + eax*2]
shl ecx, 1
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [ebp + 0x40]
lea edx, [esp + 0x14]
push 0
push edx
add eax, 0x169
push 0x64
push eax
push edi
call ebx
mov ecx, dword [ebp + 0x40]
push 0
push 0
mov byte [ecx + 0x1cd], 0
mov ecx, dword [ebp + 0x14]
mov eax, ecx
shl eax, 5
add eax, ecx
lea edx, [eax + eax*4]
lea eax, [ecx + edx*4]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edx, dword [ebp + 0x40]
lea ecx, [esp + 0x14]
push 0
push ecx
push 0x169
push edx
push esi
call ebx
mov ecx, dword [ebp + 0x40]
lea eax, [esp + 0x14]
push 0
push eax
add ecx, 0x1ce
push 0x12c
push ecx
push esi
call ebx
mov bl, 1
jmp 0x406aa2
mov bl, byte [esp + 0x13]
push esi
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
push edi
call esi
test bl, bl
je 0x406b0e
mov dword [ebp + 0x38], 8
mov ecx, 0x13
lea esi, [ebp + 0x59]
mov eax, 1
mov edi, dword [ebp + 0x40]
lea edx, [ecx + eax]
inc eax
mov dl, byte [edx + edi - 0x14]
cmp eax, 0x14
mov byte [esi + eax - 1], dl
jl 0x406ac6
add ecx, 0x13
add esi, 0x15
cmp ecx, 0x17c
jl 0x406ac1
mov ecx, dword [ebp + 0x14]
xor eax, eax
inc ecx
pop edi
mov dword [ebp + 0x300], eax
mov byte [ebp + 0x1fd], 1
mov dword [ebp + 0x14], ecx
mov dword [ebp + 0x38], eax
pop esi
pop ebp
mov al, 1
pop ebx
add esp, 0x4a0
ret
mov eax, dword [ebp + 0xc]
test eax, eax
jne 0x406b1d
mov eax, dword [ebp + 0x14]
mov dword [ebp + 0x20], eax
jmp 0x406b24
mov ecx, dword [ebp + 0x14]
dec ecx
mov dword [ebp + 0x20], ecx
pop edi
mov dword [ebp + 0x14], 0xffffffff
mov dword [ebp + 0xc], 1
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x4a0
ret