Function at 0x4035e0
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 0x403ade
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 0x403aca
mov eax, dword [esp + 0x30]
and eax, 0xf
je 0x403689
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 0x403aca
cmp dword [esp + 0x10], esi
jb 0x403aca
cmp byte [esp + 0xe], 1
jne 0x403697
mov eax, dword [ebx]
mov eax, dword [eax + 0x20]
jmp 0x40369c
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 0x403aca
mov esi, dword [esp + 0x58]
mov edx, 0x5c
mov eax, esi
call fcn.004040c0
mov edi, eax
test edi, edi
je 0x4036ce
add edi, 2
jmp 0x4036d0
mov edi, esi
mov eax, edi
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x4036d2
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 0x403700
mov edx, 0x10
sub edx, ecx
add eax, edx
mov dword [esp + 0x18], eax
test eax, eax
je 0x403aca
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 0x403aca
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.004040f0
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 0x403ab6
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 0x403ab6
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 0x403ab6
cmp dword [esp + 0x10], 8
jb 0x403ab6
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 0x403ab6
mov eax, dword [esp + 0x10]
cmp eax, dword [esp + 0x18]
jb 0x403ab6
push 0
lea ecx, [esp + 0x14]
push ecx
push 4
lea edx, [esp + 0x24]
push edx
push ebp
call esi
test eax, eax
je 0x403ab6
cmp dword [esp + 0x10], 4
jb 0x403ab6
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 0x403ab6
cmp dword [esp + 0x10], 0x10
jb 0x403ab6
cmp byte [esp + 0xe], 1
jne 0x403849
mov ecx, dword [ebx]
mov eax, dword [ecx + 0x24]
jmp 0x40384e
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 0x403ab6
cmp dword [esp + 0x10], 0x80
jb 0x403ab6
push 0
lea edx, [esp + 0x14]
push edx
push 4
push 0x419020
push ebp
call esi
test eax, eax
je 0x403ab6
cmp dword [esp + 0x10], 4
jb 0x403ab6
push 0
lea eax, [esp + 0x14]
push eax
push 4
push 0x419014
push ebp
call esi
test eax, eax
je 0x403ab6
cmp dword [esp + 0x10], 4
jb 0x403ab6
cmp byte [esp + 0xe], 1
jne 0x4038ca
mov ecx, dword [ebx]
mov eax, dword [ecx + 0x20]
jmp 0x4038cf
mov edx, dword [ebx]
mov eax, dword [edx + 0x28]
push edi
push eax
lea edi, [esp + 0x1c]
call fcn.00402ac0
test al, al
je 0x403ab6
mov eax, dword [esp + 0x2c]
cmp eax, dword [esp + 0x34]
jg 0x403a69
jl 0x403900
mov ecx, dword [esp + 0x28]
cmp ecx, dword [esp + 0x30]
jae 0x403a69
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 0x403ab6
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 0x403940
jl 0x40393a
cmp ecx, edi
jae 0x403940
mov dword [esp + 0x44], eax
jmp 0x403946
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 0x403ab6
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x403a63
cmp eax, dword [ebx + 0x10]
jae 0x403995
mov ecx, eax
and ecx, 0xf
je 0x403995
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 0x403ab6
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 0x403ab6
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 0x403ab6
mov eax, dword [esp + 0x1c]
lea edx, [eax + esi]
cmp dword [esp + 0x10], edx
jb 0x403ab6
add dword [esp + 0x28], eax
adc dword [esp + 0x2c], 0
cmp eax, dword [ebx + 0x10]
jb 0x403a63
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 0x403ab6
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 0x403ab6
cmp dword [esp + 0x10], 8
jb 0x403ab6
mov eax, dword [esp + 0x2c]
cmp eax, dword [esp + 0x34]
jl 0x403900
jg 0x403a63
mov ecx, dword [esp + 0x28]
cmp ecx, dword [esp + 0x30]
jb 0x403900
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 0x403ab6
push 0
lea edx, [esp + 0x14]
push edx
push 8
push section..data
push ebp
call esi
test eax, eax
je 0x403ab6
cmp dword [esp + 0x10], 8
jb 0x403ab6
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 0x403aed
push eax
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov al, byte [esp + 0xf]
pop edi
pop esi
pop ebp
add esp, 0x48
ret