Function at 0x40e950
Capabilities:
Get file attributes
Print debug messages
Read file on windows
Set file attributes
Write file on windows

Disassembly:
push ebp
lea ebp, [esp - 0x242c]
mov eax, 0x242c
call fcn.004fa800
push 0xfffffffffffffffe
push 0x58c840
push 0x4fb430
mov eax, dword fs:[0]
push eax
sub esp, 0x20
mov eax, dword [0x5954a0]
xor dword [ebp - 8], eax
xor eax, ebp
mov dword [ebp + 0x2428], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0x10]
mov dword fs:[0], eax
mov esi, ecx
mov eax, dword [ebp + 0x2434]
mov dword [ebp - 0x30], eax
xor ecx, ecx
mov word [ebp + 0x2200], cx
push 0x206
xor edi, edi
push edi
lea edx, [ebp + 0x2202]
push edx
call fcn.004f8090
add esp, 0xc
mov byte [ebp + 0x2408], 0
xor eax, eax
mov dword [ebp + 0x2409], eax
mov dword [ebp + 0x240d], eax
mov dword [ebp + 0x2411], eax
mov dword [ebp + 0x2415], eax
mov dword [ebp + 0x2419], eax
mov dword [ebp + 0x241d], eax
mov dword [ebp + 0x2421], eax
mov word [ebp + 0x2425], ax
mov byte [ebp + 0x2427], al
lea eax, [ebp + 0x2200]
call fcn.0040cdb0
test eax, eax
jne 0x40ea19
mov eax, 0xc0000502
jmp 0x40ec5c
lea eax, [ebp + 0x2200]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov ebx, eax
mov dword [ebp - 0x28], ebx
mov dword [ebp - 0x24], edi
xor ecx, ecx
call fcn.00404fc0
test bl, 1
je 0x40ea53
push 0x80
lea ecx, [ebp + 0x2200]
push ecx
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
mov dword [ebp - 0x24], 1
push edi
push 0xa0000000
push 3
push edi
push 3
push 0xc0000000
lea edx, [ebp + 0x2200]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
mov dword [ebp - 0x2c], ebx
cmp ebx, 0xffffffff
jne 0x40eaa5
cmp dword [ebp - 0x24], edi
je 0x40ea90
mov eax, dword [ebp - 0x28]
push eax
lea ecx, [ebp + 0x2200]
push ecx
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
lea ecx, [ebp + 0x2200]
call fcn.00404e80
mov eax, 0xc0000302
jmp 0x40ec5c
mov dword [ebp - 0x1c], edi
mov dword [ebp - 4], edi
push edi
lea edx, [ebp - 0x20]
push edx
push 0x2000
lea eax, [ebp]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp eax, edi
je 0x40ebe0
cmp dword [ebp - 0x20], 0x2000
jb 0x40ebe0
lea eax, [ebp]
call fcn.004152f0
test eax, eax
je 0x40ebe0
lea edi, [ebp + 0x2408]
mov ecx, esi
call fcn.00414fb0
mov eax, 0x20
lea ecx, [ebp + 0x25c]
mov edx, edi
nop
cmp eax, 4
jb 0x40eb4a
mov esi, dword [edx]
cmp esi, dword [ecx]
jne 0x40eb16
sub eax, 4
add ecx, 4
add edx, 4
jmp 0x40eb00
movzx eax, byte [edx]
movzx esi, byte [ecx]
sub eax, esi
jne 0x40eb42
movzx eax, byte [edx + 1]
movzx esi, byte [ecx + 1]
sub eax, esi
jne 0x40eb42
movzx eax, byte [edx + 2]
movzx esi, byte [ecx + 2]
sub eax, esi
jne 0x40eb42
movzx eax, byte [edx + 3]
movzx ecx, byte [ecx + 3]
sub eax, ecx
sar eax, 0x1f
or eax, 1
jmp 0x40eb4c
xor eax, eax
test eax, eax
je 0x40eb5c
mov dword [ebp - 0x1c], 0xc0000101
jmp 0x40ebe7
lea esi, [ebp]
lea edi, [esi + 0x25c]
mov ecx, dword [ebp - 0x30]
call fcn.00414fb0
mov eax, esi
call fcn.00415270
test eax, eax
je 0x40ebe0
push 0
push 0
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
test eax, eax
je 0x40eb92
mov dword [ebp - 0x1c], 0xc0000305
jmp 0x40ebe7
push 0
lea edx, [ebp - 0x20]
push edx
push 0x2000
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov esi, eax
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or ebx, 0xffffffff
mov dword [ebp - 0x2c], ebx
test esi, esi
je 0x40ebc1
cmp dword [ebp - 0x20], 0x2000
jae 0x40ebe7
lea eax, [ebp]
push eax
lea ecx, [ebp + 0x2200]
call fcn.00404550
add esp, 4
test eax, eax
jne 0x40ebe7
mov dword [ebp - 0x1c], 0xc0000304
jmp 0x40ebe7
mov dword [ebp - 0x1c], 0xc0000201
mov dword [ebp - 4], 0xfffffffe
call fcn.0040ec04
mov esi, dword [ebp - 0x1c]
test esi, esi
jne 0x40ec28
push str.ChangEstDiskPwd_SUCCESS
jmp 0x40ec49
push esi
push str.ChangEstDiskPwd_FAIL:_X
push 0x200
lea edx, [ebp + 0x2000]
push edx
call fcn.004fbcbc
add esp, 0x10
lea eax, [ebp + 0x2000]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
lea ecx, [ebp + 0x2200]
call fcn.00404e80
mov eax, esi
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x2428]
xor ecx, ebp
call fcn.004f8124
add ebp, 0x242c
mov esp, ebp
pop ebp
ret