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

Disassembly:
sub esp, 0x48
push ebp
mov ebp, dword [esp + 0x54]
push esi
xor esi, esi
push edi
mov dword [esp + 0x14], esi
mov byte [esp + 0xf], 0
mov dword [esp + 0x28], esi
mov dword [esp + 0x2c], esi
xor edi, edi
mov dword [esp + 0x38], esi
mov dword [esp + 0x3c], esi
call fcn.004026e0
test eax, eax
mov dword [esp + 0x20], eax
je 0x40449e
mov eax, dword [ebx]
mov cl, byte [eax + 0x30]
push 2
lea edx, [esp + 0x34]
push edx
cmp cl, 1
mov byte [esp + 0x16], cl
push edi
sete cl
push esi
add cl, 1
push ebp
mov byte [eax + 0x30], cl
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x40448a
mov eax, dword [esp + 0x30]
and eax, 0xf
je 0x404049
mov esi, 0x10
sub esi, eax
push esi
lea eax, [esp + 0x44]
push edi
push eax
call fcn.00401100
add esp, 0xc
push edi
lea ecx, [esp + 0x14]
push ecx
push esi
lea edx, [esp + 0x4c]
push edx
push ebp
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40448a
cmp dword [esp + 0x10], esi
jb 0x40448a
cmp byte [esp + 0xe], 1
jne 0x404057
mov eax, dword [ebx]
mov eax, dword [eax + 0x20]
jmp 0x40405c
mov ecx, dword [ebx]
mov eax, dword [ecx + 0x28]
mov edx, dword [esp + 0x20]
push edx
push eax
lea edi, [esp + 0x1c]
call fcn.00402ac0
test al, al
je 0x40448a
mov esi, dword [esp + 0x58]
mov edx, 0x5c
mov eax, esi
call fcn.00404a80
mov edi, eax
test edi, edi
je 0x40408e
add edi, 2
jmp 0x404090
mov edi, esi
mov eax, edi
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x404092
sub eax, edi
sar eax, 1
lea esi, [eax + eax - 2]
lea eax, [esi + 0x1c]
mov ecx, eax
and ecx, 0xf
mov dword [esp + 0x18], eax
je 0x4040c0
mov edx, 0x10
sub edx, ecx
add eax, edx
mov dword [esp + 0x18], eax
test eax, eax
je 0x40448a
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
test eax, eax
mov dword [esp + 0x24], eax
je 0x40448a
xor ecx, ecx
mov dword [eax], ecx
mov dword [eax + 4], ecx
mov dword [eax + 8], ecx
mov ecx, dword [esp + 0x30]
mov dword [eax + 0xc], ecx
mov edx, dword [esp + 0x34]
push esi
mov dword [eax + 0x10], edx
mov dword [eax + 0x14], esi
add eax, 0x18
push edi
push eax
call fcn.00401140
mov edi, dword [esp + 0x30]
add esp, 0xc
lea edx, [esi + 0x18]
mov eax, edi
call fcn.00404ae0
mov dword [esi + edi + 0x18], eax
mov eax, dword [esp + 0x18]
mov edx, dword [esp + 0x14]
mov ecx, edi
call fcn.00402b30
test eax, eax
je 0x404476
mov eax, dword [esp + 0x14]
push eax
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
push 2
lea ecx, [esp + 0x3c]
push ecx
xor eax, eax
push eax
push eax
push ebp
mov dword [esp + 0x28], 0
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x404476
mov esi, dword [sym.imp.KERNEL32.dll_WriteFile]
push 0
lea edx, [esp + 0x14]
push edx
push 8
lea eax, [esp + 0x34]
push eax
push ebp
call esi
test eax, eax
je 0x404476
cmp dword [esp + 0x10], 8
jb 0x404476
mov edx, dword [esp + 0x18]
push 0
lea ecx, [esp + 0x14]
push ecx
push edx
push edi
push ebp
call esi
test eax, eax
je 0x404476
mov eax, dword [esp + 0x10]
cmp eax, dword [esp + 0x18]
jb 0x404476
push 0
lea ecx, [esp + 0x14]
push ecx
push 4
lea edx, [esp + 0x24]
push edx
push ebp
call esi
test eax, eax
je 0x404476
cmp dword [esp + 0x10], 4
jb 0x404476
mov edi, dword [esp + 0x20]
push 0
lea eax, [esp + 0x14]
push eax
push 0x10
push edi
push ebp
call esi
test eax, eax
je 0x404476
cmp dword [esp + 0x10], 0x10
jb 0x404476
cmp byte [esp + 0xe], 1
jne 0x404209
mov ecx, dword [ebx]
mov eax, dword [ecx + 0x24]
jmp 0x40420e
mov edx, dword [ebx]
mov eax, dword [edx + 0x2c]
push 0
lea ecx, [esp + 0x14]
push ecx
push 0x80
push eax
push ebp
call esi
test eax, eax
je 0x404476
cmp dword [esp + 0x10], 0x80
jb 0x404476
push 0
lea edx, [esp + 0x14]
push edx
push 4
push 0x41b02c
push ebp
call esi
test eax, eax
je 0x404476
cmp dword [esp + 0x10], 4
jb 0x404476
push 0
lea eax, [esp + 0x14]
push eax
push 4
push 0x41b020
push ebp
call esi
test eax, eax
je 0x404476
cmp dword [esp + 0x10], 4
jb 0x404476
cmp byte [esp + 0xe], 1
jne 0x40428a
mov ecx, dword [ebx]
mov eax, dword [ecx + 0x20]
jmp 0x40428f
mov edx, dword [ebx]
mov eax, dword [edx + 0x28]
push edi
push eax
lea edi, [esp + 0x1c]
call fcn.00402ac0
test al, al
je 0x404476
mov eax, dword [esp + 0x2c]
cmp eax, dword [esp + 0x34]
jg 0x404429
jl 0x4042c0
mov ecx, dword [esp + 0x28]
cmp ecx, dword [esp + 0x30]
jae 0x404429
mov edx, dword [esp + 0x28]
push 0
push 0
push eax
push edx
push ebp
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x404476
mov ecx, dword [esp + 0x30]
mov eax, dword [esp + 0x34]
mov edi, dword [ebx + 0x10]
xor esi, esi
sub ecx, dword [esp + 0x28]
sbb eax, dword [esp + 0x2c]
xor edx, edx
cmp eax, edx
jg 0x404300
jl 0x4042fa
cmp ecx, edi
jae 0x404300
mov dword [esp + 0x44], eax
jmp 0x404306
mov ecx, edi
mov dword [esp + 0x44], edx
push 0
lea eax, [esp + 0x20]
push eax
push ecx
mov ecx, dword [ebx + 0xc]
push ecx
push ebp
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x404476
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x404423
cmp eax, dword [ebx + 0x10]
jae 0x404355
mov ecx, eax
and ecx, 0xf
je 0x404355
mov edx, dword [ebx + 0xc]
mov esi, 0x10
sub esi, ecx
push esi
add edx, eax
push 0
push edx
call fcn.00401100
mov eax, dword [esp + 0x28]
add esp, 0xc
mov ecx, dword [ebx + 0xc]
mov edx, dword [esp + 0x14]
add eax, esi
call fcn.00402b30
test eax, eax
je 0x404476
mov eax, dword [esp + 0x2c]
mov ecx, dword [esp + 0x28]
push 0
push 0
push eax
push ecx
push ebp
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x404476
mov eax, dword [esp + 0x1c]
mov ecx, dword [ebx + 0xc]
push 0
lea edx, [esp + 0x14]
push edx
add eax, esi
push eax
push ecx
push ebp
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x404476
mov eax, dword [esp + 0x1c]
lea edx, [eax + esi]
cmp dword [esp + 0x10], edx
jb 0x404476
add dword [esp + 0x28], eax
adc dword [esp + 0x2c], 0
cmp eax, dword [ebx + 0x10]
jb 0x404423
mov eax, dword [esp + 0x3c]
mov ecx, dword [esp + 0x38]
push 0
push 0
push eax
push ecx
push ebp
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x404476
push 0
lea edx, [esp + 0x14]
push edx
push 8
lea eax, [esp + 0x34]
push eax
push ebp
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x404476
cmp dword [esp + 0x10], 8
jb 0x404476
mov eax, dword [esp + 0x2c]
cmp eax, dword [esp + 0x34]
jl 0x4042c0
jg 0x404423
mov ecx, dword [esp + 0x28]
cmp ecx, dword [esp + 0x30]
jb 0x4042c0
mov esi, dword [sym.imp.KERNEL32.dll_WriteFile]
mov edx, dword [esp + 0x14]
push edx
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov eax, dword [esp + 0x3c]
mov ecx, dword [esp + 0x38]
push 0
push 0
push eax
push ecx
push ebp
mov dword [esp + 0x28], 0
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x404476
push 0
lea edx, [esp + 0x14]
push edx
push 8
push section..data
push ebp
call esi
test eax, eax
je 0x404476
cmp dword [esp + 0x10], 8
jb 0x404476
mov byte [esp + 0xf], 1
mov eax, dword [esp + 0x24]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov ecx, dword [esp + 0x20]
push ecx
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov eax, dword [esp + 0x14]
test eax, eax
je 0x4044ad
push eax
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov al, byte [esp + 0xf]
pop edi
pop esi
pop ebp
add esp, 0x48
ret