Function at 0x10012a90
Capabilities:
Check if file exists
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
push 0x1004fb50
mov dword [esp + 0x14], 0
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov ebx, dword [sym.imp.SHELL32.dll_SHGetFolderPathA]
lea eax, [esp + 0x20]
push eax
push 0
push 0
push 0x1a
push 0
call ebx
lea ecx, [esp + 0x20]
push ecx
call dword [sym.imp.SHLWAPI.dll_PathAddBackslashA]
mov eax, 0x1005a8f8
mov ecx, eax
lea esp, [esp]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x10012ae0
lea edi, [esp + 0x20]
sub eax, ecx
mov esi, ecx
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x10012af0
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
lea edx, [esp + 0x20]
and ecx, 3
push edx
rep movsb byte es:[edi], byte [esi]
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
test eax, eax
jne 0x10012b8b
lea eax, [esp + 0x128]
push eax
push 0
push 0
push 0x1a
push 0
call ebx
lea ecx, [esp + 0x128]
push ecx
call dword [sym.imp.SHLWAPI.dll_PathAddBackslashA]
mov eax, 0x1005a9fc
mov ecx, eax
lea esp, [esp]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x10012b40
lea edi, [esp + 0x128]
sub eax, ecx
mov esi, ecx
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x10012b53
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
push 1
and ecx, 3
push 0
lea eax, [esp + 0x130]
rep movsb byte es:[edi], byte [esi]
call fcn.100074a0
mov dword [esp + 0x10], eax
test eax, eax
je 0x10012df9
push eax
call fcn.10012650
mov edi, dword [sym.imp.KERNEL32.dll_CreateFileA]
xor ebx, ebx
push ebx
push 0x80
push 3
push ebx
push 3
push 0x40000000
lea edx, [esp + 0x38]
push edx
call edi
mov esi, eax
mov dword [esp + 0xc], eax
cmp esi, 0xffffffff
jne 0x10012c48
push ebx
push 0x80
push 2
push ebx
push 3
push 0xc0000000
lea eax, [esp + 0x38]
push eax
call edi
mov esi, eax
cmp esi, 0xffffffff
je 0x10012c3b
call fcn.10025930
test eax, eax
je 0x10012c3b
push ebx
lea ecx, [esp + 0x1c]
push ecx
push 1
push str.S:_ML__NRNWNX___LW_
call dword [sym.imp.ADVAPI32.dll_ConvertStringSecurityDescriptorToSecurityDescriptorW]
test eax, eax
je 0x10012c3b
lea edx, [esp + 0x14]
push edx
mov edx, dword [esp + 0x1c]
lea eax, [esp + 0x10]
push eax
lea ecx, [esp + 0x24]
push ecx
push edx
mov dword [esp + 0x1c], ebx
call dword [sym.imp.ADVAPI32.dll_GetSecurityDescriptorSacl]
test eax, eax
je 0x10012c30
mov eax, dword [esp + 0xc]
push eax
push ebx
push ebx
push ebx
push 0x10
push 1
lea ecx, [esp + 0x38]
push ecx
call dword [sym.imp.ADVAPI32.dll_SetNamedSecurityInfoA]
mov edx, dword [esp + 0x18]
push edx
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov dword [esp + 0xc], esi
cmp esi, 0xffffffff
je 0x10012da0
push 2
push ebx
xor ecx, ecx
push ecx
xor eax, eax
push eax
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
cmp dword [ebp + 0xc], ebx
je 0x10012e0d
mov eax, dword [ebp + 8]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x10012c67
sub eax, edx
add eax, 0xc
cmp eax, ebx
je 0x10012da0
lea edi, [eax + 0x13]
and edi, 0xfffffff0
push edi
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 0x10012da0
push edi
push 0
push ebx
call sub.MSVCRT.dll_memset
mov eax, dword [str._pst_]
mov dword [ebx], eax
mov cx, word [0x1004972c]
mov eax, dword [ebp + 8]
add esp, 0xc
mov word [ebx + 4], cx
mov esi, eax
mov edi, edi
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x10012cc0
sub eax, esi
lea edi, [ebx - 1]
lea esp, [esp]
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x10012cd0
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 0x10012cf0
mov edx, dword [str.__pst_]
mov dword [eax], edx
mov cx, word [0x10049734]
mov word [eax + 4], cx
mov dl, byte [0x10049736]
mov byte [eax + 6], dl
mov eax, ebx
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x10012d20
sub eax, edx
mov esi, eax
mov dword [esp + 0x18], 0
je 0x10012d78
mov edi, dword [esp + 0xc]
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 + 0x28], eax
call dword [sym.imp.KERNEL32.dll_LockFile]
push 0
lea eax, [esp + 0x1c]
push eax
push esi
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, dword [esp + 0x14]
push 0
push esi
push 0
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_UnlockFile]
push ebx
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapValidate]
test eax, eax
je 0x10012d9c
push ebx
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov esi, dword [esp + 0xc]
mov ebx, dword [esp + 0x10]
test ebx, ebx
je 0x10012dca
mov edi, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push ebx
push 0
call edi
push eax
call dword [sym.imp.KERNEL32.dll_HeapValidate]
test eax, eax
je 0x10012dca
push ebx
push 0
call edi
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
cmp esi, 0xffffffff
je 0x10012df9
mov dword [esp + 0x10], 0
test esi, esi
je 0x10012df9
lea ecx, [esp + 0x10]
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_GetHandleInformation]
test eax, eax
je 0x10012df9
test byte [esp + 0x10], 2
jne 0x10012df9
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x1004fb50
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov edx, dword [ebp + 8]
mov eax, edx
lea edi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x10012e15
sub eax, edi
mov edi, eax
mov dword [esp + 0x14], ebx
cmp edx, ebx
je 0x10012da0
cmp edi, ebx
je 0x10012da0
push 1
push ebx
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
push edi
push 0
mov ebx, eax
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_LockFile]
mov eax, dword [ebp + 8]
push 0
lea edx, [esp + 0x18]
push edx
push edi
push eax
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push 0
push edi
push 0
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_UnlockFile]
jmp 0x10012da0