Function at 0x2407030
Capabilities:
Get file size
Read file on windows
Write file on windows

Disassembly:
mov eax, 0x39bc
call fcn.024adb70
push ebx
push ebp
push esi
mov esi, ecx
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
push edi
mov edi, eax
mov eax, ecx
xor edx, edx
mov ecx, 0x6f580
div ecx
shl edi, 7
mov ebp, edi
mov ebx, edx
cmp ebx, 0x80
jbe 0x2407089
lea ecx, [ebx - 0x80]
mov eax, 0x2660e163
mul ecx
sub ecx, edx
shr ecx, 1
add ecx, edx
shr ecx, 0xb
add ebp, ecx
mov eax, dword [esi + 0x18]
cmp eax, ebp
jae 0x2407096
mov dword [esp + 0x1c], eax
jmp 0x24070b7
cmp ebx, 0x80
jbe 0x24070b3
lea ecx, [ebx - 0x80]
mov eax, 0x2660e163
mul ecx
sub ecx, edx
shr ecx, 1
add ecx, edx
shr ecx, 0xb
add edi, ecx
mov dword [esp + 0x1c], edi
mov ebp, dword [esp + 0x39d4]
mov dword [ebp], 0xffffffff
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
xor bl, bl
shl edi, 7
mov byte [esp + 0x13], 0
mov byte [esp + 0x13], bl
mov dword [esp + 0x14], 0
cmp edx, 0x80
jbe 0x240711d
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 edx, dword [esp + 0x1c]
cmp edx, edi
jb 0x2407132
mov dword [esp + 0x14], 1
jmp 0x24071e4
mov eax, dword [esi + 0x44]
mov edi, edx
shr edi, 7
cmp eax, edi
je 0x24071a7
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 0x2407207
mov eax, dword [esi]
push 0
lea ecx, [esp + 0x1c]
push ecx
push 0x80
lea edx, [esi + 0x48]
push edx
push eax
mov dword [esp + 0x2c], 0
call dword [sym.imp.kernel32.dll_ReadFile]
test eax, eax
je 0x240721d
cmp dword [esp + 0x18], 0x80
jne 0x240721d
mov edx, dword [esp + 0x1c]
mov dword [esi + 0x44], edi
mov eax, edx
and eax, 0x7f
mov ecx, eax
shl ecx, 5
add ecx, eax
lea ecx, [ecx + ecx*2]
lea ebx, [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 ebx, 1
sub ebx, eax
sub ecx, edi
shl ecx, 7
lea ecx, [ecx + ebx*2 + 0x99]
mov dword [ebp], ecx
mov bl, byte [eax + esi + 0x48]
mov byte [esp + 0x13], bl
mov eax, dword [esp + 0x39d0]
mov dword [eax], edx
mov eax, dword [esp + 0x14]
test eax, eax
jne 0x2407233
test bl, bl
je 0x240747b
inc edx
mov dword [esp + 0x1c], edx
jmp 0x24070b7
pop edi
mov dword [esi + 0x28], 0xa
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x39bc
ret 8
pop edi
mov dword [esi + 0x28], 5
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x39bc
ret 8
mov eax, dword [esi + 0x24]
lea ecx, [eax - 0x19]
mov eax, 0x264bbabd
mul ecx
mov ebp, ecx
sub ebp, edx
shr ebp, 1
add ebp, edx
mov eax, ecx
xor edx, edx
mov ecx, 0x6f580
div ecx
mov ecx, esi
shr ebp, 0x12
mov edi, edx
call fcn.02406f60
test eax, eax
je 0x2407412
cmp edi, 0x80
jae 0x240731b
mov eax, ebp
shl eax, 5
add eax, ebp
lea eax, [eax + eax*2]
lea edx, [eax + eax*8]
mov eax, dword [esi]
shl edx, 2
sub edx, ebp
push 0
shl edx, 7
push 0
add edx, 0x19
push edx
push eax
call dword [sym.imp.kernel32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x24072b4
pop edi
mov dword [esi + 0x28], 0xa
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x39bc
ret 8
xor eax, eax
push eax
mov ecx, 0x20
lea edi, [esp + 0x28]
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x1c]
push ecx
push 0x80
lea edx, [esp + 0x30]
mov dword [esp + 0x24], eax
mov eax, dword [esi]
push edx
push eax
call dword [sym.imp.kernel32.dll_WriteFile]
test eax, eax
jne 0x24072f6
pop edi
mov dword [esi + 0x28], 4
pop esi
pop ebp
pop ebx
add esp, 0x39bc
ret 8
cmp dword [esp + 0x18], 0x80
je 0x2407316
pop edi
mov dword [esi + 0x28], 4
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x39bc
ret 8
mov edi, 0x80
lea ecx, [edi - 0x80]
mov eax, 0x2660e163
mul ecx
sub ecx, edx
shr ecx, 1
add ecx, edx
shr ecx, 0xb
mov ebx, ecx
mov eax, ebp
shl eax, 5
add eax, ebp
lea eax, [eax + eax*2]
lea ecx, [eax + eax*8]
mov eax, ebx
shl eax, 5
add eax, ebx
lea eax, [eax + eax*2]
shl ecx, 2
lea edx, [eax + eax*8]
sub ecx, ebp
push 0
shl edx, 1
shl ecx, 7
sub edx, ebx
push 0
lea eax, [ecx + edx*2 + 0x99]
mov ecx, dword [esi]
push eax
push ecx
call dword [sym.imp.kernel32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x2407386
pop edi
mov dword [esi + 0x28], 0xa
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x39bc
ret 8
xor eax, eax
mov ecx, 0x37a
lea edi, [esp + 0x24]
rep stosd dword es:[edi], eax
mov ecx, dword [esi]
stosw word es:[edi], ax
xor edi, edi
push edi
lea edx, [esp + 0x24]
push edx
push 0xdea
lea eax, [esp + 0x30]
push eax
push ecx
mov dword [esp + 0x34], edi
call dword [sym.imp.kernel32.dll_WriteFile]
test eax, eax
jne 0x24073cc
pop edi
mov dword [esi + 0x28], 4
pop esi
pop ebp
pop ebx
add esp, 0x39bc
ret 8
cmp dword [esp + 0x20], 0xdea
je 0x24073ec
pop edi
mov dword [esi + 0x28], 4
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x39bc
ret 8
mov edx, dword [esi]
push edi
push edx
mov dword [esi + 0x44], 0xffffffff
call dword [sym.imp.kernel32.dll_GetFileSize]
shl ebp, 7
push edi
add ebp, ebx
push ebp
mov ecx, esi
mov dword [esi + 0x24], eax
call fcn.02406a00
test eax, eax
jne 0x2407421
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x39bc
ret 8
mov eax, dword [esp + 0x39d4]
lea ecx, [esp + 0x14]
push ecx
push eax
lea edx, [esp + 0x1b]
mov dword [eax], 0xffffffff
mov eax, dword [esp + 0x24]
push edx
push eax
mov ecx, esi
mov dword [esp + 0x24], edi
mov byte [esp + 0x23], 0
call fcn.02406ba0
test eax, eax
jne 0x240745f
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x39bc
ret 8
cmp dword [esp + 0x14], edi
je 0x240747b
pop edi
mov dword [esi + 0x28], 3
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x39bc
ret 8
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x39bc
ret 8