Function at 0x408640
Capabilities:
Query environment variable
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x118
mov eax, dword [0x442754]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
push edi
push 0x104
lea eax, [ebp - 0x108]
push eax
push str.USERPROFILE
mov esi, ecx
mov edi, edx
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
test eax, eax
je 0x4088da
push ebx
push esi
call fcn.004305ff
mov ebx, eax
push edi
mov dword [ebp - 0x110], ebx
call fcn.004305ff
mov edi, eax
push str._UserProfile_
push ebx
mov dword [ebp - 0x114], edi
call fcn.0041d490
add esp, 0x10
mov dword [ebp - 0x10c], eax
test eax, eax
je 0x408756
mov esi, eax
sub esi, ebx
lea ecx, [esi + 1]
push ecx
call fcn.0041c606
push esi
mov edi, eax
push ebx
push edi
mov dword [ebp - 0x118], edi
call fcn.0041e1b0
lea eax, [ebp - 0x108]
add esp, 0x10
mov byte [edi + esi], 0
mov ecx, eax
lea ecx, [ecx]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x4086e0
sub eax, ecx
mov esi, ecx
dec edi
lea esp, [esp]
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x4086f0
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
mov eax, dword [ebp - 0x10c]
and ecx, 3
add eax, 0xd
rep movsb byte es:[edi], byte [esi]
mov ecx, eax
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x408711
mov ebx, dword [ebp - 0x118]
sub eax, ecx
mov esi, ecx
lea edi, [ebx - 1]
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x408725
mov edx, dword [ebp - 0x110]
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
push edx
rep movsb byte es:[edi], byte [esi]
call fcn.0041ba30
mov edi, dword [ebp - 0x114]
add esp, 4
mov dword [ebp - 0x110], ebx
push str._UserProfile_
push edi
call fcn.0041d490
add esp, 8
mov dword [ebp - 0x10c], eax
test eax, eax
je 0x408804
mov esi, eax
sub esi, edi
lea eax, [esi + 1]
push eax
call fcn.0041c606
push esi
mov ebx, eax
push edi
push ebx
call fcn.0041e1b0
lea eax, [ebp - 0x108]
mov byte [ebx + esi], 0
add esp, 0x10
mov esi, eax
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408798
sub eax, esi
lea edi, [ebx - 1]
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x4087a4
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
mov eax, dword [ebp - 0x10c]
and ecx, 3
add eax, 0xd
rep movsb byte es:[edi], byte [esi]
mov esi, eax
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4087c5
sub eax, esi
lea edi, [ebx - 1]
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x4087d1
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebp - 0x114]
push ecx
call fcn.0041ba30
mov dword [ebp - 0x114], ebx
mov edi, ebx
mov ebx, dword [ebp - 0x110]
add esp, 4
push 0x43972c
push ebx
call fcn.0041ca5f
mov esi, eax
add esp, 8
test esi, esi
je 0x4088ca
push 2
push 0
push esi
call fcn.0041d18c
push esi
call fcn.0041e668
push esi
mov dword [ebp - 0x10c], eax
call fcn.0041e6cd
mov edx, dword [ebp - 0x10c]
push edx
call fcn.0041c606
add esp, 0x18
mov dword [ebp - 0x118], eax
test eax, eax
je 0x4088ca
mov ebx, dword [ebp - 0x10c]
push esi
push ebx
push 1
push eax
call fcn.0041cf14
push esi
call fcn.0041cc56
mov esi, dword [ebp - 0x118]
add esp, 0x14
push 0x43a980
push edi
push 0x43aec4
push esi
mov eax, ebx
call fcn.00402bc0
add esp, 4
push eax
push 0x43aec8
push 5
call fcn.00402eb0
mov ecx, eax
add esp, 0x18
lea edi, [ecx + 1]
jmp 0x4088a0
mov dl, byte [ecx]
inc ecx
test dl, dl
jne 0x4088a0
push eax
mov eax, dword [ebp + 8]
sub ecx, edi
push eax
mov edi, ecx
call fcn.00412810
push esi
call fcn.0041ba30
mov edi, dword [ebp - 0x114]
mov ebx, dword [ebp - 0x110]
add esp, 0xc
push ebx
call fcn.0041ba30
push edi
call fcn.0041ba30
add esp, 8
pop ebx
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
mov eax, str.success
pop esi
call fcn.0041ba21
mov esp, ebp
pop ebp
ret