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

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffdc
push ebx
push esi
push edi
mov esi, dword [ebp + 8]
push 0
push 0x80
push 3
push 0
push 1
push SysReAllocStringLen
mov eax, dword [ebp + 0xc]
push eax
call sub.KERNEL32.DLL_CreateFileA
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0xffffffff
jne 0x420863
xor eax, eax
jmp 0x420ac2
push 0
push 0x80
push 2
push 0
push 2
push 0x40000000
mov edx, dword [ebp + 0x10]
push edx
call sub.KERNEL32.DLL_CreateFileA
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0xffffffff
jne 0x420897
mov ecx, dword [ebp - 4]
push ecx
call sub.KERNEL32.DLL_CloseHandle
xor eax, eax
jmp 0x420ac2
lea edx, [ebp - 0xc]
push 0
push edx
lea ecx, [ebp - 0x18]
push 4
push ecx
mov eax, dword [ebp - 4]
push eax
call sub.KERNEL32.DLL_ReadFile
test eax, eax
je 0x4208b6
cmp dword [ebp - 0xc], 4
je 0x4208cf
mov edx, dword [ebp - 4]
push edx
call sub.KERNEL32.DLL_CloseHandle
mov ecx, dword [ebp - 8]
push ecx
call sub.KERNEL32.DLL_CloseHandle
xor eax, eax
jmp 0x420ac2
xor edx, edx
mov dword [ebp - 0x14], edx
cmp byte [ebp + 0x14], 0
je 0x420904
xor ebx, ebx
lea edi, [ebp - 0x18]
mov al, byte [edi]
push eax
push esi
call fcn.004207ec
mov ecx, ebx
xor edx, edx
add ecx, ecx
mov dl, al
add esp, 8
lea ecx, [ecx + ecx*2]
shl edx, cl
add dword [ebp - 0x14], edx
inc ebx
inc edi
cmp ebx, 4
jl 0x4208df
jmp 0x42091e
xor eax, eax
lea edx, [ebp - 0x18]
mov ecx, eax
xor ebx, ebx
shl ecx, 3
mov bl, byte [edx]
shl ebx, cl
add dword [ebp - 0x14], ebx
inc eax
inc edx
cmp eax, 4
jl 0x420909
mov ecx, dword [esi + 0x5ec]
xor edx, edx
mov eax, ecx
mov ebx, 3
div ebx
mov ebx, eax
mov eax, ecx
mov ecx, 3
xor edx, edx
div ecx
test edx, edx
je 0x420944
mov al, 1
jmp 0x420946
xor eax, eax
add bl, al
xor ecx, ecx
mov byte [ebp - 0x19], bl
mov dl, byte [ebp - 0x19]
shl edx, 2
mov byte [ebp - 0x1a], dl
xor edx, edx
mov cl, byte [ebp - 0x19]
mov dl, byte [ebp - 0x1a]
lea ebx, [ecx + ecx*2]
mov eax, ebx
add eax, edx
push eax
call fcn.004d29b4
pop ecx
mov dword [ebp - 0x20], eax
add ebx, dword [ebp - 0x20]
mov dword [ebp - 0x24], ebx
cmp byte [ebp + 0x14], 0
je 0x420a1b
push 0
lea ecx, [ebp - 0xc]
push ecx
xor ebx, ebx
mov bl, byte [ebp - 0x1a]
push ebx
mov eax, dword [ebp - 0x24]
push eax
mov edx, dword [ebp - 4]
push edx
call sub.KERNEL32.DLL_ReadFile
test eax, eax
je 0x420a9c
cmp ebx, dword [ebp - 0xc]
jne 0x420a9c
xor edi, edi
mov eax, dword [ebp - 0x24]
mov ebx, eax
jmp 0x4209c2
mov al, byte [ebx]
push eax
push esi
call fcn.004207ec
add esp, 8
mov byte [ebx], al
inc edi
inc ebx
xor edx, edx
mov dl, byte [ebp - 0x1a]
cmp edi, edx
jl 0x4209b2
xor edi, edi
mov eax, dword [ebp - 0x20]
mov edx, eax
mov ecx, dword [ebp - 0x24]
mov eax, ecx
jmp 0x420a10
mov cl, byte [eax + 1]
shl ecx, 6
or cl, byte [eax]
mov byte [edx], cl
xor ecx, ecx
mov cl, byte [eax + 1]
sar ecx, 2
mov bl, byte [eax + 2]
shl ebx, 4
or cl, bl
mov byte [edx + 1], cl
xor ecx, ecx
mov cl, byte [eax + 2]
sar ecx, 4
mov bl, byte [eax + 3]
shl ebx, 2
or cl, bl
mov byte [edx + 2], cl
inc edi
add edx, 3
add eax, 4
xor ecx, ecx
mov cl, byte [ebp - 0x19]
cmp edi, ecx
jl 0x4209d9
jmp 0x420a44
push 0
lea eax, [ebp - 0xc]
push eax
mov edx, dword [esi + 0x5ec]
push edx
mov eax, dword [ebp - 0x20]
push eax
mov edx, dword [ebp - 4]
push edx
call sub.KERNEL32.DLL_ReadFile
test eax, eax
je 0x420a9c
mov ecx, dword [esi + 0x5ec]
cmp ecx, dword [ebp - 0xc]
jne 0x420a9c
mov eax, dword [ebp - 0x20]
push eax
mov edx, dword [ebp - 0x20]
push edx
push esi
call fcn.00420f60
add esp, 0xc
mov ecx, dword [esi + 0x5ec]
cmp ecx, dword [ebp - 0x14]
jae 0x420a68
mov eax, dword [esi + 0x5ec]
jmp 0x420a6b
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0xc], eax
lea edx, [ebp - 0x10]
push 0
push edx
mov ecx, dword [ebp - 0xc]
push ecx
mov eax, dword [ebp - 0x20]
push eax
mov edx, dword [ebp - 8]
push edx
call sub.KERNEL32.DLL_WriteFile
test eax, eax
je 0x420a9c
mov ecx, dword [ebp - 0xc]
cmp ecx, dword [ebp - 0x10]
jne 0x420a9c
mov eax, dword [ebp - 0xc]
sub dword [ebp - 0x14], eax
jmp 0x420975
mov edx, dword [ebp - 0x20]
push edx
call fcn.004d27ec
pop ecx
mov ecx, dword [ebp - 4]
push ecx
call sub.KERNEL32.DLL_CloseHandle
mov eax, dword [ebp - 8]
push eax
call sub.KERNEL32.DLL_CloseHandle
cmp dword [ebp - 0x14], 0
sete al
and eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret