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

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x484
mov eax, dword [0x100e008]
and dword [ebp - 0x418], 0
and dword [ebp - 0x41c], 0
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x14]
push ebx
mov ebx, dword [ebp + 0x10]
mov dword [ebp - 0x42c], eax
mov eax, dword [ebp + 0x18]
push esi
mov esi, dword [ebp + 8]
mov dword [ebp - 0x424], eax
mov eax, dword [ebp + 0x20]
push edi
mov edi, dword [ebp + 0xc]
mov dword [ebp - 0x428], eax
call fcn.01004618
and dword [ebp - 0x41c], 0
push dword [ebp + 0x1c]
cmp byte [esi + 0x34], 0
push dword [ebp - 0x424]
sete al
push eax
xor eax, eax
mov al, byte [esi + 0x32]
push eax
lea eax, [ebp - 0x41c]
push eax
push ebx
push edi
lea eax, [ebp - 0x484]
push eax
call fcn.010080eb
push 0xb
pop ecx
mov esi, eax
lea edi, [ebp - 0x458]
xor ebx, ebx
rep movsd dword es:[edi], dword [esi]
cmp dword [ebp - 0x458], ebx
je 0x1002233
push 0x5d
push 7
call fcn.01004a3e
pop ecx
pop ecx
push dword [ebp - 0x458]
push 7
call fcn.01003f59
cmp eax, ebx
mov dword [ebp - 0x418], eax
jne 0x1002723
cmp dword [ebp - 0x430], 0xffffffff
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, dword [sym.imp.msvcrt.dll__itow]
je 0x10024ca
cmp byte [0x100efd8], 0
jne 0x1002376
lea eax, [ebp - 0x414]
push eax
push 0x104
mov byte [0x100efd8], 1
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
test eax, eax
jne 0x10022b7
call esi
mov dword [ebp - 0x418], eax
push 0xa
lea eax, [ebp - 0x20c]
push eax
push dword [ebp - 0x418]
call edi
push 0x2a
push 7
call fcn.01004a3e
lea eax, [ebp - 0x20c]
push eax
push 0x73
push 7
call fcn.01004a3e
add esp, 0x20
cmp dword [ebp - 0x418], ebx
jne 0x1002723
mov ebx, 0x100edd0
push ebx
push 0
push 0x1001328
lea eax, [ebp - 0x414]
push eax
call dword [sym.imp.KERNEL32.dll_GetTempFileNameW]
test eax, eax
jne 0x1002312
call esi
push 0xa
lea ecx, [ebp - 0x20c]
push ecx
push eax
mov dword [ebp - 0x418], eax
call edi
push 0x2a
push 7
call fcn.01004a3e
lea eax, [ebp - 0x20c]
push eax
push 0x73
push 7
call fcn.01004a3e
add esp, 0x20
cmp dword [ebp - 0x418], 0
jne 0x1002723
xor eax, eax
push eax
push 0x8000080
push 2
push eax
push eax
push 0x40000000
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
mov dword [0x100efdc], eax
jne 0x1002376
call esi
mov dword [ebp - 0x418], eax
push 0xa
lea eax, [ebp - 0x20c]
push eax
push dword [ebp - 0x418]
call edi
push 0x36
push 7
call fcn.01004a3e
lea eax, [ebp - 0x20c]
push eax
push 0x73
push 7
call fcn.01004a3e
add esp, 0x20
cmp dword [ebp - 0x418], 0
jne 0x1002723
mov ecx, dword [ebp - 0x430]
mov eax, dword [ebp - 0x41c]
shl ecx, 2
cmp dword [ecx + eax], 0
je 0x1002447
mov dword [ebp - 0x420], ecx
cmp byte [0x10121bc], 0
mov ecx, dword [ebp - 0x420]
mov ebx, dword [ecx + eax]
push ebx
je 0x10023b3
call dword [sym.imp.msvcrt.dll_wcslen]
pop ecx
shl eax, 1
jmp 0x10023cf
push ebx
call fcn.0100c4d9
test eax, eax
je 0x10025d4
mov eax, ebx
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x10023c6
sub eax, edx
push 0
push 0x100edc8
push eax
push ebx
push dword [0x100efdc]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x100242a
call esi
mov dword [ebp - 0x418], eax
push 0xa
lea eax, [ebp - 0x20c]
push eax
push dword [ebp - 0x418]
call edi
push 0x55
push 7
call fcn.01004a3e
lea eax, [ebp - 0x20c]
push eax
push 0x73
push 7
call fcn.01004a3e
add esp, 0x20
cmp dword [ebp - 0x418], 0
jne 0x1002723
add dword [ebp - 0x420], 4
mov eax, dword [ebp - 0x41c]
mov ecx, dword [ebp - 0x420]
cmp dword [ecx + eax], 0
jne 0x1002395
cmp byte [0x10121bc], 0
je 0x1002459
mov eax, 0x100131c
push 4
jmp 0x1002460
mov eax, 0x1001324
push 2
pop ecx
xor ebx, ebx
push ebx
push 0x100edc8
push ecx
push eax
push dword [0x100efdc]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x10024bc
call esi
mov dword [ebp - 0x418], eax
push 0xa
lea eax, [ebp - 0x20c]
push eax
push dword [ebp - 0x418]
call edi
push 0x55
push 7
call fcn.01004a3e
lea eax, [ebp - 0x20c]
push eax
push 0x73
push 7
call fcn.01004a3e
add esp, 0x20
cmp dword [ebp - 0x418], ebx
jne 0x1002723
mov eax, dword [ebp - 0x430]
mov dword [ebp - 0x424], eax
jmp 0x10024d1
or dword [ebp - 0x424], 0xffffffff
mov ecx, dword [ebp - 0x41c]
cmp ecx, ebx
je 0x10026b7
cmp dword [ecx], ebx
mov dword [ebp - 0x420], ebx
je 0x10025e3
mov eax, dword [ebp - 0x420]
cmp eax, dword [ebp - 0x424]
jae 0x10025b7
cmp dword [ebp - 0x424], 1
je 0x10025b7
cmp byte [0x10121bc], 0
mov ebx, dword [ecx + eax*4]
push ebx
je 0x1002524
call dword [sym.imp.msvcrt.dll_wcslen]
pop ecx
shl eax, 1
jmp 0x1002540
push ebx
call fcn.0100c4d9
test eax, eax
je 0x10025d4
mov eax, ebx
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x1002537
sub eax, edx
push 0
push 0x100edc8
push eax
push ebx
push dword [ebp - 0x42c]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x100259b
call esi
mov dword [ebp - 0x418], eax
push 0xa
lea eax, [ebp - 0x414]
push eax
push dword [ebp - 0x418]
call edi
push 0x55
push 7
call fcn.01004a3e
lea eax, [ebp - 0x414]
push eax
push 0x73
push 7
call fcn.01004a3e
add esp, 0x20
cmp dword [ebp - 0x418], 0
jne 0x1002723
inc dword [ebp - 0x420]
mov ecx, dword [ebp - 0x41c]
mov eax, dword [ebp - 0x420]
cmp dword [ecx + eax*4], 0
jne 0x10024ed
xor ebx, ebx
cmp dword [ebp - 0x420], ebx
je 0x10025e3
cmp dword [ebp + 0x1c], ebx
jne 0x10025e3
mov eax, dword [ebp - 0x428]
mov dword [eax], 1
jmp 0x10025eb
mov dword [ebp - 0x418], 8
jmp 0x1002723
mov eax, dword [ebp - 0x428]
mov dword [eax], ebx
mov ecx, dword [ecx]
cmp ecx, ebx
je 0x100269d
cmp byte [0x10121bc], 0
je 0x1002647
mov ebx, dword [sym.imp.msvcrt.dll_wcslen]
push ecx
call ebx
mov ecx, dword [ebp - 0x41c]
mov ecx, dword [ecx]
and word [ecx + eax*2 - 2], 0
mov eax, dword [ebp - 0x41c]
push dword [eax]
call ebx
mov ecx, dword [ebp - 0x41c]
mov ecx, dword [ecx]
and word [ecx + eax*2 - 2], 0
mov eax, dword [ebp - 0x41c]
mov eax, dword [eax]
add eax, 8
push eax
push 0x35
push 0xa
call fcn.01004a3e
add esp, 0x14
jmp 0x100269d
mov eax, ecx
lea edx, [eax + 1]
mov bl, byte [eax]
inc eax
test bl, bl
jne 0x100264c
sub eax, edx
mov byte [ecx + eax - 1], bl
mov eax, dword [ebp - 0x41c]
mov ecx, dword [eax]
mov eax, ecx
lea edx, [eax + 1]
mov bl, byte [eax]
inc eax
test bl, bl
jne 0x1002666
sub eax, edx
mov byte [ecx + eax - 1], bl
mov eax, dword [ebp - 0x41c]
mov eax, dword [eax]
add eax, 4
push eax
call fcn.0100c55c
mov ebx, eax
test ebx, ebx
je 0x100269d
push ebx
push 0x35
push 0xa
call fcn.01004a3e
add esp, 0xc
push ebx
call fcn.0100c41a
push dword [ebp - 0x41c]
lea eax, [ebp - 0x484]
push eax
call fcn.01006b04
xor ebx, ebx
mov dword [ebp - 0x41c], ebx
mov eax, dword [ebp - 0x428]
cmp dword [eax], ebx
je 0x1002723
cmp byte [0x10121bc], 0
je 0x10026d3
mov eax, 0x100131c
push 4
jmp 0x10026da
mov eax, 0x1001324
push 2
pop ecx
push ebx
push 0x100edc8
push ecx
push eax
push dword [ebp - 0x42c]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x1002723
call esi
push 0xa
lea ecx, [ebp - 0x414]
push ecx
push eax
mov dword [ebp - 0x418], eax
call edi
push 0x55
push 7
call fcn.01004a3e
lea eax, [ebp - 0x414]
push eax
push 0x73
push 7
call fcn.01004a3e
add esp, 0x20
cmp dword [ebp - 0x41c], 0
pop edi
pop esi
pop ebx
je 0x1002741
push dword [ebp - 0x41c]
lea eax, [ebp - 0x484]
push eax
call fcn.01006b04
mov ecx, dword [ebp - 4]
mov eax, dword [ebp - 0x418]
call fcn.01005e07
leave
ret 0x1c