Function at 0x4040c8
Capabilities:
Query environment variable
Set file attributes

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffbc8
push esi
push edi
push ebx
mov dword [ebp - 4], 0
mov byte [ebp - 5], 1
mov esi, dword [ebp + 8]
push 0x400
push 0x415cb9
push 6
push dword [0x40b3e2]
call sub.user32.dll_LoadStringA
push 0x415cb9
call fcn.004020dc
push dword [esi + 0x401]
push 0
lea eax, [esi + 1]
push eax
call fcn.00402254
or eax, eax
jne 0x404121
mov byte [ebp - 5], 0
jmp 0x4044c6
cmp dword [0x40bc55], 0x100000
jae 0x404134
mov eax, 0x100000
jmp 0x40413b
mov eax, dword [0x40bc55]
shl eax, 1
mov dword [ebp - 0x38], eax
push 4
push 0x1000
push dword [ebp - 0x38]
push 0
call sub.kernel32.dll_VirtualAlloc
mov dword [ebp - 0xc], eax
mov dword [ebp - 0x14], eax
push 4
push 0x1000
push dword [ebp - 0x38]
push 0
call sub.kernel32.dll_VirtualAlloc
mov dword [ebp - 0x10], eax
mov eax, dword [0x40bc59]
cmp word [eax], 0xfeff
jne 0x4041c2
add eax, 2
mov ecx, dword [0x40bc55]
sub ecx, 2
shr ecx, 1
push 0
push 0
push dword [ebp - 0x38]
push dword [ebp - 0xc]
push ecx
push eax
push 0
push 0
call sub.kernel32.dll_WideCharToMultiByte
push 0x400
push 0x4160b9
push 0x18
push dword [0x40b3e2]
call sub.user32.dll_LoadStringA
push 0x4160b9
call fcn.004020dc
mov dword [ebp - 0x34], 1
jmp 0x4041dd
push dword [0x40bc55]
push dword [0x40bc59]
push dword [ebp - 0xc]
call sub.kernel32.dll_RtlMoveMemory
mov dword [ebp - 0x34], 0
add esi, 0x408
jmp 0x404405
push dword [esi]
pop dword [ebp - 0x20]
add esi, 8
mov dword [ebp - 0x24], esi
push dword [esi - 4]
pop dword [ebp - 0x2c]
add esi, dword [esi - 4]
add esi, 5
mov dword [ebp - 0x28], esi
push dword [esi - 4]
pop dword [ebp - 0x30]
push dword [ebp - 0x14]
call fcn.00405c60
mov dword [ebp - 0x18], eax
mov esi, dword [ebp - 0xc]
mov edi, dword [ebp - 0x10]
push dword [ebp - 0x38]
push edi
call sub.kernel32.dll_RtlZeroMemory
push dword [ebp - 0x28]
test dword [ebp - 0x20], 0x80
je 0x404255
push 0x1000
push 0x40c4b9
push dword [ebp - 0x24]
call sub.kernel32.dll_ExpandEnvironmentStringsA
push 0x40c4b9
call fcn.00405c60
mov dword [ebp - 0x2c], eax
push 0x40c4b9
pop dword [ebp - 0x24]
test dword [ebp - 0x20], 0x100
je 0x404285
push 0x1000
push 0x40d4b9
push dword [ebp - 0x28]
call sub.kernel32.dll_ExpandEnvironmentStringsA
push 0x40d4b9
call fcn.00405c60
mov dword [ebp - 0x30], eax
push 0x40d4b9
pop dword [ebp - 0x28]
jmp 0x4043dd
lea eax, [ebp - 0x2c]
push eax
push dword [ebp - 0x20]
push esi
push dword [ebp - 0x24]
call fcn.004039b0
or eax, eax
jne 0x4042ea
test dword [ebp - 0x20], 2
je 0x4042ea
mov dword [ebp - 0x1c], 0
cmp esi, dword [ebp - 0x14]
je 0x4042cc
mov eax, esi
dec eax
push str.______________.:_____r_n_t
push eax
call fcn.00406160
or eax, eax
jne 0x4042cc
mov dword [ebp - 0x1c], 1
mov eax, esi
add eax, dword [ebp - 0x2c]
push str.______________.:_____r_n_t
push eax
call fcn.00406160
or eax, eax
jne 0x4042e7
mov dword [ebp - 0x1c], 1
mov eax, dword [ebp - 0x1c]
or eax, eax
jne 0x4043d9
test dword [ebp - 0x20], 0x40
je 0x40434d
lea eax, [ebp - 0x438]
cmp dword [0x41acb9], eax
je 0x40434d
push dword [ebp - 0x28]
pop dword [0x41acb9]
lea eax, [ebp - 0x438]
push eax
push 0x404c40
push dword [0x40b3e6]
push 3
push dword [0x40b3e2]
call sub.user32.dll_DialogBoxParamA
or eax, eax
je 0x40434d
lea eax, [ebp - 0x438]
push eax
call fcn.00405c60
mov dword [ebp - 0x30], eax
lea eax, [ebp - 0x438]
mov dword [ebp - 0x28], eax
test dword [ebp - 0x20], 8
je 0x40435b
add esi, dword [ebp - 0x2c]
jmp 0x4043ca
test dword [ebp - 0x20], 4
je 0x404378
push dword [ebp - 0x30]
push dword [ebp - 0x28]
push edi
call sub.kernel32.dll_RtlMoveMemory
add edi, dword [ebp - 0x30]
add esi, dword [ebp - 0x2c]
jmp 0x4043ca
test dword [ebp - 0x20], 0x10
je 0x4043a2
push dword [ebp - 0x2c]
push esi
push edi
call sub.kernel32.dll_RtlMoveMemory
add edi, dword [ebp - 0x2c]
add esi, dword [ebp - 0x2c]
push dword [ebp - 0x30]
push dword [ebp - 0x28]
push edi
call sub.kernel32.dll_RtlMoveMemory
add edi, dword [ebp - 0x30]
jmp 0x4043ca
test dword [ebp - 0x20], 0x20
je 0x4043ca
push dword [ebp - 0x30]
push dword [ebp - 0x28]
push edi
call sub.kernel32.dll_RtlMoveMemory
add edi, dword [ebp - 0x30]
push dword [ebp - 0x2c]
push esi
push edi
call sub.kernel32.dll_RtlMoveMemory
add edi, dword [ebp - 0x2c]
add esi, dword [ebp - 0x2c]
mov eax, dword [ebp - 0x2c]
sub dword [ebp - 0x18], eax
mov dword [ebp - 4], 1
jmp 0x4043dd
movsb byte es:[edi], byte [esi]
dec dword [ebp - 0x18]
cmp dword [ebp - 0x18], 0
jne 0x40428a
pop dword [ebp - 0x28]
push dword [ebp - 0xc]
push dword [ebp - 0x10]
pop dword [ebp - 0xc]
pop dword [ebp - 0x10]
push dword [ebp - 0xc]
pop dword [ebp - 0x14]
mov esi, dword [ebp - 0x28]
add esi, dword [esi - 4]
add esi, 1
cmp dword [esi + 4], 0
jne 0x4041e8
push dword [ebp - 4]
call fcn.00402676
mov eax, dword [0x40bc4d]
test eax, 1
je 0x404426
sub eax, 1
push eax
push 0x40b44d
call sub.kernel32.dll_SetFileAttributesA
cmp dword [ebp - 0x34], 1
jne 0x404478
mov eax, dword [ebp - 0x14]
cmp dword [ebp - 0xc], eax
jne 0x404444
mov ebx, dword [ebp - 0x10]
jmp 0x404447
mov ebx, dword [ebp - 0xc]
mov word [ebx], 0xfeff
add ebx, 2
push dword [ebp - 0x38]
push ebx
push 0xffffffffffffffff
push dword [ebp - 0x14]
push 0
push 0
call sub.kernel32.dll_MultiByteToWideChar
sub ebx, 2
mov dword [ebp - 0x14], ebx
push dword [ebp - 0x14]
call sub.kernel32.dll_lstrlenW
shl eax, 1
mov dword [0x40bc61], eax
jmp 0x404485
push dword [ebp - 0x14]
call fcn.00405c60
mov dword [0x40bc61], eax
push dword [0x40bc61]
push dword [ebp - 0x14]
push 0x40b44d
call fcn.00405ce4
push eax
push 0x4000
push dword [ebp - 0x38]
push dword [ebp - 0xc]
call sub.kernel32.dll_VirtualFree
push 0x4000
push dword [ebp - 0x38]
push dword [ebp - 0x10]
call sub.kernel32.dll_VirtualFree
pop eax
or eax, eax
jne 0x4044c4
mov byte [ebp - 5], 0
jmp 0x4044c6
jmp 0x4044ce
push dword [ebp - 4]
call fcn.00402676
cmp dword [ebp - 4], 0
jne 0x4044f6
push 0x400
push 0x4164b9
push 0xa
push dword [0x40b3e2]
call sub.user32.dll_LoadStringA
mov eax, 0x4164b9
mov byte [ebp - 5], 0
jmp 0x404512
push 0x400
push 0x4168b9
push 0xb
push dword [0x40b3e2]
call sub.user32.dll_LoadStringA
mov eax, 0x4168b9
push eax
call fcn.004020dc
push 0x400
push 0x416cb9
push 0xc
push dword [0x40b3e2]
call sub.user32.dll_LoadStringA
push 0x416cb9
call fcn.004020dc
push 0x40b0ef
call fcn.004020dc
movzx eax, byte [ebp - 5]
pop ebx
pop edi
pop esi
leave
ret 4