Function at 0x662b90
Capabilities:
Read file on windows

Disassembly:
sub esp, 8
push ebx
push ebp
mov ebp, dword [esp + 0x14]
mov ebx, dword [ebp + 0x8f8]
push esi
lea esi, [ebp + 0xf8]
push edi
mov dword [esp + 0x10], esi
mov dword [esp + 0x1c], esi
xor edx, edx
xor eax, eax
cmp edx, eax
jne 0x662c8d
cmp ebx, 8
jl 0x662c8d
cmp byte [esi], 0x47
jne 0x662c25
cmp byte [esi + 1], 0x53
jne 0x662c25
mov cl, byte [esi + 3]
mov al, byte [esi + 2]
not cl
cmp al, cl
jne 0x662c25
movzx edi, al
add edi, 8
lea edx, [edi + 8]
cmp ebx, edx
mov dword [esp + 0x14], edi
jge 0x662bf3
mov edx, 1
jmp 0x662bb1
cmp byte [edi + esi + 6], 0xd
jne 0x662c20
cmp byte [edi + esi + 7], 0xa
jne 0x662c20
lea ecx, [esi + 4]
mov edx, edi
call fcn.00662b70
xor ecx, ecx
mov ch, byte [edi + esi + 5]
movzx eax, ax
mov cl, byte [edi + esi + 4]
cmp eax, ecx
je 0x662d49
mov byte [esi], 0
jmp 0x662baf
inc esi
dec ebx
test ebx, ebx
jle 0x662c7e
jmp 0x662c30
cmp byte [esi], 0x47
jne 0x662c51
cmp ebx, 1
jle 0x662c40
cmp byte [esi + 1], 0x53
jne 0x662c51
cmp ebx, 3
jle 0x662c66
mov al, byte [esi + 3]
mov cl, byte [esi + 2]
not al
cmp cl, al
je 0x662c66
inc esi
dec ebx
test ebx, ebx
jg 0x662c30
mov ecx, dword [esp + 0x10]
mov dword [esp + 0x1c], ecx
mov esi, ecx
jmp 0x662bb1
test ebx, ebx
jle 0x662c7e
mov edi, dword [esp + 0x10]
mov ecx, ebx
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x10]
mov dword [esp + 0x1c], ecx
mov esi, ecx
jmp 0x662bb1
mov ecx, dword [ebp + 0x6c]
lea edi, [ebp + 0x70]
push edi
mov dword [edi], eax
mov dword [ebp + 0x74], eax
mov dword [ebp + 0x78], eax
mov dword [ebp + 0x7c], eax
lea eax, [ebp + 0xac]
push eax
mov edx, 0x800
sub edx, ebx
push edx
lea eax, [esi + ebx]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x662cde
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x662cde
mov edx, dword [ebp + 0x6c]
push 1
lea eax, [ebp + 0xac]
push eax
push edi
push edx
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
mov eax, dword [ebp + 0xac]
test eax, eax
jbe 0x662cef
add ebx, eax
jmp 0x662baf
mov eax, dword [ebp + 0x94]
push 0
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0x102
je 0x662daf
xor eax, eax
lea ecx, [ebp + 0x84]
push ecx
lea edx, [ebp + 0xb0]
mov dword [edi], eax
mov dword [ebp + 0x74], eax
mov dword [ebp + 0x78], eax
mov dword [ebp + 0x7c], eax
mov eax, dword [ebp + 0x6c]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WaitCommEvent]
test eax, eax
jne 0x662d3f
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
je 0x662daf
mov edx, 1
jmp 0x662bb1
mov eax, dword [esp + 0x20]
mov ecx, edi
mov edx, ecx
shr ecx, 2
add esi, 4
lea edi, [eax + 8]
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov esi, dword [esp + 0x14]
lea ecx, [esi - 8]
mov dword [eax], ecx
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov edx, dword [esp + 0x20]
sub ebx, esi
lea ecx, [ebx - 8]
test ecx, ecx
mov dword [edx + 4], eax
mov dword [ebp + 0x8f8], ecx
je 0x662da2
mov eax, dword [esp + 0x1c]
mov edi, dword [esp + 0x10]
mov edx, ecx
shr ecx, 2
lea esi, [esi + eax + 8]
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 8
ret
pop edi
pop esi
mov dword [ebp + 0x8f8], ebx
pop ebp
xor eax, eax
pop ebx
add esp, 8
ret