Function at 0x401550
Capabilities:
Query environment variable
Read file on windows
Set registry value
Write file on windows

Disassembly:
sub esp, 0x134
mov al, byte [0x408330]
push ebx
push ebp
push esi
push edi
mov byte [esp + 0x40], al
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x41]
lea edx, [esp + 0x2c]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea ecx, [esp + 0x20]
xor ebx, ebx
or esi, 0xffffffff
push ecx
push edx
mov dword [esp + 0x1c], ebx
stosb byte es:[edi], al
mov byte [esp + 0x1b], bl
mov dword [esp + 0x30], ebx
mov dword [esp + 0x44], ebx
mov dword [esp + 0x3c], 2
mov dword [esp + 0x2c], esi
mov dword [esp + 0x38], ebx
mov dword [esp + 0x34], ebx
mov dword [esp + 0x28], ebx
mov dword [esp + 0x20], 1
call section..text
add esp, 8
test eax, eax
je 0x4017ca
mov esi, dword [sym.imp.MSVCRT.dll_tmpfile]
call esi
mov edi, eax
mov dword [esp + 0x38], edi
call esi
cmp edi, ebx
mov ebp, eax
je 0x4017ce
cmp ebp, ebx
je 0x4017ce
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x2c]
push edi
push eax
push 1
push ecx
call dword [sym.imp.MSVCRT.dll_fwrite]
mov ecx, dword [esp + 0x30]
add esp, 0x10
cmp eax, ecx
jne 0x4017b9
mov esi, dword [sym.imp.MSVCRT.dll_fseek]
push ebx
push ebx
push edi
call esi
push ebp
push edi
call fcn.004013d0
add esp, 0x14
test eax, eax
jne 0x4017b9
push 2
push ebx
push ebp
call esi
push ebp
call dword [sym.imp.MSVCRT.dll_ftell]
push 0
push 0
push ebp
mov ebx, eax
call esi
push ebx
call dword [sym.imp.MSVCRT.dll_malloc]
mov esi, eax
add esp, 0x20
test esi, esi
je 0x4017b7
mov ecx, ebx
xor eax, eax
mov edx, ecx
mov edi, esi
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
push ebp
and ecx, 3
push ebx
push 1
push esi
rep stosb byte es:[edi], al
call dword [sym.imp.MSVCRT.dll_fread]
add esp, 0x10
cmp eax, ebx
jne 0x401782
cmp dword [esi], 0
je 0x401782
push esi
call fcn.004010b0
mov eax, dword [esp + 0x1c]
mov dl, byte [esp + 0x17]
add esp, 4
or al, 2
xor ecx, ecx
test dl, dl
setne cl
or al, 4
lea edx, [esp + 0x24]
mov dword [esp + 0x18], eax
lea eax, [esp + 0x1c]
push edx
push eax
push 0
push 0xf003f
push 0
push 0
push 0
inc ecx
push 0x4080c0
push 0x80000002
mov dword [esp + 0x4c], ecx
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyExA]
test eax, eax
jne 0x401768
cmp dword [esp + 0x24], 2
je 0x40176c
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x1c]
or ecx, 8
mov edi, dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
mov dword [esp + 0x18], ecx
lea ecx, [esp + 0x28]
push 4
push ecx
push 3
push 0
push 0x4080b8
push edx
call edi
test eax, eax
je 0x40170f
mov dword [esp + 0x14], eax
mov ecx, dword [esp + 0x1c]
lea eax, [esp + 0x34]
push 4
push eax
push 3
push 0
push 0x4080b4
push ecx
call edi
test eax, eax
je 0x40172e
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x1c]
lea edx, [esp + 0x13]
push 1
push edx
push 3
push 0
push 0x4080ac
push eax
call edi
test eax, eax
je 0x40174d
mov dword [esp + 0x14], eax
mov edx, dword [esp + 0x1c]
lea ecx, [esp + 0x3c]
push 4
push ecx
push 3
push 0
push 0x4080a4
push edx
call edi
test eax, eax
je 0x40176c
mov dword [esp + 0x14], eax
or dword [esp + 0x18], 0x10
call fcn.00401220
test eax, eax
je 0x401782
mov dword [esp + 0x14], 0
mov ecx, ebx
xor eax, eax
mov edx, ecx
mov edi, esi
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
push esi
and ecx, 3
rep stosb byte es:[edi], al
call dword [sym.imp.MSVCRT.dll_free]
mov edi, dword [esp + 0x3c]
mov esi, dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
xor ebx, ebx
push edi
call esi
push ebp
call esi
add esp, 8
jmp 0x4017ce
xor ebx, ebx
mov esi, dword [sym.imp.MSVCRT.dll_fclose]
push edi
call esi
push ebp
call esi
add esp, 8
jmp 0x4017ce
mov dword [esp + 0x14], esi
lea eax, [esp + 0x40]
push 0x104
push eax
push str.windir
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
test eax, eax
je 0x4018ea
or ecx, 0xffffffff
mov edi, str._temp
xor eax, eax
lea edx, [esp + 0x40]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
push ebx
mov ebp, ecx
mov esi, edi
or ecx, 0xffffffff
mov edi, edx
repne scasb al, byte es:[edi]
mov ecx, ebp
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
lea edx, [esp + 0x44]
and ecx, 3
push 0x80
rep movsb byte es:[edi], byte [esi]
or ecx, 0xffffffff
mov edi, str.DE
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
push 2
mov ebp, ecx
mov esi, edi
or ecx, 0xffffffff
mov edi, edx
repne scasb al, byte es:[edi]
mov ecx, ebp
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
lea edx, [esp + 0x4c]
and ecx, 3
push ebx
rep movsb byte es:[edi], byte [esi]
mov edi, str.1923
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
push ebx
mov esi, edi
mov ebp, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebp
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
lea edx, [esp + 0x54]
and ecx, 3
push 0xc0000000
rep movsb byte es:[edi], byte [esi]
mov edi, str..tmp
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebp, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebp
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
lea eax, [esp + 0x58]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, ebx
je 0x4018ea
mov edi, dword [sym.imp.KERNEL32.dll_WriteFile]
lea ecx, [esp + 0x30]
push ebx
push ecx
lea edx, [esp + 0x20]
push 4
push edx
push esi
call edi
lea eax, [esp + 0x30]
push ebx
push eax
lea ecx, [esp + 0x1c]
push 4
push ecx
push esi
call edi
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x134
ret