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

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffb7c
push ebx
push esi
push edi
mov esi, dword [ebp + 0x18]
mov ebx, dword [ebp + 0x10]
mov edi, dword [ebp + 0xc]
mov eax, dword [ebp + 8]
test eax, eax
je 0x40e4cb
cmp eax, 3
jne 0x40e23f
push 0x10
push ebx
lea eax, [ebp - 0x434]
push eax
call fcn.00405314
add esp, 0xc
movzx edx, word [ebx + 2]
push edx
mov ecx, dword [ebp + 0x14]
push ecx
lea eax, [ebp - 0x424]
push eax
call fcn.00405314
add esp, 0xc
mov byte [ebp - 0x434], 2
push 0x419
lea edx, [ebp - 0x434]
push edx
push edi
call dword [0x46aa88]
test al, al
jne 0x40e1a8
xor eax, eax
jmp 0x40e557
mov byte [ebp - 0x434], 1
push 0x419
lea edx, [ebp - 0x434]
push edx
push edi
call dword [0x46aa8c]
test al, al
jne 0x40e1d7
call sub.KERNEL32.DLL_GetLastError
cmp eax, 0x79
je 0x40e1a8
xor eax, eax
jmp 0x40e557
movzx edx, word [ebx + 4]
push edx
lea ecx, [ebp - 0x434]
push ecx
mov eax, dword [ebp + 0x1c]
push eax
call fcn.00405314
movzx edx, word [ebx + 4]
add esp, 0xc
mov cl, byte [ebp + edx - 0x434]
mov byte [esi + 3], cl
movzx eax, word [ebx + 4]
mov dl, byte [ebp + eax - 0x433]
mov byte [esi + 7], dl
movzx ecx, word [ebx + 4]
mov al, byte [ebp + ecx - 0x432]
mov byte [esi + 8], al
movzx edx, word [ebx + 4]
mov cl, byte [ebp + edx - 0x431]
mov byte [esi + 9], cl
movzx eax, word [ebx + 4]
mov dl, byte [ebp + eax - 0x430]
mov eax, 1
mov byte [esi + 0xa], dl
jmp 0x40e557
cmp dword [0x46aaa0], 0
jne 0x40e251
cmp eax, 2
jne 0x40e475
xor edx, edx
mov dword [ebp - 8], edx
push 0x50
push 0
lea ecx, [ebp - 0x484]
push ecx
call fcn.00405384
mov word [ebp - 0x484], 0x2c
mov byte [ebp - 0x481], 0
mov byte [ebp - 0x480], 1
mov byte [ebp - 0x47f], 0
mov byte [ebp - 0x47e], 0x10
mov byte [ebp - 0x47d], 0x18
mov byte [ebp - 0x47c], 0
movzx eax, word [ebx + 2]
mov dword [ebp - 0x478], eax
add esp, 0xc
mov dword [ebp - 0x474], 0x64
mov edx, dword [ebp + 0x14]
lea ecx, [ebp - 0x468]
mov dword [ebp - 0x470], edx
mov dword [ebp - 0x46c], 0x30
push 0x10
push ebx
push ecx
call fcn.00405314
mov byte [ebp - 0x468], 0xdd
add esp, 0xc
lea edx, [ebp - 8]
mov byte [ebp - 0x467], 0xfe
push 0
push edx
mov eax, 0x50
lea ecx, [ebp - 0x484]
push eax
push ecx
push eax
lea eax, [ebp - 0x484]
push eax
push 0x4d014
push edi
call sub.KERNEL32.DLL_DeviceIoControl
cmp byte [ebp - 0x482], 0
jne 0x40e316
test eax, eax
jne 0x40e31d
xor eax, eax
jmp 0x40e557
movzx edx, word [ebx + 4]
add edx, 5
push edx
call fcn.00404078
pop ecx
mov dword [ebp - 4], eax
push 0x50
push 0
lea ecx, [ebp - 0x484]
push ecx
call fcn.00405384
mov word [ebp - 0x484], 0x2c
mov byte [ebp - 0x481], 0
mov byte [ebp - 0x480], 1
mov byte [ebp - 0x47f], 0
mov byte [ebp - 0x47e], 0x10
mov byte [ebp - 0x47c], 1
mov byte [ebp - 0x47d], 0x18
movzx eax, word [ebx + 4]
add esp, 0xc
add eax, 5
mov dword [ebp - 0x478], eax
lea ecx, [ebp - 0x468]
mov dword [ebp - 0x474], 0x64
mov edx, dword [ebp - 4]
mov dword [ebp - 0x470], edx
mov dword [ebp - 0x46c], 0x30
push 0x10
push ebx
push ecx
call fcn.00405314
mov byte [ebp - 0x468], 0xd1
add esp, 0xc
lea edx, [ebp - 8]
mov byte [ebp - 0x467], 0xfe
push 0
push edx
mov eax, 0x50
lea ecx, [ebp - 0x484]
push eax
push ecx
push eax
lea eax, [ebp - 0x484]
push eax
push 0x4d014
push edi
call sub.KERNEL32.DLL_DeviceIoControl
cmp byte [ebp - 0x482], 0
jne 0x40e3f1
test eax, eax
jne 0x40e402
mov edx, dword [ebp - 4]
push edx
call fcn.00403eb0
pop ecx
xor eax, eax
jmp 0x40e557
movzx edx, word [ebx + 4]
push edx
mov ecx, dword [ebp - 4]
push ecx
mov eax, dword [ebp + 0x1c]
push eax
call fcn.00405314
movzx edx, word [ebx + 4]
mov ecx, dword [ebp - 4]
add esp, 0xc
mov al, byte [ecx + edx]
mov byte [esi + 3], al
movzx edx, word [ebx + 4]
mov ecx, dword [ebp - 4]
mov al, byte [ecx + edx + 1]
mov byte [esi + 7], al
movzx edx, word [ebx + 4]
mov ecx, dword [ebp - 4]
mov al, byte [ecx + edx + 2]
mov byte [esi + 8], al
movzx edx, word [ebx + 4]
mov ecx, dword [ebp - 4]
mov al, byte [ecx + edx + 3]
mov byte [esi + 9], al
movzx edx, word [ebx + 4]
mov ecx, dword [ebp - 4]
mov al, byte [ecx + edx + 4]
mov byte [esi + 0xa], al
mov edx, dword [ebp - 4]
push edx
call fcn.00403eb0
pop ecx
mov eax, 1
jmp 0x40e557
mov eax, edi
mov edx, eax
sar edx, 8
mov byte [ebp - 9], dl
mov byte [ebp - 0xa], al
push ebx
movzx ecx, word [ebx + 2]
push ecx
mov eax, dword [ebp + 0x14]
push eax
mov dl, byte [ebp - 0xa]
push edx
mov cl, byte [ebp - 9]
push ecx
call fcn.0040e038
add esp, 0x14
test eax, eax
jne 0x40e4a7
xor eax, eax
jmp 0x40e557
push esi
movzx edx, word [ebx + 4]
push edx
mov ecx, dword [ebp + 0x1c]
push ecx
mov al, byte [ebp - 0xa]
push eax
mov dl, byte [ebp - 9]
push edx
call fcn.0040df0c
add esp, 0x14
jmp 0x40e557
xor ecx, ecx
mov dword [ebp - 0x10], ecx
xor eax, eax
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x18], ebx
push ebx
call fcn.0040e110
pop ecx
test al, al
jne 0x40e4e7
xor eax, eax
jmp 0x40e557
push 0
lea edx, [ebp - 0x10]
push edx
push 0x10
mov ecx, dword [ebp - 0x18]
push ecx
push edi
call sub.KERNEL32.DLL_WriteFile
mov ax, word [ebx + 2]
test ax, ax
je 0x40e516
movzx ecx, ax
lea edx, [ebp - 0x10]
push 0
push edx
push ecx
mov eax, dword [ebp + 0x14]
push eax
push edi
call sub.KERNEL32.DLL_WriteFile
mov ax, word [ebx + 4]
test ax, ax
je 0x40e533
movzx ecx, ax
lea edx, [ebp - 0x14]
push 0
push edx
push ecx
mov eax, dword [ebp + 0x1c]
push eax
push edi
call sub.KERNEL32.DLL_ReadFile
lea edx, [ebp - 0x10]
push 0
push edx
mov eax, esi
push 0x10
push eax
push edi
call sub.KERNEL32.DLL_ReadFile
push esi
call fcn.0040e108
pop ecx
mov eax, 1
jmp 0x40e557
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret