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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x14
mov eax, dword [0x47d00c]
xor eax, esp
mov dword [esp + 0x10], eax
push ebx
mov ebx, dword [ebp + 8]
push esi
push edi
mov edi, ecx
mov eax, dword [edi]
cmp eax, 0xffffffff
je 0x4103bd
test eax, eax
je 0x4103bd
push ecx
call fcn.00410ad0
mov eax, dword [ebp + 0xc]
mov esi, eax
mov ecx, eax
shr esi, 2
and ecx, 3
mov dword [edi + 4], eax
not esi
mov dword [esp + 0x10], 3
and esi, 1
mov dword [esp + 0x18], 0
mov edx, ecx
neg edx
push 0
sbb edx, edx
and edx, 0x40000000
or edx, 0x80000000
test al, 2
mov eax, 0
sete al
test ecx, ecx
push 0
lea eax, [eax*2 + 2]
cmove eax, dword [esp + 0x18]
push eax
push 0
push esi
push edx
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
mov eax, dword [edi]
cmp eax, 0xffffffff
je 0x410430
test eax, eax
je 0x410430
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or eax, 0xffffffff
test esi, esi
cmove esi, eax
mov eax, esi
mov dword [edi], esi
cmp eax, 0xffffffff
je 0x410661
test eax, eax
je 0x410661
mov ecx, edi
call fcn.00410260
mov ebx, dword [edi + 4]
mov esi, eax
mov eax, edx
mov dword [esp + 0x10], eax
test bl, 0x10
je 0x41048a
test bl, 1
je 0x410474
push 0
push eax
push esi
mov ecx, edi
call fcn.00410a60
mov eax, dword [edi]
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x10]
xor ecx, esp
call fcn.00424a0b
mov esp, ebp
pop ebp
ret 8
test esi, esi
jne 0x410535
test eax, eax
jne 0x410535
test bl, 0xe0
setne cl
test bl, 3
setne al
test al, cl
je 0x410474
and ebx, 0x80
or ebx, 0x100
shr ebx, 7
push 0x454788
push ebx
call fcn.00424def
mov esi, eax
add esp, 8
mov eax, dword [edi + 4]
test al, al
jns 0x4104db
mov word [esi], 0xbbef
mov byte [esi + 2], 0xbf
jmp 0x4104ef
test al, 0x20
je 0x4104e6
mov word [esi], 0xfeff
jmp 0x4104ef
test al, 0x40
je 0x4104ef
mov word [esi], 0xfffe
push 0
lea eax, [esp + 0x1c]
push eax
push ebx
push esi
push dword [edi]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x410510
push ecx
mov ecx, edi
call fcn.00410ad0
mov edi, eax
jmp 0x410512
mov edi, dword [edi]
test esi, esi
je 0x41051f
push esi
call fcn.00424a4f
add esp, 4
mov eax, edi
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x10]
xor ecx, esp
call fcn.00424a0b
mov esp, ebp
pop ebp
ret 8
test bl, 2
jne 0x410474
push 0
lea eax, [esp + 0x1c]
mov word [esp + 0x18], 0
push eax
push 3
lea eax, [esp + 0x20]
mov byte [esp + 0x22], 0
push eax
push dword [edi]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x410474
mov al, byte [esp + 0x14]
xor ecx, ecx
cmp al, 0xff
jne 0x41058b
cmp byte [esp + 0x15], 0xfe
jne 0x4105cf
mov eax, dword [edi + 4]
mov ecx, 2
and eax, 0xfffffe3f
or eax, 0x20
jmp 0x4105cc
cmp al, 0xfe
jne 0x4105a8
cmp byte [esp + 0x15], 0xff
jne 0x4105cf
mov eax, dword [edi + 4]
mov ecx, 2
and eax, 0xfffffe5f
or eax, 0x40
jmp 0x4105cc
cmp al, 0xef
jne 0x4105cf
cmp byte [esp + 0x15], 0xbb
jne 0x4105cf
cmp byte [esp + 0x16], 0xbf
jne 0x4105cf
mov eax, dword [edi + 4]
mov ecx, 3
and eax, 0xfffffe9f
or eax, 0x80
mov dword [edi + 4], eax
mov eax, dword [edi + 4]
test al, 1
je 0x410636
test al, 0x60
mov ecx, edi
mov eax, dword [esp + 0x10]
push 0
je 0x41060f
sub esi, 2
sbb eax, 0
push eax
push esi
call fcn.00410a60
mov ecx, edi
call fcn.004102c0
mov ecx, 0xffff
cmp cx, ax
jne 0x410474
push 1
push 0xffffffffffffffff
push 0xfffffffffffffffe
jmp 0x41046d
sub esi, 1
sbb eax, 0
push eax
push esi
call fcn.00410a60
mov ecx, edi
call fcn.00410330
cmp al, 0xff
jne 0x410474
push 1
push 0xffffffffffffffff
push 0xffffffffffffffff
jmp 0x41046d
cmp ecx, dword [esp + 0x18]
je 0x410474
sub esp, 8
push ecx
mov ecx, edi
call fcn.00410a30
mov eax, dword [edi]
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x10]
xor ecx, esp
call fcn.00424a0b
mov esp, ebp
pop ebp
ret 8
push ecx
mov ecx, edi
call fcn.00410ad0
mov ecx, dword [esp + 0x1c]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00424a0b
mov esp, ebp
pop ebp
ret 8