Function at 0x40d520
Capabilities:
Copy file
Delete file
Enumerate files on windows
Get common file path
Link many functions at runtime
Set file attributes

Disassembly:
push 0xffffffffffffffff
push 0x45f269
mov eax, dword fs:[0]
push eax
sub esp, 0x2ac
mov eax, dword [0x491104]
xor eax, esp
mov dword [esp + 0x2a8], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x491104]
xor eax, esp
push eax
lea eax, [esp + 0x2c0]
mov dword fs:[0], eax
mov edi, ecx
push edi
lea ecx, [esp + 0x20]
mov esi, edx
call fcn.00406e00
mov dword [esp + 0x2c8], 0
lea ecx, [esp + 0x24]
call fcn.00406fc0
mov byte [esp + 0x2c8], 1
lea ecx, [esp + 0x18]
call fcn.00406fc0
mov byte [esp + 0x2c8], 2
lea ecx, [esp + 0x2c]
call fcn.00406fc0
mov byte [esp + 0x2c8], 3
lea ecx, [esp + 0x44]
call fcn.0042ef2c
mov byte [esp + 0x2c8], 4
test edi, edi
jne 0x40d5c0
xor eax, eax
jmp 0x40d5d4
mov eax, edi
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40d5c5
sub eax, edx
sar eax, 1
push eax
push edi
lea ecx, [esp + 0x2c]
call fcn.00406cd0
push str..alf
lea eax, [esp + 0x28]
push eax
lea ecx, [esp + 0x28]
push ecx
call fcn.00406150
add esp, 0xc
mov byte [esp + 0x2c8], 5
mov eax, dword [eax]
lea edx, [esp + 0x6c]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_FindFirstFileW]
mov ebp, eax
mov byte [esp + 0x2c8], 4
lea ecx, [esp + 0x20]
call fcn.00406ed0
cmp ebp, 0xffffffff
je 0x40d728
mov bl, 7
lea ebx, [ebx]
lea eax, [esp + 0x98]
push eax
lea ecx, [esp + 0x2c]
call fcn.00406e00
mov edi, eax
mov byte [esp + 0x2c8], 6
lea ecx, [esp + 0x24]
push ecx
lea edx, [esp + 0x38]
push str.Found
push edx
call fcn.00406220
mov byte [esp + 0x2d4], bl
push edi
push eax
lea eax, [esp + 0x28]
push eax
call fcn.004060a0
add esp, 0x18
mov byte [esp + 0x2c8], 8
push eax
mov ecx, esi
call fcn.00411500
mov byte [esp + 0x2c8], bl
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
jg 0x40d6ac
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0x2c8], 6
mov eax, dword [esp + 0x34]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d6d4
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0x2c8], 4
mov eax, dword [esp + 0x28]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d6fc
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov edx, dword [esp + 0x4c]
lea ecx, [esp + 0x98]
push ecx
push edx
lea ecx, [esp + 0x4c]
call fcn.0042f22e
lea eax, [esp + 0x6c]
push eax
push ebp
call dword [sym.imp.KERNEL32.dll_FindNextFileW]
test eax, eax
jne 0x40d630
jmp 0x40d760
lea ecx, [esp + 0x24]
push ecx
lea edx, [esp + 0x2c]
push str.No_.alf_to_copy_in
push edx
call fcn.00406220
add esp, 0xc
mov byte [esp + 0x2c8], 0xc
push eax
mov ecx, esi
call fcn.00411500
mov byte [esp + 0x2c8], 4
lea ecx, [esp + 0x28]
call fcn.00406ed0
mov eax, dword [esp + 0x18]
mov ecx, dword [eax - 8]
mov edx, 1
sub edx, dword [eax - 4]
sub ecx, 0x104
or ecx, edx
jge 0x40d78b
push 0x104
lea ecx, [esp + 0x1c]
call fcn.00406c20
mov eax, dword [esp + 0x18]
mov ecx, dword [eax - 8]
mov edx, 1
sub edx, dword [eax - 4]
sub ecx, 0x104
or ecx, edx
mov edi, eax
jge 0x40d7b4
push 0x104
lea ecx, [esp + 0x1c]
call fcn.00406c20
mov eax, dword [esp + 0x18]
push eax
push 0
push 0
push 0x29
push 0
call dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
push edi
mov edi, dword [sym.imp.SHLWAPI.dll_PathAddBackslashW]
call edi
mov eax, dword [esp + 0x18]
mov ecx, dword [eax - 8]
push ecx
push eax
call fcn.00442d0b
add esp, 8
test eax, eax
jl 0x40e0ca
mov ecx, dword [esp + 0x18]
cmp eax, dword [ecx - 8]
jg 0x40e0ca
mov dword [ecx - 0xc], eax
mov edx, dword [esp + 0x18]
xor ecx, ecx
mov word [edx + eax*2], cx
mov edx, dword [esp + 0x1c]
mov eax, dword [edx - 8]
mov ecx, 1
sub ecx, dword [edx - 4]
sub eax, 0x104
or eax, ecx
jge 0x40d829
push 0x104
lea ecx, [esp + 0x20]
call fcn.00406c20
mov edx, dword [esp + 0x1c]
push edx
call edi
mov eax, dword [esp + 0x1c]
mov ecx, dword [eax - 8]
push ecx
push eax
call fcn.00442d0b
add esp, 8
test eax, eax
jl 0x40e0ca
mov ecx, dword [esp + 0x1c]
cmp eax, dword [ecx - 8]
jg 0x40e0ca
mov dword [ecx - 0xc], eax
mov edx, dword [esp + 0x1c]
xor ecx, ecx
push 8
mov word [edx + eax*2], cx
push str.Aladdin_
lea ecx, [esp + 0x24]
call fcn.00406510
push str.hls32svc.exe
lea eax, [esp + 0x20]
push eax
lea ecx, [esp + 0x30]
push ecx
call fcn.00406150
add esp, 0xc
mov byte [esp + 0x2c8], 0xd
push eax
lea ecx, [esp + 0x30]
call fcn.00406800
mov byte [esp + 0x2c8], 4
lea ecx, [esp + 0x28]
call fcn.00406ed0
push str.HSIAPID.DLL
lea edx, [esp + 0x20]
push edx
lea eax, [esp + 0x30]
push eax
call fcn.00406150
add esp, 0xc
mov byte [esp + 0x2c8], 0xe
mov eax, dword [eax]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov ebp, eax
test ebp, ebp
mov dword [esp + 0x3c], ebp
sete bl
mov byte [esp + 0x2c8], 4
lea ecx, [esp + 0x28]
call fcn.00406ed0
test bl, bl
je 0x40d9e6
lea ecx, [esp + 0x1c]
push ecx
lea edx, [esp + 0x24]
push str.error_loading
push edx
call fcn.00406220
mov bl, 0xf
mov byte [esp + 0x2d4], bl
push str.HSIAPID.DLL
push eax
lea eax, [esp + 0x3c]
push eax
call fcn.00406150
add esp, 0x18
mov byte [esp + 0x2c8], 0x10
push eax
mov ecx, esi
call fcn.00411500
mov byte [esp + 0x2c8], bl
lea ecx, [esp + 0x28]
call fcn.00406ed0
mov byte [esp + 0x2c8], 4
lea ecx, [esp + 0x20]
call fcn.00406ed0
push 0
push 0x10
push str.Cannot_load_HSIAPID.DLL_
call fcn.0042f5c8
mov byte [esp + 0x2c8], 3
lea ecx, [esp + 0x44]
call fcn.0042f0e3
mov byte [esp + 0x2c8], 2
lea ecx, [esp + 0x2c]
call fcn.00406ed0
mov byte [esp + 0x2c8], 1
lea ecx, [esp + 0x18]
call fcn.00406ed0
mov byte [esp + 0x2c8], 0
lea ecx, [esp + 0x24]
call fcn.00406ed0
mov dword [esp + 0x2c8], 0xffffffff
lea ecx, [esp + 0x1c]
call fcn.00406ed0
xor al, al
mov ecx, dword [esp + 0x2c0]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x2a8]
xor ecx, esp
call fcn.00442851
add esp, 0x2b8
ret
mov edi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.HSIInstallServer
push ebp
call edi
mov dword [esp + 0x40], eax
test eax, eax
je 0x40e07d
push str.HSIRemoveServer
push ebp
call edi
mov dword [esp + 0x30], eax
test eax, eax
je 0x40e07d
push str.HSIStartServer
push ebp
call edi
mov dword [esp + 0x38], eax
test eax, eax
je 0x40e07d
push str.HSIStopServer
push ebp
call edi
mov ebx, eax
test ebx, ebx
je 0x40e07d
push str.HSISetTimeout
push ebp
call edi
mov dword [esp + 0x20], eax
test eax, eax
je 0x40e07d
push str.HSIGetStatus
push ebp
call edi
mov edi, eax
test edi, edi
je 0x40e07d
push str.starting_installation
lea ecx, [esp + 0x18]
call fcn.00406e00
mov byte [esp + 0x2c8], 0x12
lea ecx, [esp + 0x14]
push ecx
mov ecx, esi
call fcn.00411500
mov byte [esp + 0x2c8], 4
lea ecx, [esp + 0x14]
call fcn.00406ed0
call edi
cmp eax, 4
jne 0x40dacf
push str.stoping_dongleservice
lea ecx, [esp + 0x18]
call fcn.00406e00
mov byte [esp + 0x2c8], 0x13
lea edx, [esp + 0x14]
push edx
mov ecx, esi
call fcn.00411500
mov byte [esp + 0x2c8], 4
lea ecx, [esp + 0x14]
call fcn.00406ed0
call ebx
push str.hls32svc.exe
lea eax, [esp + 0x1c]
push eax
lea ecx, [esp + 0x1c]
push ecx
call fcn.00406150
add esp, 0xc
mov byte [esp + 0x2c8], 0x14
mov eax, dword [eax]
push 0x80
push eax
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
mov byte [esp + 0x2c8], 4
lea ecx, [esp + 0x14]
call fcn.00406ed0
call edi
cmp eax, 3
jne 0x40dbf6
push str.remove_service_if_necessary
lea ecx, [esp + 0x18]
call fcn.00406e00
mov byte [esp + 0x2c8], 0x15
lea edx, [esp + 0x14]
push edx
mov ecx, esi
call fcn.00411500
mov byte [esp + 0x2c8], 4
lea ecx, [esp + 0x14]
call fcn.00406ed0
push 0
call dword [esp + 0x34]
push 0x1388
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [esp + 0x18]
push eax
lea ecx, [esp + 0x18]
push str.delete
push ecx
call fcn.00406220
mov bl, 0x16
mov byte [esp + 0x2d4], bl
push str.hls32svc.exe_if_necessary
push eax
lea edx, [esp + 0x44]
push edx
call fcn.00406150
add esp, 0x18
mov byte [esp + 0x2c8], 0x17
push eax
mov ecx, esi
call fcn.00411500
mov byte [esp + 0x2c8], bl
lea ecx, [esp + 0x30]
call fcn.00406ed0
mov byte [esp + 0x2c8], 4
lea ecx, [esp + 0x14]
call fcn.00406ed0
push str.hls32svc.exe
lea eax, [esp + 0x1c]
push eax
lea ecx, [esp + 0x38]
push ecx
call fcn.00406150
add esp, 0xc
mov byte [esp + 0x2c8], 0x18
mov eax, dword [eax]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
mov byte [esp + 0x2c8], 4
lea ecx, [esp + 0x30]
call fcn.00406ed0
mov ebx, dword [sym.imp.KERNEL32.dll_CopyFileW]
xor edi, edi
cmp dword [esp + 0x4c], edi
jle 0x40dd8a
jmp 0x40dc10
lea edx, [esp + 0x24]
push edx
lea eax, [esp + 0x6c]
push str.copy
push eax
call fcn.00406220
add esp, 0xc
mov ebp, eax
mov byte [esp + 0x2c8], 0x19
push edi
lea ecx, [esp + 0x48]
call fcn.004066f0
push eax
lea ecx, [esp + 0x64]
push ebp
push ecx
call fcn.004060a0
mov byte [esp + 0x2d4], 0x1a
push str._to
push eax
lea edx, [esp + 0x6c]
push edx
call fcn.00406150
mov byte [esp + 0x2e0], 0x1b
lea ecx, [esp + 0x30]
push ecx
push eax
lea edx, [esp + 0x34]
push edx
call fcn.004060a0
add esp, 0x24
mov ebp, eax
mov byte [esp + 0x2c8], 0x1c
push edi
lea ecx, [esp + 0x48]
call fcn.004066f0
push eax
lea eax, [esp + 0x34]
push ebp
push eax
call fcn.004060a0
add esp, 0xc
mov byte [esp + 0x2c8], 0x1d
push eax
mov ecx, esi
call fcn.00411500
mov byte [esp + 0x2c8], 0x1c
lea ecx, [esp + 0x30]
call fcn.00406ed0
mov byte [esp + 0x2c8], 0x1b
lea ecx, [esp + 0x14]
call fcn.00406ed0
mov byte [esp + 0x2c8], 0x1a
lea ecx, [esp + 0x58]
call fcn.00406ed0
mov byte [esp + 0x2c8], 0x19
lea ecx, [esp + 0x60]
call fcn.00406ed0
mov byte [esp + 0x2c8], 4
lea ecx, [esp + 0x68]
call fcn.00406ed0
push edi
lea ecx, [esp + 0x48]
call fcn.004066f0
push eax
lea ecx, [esp + 0x1c]
push ecx
lea edx, [esp + 0x6c]
push edx
call fcn.004060a0
add esp, 0xc
mov ebp, eax
mov byte [esp + 0x2c8], 0x1e
push edi
lea ecx, [esp + 0x48]
call fcn.004066f0
push eax
lea eax, [esp + 0x28]
push eax
lea ecx, [esp + 0x64]
push ecx
call fcn.004060a0
add esp, 0xc
mov byte [esp + 0x2c8], 0x1f
mov ebp, dword [ebp]
mov eax, dword [eax]
push 0
push ebp
push eax
call ebx
mov byte [esp + 0x2c8], 0x1e
lea ecx, [esp + 0x5c]
call fcn.00406ed0
mov byte [esp + 0x2c8], 4
lea ecx, [esp + 0x64]
call fcn.00406ed0
inc edi
cmp edi, dword [esp + 0x4c]
jl 0x40dc10
mov ebp, dword [esp + 0x3c]
mov edx, dword [esp + 0x2c]
push edx
lea ecx, [esp + 0x38]
call fcn.0040e0e0
mov byte [esp + 0x2c8], 0x20
lea eax, [esp + 0x2c]
push eax
lea ecx, [esp + 0x40]
push str.installing
push ecx
call fcn.00406220
add esp, 0xc
mov byte [esp + 0x2c8], 0x21
push eax
mov ecx, esi
call fcn.00411500
mov byte [esp + 0x2c8], 0x20
lea ecx, [esp + 0x3c]
call fcn.00406ed0
push 0
push 0x205
lea ecx, [esp + 0x3c]
call fcn.0040e190
push eax
push 0
call dword [esp + 0x4c]
lea ecx, [esp + 0x14]
test eax, eax
je 0x40de4a
push str.error
call fcn.00406e00
mov byte [esp + 0x2c8], 0x22
lea edx, [esp + 0x14]
push edx
mov ecx, esi
call fcn.00411500
mov byte [esp + 0x2c8], 0x20
lea ecx, [esp + 0x14]
call fcn.00406ed0
lea esi, [esp + 0x34]
call fcn.0040e1c0
push ebp
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov byte [esp + 0x2c8], 4
mov ecx, esi
call fcn.00406ed0
jmp 0x40d964
push str.success
call fcn.00406e00
mov byte [esp + 0x2c8], 0x23
lea eax, [esp + 0x14]
push eax
mov ecx, esi
call fcn.00411500
mov byte [esp + 0x2c8], 0x20
lea ecx, [esp + 0x14]
call fcn.00406ed0
push 0xffffffffffffffff
lea ecx, [esp + 0x30]
call fcn.004065e0
push 0
call dword [esp + 0x3c]
test eax, eax
sete al
lea ecx, [esp + 0x14]
test al, al
je 0x40deb0
push str.starting_hls32svc.exe:_success
call fcn.00406e00
mov byte [esp + 0x2c8], 0x24
lea ecx, [esp + 0x14]
push ecx
jmp 0x40dec7
push str.error_while_starting_hls32svc.exe
call fcn.00406e00
mov byte [esp + 0x2c8], 0x25
lea edx, [esp + 0x14]
push edx
mov ecx, esi
call fcn.00411500
mov byte [esp + 0x2c8], 0x20
lea ecx, [esp + 0x14]
call fcn.00406ed0
call fcn.0040d1b0
test al, al
je 0x40df1e
push 2
call dword [esp + 0x24]
push str.setting_timeout_value:_2
lea ecx, [esp + 0x18]
call fcn.00406e00
mov byte [esp + 0x2c8], 0x26
lea eax, [esp + 0x14]
push eax
mov ecx, esi
call fcn.00411500
mov byte [esp + 0x2c8], 0x20
lea ecx, [esp + 0x14]
jmp 0x40df55
push 0x270f
call dword [esp + 0x24]
push str.setting_timeout_value:_9999
lea ecx, [esp + 0x24]
call fcn.00406e00
mov byte [esp + 0x2c8], 0x27
lea ecx, [esp + 0x20]
push ecx
mov ecx, esi
call fcn.00411500
mov byte [esp + 0x2c8], 0x20
lea ecx, [esp + 0x20]
call fcn.00406ed0
push str.hls32cmd.exe
lea edx, [esp + 0x1c]
push edx
lea eax, [esp + 0x40]
push eax
call fcn.00406150
add esp, 0xc
mov byte [esp + 0x2c8], 0x28
mov eax, dword [eax]
push 0x80
push eax
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
mov byte [esp + 0x2c8], 0x20
lea ecx, [esp + 0x38]
call fcn.00406ed0
push str.HLS32CMD.EXE
lea ecx, [esp + 0x1c]
push ecx
lea edx, [esp + 0x48]
push edx
call fcn.00406150
mov edi, eax
mov byte [esp + 0x2d4], 0x29
push str.HLS32CMD.EXE
lea eax, [esp + 0x2c]
push eax
lea ecx, [esp + 0x4c]
push ecx
call fcn.00406150
add esp, 0x18
mov byte [esp + 0x2c8], 0x2a
mov edi, dword [edi]
mov eax, dword [eax]
push 0
push edi
push eax
call ebx
mov byte [esp + 0x2c8], 0x29
lea ecx, [esp + 0x38]
call fcn.00406ed0
mov byte [esp + 0x2c8], 0x20
lea ecx, [esp + 0x40]
call fcn.00406ed0
call fcn.0040d230
mov byte [esp + 0x2c8], 4
lea ecx, [esp + 0x34]
call fcn.00406ed0
push ebp
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov byte [esp + 0x2c8], 3
lea ecx, [esp + 0x44]
call fcn.0042f0e3
mov byte [esp + 0x2c8], 2
lea ecx, [esp + 0x2c]
call fcn.00406ed0
mov byte [esp + 0x2c8], 1
lea ecx, [esp + 0x18]
call fcn.00406ed0
mov byte [esp + 0x2c8], 0
lea ecx, [esp + 0x24]
call fcn.00406ed0
mov dword [esp + 0x2c8], 0xffffffff
lea ecx, [esp + 0x1c]
call fcn.00406ed0
mov al, 1
jmp 0x40d9be
push str.invalid_functions_in_HSIAPID.DLL
lea ecx, [esp + 0x24]
call fcn.00406e00
mov byte [esp + 0x2c8], 0x11
lea edx, [esp + 0x20]
push edx
mov ecx, esi
call fcn.00411500
mov byte [esp + 0x2c8], 4
lea ecx, [esp + 0x20]
call fcn.00406ed0
push 0
push 0x10
push str.Invalid_functions_
call fcn.0042f5c8
push ebp
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
jmp 0x40d964
push 0x80070057
call fcn.00406f30
int3