Function at 0x405db6
Capabilities:
Check mutex on windows
Print debug messages
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x43c
push ebx
push esi
push edi
mov dword [ebp - 0x3c], pe_nt_image_headers32
mov dword [ebp - 0x1c], 0
mov eax, dword [ebp + 0xc]
movsx eax, byte [eax]
test eax, eax
jne 0x405de5
xor eax, eax
jmp 0x406166
cmp dword [ebp + 8], 1
jne 0x405e4b
lea eax, [ebp - 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
mov eax, dword [ebp - 0xc]
and eax, 0xffff
push eax
xor eax, eax
mov ax, word [ebp - 0xe]
push eax
mov eax, dword [ebp - 0x10]
and eax, 0xffff
push eax
xor eax, eax
mov ax, word [ebp - 0x12]
push eax
xor eax, eax
mov ax, word [ebp - 0x16]
push eax
push str._2d__02d__2d:_02d:_02d
lea eax, [ebp - 0x38]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x1c
cmp eax, 0xf
jbe 0x405e46
push str._HW32__LogString_GetLocalTime:_stack_trashed_r_n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
jmp 0x405e4f
mov byte [ebp - 0x38], 0
mov eax, dword [ebp + 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov ebx, eax
lea eax, [ebp - 0x38]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
add ebx, eax
inc ebx
push ebx
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
jne 0x405e9d
push str._HW32__LogString:_LocalAlloc_failed_r_n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov eax, dword [ebp + 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov eax, 0xffffffff
jmp 0x406166
mov eax, dword [ebp + 0x10]
push eax
lea eax, [ebp - 0x38]
push eax
push str._s_s
mov eax, dword [ebp - 8]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
lea eax, [ebp + 0x14]
mov dword [ebp - 0x20], eax
lea eax, [ebp - 0x20]
push eax
push 0
lea eax, [ebp - 0x1c]
push eax
push 0
push 0
mov eax, dword [ebp - 8]
push eax
push 0x500
call dword [sym.imp.KERNEL32.dll_FormatMessageA]
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x20], 0
cmp dword [ebp - 0x28], 0
je 0x405ef8
cmp dword [ebp - 0x1c], 0
jne 0x405f21
push str._HW32__LogString:_FormatMessage_failed_r_n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov eax, dword [ebp + 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov eax, dword [ebp - 8]
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, 0xffffffff
jmp 0x406166
push str.HW32_LOG_MUTEX
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
mov dword [ebp - 0x24], eax
cmp dword [ebp - 0x24], 0
je 0x406123
push 0x7530
mov eax, dword [ebp - 0x24]
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0x102
je 0x4060ed
push 0
push pe_nt_image_headers32
push 3
push 0
push 1
push 0x80000000
mov eax, dword [ebp + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [0x40c030], eax
cmp dword [0x40c030], 0xffffffff
je 0x405fa0
mov eax, dword [0x40c030]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [0x40d9b8], 3
jmp 0x405faa
mov dword [0x40d9b8], 1
push 0
mov eax, dword [ebp - 0x3c]
push eax
mov eax, dword [0x40d9b8]
push eax
push 0
push 1
push 0xc0000000
mov eax, dword [ebp + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [0x40c030], eax
cmp dword [0x40c030], 0xffffffff
jne 0x406030
mov eax, str.CREATE_NEW
mov ecx, str.OPEN_EXISTING
xor edx, edx
cmp dword [0x40d9b8], 1
sete dl
dec edx
sub ecx, eax
and edx, ecx
add edx, eax
push edx
mov eax, dword [ebp + 0xc]
push eax
push 0x40b268
push str._s_Unable_to_open_log_file___s__fdwCreate_s._r_n
lea eax, [ebp - 0x43c]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x14
lea eax, [ebp - 0x43c]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov dword [ebp - 4], 0xffffffff
jmp 0x4060de
push 2
push 0
push 0
mov eax, dword [0x40c030]
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x40607e
push 0x40b268
push str._s_Unable_to_position_log_file_pointer_to_end_of_file._r_n
lea eax, [ebp - 0x43c]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
lea eax, [ebp - 0x43c]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov dword [ebp - 4], 0xffffffff
jmp 0x4060d2
push 0
lea eax, [ebp - 4]
push eax
mov eax, dword [ebp - 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
push eax
mov eax, dword [ebp - 0x1c]
push eax
mov eax, dword [0x40c030]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x4060d2
push 0x40b268
push str._s_Unable_to_write_log_file_string._r_n
lea eax, [ebp - 0x43c]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
mov eax, dword [ebp - 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov dword [ebp - 4], 0xffffffff
mov eax, dword [0x40c030]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x24]
push eax
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
jmp 0x406114
push 0x40b268
push str._s_Timeout_occured_trying_to_obtain_ownership_of_log_file_mutex._r_n
lea eax, [ebp - 0x43c]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
lea eax, [ebp - 0x43c]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov eax, dword [ebp - 0x24]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40614a
push 0x40b268
push str._s_Unable_to_create_open_log_file_mutex._r_n
lea eax, [ebp - 0x43c]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
lea eax, [ebp - 0x43c]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov eax, dword [ebp - 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, dword [ebp - 8]
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, dword [ebp - 4]
jmp 0x406166
pop edi
pop esi
pop ebx
leave
ret