Function at 0x405651
Capabilities:
Check if file exists
Read file on windows
Write file on windows

Disassembly:
push ebp
sub esp, 0x840
lea ebp, [esp - 4]
mov eax, dword [0x46dff0]
xor eax, ebp
mov dword [ebp + 0x840], eax
push 0x28
mov eax, 0x44e4b6
call fcn.00437ee3
mov eax, dword [ebp + 0x850]
mov ebx, ecx
mov dword [ebp - 0x30], eax
movzx eax, byte [ebx + 0x27f]
push eax
movzx eax, byte [ebx + 0x270]
push eax
push str.CExtractManager::DecryptDoc:_msPackedSecuAclszDocEncKey:___02X___02X_
mov edi, 0x45198c
push edi
mov esi, 0x471470
push esi
mov dword [ebp - 0x24], ebx
call fcn.00401ac3
add esp, 0x14
call fcn.0041c6cf
push eax
lea ecx, [ebp - 0x10]
call fcn.0040303f
and dword [ebp - 4], 0
call fcn.0041c6cf
push eax
lea ecx, [ebp - 0x18]
call fcn.0040303f
mov byte [ebp - 4], 1
call fcn.0041c6cf
push eax
lea ecx, [ebp - 0x28]
call fcn.0040303f
push dword [ebp + 0x84c]
mov ecx, ebx
mov byte [ebp - 4], 2
call fcn.00404953
push eax
lea ecx, [ebp - 0x10]
call fcn.0040390d
lea eax, [ebp - 0x10]
push eax
lea ecx, [ebp - 0x18]
call fcn.004038c0
push 0x2e
lea ecx, [ebp - 0x18]
call fcn.00403f30
push eax
push 0
lea ecx, [ebp - 0x18]
call fcn.004042f6
push dword [ebp - 0x18]
push dword [ebp - 0x10]
push str.CExtractManager::DecryptDoc:_File___s__Ext___s_
push edi
push esi
call fcn.00401ac3
mov ebx, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
add esp, 0x14
push dword [ebp - 0x10]
call ebx
cmp eax, 1
jne 0x405879
call fcn.0041c6cf
push eax
lea ecx, [ebp - 0x14]
call fcn.0040303f
push 0x2e
lea ecx, [ebp - 0x10]
mov byte [ebp - 4], 3
mov dword [ebp - 0x1c], 1
call fcn.00403f30
push eax
lea eax, [ebp - 0x20]
push eax
lea ecx, [ebp - 0x10]
call fcn.00403842
push eax
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 4
call fcn.004038c0
mov ecx, dword [ebp - 0x20]
add ecx, 0xfffffff0
mov byte [ebp - 4], 3
call fcn.004026bb
push 1
lea eax, [ebp - 0x28]
push str.__d_
push eax
call fcn.00405201
lea eax, [ebp - 0x28]
push eax
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0x2c]
push eax
call fcn.004052ae
lea ecx, [ebp - 0x18]
push ecx
push eax
lea eax, [ebp - 0x20]
push eax
mov byte [ebp - 4], 5
call fcn.004052ae
add esp, 0x24
push eax
lea ecx, [ebp - 0x10]
mov byte [ebp - 4], 6
call fcn.004038c0
mov ecx, dword [ebp - 0x20]
add ecx, 0xfffffff0
call fcn.004026bb
mov ecx, dword [ebp - 0x2c]
add ecx, 0xfffffff0
mov byte [ebp - 4], 3
call fcn.004026bb
jmp 0x405860
push dword [ebp - 0x1c]
lea eax, [ebp - 0x28]
push str.__d_
push eax
call fcn.00405201
lea eax, [ebp - 0x28]
push eax
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0x20]
push eax
call fcn.004052ae
lea ecx, [ebp - 0x18]
push ecx
push eax
lea eax, [ebp - 0x2c]
push eax
mov byte [ebp - 4], 7
call fcn.004052ae
add esp, 0x24
push eax
lea ecx, [ebp - 0x10]
mov byte [ebp - 4], 8
call fcn.004038c0
mov ecx, dword [ebp - 0x2c]
add ecx, 0xfffffff0
call fcn.004026bb
mov ecx, dword [ebp - 0x20]
add ecx, 0xfffffff0
mov byte [ebp - 4], 3
call fcn.004026bb
push dword [ebp - 0x10]
push str.CExtractManager::DecryptDoc:_Serch___s_
push edi
push esi
call fcn.00401ac3
add esp, 0x10
inc dword [ebp - 0x1c]
push dword [ebp - 0x10]
call ebx
cmp eax, 1
je 0x4057ed
mov ecx, dword [ebp - 0x14]
add ecx, 0xfffffff0
mov byte [ebp - 4], 2
call fcn.004026bb
mov ebx, dword [ebp - 0x10]
push 0x451f54
push ebx
call fcn.0043938f
pop ecx
pop ecx
mov dword [ebp - 0x14], eax
test eax, eax
jne 0x4058d5
mov ecx, dword [ebp - 0x28]
add ecx, 0xfffffff0
call fcn.004026bb
mov ecx, dword [ebp - 0x18]
add ecx, 0xfffffff0
call fcn.004026bb
lea ecx, [ebx - 0x10]
call fcn.004026bb
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x840]
xor ecx, ebp
call fcn.00437ed4
add ebp, 0x844
leave
ret 8
push eax
push ebx
push str.CExtractManager::DecryptDoc:_Open___s__Fp___p_
push edi
push esi
call fcn.00401ac3
mov ebx, dword [ebp - 0x24]
add esp, 0x14
push 0
push dword [ebp + 0x84c]
lea ecx, [ebx + 0x258]
call fcn.00403c4a
push dword [eax + 0x200]
push dword [ebp - 0x30]
call fcn.0043b0bd
push dword [ebx + 0x1454]
call fcn.004153b0
mov ebx, eax
add esp, 0x10
mov dword [ebp - 0x34], ebx
mov eax, dword [ebp - 0x24]
mov edx, dword [ebx]
push 0x20
add eax, 0x270
push eax
mov ecx, ebx
mov byte [ebp - 4], 9
call dword [edx]
test eax, eax
jne 0x405aa3
push dword [ebp - 0x14]
call fcn.0043924d
push 0xffffffffffffffeb
push str.CExtractManager::DecryptDoc:_RijndaelInit__Fail___d
push edi
push esi
call fcn.00401ac3
push ebx
call fcn.00419c6d
mov ecx, dword [ebp - 0x28]
add esp, 0x18
add ecx, 0xfffffff0
call fcn.004026bb
mov ecx, dword [ebp - 0x18]
add ecx, 0xfffffff0
call fcn.004026bb
mov ecx, dword [ebp - 0x10]
add ecx, 0xfffffff0
jmp 0x4058a9
push 0x420
lea eax, [ebp]
push 0
push eax
call fcn.00437ff0
push 0x420
lea eax, [ebp + 0x420]
push 0
push eax
call fcn.00437ff0
mov ecx, dword [ebp - 0x24]
add esp, 0x18
push dword [ebp + 0x84c]
add ecx, 0x258
call fcn.00403c4a
push dword [ebp - 0x30]
mov ecx, eax
mov eax, 0x400
cmp dword [ecx + 0x204], eax
jb 0x405a13
push eax
lea eax, [ebp]
push 1
push eax
call fcn.0043b3e2
mov dword [ebp - 0x1c], eax
mov eax, 0x400
add esp, 0x10
cmp dword [ebp - 0x1c], eax
jne 0x405a7f
mov edx, dword [ebx]
push eax
lea eax, [ebp + 0x420]
push eax
lea eax, [ebp]
push eax
mov ecx, ebx
call dword [edx + 8]
push dword [ebp - 0x14]
push eax
lea eax, [ebp + 0x420]
push 1
push eax
call fcn.0043b561
add esp, 0x10
mov dword [ebp - 0x20], eax
jmp 0x405a7f
mov ecx, dword [ebp - 0x24]
push dword [ebp + 0x84c]
add ecx, 0x258
call fcn.00403c4a
push dword [eax + 0x204]
lea eax, [ebp]
push 1
push eax
call fcn.0043b3e2
mov edx, dword [ebx]
add esp, 0x10
push eax
mov dword [ebp - 0x1c], eax
lea eax, [ebp + 0x420]
push eax
lea eax, [ebp]
push eax
mov ecx, ebx
call dword [edx + 0xc]
push dword [ebp - 0x14]
mov dword [ebp - 0x2c], eax
push eax
lea eax, [ebp + 0x420]
push 1
push eax
call fcn.0043b561
push eax
push dword [ebp - 0x2c]
mov dword [ebp - 0x20], eax
push dword [ebp - 0x1c]
push str.CExtractManager::DecryptDoc:_padDecrypt__len__d___d__Write__d_
push edi
push esi
call fcn.00401ac3
add esp, 0x28
cmp dword [ebp - 0x20], 0
je 0x405af3
mov ecx, dword [ebp - 0x24]
push dword [ebp + 0x84c]
add ecx, 0x258
call fcn.00403c4a
mov ecx, dword [ebp - 0x1c]
add eax, 0x204
sub dword [eax], ecx
mov ecx, dword [ebp - 0x24]
push dword [ebp + 0x84c]
add ecx, 0x258
call fcn.00403c4a
cmp dword [eax + 0x204], 0
jne 0x40597a
push dword [ebp - 0x14]
call fcn.0043924d
mov dword [esp], str.CExtractManager::DecryptDoc:_End....._
push edi
push esi
call fcn.00401ac3
mov ecx, dword [ebp - 0x24]
add esp, 0xc
push dword [ebp - 0x10]
add ecx, 0x1978
call fcn.004022ae
xor esi, esi
inc esi
jmp 0x405afe
push dword [ebp - 0x14]
call fcn.0043924d
pop ecx
xor esi, esi
push ebx
call fcn.00419c6d
pop ecx
mov ecx, dword [ebp - 0x28]
add ecx, 0xfffffff0
call fcn.004026bb
mov ecx, dword [ebp - 0x18]
add ecx, 0xfffffff0
call fcn.004026bb
mov ecx, dword [ebp - 0x10]
add ecx, 0xfffffff0
call fcn.004026bb
mov eax, esi
jmp 0x4058b0