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

Disassembly:
sub esp, 0x20
push ebp
push esi
mov esi, dword [esp + 0x3c]
push edi
mov edi, dword [esp + 0x3c]
push esi
push edi
xor ebp, ebp
push 1
push ebp
call fcn.00408c20
add esp, 0x10
test al, al
je 0x4037fd
pop edi
pop esi
mov eax, 0x80008001
pop ebp
add esp, 0x20
ret
push ebx
mov dword [esp + 0x1c], ebp
mov dword [esp + 0x28], edi
mov dword [esp + 0x2c], esi
mov dword [esp + 0x20], ebp
mov dword [esp + 0x24], ebp
mov ebx, 0x300
mov eax, dword [esp + 0x38]
test eax, eax
je 0x403830
push 0
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x40399d
test bh, 1
je 0x40389f
mov edx, dword [esp + 0x2c]
mov eax, 0x80000
xor ecx, ecx
sub eax, ebp
cmp ecx, edx
mov dword [esp + 0x10], eax
jl 0x403856
jg 0x403850
cmp eax, edi
jbe 0x403856
mov eax, edi
mov dword [esp + 0x10], eax
test eax, eax
jbe 0x40389f
lea ecx, [esp + 0x14]
push 0
push ecx
push eax
mov eax, dword [esp + 0x48]
lea edx, [ebp + 0x441734]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4039aa
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
cmp eax, ecx
jne 0x4039b7
add ebp, eax
sub edi, eax
mov eax, dword [esp + 0x2c]
mov dword [esp + 0x28], edi
sbb eax, 0
mov dword [esp + 0x2c], eax
lea ecx, [esp + 0x18]
lea edx, [esp + 0x10]
push ecx
push edx
push 0x4c1734
push 0x441734
mov dword [esp + 0x20], ebp
mov dword [esp + 0x28], 0x80020
call fcn.00408cf0
mov ebx, eax
add esp, 0x10
test bl, bl
jne 0x4039c4
mov eax, dword [esp + 0x18]
test eax, eax
jbe 0x403909
mov edx, dword [esp + 0x48]
lea ecx, [esp + 0x14]
push 0
push ecx
push eax
push 0x4c1734
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4039da
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x18]
cmp eax, ecx
jne 0x4039f9
mov edx, dword [esp + 0x10]
lea ecx, [esp + 0x1c]
push ecx
push edx
push 0x441734
call fcn.00403d20
mov eax, dword [esp + 0x1c]
add esp, 0xc
sub ebp, eax
je 0x403947
mov ecx, ebp
lea esi, [eax + 0x441734]
mov edx, ecx
mov edi, 0x441734
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, dword [esp + 0x28]
mov edx, dword [esp + 0x20]
mov ecx, dword [esp + 0x24]
mov esi, dword [esp + 0x34]
add edx, eax
adc ecx, 0
mov dword [esp + 0x20], edx
test esi, esi
mov dword [esp + 0x24], ecx
je 0x403993
push 0
mov eax, ecx
push 0x64
mov ecx, edx
push eax
push ecx
call fcn.00412980
mov ecx, dword [esp + 0x44]
push ecx
mov ecx, dword [esp + 0x44]
push ecx
push edx
push eax
call fcn.004128d0
push eax
push 0
push 0x405
push esi
call dword [sym.imp.USER32.dll_PostMessageW]
test bh, 4
jne 0x403a06
jmp 0x403817
pop ebx
pop edi
pop esi
mov eax, 1
pop ebp
add esp, 0x20
ret
pop ebx
pop edi
pop esi
mov eax, 0x80018001
pop ebp
add esp, 0x20
ret
pop ebx
pop edi
pop esi
mov eax, 0x80028001
pop ebp
add esp, 0x20
ret
and ebx, 0xff
or ebx, 0x80039000
mov eax, ebx
pop ebx
pop edi
pop esi
pop ebp
add esp, 0x20
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
sub eax, 0x70
pop ebx
neg eax
sbb eax, eax
pop edi
and eax, 0xe002
pop esi
add eax, 0x8004a000
pop ebp
add esp, 0x20
ret
pop ebx
pop edi
pop esi
mov eax, 0x80068002
pop ebp
add esp, 0x20
ret
mov ecx, dword [esp + 0x48]
lea edx, [esp + 0x14]
push 0
push edx
lea eax, [esp + 0x24]
push 4
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x403a42
call dword [sym.imp.KERNEL32.dll_GetLastError]
sub eax, 0x70
pop ebx
neg eax
sbb eax, eax
pop edi
and eax, 0xe002
pop esi
add eax, 0x8007a000
pop ebp
add esp, 0x20
ret
mov eax, dword [esp + 0x14]
pop ebx
sub eax, 4
pop edi
neg eax
sbb eax, eax
pop esi
and eax, 0x80098002
pop ebp
add esp, 0x20
ret