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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x21c
push ebx
push esi
push edi
lea eax, [esp + 0x18]
push eax
push 0
push 0
push 0x1a
push 0
call dword [sym.imp.SHELL32.dll_SHGetFolderPathA]
lea ecx, [esp + 0x18]
push ecx
call dword [sym.imp.SHLWAPI.dll_PathAddBackslashA]
mov eax, 0x1005a9fc
mov ecx, eax
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x10012374
lea edi, [esp + 0x18]
sub eax, ecx
mov esi, ecx
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x10012384
mov ebx, dword [ebp + 8]
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
mov eax, ebx
rep movsb byte es:[edi], byte [esi]
lea ecx, [eax + 1]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x100123a2
sub eax, ecx
push eax
push ebx
lea eax, [esp + 0x20]
call fcn.10007140
lea edx, [esp + 0x18]
push edx
push 0
push 0
push 0x1a
push 0
call dword [sym.imp.SHELL32.dll_SHGetFolderPathA]
lea eax, [esp + 0x18]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAddBackslashA]
mov eax, 0x1005a8f8
mov ecx, eax
jmp 0x100123e0
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x100123e0
lea edi, [esp + 0x18]
sub eax, ecx
mov esi, ecx
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x100123f0
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
push 0
push 0x80
push 3
push 0
mov ecx, eax
and ecx, 3
push 3
rep movsb byte es:[edi], byte [esi]
mov esi, dword [sym.imp.KERNEL32.dll_CreateFileA]
push 0xc0000000
lea ecx, [esp + 0x30]
push ecx
call esi
mov edi, eax
mov dword [esp + 0xc], edi
cmp edi, 0xffffffff
jne 0x10012457
push 0
push 0x80
push 2
push 0
push 3
push 0xc0000000
lea edx, [esp + 0x30]
push edx
call esi
mov dword [esp + 0xc], eax
cmp eax, edi
je 0x100126fd
mov edi, eax
push 2
xor ecx, ecx
push ecx
push ecx
xor eax, eax
push eax
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
mov eax, ebx
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x10012470
sub eax, edx
add eax, 0x208
je 0x100126ce
lea esi, [eax + 0x13]
and esi, 0xfffffff0
push esi
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ebx, eax
test ebx, ebx
je 0x100126ce
push esi
push 0
push ebx
call sub.MSVCRT.dll_memset
mov eax, dword [ebp + 8]
mov ecx, 7
mov esi, str._n_n
mov edi, ebx
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
add esp, 0xc
mov esi, eax
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x100124c5
sub eax, esi
lea edi, [ebx - 1]
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x100124d1
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea eax, [ebx - 1]
lea ebx, [ebx]
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x100124f0
mov cx, word [0x100496a8]
mov word [eax], cx
mov dl, byte [0x100496aa]
push 0x104
mov byte [eax + 2], dl
lea eax, [esp + 0x124]
push eax
push str.HH:mm:ss
push 0
push 0
push 0x409
call dword [sym.imp.KERNEL32.dll_GetTimeFormatA]
lea eax, [esp + 0x120]
mov esi, eax
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x10012535
sub eax, esi
lea edi, [ebx - 1]
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x10012541
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edi, [ebx - 1]
lea ebx, [ebx]
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x10012560
mov cx, word [0x100496ac]
push 0x104
lea edx, [esp + 0x124]
push edx
push str.dd:MMM:yyyy
push 0
push 0
push 0x409
mov word [edi], cx
call dword [sym.imp.KERNEL32.dll_GetDateFormatA]
lea eax, [esp + 0x120]
mov esi, eax
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x100125a0
sub eax, esi
lea edi, [ebx - 1]
lea esp, [esp]
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x100125b0
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea eax, [ebx - 1]
lea esp, [esp]
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x100125d0
mov ecx, dword [str.___]
mov dword [eax], ecx
mov dl, byte [0x100496b4]
mov byte [eax + 4], dl
push 0x104
lea eax, [esp + 0x124]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea eax, [esp + 0x120]
mov esi, eax
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x10012607
sub eax, esi
lea edi, [ebx - 1]
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x10012613
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edi, [ebx - 1]
lea esp, [esp]
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x10012630
mov ecx, 7
mov esi, str.__n
rep movsd dword es:[edi], dword [esi]
mov eax, ebx
movsw word es:[edi], word [esi]
lea edx, [eax + 1]
jmp 0x10012650
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x10012650
sub eax, edx
mov edi, eax
mov dword [esp + 0x14], 0
je 0x100126a8
mov esi, dword [esp + 0xc]
push 1
push 0
push 0
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
push edi
push 0
push eax
push esi
mov dword [esp + 0x24], eax
call dword [sym.imp.KERNEL32.dll_LockFile]
push 0
lea ecx, [esp + 0x18]
push ecx
push edi
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov edx, dword [esp + 0x10]
push 0
push edi
push 0
push edx
push esi
call dword [sym.imp.KERNEL32.dll_UnlockFile]
mov esi, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push ebx
push 0
call esi
push eax
call dword [sym.imp.KERNEL32.dll_HeapValidate]
test eax, eax
je 0x100126ca
push ebx
push 0
call esi
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov edi, dword [esp + 0xc]
cmp edi, 0xffffffff
je 0x100126fd
mov dword [esp + 0xc], 0
test edi, edi
je 0x100126fd
lea eax, [esp + 0xc]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetHandleInformation]
test eax, eax
je 0x100126fd
test byte [esp + 0xc], 2
jne 0x100126fd
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4