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

Disassembly:
push 0xffffffffffffffff
push 0x4143ee
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x86c
push ebx
push ebp
push esi
push edi
mov edi, ecx
xor eax, eax
xor ecx, ecx
mov dword [esp + 0x28], edi
mov al, byte [edi + 0x237]
mov cl, byte [edi + 0x228]
push eax
push ecx
push str.CExtractManager::DecryptDoc:_msPackedSecuAclszDocEncKey:___02X___02X_
push 0x41a040
call fcn.0040c930
add esp, 0x10
lea ecx, [esp + 0x10]
call sub.MFC42u.DLL_CString::CString_1
lea ecx, [esp + 0x14]
mov dword [esp + 0x884], 0
call sub.MFC42u.DLL_CString::CString_1
lea ecx, [esp + 0x18]
mov byte [esp + 0x884], 1
call sub.MFC42u.DLL_CString::CString_1
mov esi, dword [esp + 0x88c]
mov ecx, edi
push esi
mov byte [esp + 0x888], 2
call fcn.00403560
push eax
lea ecx, [esp + 0x14]
call sub.MFC42u.DLL_CString::operator_1
lea edx, [esp + 0x10]
lea ecx, [esp + 0x14]
push edx
call sub.MFC42u.DLL_CString::operator_2
push 0x2e
lea ecx, [esp + 0x18]
call sub.MFC42u.DLL_CString::ReverseFind
push eax
push 0
lea ecx, [esp + 0x1c]
call sub.MFC42u.DLL_CString::Delete
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
push eax
push ecx
push str.CExtractManager::DecryptDoc:_File___s__Ext___s_
push 0x41a040
call fcn.0040c930
mov edx, dword [esp + 0x20]
mov ebp, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
add esp, 0x10
push edx
call ebp
cmp eax, 1
jne 0x4031c5
lea ecx, [esp + 0x24]
call sub.MFC42u.DLL_CString::CString_1
mov bl, 3
push 0x2e
lea ecx, [esp + 0x14]
mov byte [esp + 0x888], bl
mov esi, 1
call sub.MFC42u.DLL_CString::ReverseFind
push eax
lea eax, [esp + 0x24]
push eax
lea ecx, [esp + 0x18]
call sub.MFC42u.DLL_CString::Left
push eax
lea ecx, [esp + 0x28]
mov byte [esp + 0x888], 4
call sub.MFC42u.DLL_CString::operator_2
lea ecx, [esp + 0x20]
mov byte [esp + 0x884], bl
call sub.MFC42u.DLL_CString::CString
push esi
lea ecx, [esp + 0x1c]
push str.__d_
push ecx
call sub.MFC42u.DLL_CString::Format
add esp, 0xc
lea edx, [esp + 0x18]
lea eax, [esp + 0x24]
lea ecx, [esp + 0x1c]
push edx
push eax
push ecx
call sub.MFC42u.DLL_operator_1
lea edx, [esp + 0x14]
mov byte [esp + 0x884], 5
push edx
push eax
lea eax, [esp + 0x28]
push eax
call sub.MFC42u.DLL_operator_1
push eax
lea ecx, [esp + 0x14]
mov byte [esp + 0x888], 6
call sub.MFC42u.DLL_CString::operator_2
lea ecx, [esp + 0x20]
mov byte [esp + 0x884], 5
call sub.MFC42u.DLL_CString::CString
lea ecx, [esp + 0x1c]
mov byte [esp + 0x884], bl
call sub.MFC42u.DLL_CString::CString
mov ecx, dword [esp + 0x10]
push ecx
call ebp
cmp eax, esi
jne 0x4031ad
push esi
lea edx, [esp + 0x1c]
push str.__d_
push edx
call sub.MFC42u.DLL_CString::Format
add esp, 0xc
lea eax, [esp + 0x18]
lea ecx, [esp + 0x24]
lea edx, [esp + 0x34]
push eax
push ecx
push edx
call sub.MFC42u.DLL_operator_1
lea ecx, [esp + 0x14]
lea edx, [esp + 0x38]
push ecx
push eax
push edx
mov byte [esp + 0x890], 7
call sub.MFC42u.DLL_operator_1
push eax
lea ecx, [esp + 0x14]
mov byte [esp + 0x888], 8
call sub.MFC42u.DLL_CString::operator_2
lea ecx, [esp + 0x38]
mov byte [esp + 0x884], 7
call sub.MFC42u.DLL_CString::CString
lea ecx, [esp + 0x34]
mov byte [esp + 0x884], bl
call sub.MFC42u.DLL_CString::CString
mov eax, dword [esp + 0x10]
push eax
push str.CExtractManager::DecryptDoc:_Serch___s_
push 0x41a040
call fcn.0040c930
mov ecx, dword [esp + 0x1c]
add esp, 0xc
inc esi
push ecx
call ebp
cmp eax, 1
je 0x403113
lea ecx, [esp + 0x24]
mov byte [esp + 0x884], 2
call sub.MFC42u.DLL_CString::CString
mov esi, dword [esp + 0x88c]
mov edx, dword [esp + 0x10]
push 0x41a458
push edx
call dword [sym.imp.MSVCRT.dll__wfopen]
add esp, 8
mov dword [esp + 0x1c], eax
test eax, eax
je 0x403461
push eax
mov eax, dword [esp + 0x14]
push eax
push str.CExtractManager::DecryptDoc:_Open___s__Fp___p_
push 0x41a040
call fcn.0040c930
mov ecx, esi
mov eax, dword [edi + 0x21c]
shl ecx, 5
add ecx, esi
push 0
lea ebp, [esi + ecx*4]
mov esi, dword [esp + 0x8a4]
shl ebp, 2
mov edx, dword [eax + ebp + 0x200]
push edx
push esi
call dword [sym.imp.MSVCRT.dll_fseek]
mov eax, dword [edi + 0x140c]
push eax
call fcn.0040db60
mov ebx, eax
add esp, 0x20
test ebx, ebx
setne byte [esp + 0x2c]
mov dword [esp + 0x30], ebx
mov edx, dword [ebx]
lea eax, [edi + 0x228]
push 0x20
push eax
mov ecx, ebx
mov byte [esp + 0x88c], 9
call dword [edx]
test eax, eax
jne 0x40328e
mov eax, dword [esp + 0x1c]
push eax
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
push 0xffffffffffffffeb
push str.CExtractManager::DecryptDoc:_RijndaelInit__Fail___d
push 0x41a040
call fcn.0040c930
mov al, byte [esp + 0x38]
add esp, 0xc
test al, al
je 0x403461
jmp 0x403458
mov edx, dword [edi + 0x21c]
mov eax, dword [edx + ebp + 0x204]
test eax, eax
je 0x4033cc
jmp 0x4032ac
mov esi, dword [esp + 0x890]
mov ecx, 0x108
xor eax, eax
lea edi, [esp + 0x3c]
push esi
rep stosd dword es:[edi], eax
mov ecx, 0x108
lea edi, [esp + 0x460]
rep stosd dword es:[edi], eax
cmp dword [edx + ebp + 0x204], 0x400
jb 0x40332c
push 0x400
lea ecx, [esp + 0x44]
push 1
push ecx
call dword [sym.imp.MSVCRT.dll_fread]
mov esi, eax
add esp, 0x10
cmp esi, 0x400
jne 0x40338f
mov edx, dword [ebx]
push eax
lea eax, [esp + 0x460]
lea ecx, [esp + 0x40]
push eax
push ecx
mov ecx, ebx
call dword [edx + 8]
mov edx, dword [esp + 0x1c]
push edx
push eax
lea eax, [esp + 0x464]
push 1
push eax
call dword [sym.imp.MSVCRT.dll_fwrite]
add esp, 0x10
mov dword [esp + 0x20], eax
jmp 0x40338f
mov ecx, dword [edx + ebp + 0x204]
lea edx, [esp + 0x40]
push ecx
push 1
push edx
call dword [sym.imp.MSVCRT.dll_fread]
add esp, 0x10
mov esi, eax
mov eax, dword [ebx]
lea ecx, [esp + 0x45c]
push esi
lea edx, [esp + 0x40]
push ecx
push edx
mov ecx, ebx
call dword [eax + 0xc]
mov edi, eax
mov eax, dword [esp + 0x1c]
push eax
push edi
lea ecx, [esp + 0x464]
push 1
push ecx
call dword [sym.imp.MSVCRT.dll_fwrite]
add esp, 0x10
mov dword [esp + 0x20], eax
push eax
push edi
push esi
push str.CExtractManager::DecryptDoc:_padDecrypt__len__d___d__Write__d_
push 0x41a040
call fcn.0040c930
add esp, 0x14
mov eax, dword [esp + 0x20]
test eax, eax
je 0x403442
mov ecx, dword [esp + 0x28]
mov eax, dword [ecx + 0x21c]
mov edx, dword [eax + ebp + 0x204]
sub edx, esi
mov dword [eax + ebp + 0x204], edx
mov edx, dword [ecx + 0x21c]
mov eax, dword [edx + ebp + 0x204]
test eax, eax
jne 0x4032a5
mov edi, ecx
mov eax, dword [esp + 0x1c]
push eax
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
push str.CExtractManager::DecryptDoc:_End....._
push 0x41a040
call fcn.0040c930
mov eax, dword [esp + 0x18]
add edi, 0x1460
push eax
mov esi, eax
call dword [sym.imp.MSVCRT.dll_wcslen]
mov ebp, eax
add esp, 0xc
cmp ebp, 0x7ffffffd
jbe 0x40340f
call dword [sym.imp.MSVCP60.dll_void___cdecl_std::_Xlen_void_]
mov ecx, dword [edi + 4]
xor edx, edx
cmp ecx, edx
je 0x40349e
mov al, byte [ecx - 1]
test al, al
je 0x40349e
cmp al, 0xff
je 0x40349e
cmp ebp, edx
jne 0x4034c4
dec al
mov byte [ecx - 1], al
mov dword [edi + 4], edx
mov dword [edi + 8], edx
mov dword [edi + 0xc], edx
jmp 0x4034f6
mov edx, dword [esp + 0x1c]
push edx
call dword [sym.imp.MSVCRT.dll_fclose]
mov al, byte [esp + 0x30]
add esp, 4
test al, al
je 0x403461
push ebx
call sub.MFC42u.DLL_operatordelete
add esp, 4
lea ecx, [esp + 0x18]
mov byte [esp + 0x884], 1
call sub.MFC42u.DLL_CString::CString
lea ecx, [esp + 0x14]
mov byte [esp + 0x884], 0
call sub.MFC42u.DLL_CString::CString
lea ecx, [esp + 0x10]
mov dword [esp + 0x884], 0xffffffff
call sub.MFC42u.DLL_CString::CString
xor eax, eax
jmp 0x403542
cmp ebp, edx
jne 0x4034ae
push 1
mov ecx, edi
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::_Tidy_bool_]
jmp 0x4034f6
mov eax, dword [edi + 0xc]
cmp eax, 0x1f
ja 0x4034ba
cmp eax, ebp
jae 0x4034cd
push 1
mov ecx, edi
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::_Tidy_bool_]
push ebp
mov ecx, edi
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::_Copy_unsigned_int_]
mov ecx, dword [edi + 4]
mov eax, esi
test ebp, ebp
jbe 0x4034e7
sub ecx, esi
mov edx, ebp
mov si, word [eax]
mov word [ecx + eax], si
add eax, 2
dec edx
jne 0x4034da
mov ecx, dword [edi + 4]
mov dword [edi + 8], ebp
mov word [ecx + ebp*2], 0
lea ebp, [ecx + ebp*2]
mov al, byte [esp + 0x2c]
test al, al
je 0x403507
push ebx
call sub.MFC42u.DLL_operatordelete
add esp, 4
lea ecx, [esp + 0x18]
mov byte [esp + 0x884], 1
call sub.MFC42u.DLL_CString::CString
lea ecx, [esp + 0x14]
mov byte [esp + 0x884], 0
call sub.MFC42u.DLL_CString::CString
lea ecx, [esp + 0x10]
mov dword [esp + 0x884], 0xffffffff
call sub.MFC42u.DLL_CString::CString
mov eax, 1
mov ecx, dword [esp + 0x87c]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x878
ret 8