Function at 0x407850
Capabilities:
Get file attributes
Read file on windows
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x43eea6
mov eax, dword fs:[0]
push eax
sub esp, 0x6c0
mov eax, dword [0x44fb64]
xor eax, esp
mov dword [esp + 0x6b8], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x44fb64]
xor eax, esp
push eax
lea eax, [esp + 0x6d4]
mov dword fs:[0], eax
mov ebx, dword [esp + 0x6e4]
mov esi, ecx
mov edi, edx
mov dword [esp + 0x24], esi
mov dword [esp + 0x20], edi
mov dword [esp + 0x28], ebx
call fcn.00413c41
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x4078bc
push 0x80004005
call fcn.0040a000
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x18], eax
mov dword [esp + 0x6dc], 0
call fcn.00413c41
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x4078f1
push 0x80004005
call fcn.0040a000
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x14], eax
push 0x208
lea ecx, [esp + 0xc8]
push 0
push ecx
mov byte [esp + 0x6e8], 1
call fcn.00425400
add esp, 0xc
push 0x8000
call fcn.00413c36
mov ebp, eax
add esp, 4
test ebp, ebp
jne 0x40799d
push eax
push str.EncryptFileToLdCab_failed_with_chFileContent__NULL
push 0x453d11
call fcn.0040d890
mov byte [esp + 0x6dc], 0
mov eax, dword [esp + 0x14]
add eax, 0xfffffff0
or ecx, 0xffffffff
lea edx, [eax + 0xc]
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40796b
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [esp + 0x6dc], 0xffffffff
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x407996
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor al, al
jmp 0x407d68
push 0x8000
push 0
push ebp
call fcn.00425400
add esp, 0xc
push 0x98
lea ecx, [esp + 0x30]
push 0
push ecx
call fcn.00425400
add esp, 0xc
push 0x400
lea edx, [esp + 0x2d0]
push 0
push edx
call fcn.00425400
add esp, 0xc
push 2
push 0
push 0
push esi
call fcn.00422ad5
push ebx
mov ecx, edi
call fcn.00407e30
add esp, 0x14
push edx
push eax
lea ebx, [esp + 0x34]
call fcn.00407d90
mov ecx, 0x26
mov esi, ebx
lea edi, [esp + 0x2d4]
rep movsd dword es:[edi], dword [esi]
mov esi, dword [esp + 0x2c]
push esi
push 0x400
lea eax, [esp + 0x2dc]
push 1
push eax
call fcn.0042301c
mov edi, dword [esp + 0x38]
mov ecx, dword [edi + 0xc]
push 2
push 0
push 0
push esi
mov dword [esp + 0x44], ecx
call fcn.00422ad5
mov eax, dword [edi + 4]
add esp, 0x28
test eax, eax
jne 0x407a74
cmp dword [esp + 0x1c], 0
je 0x407d0a
mov byte [esp + 0x6dc], 0
mov eax, dword [esp + 0x14]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jmp 0x40795f
mov eax, dword [esp + 0x20]
test eax, eax
je 0x407c4a
mov edx, dword [eax]
mov ecx, dword [eax + 8]
mov esi, dword [esp + 0x18]
lea eax, [ecx - 0x10]
add esi, 0xfffffff0
mov dword [esp + 0x20], edx
cmp eax, esi
je 0x407ada
cmp dword [esi + 0xc], 0
lea edi, [esi + 0xc]
jl 0x407acc
mov edx, dword [eax]
cmp edx, dword [esi]
jne 0x407acc
push eax
call fcn.00409c20
mov ebx, eax
add esp, 4
or eax, 0xffffffff
lock xadd dword [edi], eax
dec eax
test eax, eax
jg 0x407ac3
mov ecx, dword [esi]
mov edx, dword [ecx]
mov eax, dword [edx + 4]
push esi
call eax
add ebx, 0x10
mov dword [esp + 0x18], ebx
jmp 0x407ada
mov eax, dword [ecx - 0xc]
push eax
push ecx
lea ecx, [esp + 0x20]
call fcn.00409f10
mov eax, dword [esp + 0x28]
lea edx, [esp + 0xc4]
sub edx, eax
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x407ae7
lea edi, [esp + 0xc4]
dec edi
lea esp, [esp]
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x407b00
mov cx, word [0x4478c8]
mov eax, dword [esp + 0x18]
mov word [edi], cx
mov ecx, eax
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x407b18
lea edi, [esp + 0xc4]
sub eax, ecx
mov esi, ecx
dec edi
jmp 0x407b30
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x407b30
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
lea edx, [esp + 0xc4]
and ecx, 3
push edx
rep movsb byte es:[edi], byte [esi]
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
test al, 0x10
je 0x407b61
dec dword [esp + 0x1c]
jmp 0x407c3a
lea eax, [esp + 0xc4]
push 0x447a48
push eax
call fcn.0042292f
mov ebx, eax
add esp, 8
test ebx, ebx
je 0x407c4f
push ebx
call fcn.0042309e
add esp, 4
test eax, eax
jne 0x407be6
lea ecx, [ecx]
push ebx
push 0x8000
push 1
push ebp
call fcn.004233a6
mov esi, eax
push esi
mov eax, str.Tipray_LdSafe
mov edi, ebp
call fcn.00413480
mov ecx, dword [esp + 0x38]
add esp, 0x14
push ecx
push esi
push 1
push ebp
call fcn.0042301c
add esp, 0x10
cmp esi, eax
jne 0x407ccb
push 0x8000
push 0
push ebp
call fcn.00425400
add esp, 0xc
push ebx
call fcn.0042309e
add esp, 4
test eax, eax
je 0x407b90
push ebx
call fcn.004229bd
dec dword [esp + 0x20]
add esp, 4
lea edx, [esp + 0xc4]
push edx
push str.EncryptFileToLdCab_Handle_File_Success
lea eax, [esp + 0x1c]
push str._s:_s
push eax
call fcn.00409910
mov ecx, dword [esp + 0x24]
add esp, 0x10
push 0
push ecx
push 0x453d11
call fcn.0040d890
push 0x208
lea edx, [esp + 0xc8]
push 0
push edx
call fcn.00425400
add esp, 0xc
cmp dword [esp + 0x20], 0
jne 0x407a70
jmp 0x407a44
call fcn.0041426f
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.EncryptFileToLdCab_failed_with_error_fopen_NULL__file_error_code:
lea eax, [esp + 0x1c]
push str._s__d
push eax
call fcn.00409910
mov ecx, dword [esp + 0x24]
add esp, 0x10
push 0
push ecx
push 0x453d11
call fcn.0040d890
lea edx, [esp + 0xc4]
push edx
push str.When_open_file:
lea eax, [esp + 0x1c]
push str._s__s
push eax
call fcn.00409910
mov esi, dword [esp + 0x24]
add esp, 0x10
push 0
push esi
push 0x453d11
call fcn.0040d890
lea eax, [esi - 0x10]
mov byte [esp + 0x6dc], 0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jmp 0x40795f
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.EncryptFileToLdCab_failed_with_fwrite_error_iTempRead__iTempWrite_error_code:
lea ecx, [esp + 0x1c]
push str._s__d
push ecx
call fcn.00409910
mov esi, dword [esp + 0x24]
add esp, 0x10
push 0
push esi
push 0x453d11
call fcn.0040d890
mov byte [esp + 0x6dc], 0
lea eax, [esi - 0x10]
jmp 0x407952
push ebp
call fcn.00413c2b
mov byte [esp + 0x6e0], 0
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
add esp, 4
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x407d3b
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [esp + 0x6dc], 0xffffffff
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x407d66
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov al, 1
mov ecx, dword [esp + 0x6d4]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x6b8]
xor ecx, esp
call fcn.00421f65
add esp, 0x6cc
ret