Function at 0x405100
Capabilities:
Create directory
Get common file path

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x4018
call fcn.0040c310
mov eax, dword [0x41398c]
xor eax, ebp
mov dword [ebp - 4], eax
cmp dword [0x415a78], 0
mov eax, dword [ebp + 8]
push ebx
mov ebx, dword [ebp + 0x10]
push esi
mov esi, dword [ebp + 0xc]
push edi
mov dword [ebp - 0x4018], eax
jne 0x405147
push 0x415a5c
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
mov dword [0x415a78], 0x415a5c
lea ecx, [ebp - 0x4014]
push ecx
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
mov edi, dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test esi, esi
jne 0x405216
push 0x104
lea edx, [ebp - 0x2004]
push edx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
test eax, eax
je 0x405202
push str.LogFiles
lea eax, [ebp - 0x2004]
push 0x104
push eax
call fcn.00405590
add esp, 0xc
push 0
lea ecx, [ebp - 0x2004]
push ecx
call edi
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x4051c2
call esi
cmp eax, 0xb7
je 0x4051c2
push 0
lea edx, [ebp - 0x2004]
push edx
call edi
test eax, eax
je 0x405202
push str.Apache
lea eax, [ebp - 0x2004]
push 0x104
push eax
call fcn.00405590
add esp, 0xc
push 0
lea ecx, [ebp - 0x2004]
push ecx
call edi
test eax, eax
jne 0x40522b
call esi
cmp eax, 0xb7
je 0x40522b
push 0
lea edx, [ebp - 0x2004]
push edx
call edi
test eax, eax
jne 0x40522b
pop edi
pop esi
or eax, 0xffffffff
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040c2f4
mov esp, ebp
pop ebp
ret
push esi
lea eax, [ebp - 0x2004]
push 0x104
push eax
call fcn.00405640
add esp, 0xc
test ebx, ebx
jne 0x405234
mov ebx, str.commons_daemon
mov eax, dword [ebp + 0x14]
test eax, eax
je 0x405278
cmp eax, 0x15180
jae 0x405278
movzx ecx, word [ebp - 0x400e]
movzx edx, word [ebp - 0x4012]
movzx eax, word [ebp - 0x4014]
push 0
push 0
push 0
push ecx
push edx
push eax
push ebx
lea ecx, [ebp - 0x4004]
push str._s._04d__02d__02d._02d_02d_02d.log
push ecx
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0x24
jmp 0x4052a6
movzx edx, word [ebp - 0x400e]
movzx eax, word [ebp - 0x4012]
movzx ecx, word [ebp - 0x4014]
push edx
push eax
push ecx
push ebx
lea edx, [ebp - 0x4004]
push str._s._04d__02d__02d.log
push edx
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0x18
mov eax, dword [ebp - 0x4018]
push 0x242c
push eax
call fcn.00401b10
mov esi, eax
add esp, 8
test esi, esi
je 0x405202
push 0
lea ecx, [ebp - 0x2004]
push ecx
mov dword [esi + 4], 1
call edi
mov edx, dword [ebp - 0x4014]
mov dword [esi + 0xc], edx
mov eax, dword [ebp - 0x4010]
mov dword [esi + 0x10], eax
mov ecx, dword [ebp - 0x400c]
lea eax, [ebp - 0x2004]
mov dword [esi + 0x14], ecx
mov edx, dword [ebp - 0x4008]
push eax
lea ecx, [esi + 0x1c]
push 0x104
push ecx
mov dword [esi + 0x18], edx
call fcn.00405640
lea edx, [ebp - 0x2004]
push edx
lea edi, [esi + 0x2224]
push 0x104
push edi
call fcn.00405640
lea eax, [ebp - 0x4004]
push eax
push 0x104
push edi
call fcn.00405590
push ebx
lea ecx, [esi + 0x201c]
push 0x104
push ecx
call fcn.00405640
add esp, 0x30
push 0
push 0x88000080
push 4
push 0
push 3
push 0x40000000
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [esi], eax
cmp eax, 0xffffffff
jne 0x40539c
push 0x413284
push str.Unable_to_create_logger_at__S_n
push 0
push 0
push 0
call fcn.00404f20
add esp, 0x14
pop edi
pop esi
mov eax, 0x411060
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040c2f4
mov esp, ebp
pop ebp
ret
cmp dword [0x415a74], 0
mov edx, dword [ebp + 0x14]
mov dword [esi + 8], edx
jne 0x4053b1
mov dword [0x415a74], esi
mov ecx, dword [ebp - 4]
pop edi
mov eax, esi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040c2f4
mov esp, ebp
pop ebp
ret