Function at 0x5ae830
Capabilities:
Read file on windows
Write file on windows

Disassembly:
sub esp, 0x2c
push ebx
mov ebx, ecx
mov ecx, dword [esp + 0x34]
mov dword [esp + 0x20], ebx
mov eax, dword [ecx + 0xc]
cmp eax, 2
jb 0x5ae852
mov eax, 0x820d0001
pop ebx
add esp, 0x2c
ret 4
push ebp
lea eax, [eax + eax*4]
lea ebp, [ebx + eax*8]
push esi
xor esi, esi
mov dword [esp + 0x18], ebp
test byte [ebp + 0x44], 2
je 0x5aebdf
mov eax, dword [ebp + 0x38]
push edi
mov edi, dword [ecx + 0x10]
push esi
push dword [ebx + 0x10]
cdq
push edx
push eax
call fcn.004b2d70
mov ecx, dword [ebx + 0x14]
mov dword [esp + 0x24], eax
mov eax, dword [ebp + 0x3c]
mov dword [esp + 0x20], edx
mov edx, dword [ebp + 0x34]
sub eax, edx
imul eax, ecx
add eax, 7
shr eax, 3
mov dword [esp + 0x28], eax
cmp ecx, 1
jne 0x5aeb1c
test dl, 7
je 0x5aeb1c
mov al, dl
mov dword [esp + 0x18], esi
and al, 7
mov cl, al
mov byte [esp + 0x13], al
mov eax, 0xff
sar eax, cl
mov ecx, dword [ebp + 0x3c]
not al
mov dword [esp + 0x28], eax
and ecx, 7
mov eax, 0xff
sar eax, cl
mov dword [esp + 0x30], eax
mov eax, edx
cdq
and edx, 7
add eax, edx
sar eax, 3
cdq
mov ecx, eax
mov al, 8
add ecx, dword [esp + 0x24]
mov dword [esp + 0x34], ecx
adc edx, dword [esp + 0x20]
sub al, byte [esp + 0x13]
mov dword [esp + 0x38], edx
movzx edx, al
mov eax, dword [ebp + 0x3c]
sub eax, edx
mov dword [esp + 0x20], edx
sub eax, dword [ebp + 0x34]
cdq
and edx, 7
lea ebp, [edx + eax]
mov eax, dword [esp + 0x1c]
sar ebp, 3
mov edx, dword [eax + 0x38]
mov dword [esp + 0x24], edx
cmp edx, dword [eax + 0x40]
jge 0x5aebde
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
lea eax, [esp + 0x38]
push 0
push eax
push ecx
push dword [ebx + 0x70]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x5ae971
call esi
mov esi, eax
test esi, esi
js 0x5ae95f
je 0x5aebd1
movzx esi, si
or esi, 0x83ff0000
cmp esi, 0x83ff0000
jne 0x5aebde
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
push 0
lea eax, [esp + 0x1c]
push eax
push 1
lea eax, [esp + 0x20]
push eax
push dword [ebx + 0x70]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x5aebc7
push 0
lea eax, [esp + 0x3c]
push eax
push dword [esp + 0x3c]
push dword [ebx + 0x70]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x5ae9cc
call esi
mov esi, eax
test esi, esi
js 0x5ae9c0
je 0x5aebd1
movzx esi, si
or esi, 0x83ff0000
cmp esi, 0x83ff0000
jne 0x5aebde
mov al, byte [esp + 0x14]
mov dl, byte [edi]
mov cl, byte [esp + 0x13]
and al, byte [esp + 0x28]
shr dl, cl
or dl, al
lea eax, [esp + 0x18]
push 0
push eax
push 1
lea eax, [esp + 0x20]
mov byte [esp + 0x20], dl
push eax
push dword [ebx + 0x70]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x5aeb11
xor esi, esi
test ebp, ebp
jle 0x5aea2f
mov bl, byte [esp + 0x13]
jmp 0x5aea10
mov dl, byte [esi + edi + 1]
mov cl, bl
mov al, byte [esi + edi]
shr dl, cl
mov ecx, dword [esp + 0x20]
shl al, cl
or dl, al
mov byte [esi + edi], dl
inc esi
cmp esi, ebp
jl 0x5aea10
mov ebx, dword [esp + 0x2c]
push 0
lea eax, [esp + 0x1c]
push eax
push ebp
push edi
push dword [ebx + 0x70]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x5aeb11
push 0
lea eax, [esp + 0x1c]
push eax
push 1
lea eax, [esp + 0x20]
push eax
push dword [ebx + 0x70]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x5aeb11
mov dl, byte [esi + edi]
mov ecx, dword [esp + 0x20]
shl dl, cl
mov ecx, dword [esp + 0x30]
mov al, cl
not al
push 1
and dl, al
mov al, byte [esp + 0x18]
push 0
and al, cl
push 0xffffffffffffffff
push dword [ebx + 0x70]
or dl, al
mov byte [esp + 0x24], dl
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x5aeac2
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
js 0x5aeab6
je 0x5aebd1
movzx esi, si
or esi, 0x83ff0000
cmp esi, 0x83ff0000
jne 0x5aebde
push 0
lea eax, [esp + 0x1c]
push eax
push 1
lea eax, [esp + 0x20]
push eax
push dword [ebx + 0x70]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x5aeb11
mov eax, dword [esp + 0x40]
mov ecx, dword [esp + 0x34]
add edi, dword [eax + 8]
mov eax, dword [ebx + 0x10]
cdq
add ecx, eax
mov eax, dword [esp + 0x1c]
mov dword [esp + 0x34], ecx
adc dword [esp + 0x38], edx
mov edx, dword [esp + 0x24]
inc edx
mov dword [esp + 0x24], edx
cmp edx, dword [eax + 0x40]
jge 0x5aebd1
jmp 0x5ae92c
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x5aebc9
imul ecx, edx
xor eax, eax
mov dword [esp + 0x30], esi
shr ecx, 3
add ecx, dword [esp + 0x24]
mov dword [esp + 0x34], ecx
adc eax, dword [esp + 0x20]
mov dword [esp + 0x38], eax
mov eax, dword [esp + 0x1c]
mov ebp, dword [ebp + 0x38]
cmp ebp, dword [eax + 0x40]
jge 0x5aebde
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, edi
push 0
lea eax, [esp + 0x3c]
push eax
push ecx
push dword [ebx + 0x70]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x5aeb87
call esi
mov esi, eax
test esi, esi
js 0x5aeb79
je 0x5aebd1
movzx esi, si
or esi, 0x83ff0000
cmp esi, 0x83ff0000
jne 0x5aebde
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
push 0
lea eax, [esp + 0x34]
push eax
push dword [esp + 0x30]
push edi
push dword [ebx + 0x70]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x5aebc7
mov eax, dword [ebx + 0x10]
mov ecx, dword [esp + 0x34]
cdq
add ecx, eax
mov eax, dword [esp + 0x40]
mov dword [esp + 0x34], ecx
adc dword [esp + 0x38], edx
inc ebp
add edi, dword [eax + 8]
mov eax, dword [esp + 0x1c]
cmp ebp, dword [eax + 0x40]
jl 0x5aeb50
xor esi, esi
jmp 0x5aebde
call esi
mov esi, eax
test esi, esi
js 0x5aebde
jne 0x5aebd5
xor esi, esi
jmp 0x5aebde
movzx esi, si
or esi, 0x83ff0000
pop edi
mov ebp, dword [esp + 0x3c]
mov ecx, dword [ebp + 0xc]
lea eax, [ecx + ecx*4]
test byte [ebx + eax*8 + 0x44], 4
jne 0x5aebff
push dword [ebx + eax*8 + 0x30]
call fcn.00446420
mov ecx, dword [ebp + 0xc]
add esp, 4
lea eax, [ecx + ecx*4]
xor edx, edx
mov dword [ebx + eax*8 + 0x20], edx
mov dword [ebx + eax*8 + 0x24], edx
mov dword [ebx + eax*8 + 0x28], edx
mov dword [ebx + eax*8 + 0x2c], edx
mov dword [ebx + eax*8 + 0x30], edx
mov dword [ebx + eax*8 + 0x34], edx
mov dword [ebx + eax*8 + 0x38], edx
mov dword [ebx + eax*8 + 0x3c], edx
mov dword [ebx + eax*8 + 0x40], edx
mov dword [ebx + eax*8 + 0x44], edx
mov eax, esi
pop esi
pop ebp
pop ebx
add esp, 0x2c
ret 4