Function at 0x402860
Capabilities:
Read file on windows
Resolve function by parsing pe exports
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x43b6f6
mov eax, dword fs:[0]
push eax
sub esp, 0x6b8
mov eax, dword [0x44ccd0]
xor eax, esp
mov dword [esp + 0x6b4], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x44ccd0]
xor eax, esp
push eax
lea eax, [esp + 0x6cc]
mov dword fs:[0], eax
mov esi, dword [esp + 0x6dc]
mov edi, dword [esp + 0x6e4]
mov ebx, dword [esp + 0x6e0]
mov dword [esp + 0x20], esi
mov dword [esp + 0x24], edi
call fcn.004125a5
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x4028d2
push 0x80004005
call fcn.004011d0
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 + 0x6d4], 0
call fcn.004125a5
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x402907
push 0x80004005
call fcn.004011d0
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 + 0xc4]
push 0
push ecx
mov byte [esp + 0x6e0], 1
call fcn.00421360
push 0x8000
call fcn.0041152f
mov ebp, eax
add esp, 0x10
test ebp, ebp
jne 0x4029b0
push eax
push str.EncryptFileToLdCab_failed_with_chFileContent__NULL
mov ecx, 0x44e3c9
call fcn.0040be50
mov eax, dword [esp + 0x14]
add eax, 0xfffffff0
or ecx, 0xffffffff
lea edx, [eax + 0xc]
mov byte [esp + 0x6d4], 0
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40297e
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
mov dword [esp + 0x6d4], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4029a9
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor al, al
jmp 0x402d0e
push 0x8000
push 0
push ebp
call fcn.00421360
push 0x98
lea ecx, [esp + 0x38]
push 0
push ecx
call fcn.00421360
push 0x400
lea edx, [esp + 0x2e4]
push 0
push edx
call fcn.00421360
push 2
push 0
push 0
push esi
call fcn.00421476
push edi
push ebx
call fcn.00402110
push 0
push 0
push 0x43e72c
push edx
push eax
lea eax, [esp + 0x78]
push eax
call fcn.00401300
add esp, 0x54
mov ecx, 0x26
lea esi, [esp + 0x28]
lea edi, [esp + 0x2c8]
rep movsd dword es:[edi], dword [esi]
mov esi, dword [esp + 0x20]
push esi
push 0x400
lea ecx, [esp + 0x2d0]
push 1
push ecx
call fcn.00420b12
mov edx, dword [ebx + 0xc]
push 2
push 0
push 0
push esi
mov dword [esp + 0x3c], edx
call fcn.00421476
mov ebx, dword [ebx + 4]
add esp, 0x20
test ebx, ebx
je 0x402bcc
mov eax, ebx
test ebx, ebx
je 0x402bf8
mov ebx, dword [ebx]
add eax, 8
push eax
lea ecx, [esp + 0x1c]
call fcn.00401ec0
mov eax, dword [esp + 0x24]
lea edx, [esp + 0xc0]
sub edx, eax
nop
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x402a80
lea edi, [esp + 0xc0]
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x402a92
mov ax, word [0x43e584]
mov word [edi], ax
mov eax, dword [esp + 0x18]
mov ecx, eax
lea esp, [esp]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x402ab0
lea edi, [esp + 0xc0]
sub eax, ecx
mov esi, ecx
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x402ac3
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0xc0]
push ecx
call fcn.00408b70
add esp, 4
test eax, eax
je 0x402af6
dec dword [esp + 0x1c]
jmp 0x402bc4
lea edx, [esp + 0xc0]
push 0x43e570
push edx
call fcn.00420f7d
mov edi, eax
add esp, 8
test edi, edi
je 0x402bfd
push edi
call fcn.00420b94
add esp, 4
test eax, eax
jne 0x402b73
push edi
push 0x8000
push 1
push ebp
call fcn.00420e9c
push 0xd
mov esi, eax
push str.Tipray_LdSafe
push esi
push ebp
call fcn.00411270
mov eax, dword [esp + 0x40]
push eax
push esi
push 1
push ebp
call fcn.00420b12
add esp, 0x30
cmp esi, eax
jne 0x402c79
push 0x8000
push 0
push ebp
call fcn.00421360
push edi
call fcn.00420b94
add esp, 0x10
test eax, eax
je 0x402b22
push edi
call fcn.00420934
dec dword [esp + 0x20]
lea ecx, [esp + 0xc4]
push ecx
push str.EncryptFileToLdCab_Handle_File_Success
lea edx, [esp + 0x20]
push str._s:_s
push edx
call fcn.00401f40
mov eax, dword [esp + 0x28]
add esp, 0x14
push 0
push eax
mov ecx, 0x44e3c9
call fcn.0040be50
push 0x208
lea ecx, [esp + 0xc4]
push 0
push ecx
call fcn.00421360
add esp, 0xc
test ebx, ebx
jne 0x402a59
cmp dword [esp + 0x1c], 0
je 0x402cb0
mov eax, dword [esp + 0x14]
add eax, 0xfffffff0
mov byte [esp + 0x6d4], 0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jmp 0x402972
call fcn.0041164d
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.EncryptFileToLdCab_failed_with_error_fopen_NULL__file_error_code:
lea edx, [esp + 0x1c]
push str._s__d
push edx
call fcn.00401f40
mov eax, dword [esp + 0x24]
add esp, 0x10
push 0
push eax
mov ecx, 0x44e3c9
call fcn.0040be50
lea ecx, [esp + 0xc0]
push ecx
push str.When_open_file:
lea edx, [esp + 0x1c]
push str._s__s
push edx
call fcn.00401f40
mov esi, dword [esp + 0x24]
add esp, 0x10
push 0
push esi
mov ecx, 0x44e3c9
call fcn.0040be50
lea eax, [esi - 0x10]
mov byte [esp + 0x6d4], 0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jmp 0x402972
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.00401f40
mov esi, dword [esp + 0x24]
add esp, 0x10
push 0
push esi
mov ecx, 0x44e3c9
call fcn.0040be50
lea eax, [esi - 0x10]
jmp 0x40295d
push ebp
call fcn.0041153a
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
add esp, 4
mov byte [esp + 0x6d4], 0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x402ce1
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
mov dword [esp + 0x6d4], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x402d0c
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov al, 1
mov ecx, dword [esp + 0x6cc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x6b4]
xor ecx, esp
call fcn.0041f914
add esp, 0x6c4
ret