Function at 0x403633
Capabilities:
Check os version
Get common file path
Set current directory

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x5a8
push ebx
push esi
push edi
mov edi, dword [ebp + 0x10]
xor ebx, ebx
cmp edi, ebx
push 2
pop esi
je 0x40367c
push str.none
push edi
call fcn.00406bf5
test eax, eax
pop ecx
pop ecx
jne 0x40366b
mov dword [0x40c3ec], 3
jmp 0x4036ed
push str.info
push edi
call fcn.00406bf5
test eax, eax
pop ecx
pop ecx
jne 0x403684
mov dword [0x40c3ec], ebx
jmp 0x4036ed
push str.warning
push edi
call fcn.00406bf5
test eax, eax
pop ecx
pop ecx
je 0x4036a6
push str.warn
push edi
call fcn.00406bf5
test eax, eax
pop ecx
pop ecx
jne 0x4036b2
mov dword [0x40c3ec], 1
jmp 0x4036ed
push str.error
push edi
call fcn.00406bf5
test eax, eax
pop ecx
pop ecx
je 0x4036d4
push 0x4090b0
push edi
call fcn.00406bf5
test eax, eax
pop ecx
pop ecx
jne 0x4036dc
mov dword [0x40c3ec], esi
jmp 0x4036ed
push str.log.level_unrecognized
mov dword [0x40c3ec], ebx
call fcn.00403518
pop ecx
cmp dword [ebp + 0xc], ebx
je 0x403917
lea eax, [ebp - 0x5a8]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
mov edi, dword [ebp + 0x14]
push str.:working.directory
push edi
call fcn.0040265b
cmp eax, ebx
mov dword [ebp + 0x10], eax
je 0x403738
push str.WinRun4J:IniDir
push edi
call fcn.0040265b
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
push dword [ebp + 0x10]
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
push dword [ebp + 0xc]
call fcn.00404676
pop ecx
push ebx
push str.:log.overwrite
push edi
mov dword [0x40ce84], eax
call fcn.00402389
test eax, eax
setne al
xor ecx, ecx
cmp al, bl
sete cl
push ebx
push 0x80
mov byte [0x40ce82], al
lea ecx, [ecx + ecx + 2]
push ecx
push ebx
push 1
push 0xc0000000
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [0x40ce78], eax
je 0x4038eb
mov cl, byte [0x40ce82]
neg cl
sbb ecx, ecx
and ecx, 0xfffffffe
add ecx, esi
push ecx
push ebx
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
push dword [0x40ce78]
mov esi, dword [sym.imp.KERNEL32.dll_SetStdHandle]
push 0xfffffffffffffff5
mov dword [0x40ce7c], eax
call esi
push dword [0x40ce78]
push 0xfffffffffffffff4
call esi
mov esi, str.:log.file.and.console
push esi
push edi
mov byte [0x40ce80], 1
call fcn.0040265b
test eax, eax
je 0x4037f6
push ebx
push esi
push edi
call fcn.00402389
test eax, eax
setne al
mov byte [0x40ce81], al
fldz
push ecx
push ecx
fstp qword [esp]
push 0x409060
push edi
call fcn.00402365
fmul qword [0x409058]
fst qword [0x40ce88]
fldz
fcompp
fnstsw ax
test ah, 5
jp 0x403903
push ebx
lea eax, [ebp - 0x198]
push eax
push 0x104
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_GetFullPathNameA]
lea eax, [ebp - 0x29c]
push eax
lea eax, [ebp - 0x198]
push eax
call fcn.00404535
pop ecx
pop ecx
push str.:log.roll.prefix
push edi
call fcn.0040265b
cmp eax, ebx
je 0x40386e
push eax
lea eax, [ebp - 0x29c]
push eax
call fcn.00406bbd
pop ecx
pop ecx
jmp 0x403897
lea eax, [ebp - 0x3a0]
push eax
lea eax, [ebp - 0x198]
push eax
call fcn.004045b4
lea eax, [ebp - 0x3a0]
push eax
lea eax, [ebp - 0x29c]
push eax
call fcn.00406bbd
add esp, 0x10
lea eax, [ebp - 0x29c]
push eax
call fcn.00404676
mov dword [esp], str.:log.roll.suffix
push edi
mov dword [0x40ce90], eax
call fcn.0040265b
cmp eax, ebx
je 0x4038c2
push eax
call fcn.00404676
pop ecx
jmp 0x4038e4
lea eax, [ebp - 0x4a4]
push eax
lea eax, [ebp - 0x198]
push eax
call fcn.00404584
lea eax, [ebp - 0x4a4]
push eax
call fcn.00404676
add esp, 0xc
mov dword [0x40ce94], eax
jmp 0x403903
push str.Could_not_open_log_file
call fcn.00403537
pop ecx
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov dword [0x40ce78], eax
cmp dword [ebp + 0x10], ebx
je 0x403924
lea eax, [ebp - 0x5a8]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
jmp 0x403924
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov dword [0x40ce78], eax
lea eax, [ebp - 0x94]
push eax
mov dword [ebp - 0x94], 0x94
call dword [sym.imp.KERNEL32.dll_GetVersionExA]
test eax, eax
je 0x403948
cmp dword [ebp - 0x90], 5
ja 0x403959
cmp dword [ebp - 0x90], 5
jne 0x403963
cmp dword [ebp - 0x8c], ebx
jbe 0x403963
mov dword [0x40ce70], 1
cmp dword [0x40ce6c], ebx
jne 0x4039bf
cmp dword [ebp + 0xc], ebx
jne 0x4039bf
cmp dword [0x40ce70], ebx
je 0x4039b5
push str.kernel32
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
cmp eax, ebx
je 0x4039b5
push str.AttachConsole
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
cmp eax, ebx
je 0x4039b5
push 0xffffffffffffffff
call eax
cmp eax, ebx
mov dword [0x40ce74], eax
je 0x4039b5
call dword [sym.imp.KERNEL32.dll_AllocConsole]
push 0x408ff8
call fcn.00406ee0
pop ecx
mov dword [0x40ce6c], 1
pop edi
pop esi
pop ebx
leave
ret 0x10