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

Disassembly:
sub esp, 0xe1c
push ebx
push ebp
push esi
mov esi, ecx
mov eax, dword [esi + 0x24]
lea ecx, [eax - 0x19]
mov eax, 0x264bbabd
mul ecx
mov eax, ecx
sub eax, edx
shr eax, 1
add eax, edx
shr eax, 0x12
push edi
mov edi, eax
mov eax, ecx
xor edx, edx
mov ecx, 0x6f580
div ecx
shl edi, 7
mov dword [esp + 0x20], edi
cmp edx, 0x80
jbe 0x2406159
lea ecx, [edx - 0x80]
mov eax, 0x2660e163
mul ecx
sub ecx, edx
shr ecx, 1
add ecx, edx
shr ecx, 0xb
add edi, ecx
mov dword [esp + 0x20], edi
lea eax, [edi - 1]
xor ebp, ebp
xor ebx, ebx
cmp edi, ebp
mov dword [esp + 0x24], eax
mov dword [esp + 0x18], eax
mov dword [esp + 0x14], ebx
jle 0x240660f
mov ecx, dword [esi + 0x24]
add ecx, 0xffffffe7
mov eax, 0x264bbabd
mul ecx
mov eax, ecx
sub eax, edx
shr eax, 1
add eax, edx
shr eax, 0x12
mov edi, eax
mov eax, ecx
xor edx, edx
mov ecx, 0x6f580
div ecx
shl edi, 7
cmp edx, 0x80
jbe 0x24061b9
lea ecx, [edx - 0x80]
mov eax, 0x2660e163
mul ecx
sub ecx, edx
shr ecx, 1
add ecx, edx
shr ecx, 0xb
add edi, ecx
cmp ebx, edi
jae 0x2406690
mov eax, dword [esi + 0x44]
mov edi, ebx
shr edi, 7
cmp eax, edi
mov dword [esp + 0x3c], edi
je 0x2406233
mov eax, edi
shl eax, 5
add eax, edi
lea eax, [eax + eax*2]
lea edx, [eax + eax*8]
mov eax, dword [esi]
shl edx, 2
sub edx, edi
push ebp
shl edx, 7
push ebp
add edx, 0x19
push edx
push eax
call dword [sym.imp.kernel32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x2406581
mov eax, dword [esi]
push ebp
lea ecx, [esp + 0x30]
push ecx
push 0x80
lea edx, [esi + 0x48]
push edx
push eax
mov dword [esp + 0x40], ebp
call dword [sym.imp.kernel32.dll_ReadFile]
test eax, eax
je 0x2406595
cmp dword [esp + 0x2c], 0x80
jne 0x2406595
mov dword [esi + 0x44], edi
mov eax, edi
shl eax, 5
add eax, edi
lea eax, [eax + eax*2]
lea ebp, [eax + eax*8]
and ebx, 0x7f
mov eax, ebx
shl eax, 5
add eax, ebx
lea eax, [eax + eax*2]
shl ebp, 2
lea ecx, [eax + eax*8]
mov al, byte [ebx + esi + 0x48]
sub ebp, edi
shl ecx, 1
shl ebp, 7
sub ecx, ebx
test al, al
lea edx, [ebp + ecx*2 + 0x99]
mov dword [esp + 0x38], edx
jne 0x2406563
mov eax, dword [esp + 0x14]
cmp dword [esp + 0x18], eax
jle 0x240660d
mov eax, dword [esi + 0x24]
lea ecx, [eax - 0x19]
mov eax, 0x264bbabd
mul ecx
mov eax, ecx
sub eax, edx
shr eax, 1
add eax, edx
shr eax, 0x12
mov edi, eax
mov eax, ecx
xor edx, edx
mov ecx, 0x6f580
div ecx
shl edi, 7
cmp edx, 0x80
jbe 0x24062c6
lea ecx, [edx - 0x80]
mov eax, 0x2660e163
mul ecx
sub ecx, edx
shr ecx, 1
add ecx, edx
shr ecx, 0xb
add edi, ecx
mov eax, dword [esp + 0x18]
cmp eax, edi
jae 0x2406690
mov ecx, dword [esi + 0x44]
mov edi, eax
shr edi, 7
cmp ecx, edi
je 0x240634b
mov eax, edi
shl eax, 5
add eax, edi
lea eax, [eax + eax*2]
lea edx, [eax + eax*8]
mov eax, dword [esi]
shl edx, 2
sub edx, edi
push 0
shl edx, 7
push 0
add edx, 0x19
push edx
push eax
call dword [sym.imp.kernel32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x2406581
mov eax, dword [esi]
push 0
lea ecx, [esp + 0x2c]
push ecx
push 0x80
lea edx, [esi + 0x48]
push edx
push eax
mov dword [esp + 0x3c], 0
call dword [sym.imp.kernel32.dll_ReadFile]
test eax, eax
je 0x2406595
cmp dword [esp + 0x28], 0x80
jne 0x2406595
mov eax, dword [esp + 0x18]
mov dword [esi + 0x44], edi
and eax, 0x7f
mov ecx, eax
shl ecx, 5
add ecx, eax
lea ecx, [ecx + ecx*2]
lea edx, [ecx + ecx*8]
mov ecx, edi
shl ecx, 5
add ecx, edi
lea ecx, [ecx + ecx*2]
lea ecx, [ecx + ecx*8]
shl ecx, 2
shl edx, 1
sub ecx, edi
sub edx, eax
shl ecx, 7
lea ecx, [ecx + edx*2 + 0x99]
cmp byte [eax + esi + 0x48], 1
je 0x240639c
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x14]
dec eax
cmp eax, ecx
mov dword [esp + 0x18], eax
jle 0x240660d
jmp 0x2406281
mov edx, dword [esi]
mov edi, dword [sym.imp.kernel32.dll_SetFilePointer]
push 0
push 0
push ecx
push edx
call edi
cmp eax, 0xffffffff
je 0x24065e5
mov edx, dword [esi]
push 0
lea eax, [esp + 0x20]
push eax
push 0xdea
lea ecx, [esp + 0x4c]
push ecx
push edx
mov dword [esp + 0x30], 0
call dword [sym.imp.kernel32.dll_ReadFile]
test eax, eax
je 0x24065d1
cmp dword [esp + 0x1c], 0xdea
jne 0x24065d1
mov eax, dword [esp + 0x38]
mov ecx, dword [esi]
push 0
push 0
push eax
push ecx
call edi
cmp eax, 0xffffffff
je 0x24065e5
mov ecx, dword [esi]
push 0
lea edx, [esp + 0x20]
push edx
push 0xdea
lea eax, [esp + 0x4c]
push eax
push ecx
mov dword [esp + 0x30], 0
call dword [sym.imp.kernel32.dll_WriteFile]
test eax, eax
je 0x24065f9
cmp dword [esp + 0x1c], 0xdea
jne 0x24065f9
mov ecx, esi
call fcn.02406fe0
cmp dword [esp + 0x14], eax
jae 0x24065a9
mov eax, dword [esi]
push 0
push 0
lea edx, [ebx + ebp + 0x19]
push edx
push eax
mov byte [esp + 0x23], 1
call edi
cmp eax, 0xffffffff
je 0x2406581
mov eax, dword [esi]
push 0
lea ecx, [esp + 0x34]
push ecx
push 1
lea edx, [esp + 0x1f]
push edx
push eax
mov dword [esp + 0x44], 0
call dword [sym.imp.kernel32.dll_WriteFile]
test eax, eax
je 0x24065bd
cmp dword [esp + 0x30], 1
jne 0x24065bd
mov ecx, dword [esp + 0x3c]
cmp dword [esi + 0x44], ecx
jne 0x24064ac
mov dl, byte [esp + 0x13]
mov byte [ebx + esi + 0x48], dl
mov ecx, esi
call fcn.02406f60
test eax, eax
je 0x2406690
mov ecx, esi
call fcn.02406fe0
mov ebx, dword [esp + 0x18]
cmp ebx, eax
jae 0x24065a9
mov edx, dword [esi]
mov edi, ebx
shr edi, 7
mov eax, edi
shl eax, 5
add eax, edi
lea eax, [eax + eax*2]
lea eax, [eax + eax*8]
shl eax, 2
push 0
sub eax, edi
mov ebp, ebx
shl eax, 7
and ebp, 0x7f
push 0
lea ecx, [eax + ebp + 0x19]
push ecx
push edx
mov byte [esp + 0x22], 0
call dword [sym.imp.kernel32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x2406581
mov edx, dword [esi]
push 0
lea eax, [esp + 0x38]
push eax
push 1
lea ecx, [esp + 0x1e]
push ecx
push edx
mov dword [esp + 0x48], 0
call dword [sym.imp.kernel32.dll_WriteFile]
test eax, eax
je 0x24065bd
cmp dword [esp + 0x34], 1
jne 0x24065bd
cmp dword [esi + 0x44], edi
jne 0x2406548
mov al, byte [esp + 0x12]
mov byte [esi + ebp + 0x48], al
mov eax, dword [esi + 0x18]
cmp eax, ebx
jb 0x2406551
mov eax, ebx
mov ecx, esi
mov dword [esi + 0x18], eax
call fcn.02406f60
test eax, eax
je 0x2406690
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x20]
inc eax
cmp eax, ecx
mov dword [esp + 0x14], eax
jge 0x240660d
xor ebp, ebp
mov ebx, eax
jmp 0x2406174
pop edi
mov dword [esi + 0x28], 0xa
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0xe1c
ret
pop edi
mov dword [esi + 0x28], 5
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0xe1c
ret
pop edi
mov dword [esi + 0x28], 9
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0xe1c
ret
pop edi
mov dword [esi + 0x28], 4
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0xe1c
ret
pop edi
mov dword [esi + 0x28], 5
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0xe1c
ret
pop edi
mov dword [esi + 0x28], 0xa
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0xe1c
ret
pop edi
mov dword [esi + 0x28], 4
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0xe1c
ret
xor ebp, ebp
mov edi, dword [esp + 0x24]
xor ebx, ebx
cmp edi, ebp
jl 0x240669d
lea ecx, [esp + 0x20]
push ecx
lea edx, [esp + 0x28]
push edx
lea eax, [esp + 0x1a]
push eax
push edi
mov ecx, esi
mov dword [esp + 0x30], ebp
mov byte [esp + 0x22], 0
mov dword [esp + 0x34], ebp
call fcn.02406ba0
test eax, eax
je 0x2406690
cmp dword [esp + 0x20], ebp
jne 0x2406671
cmp byte [esp + 0x12], 1
je 0x2406656
inc ebx
dec edi
jns 0x240661d
cmp ebx, ebp
je 0x240669d
push ebx
mov ecx, esi
call fcn.02406d10
test eax, eax
jne 0x2406685
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xe1c
ret
pop edi
mov dword [esi + 0x28], 3
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0xe1c
ret
mov ecx, esi
call fcn.02406f60
test eax, eax
jne 0x240669d
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0xe1c
ret
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0xe1c
ret