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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x224
push ebx
push esi
push edi
lea eax, [esp + 0x20]
push eax
push 0
push 0
push 0x1a
push 0
call dword [sym.imp.SHELL32.dll_SHGetFolderPathA]
lea ecx, [esp + 0x20]
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 0x10012684
lea edi, [esp + 0x20]
sub eax, ecx
mov esi, ecx
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x10012694
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 0x100126b2
sub eax, ecx
push eax
push ebx
lea eax, [esp + 0x28]
call fcn.10007350
lea edx, [esp + 0x20]
push edx
push 0
push 0
push 0x1a
push 0
call dword [sym.imp.SHELL32.dll_SHGetFolderPathA]
lea eax, [esp + 0x20]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAddBackslashA]
mov eax, 0x1005a8f8
mov ecx, eax
jmp 0x100126f0
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x100126f0
lea edi, [esp + 0x20]
sub eax, ecx
mov esi, ecx
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x10012700
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 + 0x38]
push ecx
call esi
mov edi, eax
mov dword [esp + 0x10], edi
cmp edi, 0xffffffff
jne 0x100127de
push 0
push 0x80
push 2
push 0
push 3
push 0xc0000000
lea edx, [esp + 0x38]
push edx
call esi
mov esi, eax
cmp esi, edi
je 0x100127cf
call fcn.10025930
test eax, eax
je 0x100127cf
push 0
lea eax, [esp + 0x18]
push eax
push 1
push str.S:_ML__NRNWNX___LW_
call dword [sym.imp.ADVAPI32.dll_ConvertStringSecurityDescriptorToSecurityDescriptorW]
test eax, eax
je 0x100127cf
lea ecx, [esp + 0x18]
push ecx
mov ecx, dword [esp + 0x18]
lea edx, [esp + 0x14]
push edx
lea eax, [esp + 0x24]
push eax
push ecx
mov dword [esp + 0x20], 0
call dword [sym.imp.ADVAPI32.dll_GetSecurityDescriptorSacl]
test eax, eax
je 0x100127c4
mov edx, dword [esp + 0x10]
push edx
push 0
push 0
push 0
push 0x10
push 1
lea eax, [esp + 0x38]
push eax
call dword [sym.imp.ADVAPI32.dll_SetNamedSecurityInfoA]
mov ecx, dword [esp + 0x14]
push ecx
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov dword [esp + 0x10], esi
cmp esi, 0xffffffff
je 0x10012a7d
mov edi, esi
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]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x100127f3
sub eax, edx
add eax, 0x208
je 0x10012a4e
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 0x10012a4e
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 0x10012848
sub eax, esi
lea edi, [ebx - 1]
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x10012854
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 ecx, [ecx]
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x10012870
mov dx, word [0x100496f8]
push 0x104
mov word [eax], dx
mov cl, byte [0x100496fa]
lea edx, [esp + 0x12c]
push edx
push str.HH:mm:ss
push 0
push 0
push 0x409
mov byte [eax + 2], cl
call dword [sym.imp.KERNEL32.dll_GetTimeFormatA]
lea eax, [esp + 0x128]
mov esi, eax
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x100128b5
sub eax, esi
lea edi, [ebx - 1]
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x100128c1
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 0x100128e0
mov ax, word [0x100496fc]
push 0x104
lea ecx, [esp + 0x12c]
push ecx
push str.dd:MMM:yyyy
push 0
push 0
push 0x409
mov word [edi], ax
call dword [sym.imp.KERNEL32.dll_GetDateFormatA]
lea eax, [esp + 0x128]
mov esi, eax
jmp 0x10012920
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x10012920
sub eax, esi
lea edi, [ebx - 1]
lea esp, [esp]
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x10012930
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 0x10012950
mov edx, dword [str.___]
mov dword [eax], edx
mov cl, byte [0x10049704]
push 0x104
lea edx, [esp + 0x12c]
push edx
push 0
mov byte [eax + 4], cl
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea eax, [esp + 0x128]
mov esi, eax
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x10012987
sub eax, esi
lea edi, [ebx - 1]
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x10012993
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 0x100129b0
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 0x100129d0
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x100129d0
sub eax, edx
mov esi, eax
mov dword [esp + 0x14], 0
je 0x10012a28
mov edi, dword [esp + 0x10]
push 1
push 0
push 0
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
push esi
push 0
push eax
push edi
mov dword [esp + 0x2c], eax
call dword [sym.imp.KERNEL32.dll_LockFile]
push 0
lea eax, [esp + 0x18]
push eax
push esi
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, dword [esp + 0x18]
push 0
push esi
push 0
push ecx
push edi
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 0x10012a4a
push ebx
push 0
call esi
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov edi, dword [esp + 0x10]
cmp edi, 0xffffffff
je 0x10012a7d
mov dword [esp + 0x14], 0
test edi, edi
je 0x10012a7d
lea edx, [esp + 0x14]
push edx
push edi
call dword [sym.imp.KERNEL32.dll_GetHandleInformation]
test eax, eax
je 0x10012a7d
test byte [esp + 0x14], 2
jne 0x10012a7d
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4