Function at 0x401e30
Capabilities:
Copy file
Delete file
Get common file path
Move file
Persist via run registry key
Query or enumerate registry value
Set registry value

Disassembly:
sub esp, 0xd20
mov dl, byte [0x4091b8]
push ebx
push ebp
push esi
push edi
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x729]
mov byte [esp + 0x728], dl
mov byte [esp + 0x1c], dl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x1d]
mov byte [esp + 0x224], dl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x225]
mov byte [esp + 0x82c], dl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x82d]
mov byte [esp + 0x120], dl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x121]
mov byte [esp + 0x930], dl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov ecx, 0xff
xor eax, eax
lea edi, [esp + 0x931]
xor ebx, ebx
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov al, byte [0x408940]
mov dword [esp + 0x14], 0x400
cmp al, 0x31
jne 0x402511
mov ecx, dword [esp + 0xd34]
mov edi, dword [sym.imp.KERNEL32.dll_GetShortPathNameA]
lea eax, [esp + 0x728]
push 0x104
push eax
push ecx
call edi
test eax, eax
je 0x4024c6
cmp eax, 0x104
ja 0x4024c6
mov esi, dword [esp + 0xd38]
test esi, esi
jne 0x401f3e
xor eax, eax
mov cl, byte [eax + 0x408484]
mov byte [esp + eax + 0x1c], cl
inc eax
test cl, cl
jne 0x401f2a
jmp 0x402153
lea edx, [esp + 0x1c]
push 0x104
push edx
push esi
call edi
test eax, eax
je 0x4024c6
cmp eax, 0x104
ja 0x4024c6
lea eax, [esp + 0x1c]
push eax
push esi
call dword [sym.imp.MSVCRT.dll__stricmp]
add esp, 8
test eax, eax
je 0x402153
mov edi, 0x408fa8
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
jne 0x402113
mov ebp, dword [sym.imp.MSVCRT.dll_sprintf]
push str.WDRenSrv.exe
push 0x4097e8
lea ecx, [esp + 0x834]
push 0x408394
push ecx
call ebp
lea edx, [esp + 0x83c]
push 0
push edx
call dword [sym.imp.MSVCRT.dll__access]
add esp, 0x18
test eax, eax
jne 0x4024c6
push str.WDRenSrv.exe
push 0x4096e0
lea eax, [esp + 0x128]
push 0x408394
push eax
call ebp
add esp, 0x10
lea ecx, [esp + 0x120]
lea edx, [esp + 0x82c]
push 0
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_CopyFileA]
test eax, eax
je 0x4024c6
push 0x408fa8
push 0
push 0x408434
push 0x4096e0
call dword [sym.imp.KERNEL32.dll_GetTempFileNameA]
test eax, eax
jne 0x40202f
push 0x4096e0
push str._sWDSFFFF.tmp
push 0x408fa8
call ebp
add esp, 0xc
push 0x408470
push 0x408fa8
call dword [sym.imp.MSVCRT.dll_fopen]
mov esi, eax
add esp, 8
test esi, esi
je 0x4024c6
lea eax, [esp + 0x10]
push eax
push 0xf003f
push 0
push str.SoftwareMicrosoftWindowsCurrentVersionRunServicesOnce
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x4024c6
lea ecx, [esp + 0x14]
lea edx, [esp + 0x930]
push ecx
mov ecx, dword [esp + 0x14]
lea eax, [esp + 0x1c]
push edx
push eax
push 0
push str.WDRenameService
push ecx
mov dword [esp + 0x2c], 0x400
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
je 0x4020b0
mov ecx, pe_nt_image_headers32
xor eax, eax
lea edi, [esp + 0x930]
rep stosd dword es:[edi], eax
lea edx, [esp + 0x120]
push 0x408fa8
push edx
lea eax, [esp + 0x330]
push str._s__s
push eax
call ebp
lea edi, [esp + 0x338]
or ecx, 0xffffffff
xor eax, eax
add esp, 0x10
repne scasb al, byte es:[edi]
not ecx
mov edx, dword [esp + 0x10]
dec ecx
push ecx
lea ecx, [esp + 0x32c]
push ecx
push 1
push eax
push str.WDRenameService
push edx
call dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
mov edi, eax
mov eax, dword [esp + 0x10]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
test edi, edi
jne 0x4024c6
jmp 0x402130
push 0x408464
push 0x408fa8
call dword [sym.imp.MSVCRT.dll_fopen]
mov esi, eax
add esp, 8
test esi, esi
je 0x4024c6
mov ecx, dword [esp + 0xd38]
lea edx, [esp + 0x1c]
push ecx
push edx
push str._s_s_n
push esi
call dword [sym.imp.MSVCRT.dll_fprintf]
push esi
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 0x14
push 0
push str.WININIT.INI
call dword [sym.imp.MSVCRT.dll__access]
add esp, 8
test eax, eax
je 0x4021b8
push 0x408470
push str.WININIT.INI
call dword [sym.imp.MSVCRT.dll_fopen]
mov esi, eax
add esp, 8
test esi, esi
je 0x4024c6
lea eax, [esp + 0x728]
lea ecx, [esp + 0x1c]
push eax
push ecx
push str._rename_
push str._n_n_s_n_s_s_n
push esi
call dword [sym.imp.MSVCRT.dll_fprintf]
push esi
call dword [sym.imp.MSVCRT.dll_fflush]
push esi
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 0x1c
jmp 0x4023fc
mov edi, dword [sym.imp.MSVCRT.dll_fopen]
push 0x408390
push str.WININIT.INI
call edi
mov esi, eax
add esp, 8
test esi, esi
je 0x4024c6
lea edx, [esp + 0x224]
push edx
push 0
push 0x408434
push 0x408a78
call dword [sym.imp.KERNEL32.dll_GetTempFileNameA]
test eax, eax
je 0x4024a2
lea eax, [esp + 0x224]
push 0x408470
push eax
call edi
mov ebx, eax
add esp, 8
test ebx, ebx
je 0x4024a2
mov ebp, dword [sym.imp.MSVCRT.dll_fgets]
mov ecx, pe_nt_image_headers32
xor eax, eax
lea edi, [esp + 0x328]
rep stosd dword es:[edi], eax
test byte [esi + 0xc], 0x10
jne 0x4024a2
mov edi, str._rename_
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
push ecx
lea ecx, [esp + 0x32c]
push str._rename_
push ecx
call dword [sym.imp.MSVCRT.dll__strnicmp]
add esp, 0xc
test eax, eax
je 0x40229d
mov ecx, pe_nt_image_headers32
xor eax, eax
lea edi, [esp + 0x328]
push esi
lea edx, [esp + 0x32c]
push 0x400
rep stosd dword es:[edi], eax
push edx
call ebp
lea eax, [esp + 0x334]
push eax
push 0x40844c
push ebx
call dword [sym.imp.MSVCRT.dll_fprintf]
mov al, byte [esi + 0xc]
add esp, 0x18
test al, 0x10
je 0x402235
test byte [esi + 0xc], 0x10
jne 0x4024a2
mov ecx, pe_nt_image_headers32
xor eax, eax
lea edi, [esp + 0x328]
push esi
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x32c]
push 0x400
push ecx
call ebp
mov al, byte [esi + 0xc]
add esp, 0xc
test al, 0x10
jne 0x402345
mov dl, byte [esp + 0x328]
cmp dl, 0xa
je 0x402345
lea edi, [esp + 0x328]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp dl, 0x5b
jne 0x402307
cmp byte [esp + ecx + 0x326], 0x5d
jne 0x402307
cmp byte [esp + ecx + 0x327], 0xa
je 0x402345
lea edx, [esp + 0x328]
push edx
push 0x40844c
push ebx
call dword [sym.imp.MSVCRT.dll_fprintf]
mov ecx, pe_nt_image_headers32
xor eax, eax
lea edi, [esp + 0x334]
push esi
rep stosd dword es:[edi], eax
lea eax, [esp + 0x338]
push 0x400
push eax
call ebp
mov al, byte [esi + 0xc]
add esp, 0x18
test al, 0x10
je 0x4022d1
mov edi, dword [sym.imp.MSVCRT.dll_fprintf]
lea ecx, [esp + 0x728]
lea edx, [esp + 0x1c]
push ecx
push edx
push str._s_s_n
push ebx
call edi
lea eax, [esp + 0x338]
push eax
push 0x40844c
push ebx
call edi
mov al, byte [esi + 0xc]
add esp, 0x1c
test al, 0x10
jne 0x4023b8
mov ecx, pe_nt_image_headers32
xor eax, eax
lea edi, [esp + 0x328]
push esi
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x32c]
push 0x400
push ecx
call ebp
lea edx, [esp + 0x334]
push edx
push 0x40844c
push ebx
call dword [sym.imp.MSVCRT.dll_fprintf]
mov al, byte [esi + 0xc]
add esp, 0x18
test al, 0x10
je 0x40237a
push ebx
call dword [sym.imp.MSVCRT.dll_fflush]
mov edi, dword [sym.imp.MSVCRT.dll_fclose]
push ebx
call edi
push esi
call edi
add esp, 0xc
push str.WININIT.INI
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
test eax, eax
je 0x4024c6
lea eax, [esp + 0x224]
push str.WININIT.INI
push eax
call dword [sym.imp.KERNEL32.dll_MoveFileA]
test eax, eax
je 0x4024c6
lea edi, [esp + 0x930]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
je 0x402447
lea ecx, [esp + 0x930]
push 0x20
push ecx
call dword [sym.imp.MSVCRT.dll_strchr]
mov esi, eax
push 0
inc esi
push esi
call dword [sym.imp.MSVCRT.dll__access]
add esp, 0x10
test eax, eax
jne 0x402447
push esi
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
test eax, eax
jne 0x402447
push eax
push esi
call fcn.00401e30
add esp, 8
mov edi, 0x408fa8
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
jne 0x40246d
call fcn.00402520
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0xd20
ret
lea edi, [esp + 0x120]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
je 0x402492
lea edx, [esp + 0x120]
push 1
push edx
call fcn.00403ed0
add esp, 8
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0xd20
ret
push esi
mov esi, dword [sym.imp.MSVCRT.dll_fclose]
call esi
add esp, 4
test ebx, ebx
je 0x4024c6
push ebx
call esi
add esp, 4
lea eax, [esp + 0x224]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
lea edi, [esp + 0x930]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
je 0x402511
lea ecx, [esp + 0x930]
push 0x20
push ecx
call dword [sym.imp.MSVCRT.dll_strchr]
mov esi, eax
push 0
inc esi
push esi
call dword [sym.imp.MSVCRT.dll__access]
add esp, 0x10
test eax, eax
jne 0x402511
push esi
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
test eax, eax
jne 0x402511
push eax
push esi
call fcn.00401e30
add esp, 8
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0xd20
ret