Function at 0x40109c
Capabilities:
Check if file exists
Create process on windows
Delete file
Get common file path
Get file attributes
Set registry value

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x1c54
call fcn.00417780
mov eax, dword [0x431c20]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
xor eax, eax
mov esi, 0x206
xor ebx, ebx
push esi
mov word [ebp - reloc.crtdll.dll_sscanf], ax
lea eax, [ebp - 0x3ce]
push ebx
push eax
mov dword [ebp - 0x1c48], ebx
call fcn.004152c0
add esp, 0xc
xor eax, eax
push esi
mov word [ebp - reloc.crtdll.dll_sscanf], ax
lea eax, [ebp - 0xdf6]
push ebx
push eax
call fcn.004152c0
add esp, 0xc
xor eax, eax
push esi
mov word [ebp - reloc.crtdll.dll_sscanf], ax
lea eax, [ebp - 0xbee]
push ebx
push eax
call fcn.004152c0
add esp, 0xc
xor eax, eax
push 7
mov word [ebp - 0x24], ax
pop ecx
lea edi, [ebp - 0x22]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
xor eax, eax
push 0x7e
mov word [ebp - reloc.crtdll.dll_sscanf], ax
lea eax, [ebp - 0x1c6]
push ebx
push eax
call fcn.004152c0
add esp, 0xc
xor eax, eax
push 0x7e
mov word [ebp - 0xc8], ax
lea eax, [ebp - 0xc6]
push ebx
push eax
call fcn.004152c0
add esp, 0xc
xor eax, eax
push 0x7e
mov word [ebp - reloc.crtdll.dll_sscanf], ax
lea eax, [ebp - 0x146]
push ebx
push eax
mov dword [ebp - 0x1c38], ebx
call fcn.004152c0
add esp, 0xc
xor eax, eax
push esi
mov word [ebp - reloc.crtdll.dll_sscanf], ax
lea eax, [ebp - 0x7de]
push ebx
push eax
mov dword [ebp - 0x1c3c], ebx
call fcn.004152c0
add esp, 0xc
xor eax, eax
push 7
mov word [ebp - 0x44], ax
pop ecx
lea edi, [ebp - 0x42]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
xor eax, eax
mov dword [ebp - 0x1c34], ebx
mov word [ebp - reloc.crtdll.dll_sscanf], ax
push esi
lea eax, [ebp - 0x5d6]
push ebx
push eax
call fcn.004152c0
add esp, 0xc
xor eax, eax
push esi
mov word [ebp - reloc.crtdll.dll_sscanf], ax
lea eax, [ebp - 0x9e6]
push ebx
push eax
call fcn.004152c0
add esp, 0xc
push 0x200
lea eax, [ebp - 0x17f8]
push ebx
push eax
call fcn.004152c0
add esp, 0xc
push 1
lea edi, [ebp - 0x17f8]
call fcn.00401a6e
pop ecx
push ebx
lea edi, [ebp - 0x1c30]
mov dword [ebp - 0x1c50], eax
call fcn.00401a6e
pop ecx
mov dword [ebp - 0x1c4c], eax
mov edi, 0x104
push edi
lea eax, [ebp - 0xdf8]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea eax, [ebp - 0x3d0]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
push 0x42b750
lea eax, [ebp - 0x3d0]
push edi
push eax
call fcn.00412ee9
lea eax, [ebp - 0x3d0]
add esp, 0xc
lea ecx, [eax + 2]
mov dx, word [eax]
inc eax
inc eax
cmp dx, bx
jne 0x40125e
mov esi, dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
sub eax, ecx
sar eax, 1
je 0x40128f
lea eax, [ebp - 0x3d0]
push eax
call esi
cmp eax, 0xffffffff
je 0x40128f
lea eax, [ebp - 0x3d0]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
cmp dword [ebp - 0x1c50], ebx
je 0x4014a5
lea eax, [ebp - 0x3d0]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
lea eax, [ebp - 0x1670]
push eax
lea eax, [ebp - 0x3d0]
push edi
push eax
call fcn.00412ee9
add esp, 0xc
push 0x42b768
lea eax, [ebp - 0x3d0]
push edi
push eax
call fcn.00412ee9
lea eax, [ebp - 0x3d0]
add esp, 0xc
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
cmp cx, bx
jne 0x4012de
sub eax, edx
sar eax, 1
je 0x401309
lea eax, [ebp - 0x3d0]
push eax
call esi
cmp eax, 0xffffffff
je 0x401309
lea eax, [ebp - 0x3d0]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
lea eax, [ebp - 0x1650]
push eax
lea eax, [ebp - 0x24]
push 0x10
push eax
call fcn.00412f66
add esp, 0xc
lea ebx, [ebp - 0x3d0]
lea edi, [ebp - 0x1650]
call fcn.00401cb9
mov esi, edi
call fcn.00401d4e
cmp eax, 1
jne 0x401342
xor eax, eax
jmp 0x401a5f
xor eax, eax
movzx ecx, word [ebp + eax - reloc.crtdll.dll_sscanf]
mov word [ebp + eax - reloc.crtdll.dll_sscanf], cx
inc eax
inc eax
test cx, cx
jne 0x401344
xor eax, eax
movzx ecx, word [ebp + eax - reloc.crtdll.dll_sscanf]
mov word [ebp + eax - reloc.crtdll.dll_sscanf], cx
inc eax
inc eax
test cx, cx
jne 0x40135d
lea edi, [ebp - 0x9e8]
dec edi
dec edi
mov ax, word [edi + 2]
inc edi
inc edi
test ax, ax
jne 0x40137c
mov esi, 0x42b774
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
lea eax, [ebp - 0x5d8]
push eax
push 0
movsd dword es:[edi], dword [esi]
mov edi, dword [sym.imp.KERNEL32.dll_OpenEventW]
mov ebx, 0x20000
push ebx
call edi
test eax, eax
je 0x4013fb
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push eax
call esi
lea eax, [ebp - 0x9e8]
push eax
xor eax, eax
push eax
push eax
push eax
call dword [sym.imp.KERNEL32.dll_CreateEventW]
and dword [ebp - 0x1c34], 0
jmp 0x4013eb
cmp dword [ebp - 0x1c34], 5
jge 0x4013fb
push eax
call esi
inc dword [ebp - 0x1c34]
push 0x1f4
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 0x5d8]
push eax
push 0
push ebx
call edi
test eax, eax
jne 0x4013ce
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 0x3d0]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
xor eax, eax
movzx ecx, word [ebp + eax - reloc.crtdll.dll_sscanf]
mov word [ebp + eax - reloc.crtdll.dll_sscanf], cx
inc eax
inc eax
test cx, cx
jne 0x401415
xor eax, eax
movzx ecx, word [ebp + eax - reloc.crtdll.dll_sscanf]
mov word [ebp + eax - 0xc8], cx
inc eax
inc eax
test cx, cx
jne 0x40142e
movzx eax, word [ebp - reloc.crtdll.dll_sscanf]
mov dword [ebp - 0x1c38], eax
xor eax, eax
movzx ecx, word [ebp + eax - reloc.crtdll.dll_sscanf]
mov word [ebp + eax - reloc.crtdll.dll_sscanf], cx
inc eax
inc eax
test cx, cx
jne 0x401454
movzx eax, word [ebp - reloc.crtdll.dll_sscanf]
mov dword [ebp - 0x1c3c], eax
mov eax, dword [ebp - 0x1630]
mov dword [ebp - 0x1c34], eax
lea eax, [ebp - 0x1670]
push eax
lea eax, [ebp - 0x44]
push 0x10
push eax
call fcn.00412f66
add esp, 0xc
xor ebx, ebx
mov edi, 0x104
jmp 0x401554
cmp dword [reloc.crtdll.dll_vsprintf], 3
jne 0x401554
push 0x236
lea eax, [ebp - 0x1a30]
push ebx
push eax
call fcn.004152c0
lea eax, [ebp - 0x1a30]
add esp, 0xc
push eax
call fcn.00401eaf
pop ecx
mov dword [ebp - 0x1c48], eax
cmp eax, ebx
je 0x401554
xor eax, eax
movzx ecx, word [ebp + eax - reloc.crtdll.dll_sscanf]
mov word [ebp + eax - reloc.crtdll.dll_sscanf], cx
inc eax
inc eax
cmp cx, bx
jne 0x4014e0
mov edx, dword [ebp - 0x192a]
lea esi, [ebp - 0xc8]
call fcn.0040219a
movzx eax, word [ebp - reloc.crtdll.dll_sscanf]
mov edx, dword [ebp - 0x1930]
lea esi, [ebp - 0x148]
mov dword [ebp - 0x1c38], eax
call fcn.0040219a
movzx eax, word [ebp - reloc.crtdll.dll_sscanf]
mov dword [ebp - 0x1c3c], eax
mov eax, dword [ebp - 0x1a28]
mov dword [ebp - 0x1c34], eax
lea eax, [ebp - 0x1902]
push eax
lea eax, [ebp - 0x24]
push 0x10
push eax
call fcn.00412f66
add esp, 0xc
cmp dword [ebp - 0x1c4c], ebx
je 0x40163b
xor eax, eax
movzx ecx, word [ebp + eax - reloc.crtdll.dll_sscanf]
mov word [ebp + eax - reloc.crtdll.dll_sscanf], cx
inc eax
inc eax
cmp cx, bx
jne 0x401562
xor eax, eax
movzx ecx, word [ebp + eax - reloc.crtdll.dll_sscanf]
mov word [ebp + eax - 0xc8], cx
inc eax
inc eax
cmp cx, bx
jne 0x40157b
movzx eax, word [ebp - reloc.crtdll.dll_sscanf]
mov dword [ebp - 0x1c38], eax
xor eax, eax
movzx ecx, word [eax + reloc.crtdll.dll_sscanf]
mov word [ebp + eax - reloc.crtdll.dll_sscanf], cx
inc eax
inc eax
cmp cx, bx
jne 0x4015a1
cmp dword [reloc.crtdll.dll_vsprintf], 3
movzx esi, word [ebp - reloc.crtdll.dll_sscanf]
mov dword [ebp - 0x1c34], 5
lea eax, [ebp - 0x7e0]
je 0x4015e1
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
jmp 0x4015fe
push edi
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
push 0x42b878
lea eax, [ebp - 0x7e0]
push edi
push eax
call fcn.00412ee9
add esp, 0xc
xor eax, eax
movzx ecx, word [ebp + eax - reloc.crtdll.dll_sscanf]
mov word [ebp + eax - reloc.crtdll.dll_sscanf], cx
inc eax
inc eax
cmp cx, bx
jne 0x401600
push 0x42b79c
lea eax, [ebp - 0xbf0]
push edi
push eax
call fcn.00412ee9
add esp, 0xc
lea eax, [ebp - 0xbf0]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
jmp 0x401641
mov esi, dword [ebp - 0x1c3c]
push 0x200
lea eax, [ebp - 0x17f8]
push ebx
push eax
call fcn.004152c0
add esp, 0xc
push 0x51
pop eax
mov word [ebp - reloc.crtdll.dll_sscanf], ax
mov dword [ebp - 0x17f8], 0x504d534d
xor eax, eax
movzx ecx, word [eax + reloc.crtdll.dll_sscanf]
mov word [ebp + eax - reloc.crtdll.dll_sscanf], cx
inc eax
inc eax
cmp cx, bx
jne 0x40166c
mov edi, 0x2b70
mov eax, edi
mov word [ebp - reloc.crtdll.dll_sscanf], ax
xor eax, eax
movzx ecx, word [eax + reloc.crtdll.dll_sscanf]
mov word [ebp + eax - reloc.crtdll.dll_sscanf], cx
inc eax
inc eax
cmp cx, bx
jne 0x401692
xor eax, eax
movzx ecx, word [eax + reloc.crtdll.dll_sscanf]
mov word [ebp + eax - reloc.crtdll.dll_sscanf], cx
inc eax
inc eax
cmp cx, bx
jne 0x4016aa
mov dword [ebp - 0x1630], 5
cmp dword [ebp - 0x1c50], ebx
jne 0x4016e2
cmp dword [ebp - 0x1c48], ebx
jne 0x4016e2
cmp dword [ebp - 0x1c4c], ebx
je 0x401759
lea eax, [ebp - 0x1c8]
push eax
lea eax, [ebp - 0x1772]
push 0x10
push eax
call fcn.00412f66
add esp, 0xc
lea eax, [ebp - 0xc8]
push eax
lea eax, [ebp - 0x17f4]
push reloc.shlwapi.dll_PathAppendA
push eax
call fcn.00412f66
mov ax, word [ebp - reloc.crtdll.dll_sscanf]
mov word [ebp - reloc.crtdll.dll_sscanf], ax
add esp, 0xc
lea eax, [ebp - 0x148]
push eax
lea eax, [ebp - 0x1752]
push reloc.shlwapi.dll_PathAppendA
push eax
call fcn.00412f66
mov eax, dword [ebp - 0x1c34]
add esp, 0xc
mov word [ebp - reloc.crtdll.dll_sscanf], si
mov dword [ebp - 0x1630], eax
cmp eax, ebx
jne 0x401759
mov dword [ebp - 0x1630], 5
mov edx, 0x42b7b4
lea eax, [ebp - 0x17f4]
mov cx, word [eax]
cmp cx, word [edx]
jne 0x40178a
cmp cx, bx
je 0x401786
mov cx, word [eax + 2]
cmp cx, word [edx + 2]
jne 0x40178a
add eax, 4
add edx, 4
cmp cx, bx
jne 0x401764
xor eax, eax
jmp 0x40178f
sbb eax, eax
sbb eax, 0xffffffff
cmp eax, ebx
jne 0x40179d
cmp word [ebp - reloc.crtdll.dll_sscanf], 0x51
je 0x4017e8
xor eax, eax
movzx ecx, word [eax + reloc.crtdll.dll_sscanf]
mov word [ebp + eax - reloc.crtdll.dll_sscanf], cx
inc eax
inc eax
cmp cx, bx
jne 0x40179f
push 0x51
pop eax
mov word [ebp - reloc.crtdll.dll_sscanf], ax
mov dword [ebp - 0x1630], 5
mov word [ebp - reloc.crtdll.dll_sscanf], di
xor eax, eax
movzx ecx, word [eax + reloc.crtdll.dll_sscanf]
mov word [ebp + eax - reloc.crtdll.dll_sscanf], cx
inc eax
inc eax
cmp cx, bx
jne 0x4017d2
cmp word [ebp - reloc.crtdll.dll_sscanf], bx
je 0x401a5c
cmp word [ebp - reloc.crtdll.dll_sscanf], bx
jbe 0x401a5c
mov dword [ebp - 0x17f8], 0x504d534d
call dword [sym.imp.KERNEL32.dll_GetTickCount]
push eax
call fcn.00412fd5
xor eax, eax
mov word [ebp - reloc.crtdll.dll_sscanf], ax
mov dword [esp], 0x7fe
lea eax, [ebp - 0x15f6]
push ebx
push eax
call fcn.004152c0
add esp, 0xc
cmp word [ebp - reloc.crtdll.dll_sscanf], bx
jne 0x40186a
lea eax, [ebp - 0x15f8]
push eax
call fcn.004021ff
pop ecx
lea eax, [ebp - 0x15f8]
push eax
push 0x10
pop esi
lea eax, [ebp - 0x16d0]
push esi
push eax
call fcn.00412f66
add esp, 0xc
jmp 0x40186d
push 0x10
pop esi
cmp word [ebp - reloc.crtdll.dll_sscanf], bx
jne 0x40189a
lea eax, [ebp - 0x15f8]
push eax
call fcn.004021ff
pop ecx
lea eax, [ebp - 0x15f8]
push eax
lea eax, [ebp - 0x16b0]
push esi
push eax
call fcn.00412f66
add esp, 0xc
lea eax, [ebp - 0x44]
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
cmp cx, bx
jne 0x4018a0
sub eax, edx
sar eax, 1
je 0x4018d8
lea eax, [ebp - 0x44]
push eax
push ebx
push 0x20000
call dword [sym.imp.KERNEL32.dll_OpenEventW]
test eax, eax
je 0x4018d8
lea eax, [ebp - 0x44]
push eax
lea eax, [ebp - 0x1670]
push esi
push eax
call fcn.00412f66
add esp, 0xc
cmp word [ebp - reloc.crtdll.dll_sscanf], bx
jne 0x401905
lea eax, [ebp - 0x15f8]
push eax
call fcn.004021ff
pop ecx
lea eax, [ebp - 0x15f8]
push eax
lea eax, [ebp - 0x1670]
push esi
push eax
call fcn.00412f66
add esp, 0xc
cmp word [ebp - reloc.crtdll.dll_sscanf], bx
jne 0x40195c
lea eax, [ebp - 0x15f8]
push eax
call fcn.004021ff
pop ecx
lea eax, [ebp - 0x15f8]
push eax
lea eax, [ebp - 0x1650]
push esi
push eax
call fcn.00412f66
lea eax, [ebp - 0x24]
add esp, 0xc
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
cmp cx, bx
jne 0x401938
sub eax, edx
sar eax, 1
je 0x40195c
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp - 0x1650]
push esi
push eax
call fcn.00412f66
add esp, 0xc
cmp word [ebp - reloc.crtdll.dll_sscanf], bx
jne 0x401989
lea eax, [ebp - 0x15f8]
push eax
call fcn.004021ff
pop ecx
lea eax, [ebp - 0x15f8]
push eax
lea eax, [ebp - 0x1690]
push esi
push eax
call fcn.00412f66
add esp, 0xc
mov dword [ebp - 0x162c], 0x1000265
cmp dword [ebp - 0x1630], ebx
jne 0x4019a5
mov dword [ebp - 0x1630], 5
lea eax, [ebp - 0x17f8]
push eax
call fcn.004022ab
pop ecx
test eax, eax
je 0x401a5c
lea ebx, [ebp - 0x3d0]
lea edi, [ebp - 0x1650]
call fcn.00401cb9
mov eax, ebx
push eax
lea eax, [ebp - 0xdf8]
push eax
call fcn.004023f4
pop ecx
pop ecx
lea eax, [ebp - 0x1c44]
push eax
push 3
xor esi, esi
push esi
push 0x42b7e0
push closesocket
mov dword [ebp - 0x1c44], esi
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x401a45
mov eax, ebx
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
cmp cx, si
jne 0x401a07
sub eax, edx
sar eax, 1
lea eax, [eax + eax + 2]
push eax
lea eax, [ebp - 0x3d0]
push eax
push 1
push esi
push 0x42b84c
push dword [ebp - 0x1c44]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
test eax, eax
jne 0x401a45
push dword [ebp - 0x1c44]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push 1
push esi
push 0x42b998
lea eax, [ebp - 0x3d0]
push eax
push esi
push esi
call dword [sym.imp.SHELL32.dll_ShellExecuteW]
xor eax, eax
inc eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00412eda
leave
ret