Function at 0x522aa0
Capabilities:
Check if file exists
Copy file
Create directory
Get file attributes
Get file size
Set registry value

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x58f0c4
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
push ecx
mov eax, 0x33060
call fcn.0054e3f0
push ebx
push esi
mov esi, ecx
push edi
mov dword [ebp - 0x10], esp
mov dword [ebp - 0x2c], esi
mov edx, dword [esi + 0x390]
mov dword [ebp - 4], 0
test edx, edx
jne 0x522d9a
mov al, byte [esi + 0x70e]
test al, al
je 0x522d9a
mov eax, dword [0x639ad4]
mov dword [ebp - 0x20], eax
mov ecx, dword [esi + 0x4c]
lea edx, [ebp - 0x20]
push ecx
push 0x615e9c
push edx
mov byte [ebp - 4], 1
call fcn.00562ecb
mov eax, dword [ebp - 0x20]
add esp, 0xc
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
jne 0x522c1f
mov edi, 2
inc edi
lea ecx, [ebp - 0x20]
push edi
push 0x5c
call fcn.0056a56f
mov edi, eax
cmp edi, 0xffffffff
je 0x522c1f
lea ecx, [ebp - 0x24]
push edi
push ecx
lea ecx, [ebp - 0x20]
call fcn.00562acd
mov eax, dword [eax]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
lea ecx, [ebp - 0x24]
sete bl
call fcn.0056a100
test bl, bl
je 0x522b2a
lea edx, [ebp - 0x14]
push edi
push edx
lea ecx, [ebp - 0x20]
call fcn.00562acd
mov eax, dword [eax]
push 0
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
test eax, eax
lea ecx, [ebp - 0x14]
sete bl
call fcn.0056a100
test bl, bl
je 0x522b2a
mov eax, dword [0x639ad4]
mov dword [ebp - 0x14], eax
push 0
lea ecx, [ebp - 0x18]
push 0
push ecx
push 0x400
mov byte [ebp - 4], 2
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0
push 0x1100
call dword [sym.imp.KERNEL32.dll_FormatMessageA]
mov edx, dword [ebp - 0x18]
mov eax, dword [0x63f14c]
push edx
lea ecx, [ebp - 0x14]
push eax
push ecx
call fcn.00562ecb
mov edx, dword [ebp - 0x18]
add esp, 0xc
push edx
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, dword [ebp - 0x20]
mov ecx, dword [ebp - 0x14]
push 0x30
push eax
push ecx
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 1
call fcn.0056a100
lea ecx, [ebp - 0x20]
mov byte [ebp - 4], 0
call fcn.0056a100
mov eax, 0x7546
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [esi + 0x704]
test eax, eax
je 0x522d8c
mov eax, dword [esi + 0x708]
test eax, eax
je 0x522d8c
lea edx, [ebp - 0x24]
lea eax, [ebp - 0x18]
push edx
mov edi, dword [sym.imp.ADVAPI32.dll_RegCreateKeyExA]
push eax
push 0
push 0xf003f
push 0
push 0x63e040
push 0
push str.SoftwareDownloadManagerGrabberStsProjects_
push reloc.WSOCK32.dll_accept
call edi
test eax, eax
jne 0x522d8c
mov ecx, dword [ebp - 0x18]
mov ebx, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push ecx
call ebx
mov edx, dword [0x639ad4]
mov dword [ebp - 0x14], edx
mov eax, dword [esi + 0x704]
lea ecx, [ebp - 0x14]
push eax
push str.SoftwareDownloadManagerGrabberStsProjects_ld_
push ecx
mov byte [ebp - 4], 3
call fcn.00562ecb
add esp, 0xc
mov ecx, dword [ebp - 0x14]
lea edx, [ebp - 0x24]
lea eax, [ebp - 0x18]
push edx
push eax
push 0
push 0xf003f
push 0
push 0x63e040
push 0
push ecx
push reloc.WSOCK32.dll_accept
call edi
test eax, eax
jne 0x522d80
mov edx, dword [ebp - 0x18]
push edx
call ebx
mov eax, dword [esi + 0x708]
mov ecx, dword [esi + 0x704]
push eax
push ecx
lea edx, [ebp - 0x14]
push str.SoftwareDownloadManagerGrabberStsProjects_ld_ld_
push edx
call fcn.00562ecb
add esp, 0x10
mov edx, dword [ebp - 0x14]
lea eax, [ebp - 0x24]
lea ecx, [ebp - 0x18]
push eax
push ecx
push 0
push 0xf003f
push 0
push 0x63e040
push 0
push edx
push reloc.WSOCK32.dll_accept
call edi
test eax, eax
jne 0x522d80
mov edx, dword [esi + 0x50]
or ecx, 0xffffffff
mov edi, edx
mov ebx, dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
repne scasb al, byte es:[edi]
not ecx
push ecx
push edx
push 1
push eax
mov eax, dword [ebp - 0x18]
push str.LocalFileName
push eax
call ebx
mov edx, dword [esi + 0x4c]
or ecx, 0xffffffff
mov edi, edx
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
push ecx
mov ecx, dword [ebp - 0x18]
push edx
push 1
push eax
push str.LocalPath
push ecx
call ebx
lea edx, [esi + 0x3b8]
or ecx, 0xffffffff
mov edi, edx
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
push ecx
push edx
mov edx, dword [ebp - 0x18]
push 1
push eax
push str.LogFileName
push edx
call ebx
mov eax, dword [ebp - 0x18]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 1
call fcn.0056a100
lea ecx, [ebp - 0x20]
mov byte [ebp - 4], 0
call fcn.0056a100
jmp 0x522dce
mov al, byte [esi + 0x6f4]
test al, al
je 0x522dac
mov ecx, dword [esi + 0x708]
jmp 0x522dae
xor ecx, ecx
test al, al
je 0x522dba
mov eax, dword [esi + 0x704]
jmp 0x522dbc
xor eax, eax
push ecx
push eax
push edx
lea ecx, [esi + 0x20]
call fcn.0052ac10
mov byte [esi + 0x70e], 1
mov ecx, dword [esi + 0x390]
lea ebx, [esi + 0x20]
push ecx
mov ecx, ebx
call fcn.0052a8d0
mov eax, dword [esi + 0x18]
xor edi, edi
cmp eax, edi
je 0x522e00
mov edx, dword [esi + 0x390]
push edx
push 0x13cd
push 0x111
push eax
call dword [sym.imp.USER32.dll_PostMessageA]
push 1
mov ecx, esi
mov dword [esi + 0x6f0], edi
mov dword [esi + 0x700], edi
call fcn.00522180
lea ecx, [esi + 0x3b4]
call fcn.004ec3c0
mov edi, dword [esi + 0x38]
test edi, edi
je 0x522e3a
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov dword [ebp - 0x24], ecx
jne 0x522f4c
mov eax, dword [esi + 0x44]
cmp eax, 2
je 0x522e4b
cmp eax, 1
jne 0x522f4c
mov eax, dword [esi + 0x24]
test eax, eax
je 0x522e7c
push str._simtelnet_
push eax
call fcn.0054e0f0
add esp, 8
test eax, eax
je 0x522e7c
mov eax, dword [ebx]
push str.simtel.net
push eax
call fcn.0054e0f0
add esp, 8
test eax, eax
je 0x522f4c
mov eax, dword [esi + 0x6f8]
test eax, eax
jne 0x522f4c
mov ecx, dword [0x639ad4]
mov dword [ebp - 0x14], ecx
mov eax, dword [esi + 0x34]
mov byte [ebp - 4], 4
cmp eax, 0x50
jne 0x522ea5
cmp dword [esi + 0x44], 1
je 0x522eb2
cmp eax, 0x1bb
jne 0x522ec5
cmp dword [esi + 0x44], 2
jne 0x522ec5
lea edx, [ebp - 0x28]
push 0x63e040
push edx
call fcn.0054ea2a
add esp, 8
jmp 0x522ed7
push eax
lea eax, [ebp - 0x28]
push str.:_ld
push eax
call fcn.0054ea2a
add esp, 0xc
mov eax, dword [esi + 0x24]
test eax, eax
mov edx, eax
jne 0x522ee5
mov edx, 0x63e040
test eax, eax
je 0x522ef5
mov cl, byte [eax]
cmp cl, 0x2f
mov ecx, 0x63e040
je 0x522efa
mov ecx, 0x617b3c
mov eax, dword [esi + 0x44]
cmp eax, 1
mov eax, 0x616150
je 0x522f0c
mov eax, 0x616080
push edx
mov edx, dword [ebx]
push ecx
lea ecx, [ebp - 0x28]
push ecx
push edx
push eax
lea eax, [ebp - 0x14]
push str._s:___s_s_s_s
push eax
call fcn.00562ecb
mov ecx, dword [ebp - 0x14]
add esp, 0x1c
push ecx
mov ecx, esi
call fcn.005248b0
lea ecx, [ebp - 0x14]
mov byte [esi + 0x2cb], 1
mov byte [esi + 0x2cc], 1
mov byte [ebp - 4], 0
call fcn.0056a100
mov edx, dword [esi + 0x71c]
or ecx, 0xffffffff
mov edi, edx
xor eax, eax
mov byte [esi + 0x2ca], 0
mov dword [esi + 0xcc], 0
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov byte [ebp - 0x19], 0
je 0x5231b3
push eax
push eax
push 3
push eax
push 1
push connect
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
je 0x5231b3
lea edx, [ebp - 0x24]
push edx
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
xor ebx, ebx
mov dword [esi + 0x398], eax
mov dword [esi + 0x39c], ebx
mov eax, dword [esi + 0x398]
cmp eax, 0xffffffff
jne 0x522fd9
mov eax, ebx
cmp eax, ebx
jne 0x522fd9
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, ebx
je 0x522fd9
mov dword [esi + 0x398], ebx
mov dword [esi + 0x39c], ebx
jmp 0x523002
mov eax, dword [ebp - 0x24]
push 1
push ebx
push ebx
push eax
call fcn.00550840
mov ecx, dword [esi + 0x398]
add ecx, eax
mov dword [esi + 0x398], ecx
mov eax, dword [esi + 0x39c]
adc eax, edx
mov dword [esi + 0x39c], eax
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x4f8290
push fcn.004f8050
push 0x10
lea ecx, [ebp - 0x33070]
push 0x3288
push ecx
call fcn.0054ebc3
mov edx, dword [esi]
lea eax, [esi + 0x3b4]
push edx
push eax
lea eax, [esi + 0x20]
lea ecx, [esi + 0x5d4]
push eax
lea eax, [ebp - 0x33070]
push eax
push ecx
lea ecx, [ebp - 0x7f0]
mov byte [ebp - 4], 5
call fcn.005035c0
mov ecx, dword [esi + 0x6fc]
lea eax, [esi + 0x18]
mov dword [ebp - 0x7dc], eax
mov eax, dword [esi + 0x6f8]
lea edx, [esi + 0x1c]
push eax
mov eax, dword [esi + 0x704]
mov dword [ebp - 0x7d8], edx
mov edx, dword [esi + 0x708]
push ecx
push edx
mov edx, dword [esi + 0x390]
push eax
mov al, byte [esi + 0x6f4]
xor ecx, ecx
lea ebx, [esi + 0x14]
test al, al
sete cl
push ecx
push edx
lea ecx, [ebp - 0x7f0]
mov byte [ebp - 4], 6
mov dword [ebp - 0x7e0], ebx
mov dword [ebp - 0x758], ebx
call fcn.0051c980
mov eax, dword [esi + 0x39c]
mov ecx, dword [esi + 0x398]
push eax
push ecx
lea ecx, [ebp - 0x7f0]
call fcn.0051cc60
mov al, byte [esi + 0x6f4]
test al, al
je 0x5230e4
xor edi, edi
mov bl, 1
mov dword [esi + 0x6f0], edi
jmp 0x523184
mov edx, dword [esi + 0x50]
mov eax, dword [esi + 0x71c]
push 0
push edx
push eax
call dword [sym.imp.KERNEL32.dll_CopyFileA]
test eax, eax
je 0x52316e
mov eax, dword [esi + 0x398]
mov ecx, dword [esi + 0x39c]
mov dword [esi + 0x3a0], eax
mov dword [ebp - 0x6cc], ecx
mov dword [esi + 0x3a4], ecx
lea ecx, [ebp - 0x7f0]
mov dword [ebp - 0x6d0], eax
mov dword [esi + 0x6f0], 0
call fcn.0051cbf0
mov dword [esi + 0x5cc], 3
mov eax, dword [esi + 0x5c]
xor edi, edi
mov byte [ebp - 0x19], 1
test eax, eax
je 0x523171
mov eax, dword [ebx]
test eax, eax
je 0x523163
push edi
push 0x138a
push 0x111
push eax
call dword [sym.imp.USER32.dll_SendMessageA]
push 1
mov ecx, esi
call fcn.00521c70
jmp 0x523171
mov edi, dword [ebp - 0x2c]
push 0x63e040
lea ecx, [esi + 0x71c]
call fcn.0056a289
mov bl, byte [ebp - 0x19]
lea ecx, [ebp - 0x7f0]
mov byte [ebp - 4], 5
call fcn.00503670
push 0x4f8290
push 0x10
lea eax, [ebp - 0x33070]
push 0x3288
push eax
mov byte [ebp - 4], 0
call fcn.0054db32
test bl, bl
jne 0x5231de
mov eax, dword [esi + 0x44]
cmp eax, 1
je 0x5231d5
cmp eax, 2
je 0x5231d5
cmp eax, 3
mov ecx, esi
jne 0x5231ce
call fcn.0051ec20
jmp 0x5231dc
call fcn.0051e650
jmp 0x5231dc
mov ecx, esi
call fcn.0051f100
mov edi, eax
mov byte [esi + 0x2d0], 0
mov byte [esi + 0x16d], 0
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret