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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x14
mov eax, dword [0x47b00c]
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 0x411d4d
test eax, eax
je 0x411d4d
push ecx
call fcn.00412460
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 0x411dc0
test eax, eax
je 0x411dc0
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 0x411ff1
test eax, eax
je 0x411ff1
mov ecx, edi
call fcn.00411bf0
mov ebx, dword [edi + 4]
mov esi, eax
mov eax, edx
mov dword [esp + 0x10], eax
test bl, 0x10
je 0x411e1a
test bl, 1
je 0x411e04
push 0
push eax
push esi
mov ecx, edi
call fcn.004123f0
mov eax, dword [edi]
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x10]
xor ecx, esp
call fcn.00430eab
mov esp, ebp
pop ebp
ret 8
test esi, esi
jne 0x411ec5
test eax, eax
jne 0x411ec5
test bl, 0xe0
setne cl
test bl, 3
setne al
test al, cl
je 0x411e04
and ebx, 0x80
or ebx, 0x100
shr ebx, 7
push 0x4507e8
push ebx
call fcn.00431280
mov esi, eax
add esp, 8
mov eax, dword [edi + 4]
test al, al
jns 0x411e6b
mov word [esi], 0xbbef
mov byte [esi + 2], 0xbf
jmp 0x411e7f
test al, 0x20
je 0x411e76
mov word [esi], 0xfeff
jmp 0x411e7f
test al, 0x40
je 0x411e7f
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 0x411ea0
push ecx
mov ecx, edi
call fcn.00412460
mov edi, eax
jmp 0x411ea2
mov edi, dword [edi]
test esi, esi
je 0x411eaf
push esi
call fcn.00430eef
add esp, 4
mov eax, edi
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x10]
xor ecx, esp
call fcn.00430eab
mov esp, ebp
pop ebp
ret 8
test bl, 2
jne 0x411e04
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 0x411e04
mov al, byte [esp + 0x14]
xor ecx, ecx
cmp al, 0xff
jne 0x411f1b
cmp byte [esp + 0x15], 0xfe
jne 0x411f5f
mov eax, dword [edi + 4]
mov ecx, 2
and eax, 0xfffffe3f
or eax, 0x20
jmp 0x411f5c
cmp al, 0xfe
jne 0x411f38
cmp byte [esp + 0x15], 0xff
jne 0x411f5f
mov eax, dword [edi + 4]
mov ecx, 2
and eax, 0xfffffe5f
or eax, 0x40
jmp 0x411f5c
cmp al, 0xef
jne 0x411f5f
cmp byte [esp + 0x15], 0xbb
jne 0x411f5f
cmp byte [esp + 0x16], 0xbf
jne 0x411f5f
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 0x411fc6
test al, 0x60
mov ecx, edi
mov eax, dword [esp + 0x10]
push 0
je 0x411f9f
sub esi, 2
sbb eax, 0
push eax
push esi
call fcn.004123f0
mov ecx, edi
call fcn.00411c50
mov ecx, 0xffff
cmp cx, ax
jne 0x411e04
push 1
push 0xffffffffffffffff
push 0xfffffffffffffffe
jmp 0x411dfd
sub esi, 1
sbb eax, 0
push eax
push esi
call fcn.004123f0
mov ecx, edi
call fcn.00411cc0
cmp al, 0xff
jne 0x411e04
push 1
push 0xffffffffffffffff
push 0xffffffffffffffff
jmp 0x411dfd
cmp ecx, dword [esp + 0x18]
je 0x411e04
sub esp, 8
push ecx
mov ecx, edi
call fcn.004123c0
mov eax, dword [edi]
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x10]
xor ecx, esp
call fcn.00430eab
mov esp, ebp
pop ebp
ret 8
push ecx
mov ecx, edi
call fcn.00412460
mov ecx, dword [esp + 0x1c]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00430eab
mov esp, ebp
pop ebp
ret 8