Function at 0x403020
Capabilities:
Get common file path
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x12b0
call fcn.00416680
mov eax, dword [0x42603c]
xor eax, ebp
mov dword [ebp - 8], eax
cmp byte [0x4288f6], 1
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
mov dword [ebp - 0x12a4], eax
jne 0x4033b9
xor ecx, ecx
push 0x206
push ecx
lea edx, [ebp - 0x41a]
push edx
mov word [ebp - 0x41c], cx
call fcn.00414930
add esp, 0xc
xor eax, eax
push 0x206
push eax
lea ecx, [ebp - 0x82a]
push ecx
mov word [ebp - 0x82c], ax
call fcn.00414930
add esp, 0xc
push 0x104
lea edx, [ebp - 0x82c]
push edx
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
xor eax, eax
movzx ecx, word [ebp + eax - 0x82c]
mov word [ebp + eax - 0x41c], cx
add eax, 2
test cx, cx
jne 0x4030a0
mov eax, str.DebugSMR7RMSLog
mov edx, eax
nop
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x4030c0
lea edi, [ebp - 0x41c]
sub eax, edx
add edi, 0xfffffffe
mov cx, word [edi + 2]
add edi, 2
test cx, cx
jne 0x4030d6
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
lea eax, [ebp - 0x41c]
and ecx, 3
push 0
push eax
rep movsb byte es:[edi], byte [esi]
call fcn.0040e7ad
add esp, 8
cmp eax, 0xffffffff
jne 0x403113
lea ebx, [ebp - 0x41c]
call fcn.00402e50
xor ecx, ecx
push 0x206
push ecx
lea edx, [ebp - 0x212]
push edx
mov dword [ebp - 0x12a0], 0
mov word [ebp - 0x214], cx
call fcn.00414930
add esp, 0xc
xor eax, eax
push 0x206
push eax
lea ecx, [ebp - 0x622]
push ecx
mov word [ebp - 0x624], ax
call fcn.00414930
add esp, 0xc
xor eax, eax
jmp 0x403160
movzx ecx, word [ebp + eax - 0x41c]
mov word [ebp + eax - 0x214], cx
add eax, 2
test cx, cx
jne 0x403160
lea eax, [ebp - 0x214]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x403181
mov edi, dword [sym.imp.KERNEL32.dll_GetLocalTime]
sub eax, edx
lea edx, [ebp - 0x103c]
sar eax, 1
push edx
mov esi, eax
call edi
push 0x104
lea eax, [ebp - 0x624]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
movzx ecx, word [ebp - 0x1036]
movzx edx, word [ebp - 0x103a]
movzx eax, word [ebp - 0x103c]
mov ebx, dword [sym.imp.USER32.dll_wsprintfW]
push ecx
push edx
push eax
lea ecx, [ebp + esi*2 - 0x214]
push str._04u_02u_02u.log
push ecx
call ebx
mov esi, dword [sym.imp.KERNEL32.dll_CreateFileW]
add esp, 0x14
push 0
push 0x8000080
push 3
push 0
push 1
push 0x80000000
lea edx, [ebp - 0x214]
push edx
call esi
cmp eax, 0xffffffff
jne 0x403230
push 0
push 0x8000080
push 1
push 0
push 1
push 0x80000000
lea eax, [ebp - 0x214]
push eax
call esi
mov dword [ebp - 0x12a0], 1
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp - 0x214]
push str.ab___ccsUNICODE
push ecx
call fcn.0040df9c
mov esi, eax
add esp, 8
test esi, esi
jne 0x403264
xor al, al
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.0040d7f6
mov esp, ebp
pop ebp
ret
cmp dword [ebp - 0x12a0], 1
jne 0x40328c
push esi
push 2
lea edx, [ebp - 0x12a0]
push 1
push edx
mov word [ebp - 0x12a0], 0xfeff
call fcn.0040eaa5
add esp, 0x10
jmp 0x403299
push 2
push 0
push esi
call fcn.0040ed19
add esp, 0xc
xor eax, eax
push 0x7fe
push eax
lea ecx, [ebp - 0x102a]
push ecx
mov word [ebp - 0x102c], ax
call fcn.00414930
add esp, 0xc
lea edx, [ebp - 0x103c]
push edx
call edi
lea eax, [ebp - 0x129c]
push eax
lea ecx, [ebp - 0x624]
push ecx
call dword [sym.imp.KERNEL32.dll_FindFirstFileW]
lea edx, [ebp - 0x12ac]
mov edi, eax
push edx
lea eax, [ebp - 0x1288]
push eax
call dword [sym.imp.KERNEL32.dll_FileTimeToLocalFileTime]
lea ecx, [ebp - 0x104c]
push ecx
lea edx, [ebp - 0x12ac]
push edx
call dword [sym.imp.KERNEL32.dll_FileTimeToSystemTime]
movzx ecx, word [ebp - 0x102e]
mov eax, dword [ebp - 0x12a4]
movzx edx, word [ebp - 0x1030]
push eax
movzx eax, word [ebp - 0x1032]
push ecx
movzx ecx, word [ebp - 0x1034]
push edx
movzx edx, word [ebp - 0x1036]
push eax
movzx eax, word [ebp - 0x103a]
push ecx
movzx ecx, word [ebp - 0x103c]
push edx
movzx edx, word [ebp - 0x1042]
push eax
movzx eax, word [ebp - 0x1044]
push ecx
movzx ecx, word [ebp - 0x1046]
push edx
movzx edx, word [ebp - 0x104a]
push eax
movzx eax, word [ebp - 0x104c]
push ecx
push edx
cdq
mov ecx, 0x7d0
idiv ecx
push edx
lea edx, [ebp - 0x102c]
push 0x41bde0
push edx
call ebx
lea eax, [ebp - 0x102c]
add esp, 0x3c
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x403387
sub eax, edx
sar eax, 1
push esi
push eax
lea eax, [ebp - 0x102c]
push 2
push eax
call fcn.0040eaa5
add esp, 0x10
push edi
call dword [sym.imp.KERNEL32.dll_FindClose]
push esi
call fcn.0040ee65
add esp, 4
mov ecx, dword [ebp - 8]
pop edi
pop esi
xor ecx, ebp
mov al, 1
pop ebx
call fcn.0040d7f6
mov esp, ebp
pop ebp
ret