Function at 0x410480
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 0x4104ad
test eax, eax
je 0x4104ad
push ecx
call fcn.00410bc0
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 0x410520
test eax, eax
je 0x410520
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 0x410751
test eax, eax
je 0x410751
mov ecx, edi
call fcn.00410350
mov ebx, dword [edi + 4]
mov esi, eax
mov eax, edx
mov dword [esp + 0x10], eax
test bl, 0x10
je 0x41057a
test bl, 1
je 0x410564
push 0
push eax
push esi
mov ecx, edi
call fcn.00410b50
mov eax, dword [edi]
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x10]
xor ecx, esp
call fcn.0042520b
mov esp, ebp
pop ebp
ret 8
test esi, esi
jne 0x410625
test eax, eax
jne 0x410625
test bl, 0xe0
setne cl
test bl, 3
setne al
test al, cl
je 0x410564
and ebx, 0x80
or ebx, 0x100
shr ebx, 7
push 0x454798
push ebx
call fcn.004255d2
mov esi, eax
add esp, 8
mov eax, dword [edi + 4]
test al, al
jns 0x4105cb
mov word [esi], 0xbbef
mov byte [esi + 2], 0xbf
jmp 0x4105df
test al, 0x20
je 0x4105d6
mov word [esi], 0xfeff
jmp 0x4105df
test al, 0x40
je 0x4105df
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 0x410600
push ecx
mov ecx, edi
call fcn.00410bc0
mov edi, eax
jmp 0x410602
mov edi, dword [edi]
test esi, esi
je 0x41060f
push esi
call fcn.0042524f
add esp, 4
mov eax, edi
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x10]
xor ecx, esp
call fcn.0042520b
mov esp, ebp
pop ebp
ret 8
test bl, 2
jne 0x410564
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 0x410564
mov al, byte [esp + 0x14]
xor ecx, ecx
cmp al, 0xff
jne 0x41067b
cmp byte [esp + 0x15], 0xfe
jne 0x4106bf
mov eax, dword [edi + 4]
mov ecx, 2
and eax, 0xfffffe3f
or eax, 0x20
jmp 0x4106bc
cmp al, 0xfe
jne 0x410698
cmp byte [esp + 0x15], 0xff
jne 0x4106bf
mov eax, dword [edi + 4]
mov ecx, 2
and eax, 0xfffffe5f
or eax, 0x40
jmp 0x4106bc
cmp al, 0xef
jne 0x4106bf
cmp byte [esp + 0x15], 0xbb
jne 0x4106bf
cmp byte [esp + 0x16], 0xbf
jne 0x4106bf
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 0x410726
test al, 0x60
mov ecx, edi
mov eax, dword [esp + 0x10]
push 0
je 0x4106ff
sub esi, 2
sbb eax, 0
push eax
push esi
call fcn.00410b50
mov ecx, edi
call fcn.004103b0
mov ecx, 0xffff
cmp cx, ax
jne 0x410564
push 1
push 0xffffffffffffffff
push 0xfffffffffffffffe
jmp 0x41055d
sub esi, 1
sbb eax, 0
push eax
push esi
call fcn.00410b50
mov ecx, edi
call fcn.00410420
cmp al, 0xff
jne 0x410564
push 1
push 0xffffffffffffffff
push 0xffffffffffffffff
jmp 0x41055d
cmp ecx, dword [esp + 0x18]
je 0x410564
sub esp, 8
push ecx
mov ecx, edi
call fcn.00410b20
mov eax, dword [edi]
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x10]
xor ecx, esp
call fcn.0042520b
mov esp, ebp
pop ebp
ret 8
push ecx
mov ecx, edi
call fcn.00410bc0
mov ecx, dword [esp + 0x1c]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0042520b
mov esp, ebp
pop ebp
ret 8