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

Disassembly:
push 0xffffffffffffffff
mov eax, dword fs:[0]
push 0x40779b
push eax
mov eax, 0x205c
mov dword fs:[0], esp
call fcn.004072d0
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x2080]
lea eax, [esp + 0x106c]
mov esi, ecx
push edi
push eax
mov dword [esp + 0x28], esi
call sub.MSVCRT.dll_wcscpy
lea ecx, [esp + 0x1074]
push ecx
call sub.MSVCRT.dll__wcslwr
push 0x40a0ac
push edi
call sub.MSVCRT.dll_wcscmp
mov ebp, dword [0x40af3c]
mov ecx, dword [0x40af40]
mov edi, eax
add esp, 0x14
neg edi
sbb edi, edi
mov eax, 0xc
inc edi
cmp ebp, ecx
mov dword [esp + 0x10], edi
mov dword [esp + 0x1c], eax
mov dword [esp + 0x14], ebp
je 0x403df5
mov ebx, dword [ebp]
lea edx, [esp + 0x186c]
push ebx
push edx
call sub.MSVCRT.dll_wcscpy
lea eax, [esp + 0x1874]
push eax
call sub.MSVCRT.dll__wcslwr
add esp, 0xc
test edi, edi
jne 0x403a0a
lea ecx, [esp + 0x106c]
lea edx, [esp + 0x186c]
push ecx
push edx
call sub.MSVCRT.dll_wcsstr
add esp, 8
test eax, eax
je 0x403d2c
mov eax, dword [ebx + 0x800]
mov ecx, dword [esi + 4]
push 0
push 0
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
lea ecx, [esp + 0x40]
mov dword [esp + 0x18], 0
call fcn.00402f30
mov edx, dword [esi + 0x14]
lea ecx, [esp + 0x40]
push edx
mov dword [esp + 0x2078], 0
call fcn.004030b0
xor eax, eax
lea ecx, [esp + 0x18]
mov dword [esp + 0x24], eax
lea edx, [esp + 0x24]
mov dword [esp + 0x28], eax
mov dword [esp + 0x2c], eax
mov dword [esp + 0x30], eax
push eax
mov dword [esp + 0x38], eax
mov eax, dword [esi + 4]
push ecx
push 0x14
push edx
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x403d18
mov ecx, dword [esp + 0x2c]
push ecx
call sub.MFC42u.DLL_operatornew
mov ecx, dword [esp + 0x30]
mov ebp, eax
mov edx, ecx
xor eax, eax
mov edi, ebp
add esp, 4
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
push 0
and ecx, 3
rep stosb byte es:[edi], al
mov ecx, dword [esp + 0x30]
mov edx, dword [esi + 4]
lea eax, [esp + 0x1c]
push eax
push ecx
push ebp
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x403d03
mov eax, dword [esp + 0x18]
lea ecx, [esp + 0x30]
push 5
push ecx
lea ecx, [esp + 0x48]
mov dword [esp + 0x44], eax
call fcn.00403040
mov eax, dword [esp + 0x28]
lea edx, [esp + 0x3c]
push edx
push ebp
push eax
lea ecx, [esp + 0x4c]
call fcn.00402fc0
test eax, eax
jne 0x403cc5
mov ecx, 0x200
lea edi, [esp + 0x6c]
rep stosd dword es:[edi], eax
mov ecx, dword [esp + 0x207c]
lea edx, [esp + 0x6c]
push ecx
push edx
call sub.MSVCRT.dll_wcscpy
push 0x40a1f0
push ebx
call sub.MSVCRT.dll_wcsstr
add esp, 0x10
test eax, eax
je 0x403bad
mov ecx, 0x200
xor eax, eax
lea edi, [esp + 0x86c]
rep stosd dword es:[edi], eax
lea eax, [esp + 0x6c]
lea ecx, [esp + 0x86c]
push eax
push ecx
call sub.MSVCRT.dll_wcscpy
lea edx, [esp + 0x874]
push ebx
push edx
call sub.MSVCRT.dll_wcscat
lea eax, [esp + 0x87c]
push 0x5c
push eax
call sub.MSVCRT.dll_wcsrchr
mov word [eax + 2], 0
mov al, byte [0x40af7d]
add esp, 0x18
test al, 1
jne 0x403b9b
mov dl, al
mov ecx, 0x40af80
or dl, 1
mov byte [0x40af7d], dl
call fcn.00406cb0
push 0x4048f0
call fcn.0040729b
add esp, 4
lea ecx, [esp + 0x86c]
push ecx
mov ecx, 0x40af80
call fcn.00406dc0
mov eax, dword [esp + 0x2084]
test eax, eax
jne 0x403bba
mov eax, ebx
lea edx, [esp + 0x6c]
push eax
push edx
call sub.MSVCRT.dll_wcscat
mov al, byte [0x40af7d]
mov esi, dword [esp + 0x5c]
mov edi, dword [esp + 0x58]
add esp, 8
test al, 1
jne 0x403bfb
mov dl, al
mov ecx, 0x40af80
or dl, 1
mov byte [0x40af7d], dl
call fcn.00406cb0
push 0x4048f0
call fcn.0040729b
add esp, 4
push 0
push 0
push esi
push edi
mov ecx, 0x40af80
call fcn.00406e60
mov esi, eax
mov eax, dword [esp + 0x24]
cmp esi, eax
jne 0x403d45
xor edi, edi
lea eax, [esp + 0x6c]
push edi
push 0x80
push 2
push edi
push 2
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x403db3
mov edx, dword [esp + 0x54]
mov eax, dword [esp + 0x50]
lea ecx, [esp + 0x38]
push edi
push ecx
push edx
push eax
push esi
mov dword [esp + 0x4c], edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [esp + 0x1c], edi
mov edi, dword [esp + 0x20]
lea ecx, [esp + 0x64]
lea edx, [ebx + 0x804]
push ecx
push edx
mov ecx, edi
call fcn.004048a0
lea eax, [esp + 0x5c]
add ebx, 0x814
push eax
push ebx
mov ecx, edi
call fcn.004048a0
lea ecx, [esp + 0x5c]
lea edx, [esp + 0x64]
push ecx
push 0
push edx
push esi
call dword [sym.imp.KERNEL32.dll_SetFileTime]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test ebp, ebp
je 0x403cb3
push ebp
call sub.MFC42u.DLL_operatordelete
add esp, 4
xor ebp, ebp
mov eax, dword [esp + 0x10]
test eax, eax
je 0x403ddd
mov esi, dword [esp + 0x20]
jmp 0x403d03
mov al, byte [0x40af7d]
test al, 1
jne 0x403cf0
mov dl, al
mov ecx, 0x40af80
or dl, 1
mov byte [0x40af7d], dl
call fcn.00406cb0
push 0x4048f0
call fcn.0040729b
add esp, 4
push ebx
push str.Get_File_:__s__UNCOMPRESS_ERROR_r_n
push 0x40af80
call fcn.00406d70
add esp, 0xc
test ebp, ebp
je 0x403d10
push ebp
call sub.MFC42u.DLL_operatordelete
add esp, 4
mov ebp, dword [esp + 0x14]
mov edi, dword [esp + 0x10]
lea ecx, [esp + 0x40]
mov dword [esp + 0x2074], 0xffffffff
call fcn.00402f70
mov eax, dword [0x40af40]
add ebp, 4
cmp ebp, eax
mov dword [esp + 0x14], ebp
jne 0x4039c5
jmp 0x403df1
mov al, byte [0x40af7d]
mov edi, 0xb
test al, 1
jne 0x403d75
mov dl, al
mov ecx, 0x40af80
or dl, 1
mov byte [0x40af7d], dl
call fcn.00406cb0
push 0x4048f0
call fcn.0040729b
add esp, 4
mov eax, dword [esp + 0x24]
push eax
push esi
push ebx
push str.Get_File_:__s__CRC_ERROR__d_d__r_n
push 0x40af80
call fcn.00406d70
add esp, 0x14
test ebp, ebp
je 0x403d9b
push ebp
call sub.MFC42u.DLL_operatordelete
add esp, 4
lea ecx, [esp + 0x40]
mov dword [esp + 0x2074], 0xffffffff
call fcn.00402f70
mov eax, edi
jmp 0x403df5
cmp ebp, edi
mov esi, 2
je 0x403dc5
push ebp
call sub.MFC42u.DLL_operatordelete
add esp, 4
lea ecx, [esp + 0x40]
mov dword [esp + 0x2074], 0xffffffff
call fcn.00402f70
mov eax, esi
jmp 0x403df5
lea ecx, [esp + 0x40]
mov dword [esp + 0x2074], 0xffffffff
call fcn.00402f70
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x206c]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x2068
ret 0xc