Function at 0x409820
Capabilities:
Copy file
Delete file
Get file attributes
Get file size
Move file
Read file on windows
Resolve function by parsing pe exports
Set file attributes
Write file on windows

Disassembly:
mov eax, 0x1578
call fcn.0041c300
mov eax, dword [0x42f370]
xor eax, esp
mov dword [esp + 0x1574], eax
mov eax, dword [esp + 0x157c]
push ebx
push ebp
push esi
push edi
mov edi, dword [sym.imp.KERNEL32.dll_CreateFileW]
push 0
push 0x80
push 3
push 0
push 3
mov ebx, edx
push SysReAllocString
push ebx
mov dword [esp + 0x48], ebx
mov dword [esp + 0x2c], eax
mov dword [esp + 0x34], ecx
call edi
mov esi, eax
cmp esi, 0xffffffff
jne 0x409898
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
push esi
push ebx
push str.Failed_to_open___s__for_reading__error_code:__lu.
call fcn.0040c4d0
add esp, 0xc
push esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
jmp 0x40a1eb
push 0
push 0
push 3
push 0
push 7
push SysReAllocString
push ebx
call edi
mov edi, eax
cmp edi, 0xffffffff
je 0x409943
push 0
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebp, eax
cmp ebp, 0xffffffff
mov dword [esp + 0x28], ebp
jne 0x4098cf
call dword [sym.imp.KERNEL32.dll_GetLastError]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor edi, edi
cmp ebp, edi
je 0x40994e
cmp ebp, 0xffffffff
je 0x40994e
push edi
lea edx, [esp + 0x18]
push edx
push 4
lea eax, [esp + 0x464]
push eax
push esi
mov byte [esp + 0x46c], 0
mov dword [esp + 0x46d], edi
mov dword [esp + 0x28], edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp ebp, 4
jb 0x409978
cmp dword [esp + 0x14], 4
je 0x409978
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
push edi
push ebx
push str.Failed_to_read___s___error_code:__lu.
call fcn.0040c4d0
add esp, 0xc
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push edi
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
jmp 0x40a1eb
call dword [sym.imp.KERNEL32.dll_GetLastError]
or ebp, 0xffffffff
xor edi, edi
call dword [sym.imp.KERNEL32.dll_GetLastError]
push esi
mov dword [esp + 0x20], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp ebp, 0xffffffff
jne 0x40a16d
mov esi, dword [esp + 0x1c]
push esi
push ebx
push str._Failed_to_get_size_of___s___error_code:__lu.
jmp 0x409882
mov ebp, dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
call ebp
push 4
lea ecx, [esp + 0x45c]
push ecx
push str.IGEF
call fcn.0041279e
add esp, 0xc
test eax, eax
je 0x409a03
mov esi, dword [esp + 0x10]
push esi
push ebx
call fcn.00412119
add esp, 8
test eax, eax
je 0x40a1e6
lea edx, [esp + 0x1c]
push edx
lea eax, [esp + 0x30]
push eax
mov eax, ebx
mov dword [esp + 0x34], edi
mov dword [esp + 0x38], edi
mov dword [esp + 0x24], edi
mov dword [esp + 0x28], edi
call fcn.00408770
add esp, 8
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
push 0x80
push esi
mov ebp, eax
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
push edi
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_CopyFileW]
lea ecx, [esp + 0x1c]
push ecx
lea edx, [esp + 0x30]
push edx
jmp 0x40a1cf
push edi
push 0x80
push 3
push edi
push 3
push SysReAllocString
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x409873
xor eax, eax
push 0x3fc
mov word [esp + 0x5d], ax
mov byte [esp + 0x5f], al
lea eax, [esp + 0x60]
push edi
push eax
mov byte [esp + 0x64], 0
call fcn.004145e0
add esp, 0xc
push edi
lea ecx, [esp + 0x18]
push ecx
push 0x400
lea edx, [esp + 0x64]
push edx
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40a145
cmp dword [esp + 0x14], 0x400
jne 0x40a145
push esi
call ebp
mov eax, dword [esp + 0x5c]
sub eax, 1
je 0x40a11e
sub eax, 1
je 0x409aaa
push ebx
push str.Failed_to_match_the_ENCRYPT_MAJOR_VERSION_from_file___s_
call fcn.0040c4d0
add esp, 8
push 0x51a
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
jmp 0x40a1eb
cmp dword [esp + 0x64], 0x64
jb 0x409ae0
cmp dword [0x4335e0], edi
jne 0x409ae0
mov eax, dword [esp + 0x68]
mov edi, dword [esp + 0x18]
push eax
call fcn.00407b10
add esp, 4
test eax, eax
jne 0x409ae0
push 0x45a
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
jmp 0x40a1eb
push 0x400
lea ecx, [esp + 0xd75]
push 0
push ecx
mov byte [esp + 0xd7c], 0
call fcn.004145e0
add esp, 0xc
push 0x103
lea edx, [esp + 0x465]
push 0
push edx
mov byte [esp + 0x46c], 0
call fcn.004145e0
mov ebp, dword [esp + 0x24]
add esp, 0xc
lea edi, [esp + 0x460]
mov edx, ebp
call fcn.0040c030
mov esi, edi
lea eax, [esp + 0x74]
mov cl, byte [eax]
cmp cl, byte [esi]
jne 0x409b56
test cl, cl
je 0x409b52
mov cl, byte [eax + 1]
cmp cl, byte [esi + 1]
jne 0x409b56
add eax, 2
add esi, 2
test cl, cl
jne 0x409b36
xor eax, eax
jmp 0x409b5b
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x409c80
mov edi, str.fc1b28f6d31e228bb42421e63eb5fce4
lea esi, [esp + 0x74]
mov ecx, 0x21
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
jne 0x409c37
push 0x400
push eax
lea ecx, [esp + 0x1181]
push ecx
mov byte [esp + 0x1184], al
call fcn.004145e0
add esp, 0xc
lea edx, [esp + 0x1178]
push edx
push 0x80
mov ecx, 0x426b60
call fcn.00408810
add esp, 8
lea edi, [esp + 0x460]
lea edx, [esp + 0x1178]
call fcn.0040c030
mov esi, edi
lea eax, [esp + 0x74]
jmp 0x409bd0
mov cl, byte [eax]
cmp cl, byte [esi]
jne 0x409bf0
test cl, cl
je 0x409bec
mov cl, byte [eax + 1]
cmp cl, byte [esi + 1]
jne 0x409bf0
add eax, 2
add esi, 2
test cl, cl
jne 0x409bd0
xor eax, eax
jmp 0x409bf5
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x409c16
push ebx
push str.Failed_to_match_encrypt_key_and_demo_key_from_file___s_
call fcn.0040c4d0
add esp, 8
push 0x57
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
jmp 0x40a1eb
xor eax, eax
jmp 0x409c20
mov cl, byte [esp + eax + 0x1178]
mov byte [esp + eax + 0xd70], cl
add eax, 1
test cl, cl
jne 0x409c20
jmp 0x409c9c
cmp dword [esp + 0x64], 0x64
jb 0x409c63
cmp dword [0x4335e0], 0
je 0x409c63
mov eax, dword [0x433604]
test eax, eax
je 0x409c63
lea ecx, [esp + 0xd70]
push ecx
lea edx, [esp + 0x78]
push edx
call eax
test eax, eax
jne 0x409c9c
push ebx
push str.Failed_to_match_encrypt_key_from_file___s_
call fcn.0040c4d0
add esp, 8
push 0x57
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
jmp 0x40a1eb
lea edx, [esp + 0xd70]
mov eax, ebp
sub edx, ebp
jmp 0x409c90
mov cl, byte [eax]
mov byte [edx + eax], cl
add eax, 1
test cl, cl
jne 0x409c90
lea eax, [esp + 0xd70]
lea edx, [eax + 1]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x409ca6
sub eax, edx
cmp eax, dword [esp + 0x68]
je 0x409cd4
push ebx
push str.Failed_to_match_the_length_of_key_from_file___s_
call fcn.0040c4d0
add esp, 8
push 0x57
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
jmp 0x40a1eb
lea eax, [esp + 0x48]
xor ebp, ebp
push eax
lea ecx, [esp + 0x54]
push ecx
mov eax, ebx
mov dword [esp + 0x58], ebp
mov dword [esp + 0x5c], ebp
mov dword [esp + 0x50], ebp
mov dword [esp + 0x54], ebp
call fcn.00408770
add esp, 8
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
push 0x800
lea edx, [esp + 0x56e]
push ebp
push edx
mov dword [esp + 0x28], eax
mov word [esp + 0x574], bp
call fcn.004145e0
mov esi, dword [esp + 0x1c]
add esp, 0xc
push esi
xor edi, edi
push str._s.igbak
lea edx, [esp + 0x570]
mov dword [esp + 0x48], edi
mov dword [esp + 0x20], ebp
call fcn.00401000
add esp, 8
lea eax, [esp + 0x568]
call fcn.00408720
cmp eax, ebp
je 0x409d5b
cmp eax, 0xffffffff
jne 0x409d84
lea eax, [esp + 0x568]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
push 1
lea ecx, [esp + 0x56c]
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
mov edi, eax
cmp edi, ebp
mov dword [esp + 0x40], edi
jne 0x409e03
push esi
push str._s.ig_
lea edx, [esp + 0x570]
call fcn.00401000
add esp, 8
mov dword [esp + 0x18], 1
push 0
push 0x80
push 3
push 0
push 3
push SysReAllocString
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebp, eax
cmp ebp, 0xffffffff
jne 0x409e2b
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
push esi
push ebx
push str.Failed_to_open___s__for_reading__error_code:__lu.
call fcn.0040c4d0
add esp, 0xc
test edi, edi
je 0x40988a
mov eax, dword [esp + 0x10]
push 0
push eax
lea ecx, [esp + 0x570]
push ecx
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
push esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
jmp 0x40a1eb
push esi
push ebx
call fcn.00412119
add esp, 8
test eax, eax
jne 0x409da1
push eax
push 0x80
push 3
push eax
push 3
push SysReAllocString
lea edx, [esp + 0x580]
push edx
jmp 0x409db4
push 0
push 0
push 0x400
push ebp
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0x80
push esi
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
cmp dword [esp + 0x18], 0
lea eax, [esp + 0x568]
jne 0x409e57
mov eax, esi
push 0
push 0x80
push 2
push 0
push 3
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
cmp ebx, 0xffffffff
mov dword [esp + 0x24], ebx
jne 0x409ebc
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
push ebx
push esi
push str.Failed_to_open___s__for_encrypting__error_code:__lu.
call fcn.0040c4d0
add esp, 0xc
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test edi, edi
je 0x409eae
push 0
push esi
lea edx, [esp + 0x570]
push edx
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
push ebx
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
jmp 0x40a1eb
mov eax, dword [esp + 0x28]
add eax, 0xfffffc00
cmp eax, 0x200000
mov dword [esp + 0x38], eax
mov dword [esp + 0x44], eax
jbe 0x409edc
mov dword [esp + 0x44], 0x200000
push 0x200001
mov dword [esp + 0x38], 0
call fcn.00412c76
mov esi, eax
add esp, 4
test esi, esi
je 0x40a10f
push 0x200001
push 0
push esi
call fcn.004145e0
add esp, 0xc
cmp dword [esp + 0x38], 0
mov dword [esp + 0x3c], esi
jbe 0x409fc4
mov ebx, dword [esp + 0x44]
push 0
lea eax, [esp + 0x18]
push eax
push ebx
push esi
push ebp
mov dword [esp + 0x28], 0
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40a079
mov edi, dword [esp + 0x14]
cmp edi, ebx
je 0x409f56
mov ecx, dword [esp + 0x34]
add ecx, edi
cmp ecx, dword [esp + 0x38]
jne 0x40a079
mov edx, dword [esp + 0x34]
push edx
lea eax, [esp + 0xd74]
push eax
lea ecx, [esp + 0x6c]
push ecx
mov ebx, esi
call fcn.00409060
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x30]
add esp, 0xc
push 0
lea edx, [esp + 0x2c]
push edx
push eax
push esi
push ecx
mov dword [esp + 0x3c], 0
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40a037
mov ecx, dword [esp + 0x14]
cmp dword [esp + 0x28], ecx
jne 0x40a037
mov eax, dword [esp + 0x34]
add eax, ecx
cmp eax, dword [esp + 0x38]
mov dword [esp + 0x34], eax
jb 0x409f1a
mov edi, dword [esp + 0x40]
mov ebx, dword [esp + 0x24]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebp
call esi
push ebx
call esi
lea esi, [esp + 0x3c]
call fcn.0040c8e0
test edi, edi
mov esi, 1
je 0x40a0bb
push 0x80
lea eax, [esp + 0x56c]
push eax
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
lea ecx, [esp + 0x568]
push ecx
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
mov edi, dword [esp + 0x10]
lea ecx, [esp + 0x48]
push ecx
lea edx, [esp + 0x54]
push edx
mov eax, edi
call fcn.004087c0
add esp, 8
mov eax, dword [esp + 0x1c]
cmp eax, 0xffffffff
je 0x40a030
push eax
push edi
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
mov eax, esi
jmp 0x40a1eb
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [esp + 0x10]
mov edi, eax
push edi
push edx
push str.Failed_to_write___s___error_code:__lu.
call fcn.0040c4d0
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
add esp, 0xc
push ebp
call esi
mov eax, dword [esp + 0x24]
push eax
call esi
lea esi, [esp + 0x3c]
call fcn.0040c8e0
push edi
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
jmp 0x40a1eb
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [esp + 0x2c]
mov edi, eax
push edi
push ecx
push str.Failed_to_read___s___error_code:__lu.
call fcn.0040c4d0
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
add esp, 0xc
push ebp
call esi
mov edx, dword [esp + 0x24]
push edx
call esi
lea esi, [esp + 0x3c]
call fcn.0040c8e0
push edi
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
jmp 0x40a1eb
cmp dword [esp + 0x18], 0
je 0x40a007
mov edi, dword [esp + 0x10]
mov ebp, dword [sym.imp.KERNEL32.dll_MoveFileExW]
mov ebx, esi
push 1
push edi
lea edx, [esp + 0x570]
push edx
call ebp
mov esi, eax
test esi, esi
jne 0x40a00b
push 0xc8
call dword [sym.imp.KERNEL32.dll_Sleep]
add ebx, 1
cmp ebx, 0xa
jle 0x40a0d2
lea eax, [esp + 0x568]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
jmp 0x40a01f
push 0x200000
push str.SafeMalloc__d__fail_
call fcn.0040c7f0
mov esi, dword [esp + 0x10]
push esi
push ebx
push str.Call_DecodeFile_1_0___to_decrypt_file___s_______s_.
call fcn.0040c4d0
mov ecx, dword [esp + 0x24]
add esp, 0xc
push esi
mov edx, ebx
call fcn.00408a00
add esp, 4
jmp 0x40a1eb
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
push edi
push ebx
push str.Failed_to_read___s___error_code:__lu.
call fcn.0040c4d0
add esp, 0xc
push esi
call ebp
push edi
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
jmp 0x40a1eb
cmp ebp, edi
jne 0x40a1e6
mov esi, dword [esp + 0x10]
push esi
push ebx
call fcn.00412119
add esp, 8
test eax, eax
je 0x40a1e6
lea eax, [esp + 0x1c]
push eax
lea ecx, [esp + 0x30]
push ecx
mov eax, ebx
mov dword [esp + 0x34], edi
mov dword [esp + 0x38], edi
mov dword [esp + 0x24], edi
mov dword [esp + 0x28], edi
call fcn.00408770
add esp, 8
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
push 0x80
push esi
mov ebp, eax
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
push edi
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_CopyFileW]
lea edx, [esp + 0x1c]
push edx
lea eax, [esp + 0x30]
push eax
mov eax, esi
call fcn.004087c0
add esp, 8
cmp ebp, 0xffffffff
je 0x40a1e6
push ebp
push esi
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
mov eax, 1
mov ecx, dword [esp + 0x1584]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.004110f4
add esp, 0x1578
ret