Function at 0x40e980
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.004d7c90
push 0xfffffffffffffffe
push 0x5637c0
push 0x4d8830
mov eax, dword fs:[0]
push eax
sub esp, 0x20
mov eax, dword [0x56c3c0]
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.004d5720
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.0040cde0
test eax, eax
jne 0x40ea49
mov eax, 0xc0000502
jmp 0x40ec8c
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.00404ff0
test bl, 1
je 0x40ea83
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 0x40ead5
cmp dword [ebp - 0x24], edi
je 0x40eac0
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.00404eb0
mov eax, 0xc0000302
jmp 0x40ec8c
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 0x40ec10
cmp dword [ebp - 0x20], 0x2000
jb 0x40ec10
lea eax, [ebp]
call fcn.00415320
test eax, eax
je 0x40ec10
lea edi, [ebp + 0x2408]
mov ecx, esi
call fcn.00414fe0
mov eax, 0x20
lea ecx, [ebp + 0x25c]
mov edx, edi
nop
cmp eax, 4
jb 0x40eb7a
mov esi, dword [edx]
cmp esi, dword [ecx]
jne 0x40eb46
sub eax, 4
add ecx, 4
add edx, 4
jmp 0x40eb30
movzx eax, byte [edx]
movzx esi, byte [ecx]
sub eax, esi
jne 0x40eb72
movzx eax, byte [edx + 1]
movzx esi, byte [ecx + 1]
sub eax, esi
jne 0x40eb72
movzx eax, byte [edx + 2]
movzx esi, byte [ecx + 2]
sub eax, esi
jne 0x40eb72
movzx eax, byte [edx + 3]
movzx ecx, byte [ecx + 3]
sub eax, ecx
sar eax, 0x1f
or eax, 1
jmp 0x40eb7c
xor eax, eax
test eax, eax
je 0x40eb8c
mov dword [ebp - 0x1c], 0xc0000101
jmp 0x40ec17
lea esi, [ebp]
lea edi, [esi + 0x25c]
mov ecx, dword [ebp - 0x30]
call fcn.00414fe0
mov eax, esi
call fcn.004152a0
test eax, eax
je 0x40ec10
push 0
push 0
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
test eax, eax
je 0x40ebc2
mov dword [ebp - 0x1c], 0xc0000305
jmp 0x40ec17
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 0x40ebf1
cmp dword [ebp - 0x20], 0x2000
jae 0x40ec17
lea eax, [ebp]
push eax
lea ecx, [ebp + 0x2200]
call fcn.00404580
add esp, 4
test eax, eax
jne 0x40ec17
mov dword [ebp - 0x1c], 0xc0000304
jmp 0x40ec17
mov dword [ebp - 0x1c], 0xc0000201
mov dword [ebp - 4], 0xfffffffe
call fcn.0040ec34
mov esi, dword [ebp - 0x1c]
test esi, esi
jne 0x40ec58
push str.ChangEstDiskPwd_SUCCESS
jmp 0x40ec79
push esi
push str.ChangEstDiskPwd_FAIL:_X
push 0x200
lea edx, [ebp + 0x2000]
push edx
call fcn.004d9900
add esp, 0x10
lea eax, [ebp + 0x2000]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
lea ecx, [ebp + 0x2200]
call fcn.00404eb0
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.004d6555
add ebp, 0x242c
mov esp, ebp
pop ebp
ret