Function at 0x857050
Capabilities:
Read file on windows

Disassembly:
sub esp, 0x10
push ebp
push esi
lea esi, [ebx + 0x10c]
push edi
mov edi, dword [ebx + 0x90c]
mov dword [esp + 0x14], esi
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], edi
xor ebp, ebp
xor edx, edx
cmp ebp, edx
jne 0x857177
cmp edi, 8
jl 0x857177
cmp byte [esi], 0x47
jne 0x857104
cmp byte [esi + 1], 0x53
jne 0x857104
mov cl, byte [esi + 3]
mov al, byte [esi + 2]
not cl
cmp al, cl
jne 0x857104
movzx ebp, al
add ebp, 8
lea eax, [ebp + 8]
cmp edi, eax
jge 0x8570ae
mov ebp, 1
jmp 0x857070
cmp byte [esi + ebp + 6], 0xd
jne 0x8570fc
cmp byte [esi + ebp + 7], 0xa
jne 0x8570fc
xor eax, eax
cmp ebp, edx
lea ecx, [esi + 4]
jle 0x8570e5
mov dword [esp + 0x18], ebp
lea esp, [esp]
movzx dx, byte [ecx]
imul eax, eax, 0xd
add eax, edx
mov edx, dword [esp + 0x18]
inc ecx
dec edx
mov dword [esp + 0x18], edx
jne 0x8570d0
xor ecx, ecx
mov ch, byte [esi + ebp + 5]
movzx edx, ax
mov cl, byte [esi + ebp + 4]
cmp edx, ecx
je 0x857253
xor edx, edx
mov byte [esi], 0
jmp 0x85706e
inc esi
dec edi
cmp edi, edx
mov dword [esp + 0xc], edi
jle 0x857168
mov edi, edi
cmp byte [esi], 0x47
jne 0x857131
cmp edi, 1
jle 0x857120
cmp byte [esi + 1], 0x53
jne 0x857131
cmp edi, 3
jle 0x85714a
mov al, byte [esi + 3]
mov cl, byte [esi + 2]
not al
cmp cl, al
je 0x85714a
inc esi
dec edi
cmp edi, edx
jg 0x857110
mov eax, dword [esp + 0x14]
mov dword [esp + 0xc], edi
mov dword [esp + 0x10], eax
mov esi, eax
jmp 0x857070
cmp edi, edx
mov dword [esp + 0xc], edi
jle 0x857168
mov ecx, edi
mov edi, dword [esp + 0x14]
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, edx
mov eax, dword [esp + 0x14]
mov dword [esp + 0x10], eax
mov esi, eax
jmp 0x857070
lea ebp, [ebx + 0x84]
push ebp
lea eax, [ebx + 0xc0]
push eax
mov eax, dword [ebx + 0x80]
mov ecx, 0x800
sub ecx, edi
mov dword [ebp], edx
mov dword [ebx + 0x88], edx
mov dword [ebx + 0x8c], edx
mov dword [ebx + 0x90], edx
push ecx
lea edx, [esi + edi]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x8571db
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x8571db
mov ecx, dword [ebx + 0x80]
push 1
lea eax, [ebx + 0xc0]
push eax
push ebp
push ecx
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
mov eax, dword [ebx + 0xc0]
test eax, eax
jbe 0x8571ec
add edi, eax
jmp 0x85706a
mov edx, dword [ebx + 0xa8]
push 0
push edx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0x102
je 0x8572b8
mov edx, dword [ebx + 0x80]
xor eax, eax
mov dword [ebp], eax
mov dword [ebx + 0x88], eax
mov dword [ebx + 0x8c], eax
mov dword [ebx + 0x90], eax
lea eax, [ebx + 0x98]
push eax
lea ecx, [ebx + 0xc4]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_WaitCommEvent]
test eax, eax
jne 0x857249
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
je 0x8572b8
mov ebp, 1
jmp 0x857070
mov eax, dword [esp + 0x20]
mov ecx, ebp
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]
lea ecx, [ebp - 8]
mov dword [eax], ecx
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov edx, dword [esp + 0x20]
mov dword [edx + 4], eax
mov eax, dword [esp + 0xc]
sub eax, ebp
lea ecx, [eax - 8]
test ecx, ecx
mov dword [ebx + 0x90c], ecx
je 0x8572ac
mov eax, dword [esp + 0x10]
mov edi, dword [esp + 0x14]
mov edx, ecx
shr ecx, 2
lea esi, [eax + ebp + 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
mov eax, 1
pop ebp
add esp, 0x10
ret
mov dword [ebx + 0x90c], edi
pop edi
pop esi
xor eax, eax
pop ebp
add esp, 0x10
ret