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

Disassembly:
push 0xffffffffffffffff
push 0x43e456
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.004133f1
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x4075ec
push 0x80004005
call fcn.00409d60
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.004133f1
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x407621
push 0x80004005
call fcn.00409d60
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.00424c40
add esp, 0xc
push 0x8000
call fcn.004133db
mov ebp, eax
add esp, 4
test ebp, ebp
jne 0x4076cd
push eax
push str.EncryptFileToLdCab_failed_with_chFileContent__NULL
push 0x453d09
call fcn.0040d390
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 0x40769b
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 0x4076c6
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor al, al
jmp 0x407a98
push 0x8000
push 0
push ebp
call fcn.00424c40
add esp, 0xc
push 0x98
lea ecx, [esp + 0x30]
push 0
push ecx
call fcn.00424c40
add esp, 0xc
push 0x400
lea edx, [esp + 0x2d0]
push 0
push edx
call fcn.00424c40
add esp, 0xc
push 2
push 0
push 0
push esi
call fcn.00422bac
push ebx
mov ecx, edi
call fcn.00407b60
add esp, 0x14
push edx
push eax
lea ebx, [esp + 0x34]
call fcn.00407ac0
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.004223d3
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.00422bac
mov eax, dword [edi + 4]
add esp, 0x28
test eax, eax
jne 0x4077a4
cmp dword [esp + 0x1c], 0
je 0x407a3a
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 0x40768f
mov eax, dword [esp + 0x20]
test eax, eax
je 0x40797a
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 0x40780a
cmp dword [esi + 0xc], 0
lea edi, [esi + 0xc]
jl 0x4077fc
mov edx, dword [eax]
cmp edx, dword [esi]
jne 0x4077fc
push eax
call fcn.00409980
mov ebx, eax
add esp, 4
or eax, 0xffffffff
lock xadd dword [edi], eax
dec eax
test eax, eax
jg 0x4077f3
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 0x40780a
mov eax, dword [ecx - 0xc]
push eax
push ecx
lea ecx, [esp + 0x20]
call fcn.00409c70
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 0x407817
lea edi, [esp + 0xc4]
dec edi
lea esp, [esp]
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x407830
mov cx, word [0x4478d8]
mov eax, dword [esp + 0x18]
mov word [edi], cx
mov ecx, eax
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x407848
lea edi, [esp + 0xc4]
sub eax, ecx
mov esi, ecx
dec edi
jmp 0x407860
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x407860
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 0x407891
dec dword [esp + 0x1c]
jmp 0x40796a
lea eax, [esp + 0xc4]
push 0x447a7c
push eax
call fcn.00422167
mov ebx, eax
add esp, 8
test ebx, ebx
je 0x40797f
push ebx
call fcn.004227eb
add esp, 4
test eax, eax
jne 0x407916
lea ecx, [ecx]
push ebx
push 0x8000
push 1
push ebp
call fcn.00422af3
mov esi, eax
push esi
mov eax, str.Tipray_LdSafe
mov edi, ebp
call fcn.00412c30
mov ecx, dword [esp + 0x38]
add esp, 0x14
push ecx
push esi
push 1
push ebp
call fcn.004223d3
add esp, 0x10
cmp esi, eax
jne 0x4079fb
push 0x8000
push 0
push ebp
call fcn.00424c40
add esp, 0xc
push ebx
call fcn.004227eb
add esp, 4
test eax, eax
je 0x4078c0
push ebx
call fcn.004221f5
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.00409670
mov ecx, dword [esp + 0x24]
add esp, 0x10
push 0
push ecx
push 0x453d09
call fcn.0040d390
push 0x208
lea edx, [esp + 0xc8]
push 0
push edx
call fcn.00424c40
add esp, 0xc
cmp dword [esp + 0x20], 0
jne 0x4077a0
jmp 0x407774
call fcn.00413a1f
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.00409670
mov ecx, dword [esp + 0x24]
add esp, 0x10
push 0
push ecx
push 0x453d09
call fcn.0040d390
lea edx, [esp + 0xc4]
push edx
push str.When_open_file:
lea eax, [esp + 0x1c]
push str._s__s
push eax
call fcn.00409670
mov esi, dword [esp + 0x24]
add esp, 0x10
push 0
push esi
push 0x453d09
call fcn.0040d390
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 0x40768f
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.00409670
mov esi, dword [esp + 0x24]
add esp, 0x10
push 0
push esi
push 0x453d09
call fcn.0040d390
mov byte [esp + 0x6dc], 0
lea eax, [esi - 0x10]
jmp 0x407682
push ebp
call fcn.004133e6
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 0x407a6b
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 0x407a96
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.0042179d
add esp, 0x6cc
ret