Function at 0x406bd0
Capabilities:
Create directory
Delete file
Move file
Query environment variable
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
mov edx, dword [ebp + 8]
mov word [ebp - 4], 0xfeff
push ebx
mov ebx, 0x104
mov dword [ebp - 0xc], ebx
test edx, edx
je 0x40704d
mov ecx, edx
push esi
lea esi, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x406bf6
sub ecx, esi
sar ecx, 1
je 0x40704c
mov ecx, edx
lea esi, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x406c10
sub ecx, esi
sar ecx, 1
push edi
cmp word [edx + ecx*2 - 2], 0xa
jne 0x406c8d
mov ecx, edx
lea esi, [ecx + 2]
lea ecx, [ecx]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x406c30
sub ecx, esi
sar ecx, 1
cmp ecx, 2
jb 0x406c72
mov ecx, edx
lea esi, [ecx + 2]
lea esp, [esp]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x406c50
sub ecx, esi
sar ecx, 1
cmp word [edx + ecx*2 - 4], 0xd
jne 0x406c72
push edx
call fcn.00408e70
add esp, 4
jmp 0x406c9b
mov ecx, edx
lea esi, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x406c77
sub ecx, esi
sar ecx, 1
xor eax, eax
mov word [edx + ecx*2 - 2], ax
push 0x56e020
push edx
call fcn.00408cb0
add esp, 8
mov edi, eax
mov dword [ebp - 0x10], 0
add ebx, ebx
je 0x40703e
push ebx
call fcn.005369fe
mov esi, eax
add esp, 4
test esi, esi
je 0x40703e
push ebx
push 0
push esi
call fcn.00537300
add esp, 0xc
test esi, esi
je 0x40703e
mov ebx, dword [ebp - 0xc]
push ebx
push esi
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
test eax, eax
jne 0x406cfd
call dword [sym.imp.KERNEL32.dll_GetLastError]
shr ebx, 1
push esi
mov dword [ebp - 0x10], eax
mov dword [ebp - 0xc], ebx
call fcn.005369c6
add esp, 4
xor esi, esi
cmp dword [ebp - 0x10], 0x7a
je 0x406ca4
mov ecx, esi
lea edx, [ecx + 2]
jmp 0x406d10
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x406d10
sub ecx, edx
sar ecx, 1
je 0x406d33
lea eax, [ecx - 1]
lea eax, [esi + eax*2]
cmp word [eax], 0x5c
je 0x406d33
sub eax, 2
dec ecx
jne 0x406d27
lea edx, [esi + ecx*2]
test edx, edx
jne 0x406d3e
xor ecx, ecx
jmp 0x406d59
mov ecx, edx
lea ebx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x406d43
sub ecx, ebx
sar ecx, 1
lea ecx, [ecx*2 + 2]
test esi, esi
je 0x406d92
test edx, edx
je 0x406d92
test ecx, ecx
je 0x406d92
cmp esi, edx
je 0x406d92
jbe 0x406d74
lea eax, [ecx + edx]
cmp esi, eax
jb 0x406d7d
cmp esi, edx
jae 0x406d87
lea eax, [ecx + esi]
cmp edx, eax
jae 0x406d87
push ecx
push edx
push esi
call fcn.00535ce0
jmp 0x406d8f
push ecx
push edx
push esi
call fcn.00536cb0
add esp, 0xc
push 0
push 0
xorps xmm0, xmm0
push str.TEMP
movlpd qword [ebp - 0x20], xmm0
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
inc eax
mov dword [ebp - 0x14], eax
add eax, eax
je 0x407031
push eax
call fcn.005369fe
add esp, 4
mov dword [ebp - 0x10], eax
mov ebx, eax
mov dword [ebp - 8], ebx
test eax, eax
je 0x407031
push dword [ebp - 0x14]
push eax
push str.TEMP
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
lea eax, [ebp - 8]
test eax, eax
je 0x406dff
push 0x56df74
push ebx
call fcn.00408cb0
push dword [ebp - 0x10]
mov ebx, eax
mov dword [ebp - 8], ebx
call fcn.005369c6
add esp, 0xc
test ebx, ebx
je 0x407031
lea eax, [ebp - 8]
test eax, eax
je 0x406e34
push str.Comodo_LogsFolder
push ebx
mov dword [ebp - 0x14], ebx
call fcn.00408cb0
mov ebx, eax
add esp, 8
mov eax, dword [ebp - 0x14]
mov dword [ebp - 8], ebx
test eax, eax
je 0x406e34
push eax
call fcn.005369c6
add esp, 4
test ebx, ebx
je 0x407031
cmp byte [section..data], 0
je 0x406e55
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
mov byte [section..data], 0
lea eax, [ebp - 8]
test eax, eax
je 0x406e82
push 0x56df74
push ebx
mov dword [ebp - 0x14], ebx
call fcn.00408cb0
mov ebx, eax
add esp, 8
mov eax, dword [ebp - 0x14]
mov dword [ebp - 8], ebx
test eax, eax
je 0x406e82
push eax
call fcn.005369c6
add esp, 4
test ebx, ebx
je 0x407031
lea eax, [ebp - 8]
push esi
push eax
call fcn.00408ba0
add esp, 8
cmp dword [ebp - 8], 0
je 0x407031
lea eax, [ebp - 8]
push str..log
push eax
call fcn.00408ba0
mov ebx, dword [ebp - 8]
add esp, 8
test ebx, ebx
je 0x407031
xor ecx, ecx
mov eax, 0x56dfc8
sub eax, 4
mov dword [ebp - 0x10], ecx
mov dword [ebp - 0x14], eax
mov dword [ebp - 0xc], ecx
test ecx, ecx
je 0x406edc
push dword [eax]
call dword [sym.imp.KERNEL32.dll_Sleep]
push 0
push 0x80
push 4
push 0
push 1
push 0x40000000
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
test ebx, ebx
je 0x406f00
cmp ebx, 0xffffffff
jne 0x406f32
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x20
jne 0x407025
mov edx, dword [ebp - 0xc]
mov ecx, dword [ebp - 0x10]
add edx, 4
mov eax, dword [ebp - 0x14]
inc ecx
add eax, 4
mov dword [ebp - 0x10], ecx
mov dword [ebp - 0xc], edx
mov dword [ebp - 0x14], eax
cmp edx, 0x58
ja 0x406f4e
mov ebx, dword [ebp - 8]
jmp 0x406ed0
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x406f4e
push eax
lea eax, [ebp + 8]
push eax
push 2
lea eax, [ebp - 4]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test ebx, ebx
je 0x407025
cmp ebx, 0xffffffff
je 0x407025
push 2
lea eax, [ebp - 0x20]
push eax
push dword [ebp - 0x1c]
push dword [ebp - 0x20]
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
mov ecx, edi
mov dword [ebp + 8], 0
lea edx, [ecx + 2]
mov edi, edi
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x406f80
sub ecx, edx
lea eax, [ebp + 8]
push 0
sar ecx, 1
push eax
lea eax, [ecx + ecx]
push eax
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp + 8]
xor eax, eax
add ecx, dword [ebp - 0x20]
adc eax, dword [ebp - 0x1c]
mov dword [ebp - 0x14], eax
js 0x406ff8
jg 0x406fc2
cmp ecx, 0x32000
jb 0x406ff8
mov ebx, dword [ebp - 8]
push str.old.log
push ebx
call fcn.00408cb0
add esp, 8
mov dword [ebp - 0x14], eax
test eax, eax
je 0x407028
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
push dword [ebp - 0x14]
push ebx
call dword [sym.imp.KERNEL32.dll_MoveFileW]
push dword [ebp - 0x14]
call fcn.005369c6
add esp, 4
jmp 0x406ffb
mov ebx, dword [ebp - 8]
test edi, edi
je 0x407008
push edi
call fcn.005369c6
add esp, 4
test esi, esi
je 0x407015
push esi
call fcn.005369c6
add esp, 4
push ebx
call fcn.005369c6
add esp, 4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ebx, dword [ebp - 8]
push ebx
call fcn.005369c6
add esp, 4
test esi, esi
je 0x40703e
push esi
call fcn.005369c6
add esp, 4
test edi, edi
je 0x40704b
push edi
call fcn.005369c6
add esp, 4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret