Function at 0x405740
Capabilities:
Create directory
Get common file path
Get file size
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x57ebc1
mov eax, dword fs:[0]
push eax
sub esp, 0x310
mov eax, dword [0x5e68f0]
xor eax, esp
mov dword [esp + 0x308], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x5e68f0]
xor eax, esp
push eax
lea eax, [esp + 0x324]
mov dword fs:[0], eax
mov eax, dword [esp + 0x334]
mov dword [esp + 0x2c], eax
mov eax, dword [0x5e936c]
push 0x5be98c
xor edi, edi
mov ecx, 0x5e9358
call fcn.00407660
test eax, eax
jne 0x4059f4
xor ecx, ecx
push 0x208
push ecx
lea edx, [esp + 0x116]
push edx
mov word [esp + 0x118], cx
call fcn.0050fd50
add esp, 0xc
lea eax, [esp + 0x10c]
push eax
push edi
push edi
push 0x23
push edi
call dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
test eax, eax
jl 0x4059f4
mov esi, dword [sym.imp.SHLWAPI.dll_PathAppendW]
push 0x5bdcf8
lea ecx, [esp + 0x110]
push ecx
call esi
push edi
mov edi, dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
lea edx, [esp + 0x110]
push edx
call edi
push 0x5be884
lea eax, [esp + 0x110]
push eax
call esi
push 0
lea ecx, [esp + 0x110]
push ecx
call edi
push 0
call fcn.0050ccb0
add esp, 4
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], edx
call fcn.00418ab3
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x40584c
push 0x80004005
call fcn.00401920
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x14], eax
lea ecx, [esp + 0x1c]
push ecx
lea edx, [esp + 0xec]
push edx
mov dword [esp + 0x334], 0
call fcn.0050cd01
add esp, 8
test eax, eax
jne 0x40588d
mov eax, dword [esp + 0xe8]
mov dword [esp + 0x18], eax
jmp 0x405895
mov dword [esp + 0x18], 0xffffffff
lea ecx, [esp + 0x1c]
push ecx
lea edx, [esp + 0x34]
push edx
call fcn.0050cd01
add esp, 8
test eax, eax
jne 0x4058b1
mov ebp, dword [esp + 0x34]
jmp 0x4058b4
or ebp, 0xffffffff
lea eax, [esp + 0x1c]
push eax
lea ecx, [esp + 0xa4]
push ecx
call fcn.0050cd01
add esp, 8
test eax, eax
jne 0x4058d6
mov ebx, dword [esp + 0xa8]
jmp 0x4058d9
or ebx, 0xffffffff
lea edx, [esp + 0x1c]
push edx
lea eax, [esp + 0x5c]
push eax
call fcn.0050cd01
neg eax
sbb eax, eax
not eax
and eax, dword [esp + 0x6c]
lea ecx, [esp + 0x24]
push ecx
lea edx, [esp + 0x88]
push edx
mov edi, eax
call fcn.0050cd01
add esp, 0x10
test eax, eax
jne 0x405917
mov esi, dword [esp + 0x8c]
inc esi
jmp 0x405919
xor esi, esi
lea eax, [esp + 0x1c]
push eax
lea ecx, [esp + 0xc8]
push ecx
call fcn.0050cd01
add esp, 8
test eax, eax
jne 0x405940
mov eax, dword [esp + 0xd8]
add eax, 0x76c
jmp 0x405942
xor eax, eax
mov edx, dword [esp + 0x18]
push edx
push ebp
push ebx
push edi
push esi
push eax
lea eax, [esp + 0x124]
push eax
lea ecx, [esp + 0x30]
push str._s_04d__02d__02d__02d_02d_02d.log
push ecx
call fcn.004019f0
mov eax, dword [esp + 0x38]
mov ecx, eax
add esp, 0x24
lea esi, [ecx + 2]
nop
mov dx, word [ecx]
add ecx, 2
test dx, dx
jne 0x405970
sub ecx, esi
sar ecx, 1
push ecx
mov esi, 0x5e9358
call fcn.00406660
lea edx, [esp + 0x10c]
push edx
lea eax, [esp + 0x18]
push str._sconfig.dat
push eax
call fcn.004019f0
mov eax, dword [0x5e935c]
add esp, 0xc
cmp dword [0x5e9370], 8
jae 0x4059b7
mov eax, 0x5e935c
mov esi, dword [esp + 0x14]
push esi
push eax
push str.LogPath
push 0x5bdcf8
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
lea eax, [esi - 0x10]
mov dword [esp + 0x32c], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4059f4
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [0x5e936c]
push 0x5be98c
xor edi, edi
mov ecx, 0x5e9358
call fcn.00407660
test eax, eax
je 0x405ce7
test byte [0x5efd44], 1
jne 0x405a2d
or dword [0x5efd44], 1
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
mov dword [0x5efd40], eax
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push 0
mov dword [esp + 0x20], eax
call fcn.0050ccb0
add esp, 4
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], edx
call fcn.00418ab3
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x405a63
push 0x80004005
call fcn.00401920
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x14], eax
lea ecx, [esp + 0x24]
push ecx
lea edx, [esp + 0xc8]
push edx
mov dword [esp + 0x334], 1
call fcn.0050cd01
add esp, 8
test eax, eax
jne 0x405aa4
mov eax, dword [esp + 0xc4]
mov dword [esp + 0x18], eax
jmp 0x405aac
mov dword [esp + 0x18], 0xffffffff
lea ecx, [esp + 0x24]
push ecx
lea edx, [esp + 0x80]
push edx
call fcn.0050cd01
add esp, 8
test eax, eax
jne 0x405ace
mov ebp, dword [esp + 0x80]
jmp 0x405ad1
or ebp, 0xffffffff
lea eax, [esp + 0x24]
push eax
lea ecx, [esp + 0x5c]
push ecx
call fcn.0050cd01
add esp, 8
test eax, eax
jne 0x405aed
mov ebx, dword [esp + 0x60]
jmp 0x405af0
or ebx, 0xffffffff
lea edx, [esp + 0x24]
push edx
lea eax, [esp + 0xa4]
push eax
call fcn.0050cd01
neg eax
sbb eax, eax
not eax
and eax, dword [esp + 0xb4]
lea ecx, [esp + 0x2c]
push ecx
lea edx, [esp + 0xf4]
push edx
mov edi, eax
call fcn.0050cd01
add esp, 0x10
test eax, eax
jne 0x405b34
mov esi, dword [esp + 0xf8]
inc esi
jmp 0x405b36
xor esi, esi
lea eax, [esp + 0x24]
push eax
lea ecx, [esp + 0x34]
push ecx
call fcn.0050cd01
add esp, 8
test eax, eax
jne 0x405b57
mov eax, dword [esp + 0x44]
add eax, 0x76c
jmp 0x405b59
xor eax, eax
mov edx, dword [esp + 0x2c]
mov ecx, dword [esp + 0x1c]
push edx
mov edx, dword [0x5efd40]
push ecx
mov ecx, dword [esp + 0x20]
push edx
push ecx
push ebp
push ebx
push edi
push esi
push eax
lea edx, [esp + 0x38]
push str._04d__02d__02d__02d:_02d:_02d__d___d___s_r_n
push edx
call fcn.004019f0
mov eax, dword [0x5e935c]
add esp, 0x2c
cmp dword [0x5e9370], 8
jae 0x405b99
mov eax, 0x5e935c
push 0
push 0x80
push 4
push 0
push 1
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, dword [esp + 0x14]
mov ebp, eax
cmp ebp, 0xffffffff
je 0x405cc0
lea eax, [esp + 0x18]
push eax
push ebp
call dword [sym.imp.KERNEL32.dll_GetFileSize]
push 0
push 0
push eax
push ebp
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
xor ecx, ecx
mov eax, ebx
mov dword [esp + 0x48], 7
mov dword [esp + 0x44], 0
mov word [esp + 0x34], cx
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x405bf5
sub eax, edx
sar eax, 1
push eax
mov eax, ebx
lea esi, [esp + 0x34]
call fcn.00406660
mov edx, esi
push edx
lea edi, [esp + 0xec]
mov byte [esp + 0x330], 2
call fcn.00405da0
add esp, 4
cmp dword [esp + 0x48], 8
jb 0x405c3e
mov eax, dword [esp + 0x34]
push eax
call fcn.0040d4cc
add esp, 4
mov eax, dword [esp + 0xec]
xor edi, edi
xor ecx, ecx
mov esi, 0x10
mov dword [esp + 0x48], 7
mov dword [esp + 0x44], edi
mov word [esp + 0x34], cx
cmp dword [esp + 0x100], esi
jae 0x405c6f
lea eax, [esp + 0xec]
mov ecx, dword [esp + 0xfc]
push edi
lea edx, [esp + 0x58]
push edx
inc ecx
push ecx
push eax
push ebp
call dword [sym.imp.KERNEL32.dll_WriteFile]
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [esp + 0x100], esi
jb 0x405ca6
mov edx, dword [esp + 0xec]
push edx
call fcn.0040d4cc
add esp, 4
mov dword [esp + 0x100], 0xf
mov dword [esp + 0xfc], edi
mov byte [esp + 0xec], 0
lea eax, [ebx - 0x10]
mov dword [esp + 0x32c], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x405ce7
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [esp + 0x324]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x308]
xor ecx, esp
call fcn.0050c2f2
add esp, 0x31c
ret