Function at 0x1039a51
Capabilities:
Get common file path
Get file size
Query or enumerate registry value
Write file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x748
mov eax, dword [0x103f058]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
xor ebx, ebx
mov dword [ebp - 0x728], eax
cmp dword [0x10416fc], ebx
je 0x1039a92
mov ecx, dword [ebp + 0xc]
cmp ecx, dword [0x1041700]
jg 0x1039f07
cmp dword [eax], 0xffffffff
jne 0x1039f07
push esi
push edi
xor eax, eax
lea ecx, [ebp - 0x738]
push ecx
inc eax
push eax
push ebx
push 0x1002288
push 0x80000001
mov dword [ebp - 0x738], ebx
mov dword [ebp - 0x72c], ebx
xor esi, esi
mov dword [0x10416fc], eax
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
mov edi, dword [sym.imp.KERNEL32.dll_CreateFileA]
test eax, eax
jne 0x1039bf0
lea eax, [ebp - 0x730]
push eax
lea eax, [ebp - 0x108]
push eax
lea eax, [ebp - 0x734]
push eax
push ebx
push 0x10090f4
push dword [ebp - 0x738]
mov dword [ebp - 0x734], 1
mov dword [ebp - 0x730], 0x104
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
jne 0x1039b94
cmp dword [ebp - 0x734], 1
jne 0x1039b94
push ebx
push 0x8000080
push 3
push ebx
push ebx
push 0x80000000
lea eax, [ebp - 0x108]
push eax
mov byte [ebp - 5], bl
call edi
mov dword [ebp - 0x724], eax
cmp eax, 0xffffffff
je 0x1039b69
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
cmp eax, 0xffffffff
jne 0x1039b52
xor eax, eax
push dword [ebp - 0x724]
mov ecx, 0x7a120
cmp ecx, eax
sbb esi, esi
neg esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
cmp esi, ebx
sete al
push ebx
push 0x8000080
lea eax, [eax + eax + 2]
push eax
push ebx
push 1
push 0x40000000
lea eax, [ebp - 0x108]
push eax
call edi
mov ecx, dword [ebp - 0x728]
mov dword [ecx], eax
lea eax, [ebp - 0x730]
push eax
lea eax, [ebp - 0x72c]
push eax
lea eax, [ebp - 0x734]
push eax
push ebx
push 0x10090d8
push dword [ebp - 0x738]
mov dword [ebp - 0x730], 4
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x1039bd2
cmp dword [ebp - 0x734], 4
je 0x1039bd8
mov dword [ebp - 0x72c], ebx
movzx eax, word [ebp - 0x72c]
push dword [ebp - 0x738]
mov dword [0x1041700], eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [ebp - 0x728]
cmp dword [eax], 0xffffffff
jne 0x1039d67
mov eax, dword [0x1041700]
cmp eax, ebx
jne 0x1039c10
push 4
pop eax
mov dword [0x1041700], eax
cmp dword [ebp + 0xc], eax
jg 0x1039d67
push 0x104
lea eax, [ebp - 0x108]
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
test eax, eax
je 0x1039d67
lea eax, [ebp - 0x108]
push eax
call fcn.0102e5ff
push dword [ebp + 0x10]
lea eax, [ebp - 0x108]
push 0x104
push eax
call fcn.0102fc10
test eax, eax
jl 0x1039d67
push ebx
push 0x8000080
push 3
push ebx
push ebx
push 0x80000000
lea eax, [ebp - 0x108]
push eax
call edi
mov dword [ebp - 0x724], eax
cmp eax, 0xffffffff
je 0x1039ca4
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
cmp eax, 0xffffffff
jne 0x1039c8d
xor eax, eax
push dword [ebp - 0x724]
mov ecx, 0x7a120
cmp ecx, eax
sbb esi, esi
neg esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x728]
cmp dword [eax], 0xffffffff
jne 0x1039d67
lea eax, [ebp - 0x20c]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
test eax, eax
je 0x1039d67
lea eax, [ebp - 0x20c]
push eax
call fcn.0102e5ff
push 0x10090cc
push 0x104
lea eax, [ebp - 0x20c]
push eax
call fcn.0102fc10
test eax, eax
jl 0x1039d67
push ebx
push 0x8000080
push 3
push ebx
push ebx
push 0x80000000
lea eax, [ebp - 0x20c]
push eax
call edi
mov dword [ebp - 0x724], eax
cmp eax, 0xffffffff
je 0x1039d3c
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
cmp eax, 0xffffffff
jne 0x1039d25
xor eax, eax
push dword [ebp - 0x724]
mov ecx, 0x7a120
cmp ecx, eax
sbb esi, esi
neg esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
cmp esi, ebx
sete al
push ebx
push 0x8000080
lea eax, [eax + eax + 2]
push eax
push ebx
push 1
push 0x40000000
lea eax, [ebp - 0x20c]
push eax
call edi
mov ecx, dword [ebp - 0x728]
mov dword [ecx], eax
mov eax, dword [ebp - 0x728]
mov eax, dword [eax]
cmp eax, 0xffffffff
je 0x1039f05
cmp esi, ebx
jne 0x1039d87
push 2
push ebx
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
lea eax, [ebp - 0x748]
push eax
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
push dword [0x1041700]
movzx eax, word [ebp - 0x73c]
push eax
movzx eax, word [ebp - 0x73e]
push eax
movzx eax, word [ebp - 0x740]
push eax
movzx eax, word [ebp - 0x742]
push eax
movzx eax, word [ebp - 0x746]
push eax
movzx eax, word [ebp - 0x748]
push eax
push 0x1009070
mov edi, 0x104
lea eax, [ebp - 0x108]
push edi
push eax
call fcn.0103998a
mov esi, dword [sym.imp.KERNEL32.dll_WriteFile]
add esp, 0x28
test eax, eax
jl 0x1039e20
lea eax, [ebp - 0x108]
mov dword [ebp - 0x72c], ebx
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x1039dfd
push ebx
sub eax, edx
lea ecx, [ebp - 0x72c]
push ecx
push eax
lea eax, [ebp - 0x108]
push eax
mov eax, dword [ebp - 0x728]
push dword [eax]
call esi
push 0x7f
lea eax, [ebp - 0x208]
push eax
call fcn.0102e92f
push edx
push eax
call fcn.0102fda1
call fcn.0103061f
push 0x103
lea ecx, [ebp - 0x518]
push ecx
push edx
push eax
call fcn.0102fda1
call dword [sym.imp.KERNEL32.dll_GetSystemDefaultLangID]
movzx eax, ax
mov dword [ebp - 0x724], eax
push edi
lea eax, [ebp - 0x720]
push eax
call fcn.010309b6
test eax, eax
je 0x1039f05
push ebx
push 4
call fcn.0102eaba
mov dword [ebp - 0x730], 0x100906c
test eax, eax
jne 0x1039e91
mov dword [ebp - 0x730], 0x1009068
lea eax, [ebp - 0x720]
push eax
lea eax, [ebp - 0x518]
push eax
movzx eax, word [ebp - 0x724]
push eax
call fcn.010399c5
push eax
lea eax, [ebp - 0x208]
push eax
push dword [ebp - 0x730]
lea eax, [ebp - 0x310]
push 0x1009008
push edi
push eax
call fcn.0103998a
add esp, 0x24
test eax, eax
jl 0x1039f05
lea eax, [ebp - 0x310]
mov dword [ebp - 0x72c], ebx
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x1039ee2
push ebx
sub eax, edx
lea ecx, [ebp - 0x72c]
push ecx
push eax
lea eax, [ebp - 0x310]
push eax
mov eax, dword [ebp - 0x728]
push dword [eax]
call esi
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
pop ebx
call fcn.0102df7d
leave
ret 0xc