Function at 0x401226
Capabilities:
Check if file exists
Check mutex and terminate process on windows
Check mutex on windows
Create directory
Delete directory
Delete file
Get common file path
Get file attributes
Get file size
Terminate process
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xa5c
push ebx
lea eax, [ebp - 0x65c]
push esi
xor ebx, ebx
push edi
lea ecx, [ebp - 0xa5c]
push 0x200
mov dword [ebp - 0x10], ebx
push ecx
mov dword [ebp - 8], eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
cmp dword [0x40202c], ebx
je 0x4012aa
mov eax, dword [0x40202c]
lea ecx, [ebp - 0x25c]
push eax
push 0x403198
push ecx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
lea ecx, [ebp - 0x25c]
push ecx
push 1
push ebx
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x4012aa
push str.The_application_has_already_run.
lea eax, [ebp - 0x25c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
jmp 0x401642
xor esi, esi
cmp dword [0x40201c], esi
je 0x4012fd
push esi
lea eax, [ebp - 0xa5c]
push esi
push 3
push esi
push 3
push 0x80000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
push esi
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
cmp eax, dword [0x40201c]
jae 0x4012f6
push str.The_file_is_corrupted._It_was_downloaded_with_errors_or_otherwise_damaged._nPlease_download_it_again_and_make_sure_that_you_do_not_have_viruses.
lea eax, [ebp - 0x25c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
jmp 0x401642
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
mov esi, dword [section..rdata]
push 0x28
add esi, eax
lea eax, [ebp - 0x5c]
push eax
call fcn.00401bee
mov eax, dword [0x402024]
mov ecx, dword [esi]
mov eax, dword [eax + esi]
cmp eax, ecx
ja 0x401328
mov eax, ecx
add eax, 0x400
push eax
call fcn.00401bc4
cmp dword [0x402024], 0
mov edi, eax
je 0x4014d2
lea eax, [ebp - 0x25c]
push eax
push 0x200
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
lea eax, [ebp - 0x25c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
cmp byte [ebp + eax - 0x25d], 0x5c
jne 0x401380
lea eax, [ebp - 0x25c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov byte [ebp + eax - 0x25d], 0
lea ecx, [ebp - 0x25c]
lea edx, [ebp - 0x45c]
push dword [ebp - 0x10]
push ecx
push str._sgentee_02X.tmp
push edx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
lea ecx, [ebp - 0x45c]
push 0
push 0
push 2
push 0
push 0
push 0xc0000000
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0xc], eax
cmp eax, 0xffffffff
lea eax, [ebp - 0x45c]
push eax
jne 0x40141e
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
jne 0x4013ff
test ebx, ebx
jne 0x401407
push str.c:_temp
lea eax, [ebp - 0x25c]
push eax
mov ebx, 1
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push 0
lea eax, [ebp - 0x25c]
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
inc dword [ebp - 0x10]
jmp 0x401380
push str.Cannot_create_temporary_directory_
lea eax, [ebp - 0x25c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
jmp 0x401642
lea ecx, [ebp - 0x65c]
xor ebx, ebx
push ecx
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea ecx, [ebp - 0x65c]
push ecx
call dword [sym.imp.KERNEL32.dll_lstrlenA]
push ebx
lea ecx, [ebp - 0x65c]
push ecx
mov byte [ebp + eax - 0x660], bl
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
lea eax, [ebp - 0x5c]
push eax
lea eax, [esi + 4]
push dword [esi]
push edi
push eax
call fcn.004019d5
lea eax, [ebp - 0x65c]
lea ecx, [ebp - 0x85c]
push eax
push str._sgentee.dll
push ecx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
lea ecx, [ebp - 0x85c]
push ebx
push ebx
push 2
push ebx
push ebx
push 0xc0000000
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 4], eax
cmp eax, 0xffffffff
je 0x4014bb
push ebx
lea eax, [ebp - 0x34]
push eax
push dword [esi]
push edi
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4014bb
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x4014e4
push str.Internal_error_:_1__
lea eax, [ebp - 0x25c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
jmp 0x401642
push str.gentee.dll
lea eax, [ebp - 0x85c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea eax, [ebp - 0x85c]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov ebx, eax
test ebx, ebx
jne 0x401518
lea eax, [ebp - 0x85c]
lea ecx, [ebp - 0x25c]
push eax
push str.Cannot_load__s.
push ecx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
jmp 0x401642
push str.ge_init
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.ge_deinit
mov dword [ebp - 0x18], eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.ge_load
mov dword [ebp - 4], eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.ge_call
mov dword [ebp - 0x14], eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
add esi, dword [0x402024]
push 0x28
mov dword [fcn.00403500], eax
lea eax, [ebp - 0x5c]
push eax
call fcn.00401bee
lea eax, [ebp - 0x5c]
push eax
push dword [esi]
push edi
add esi, 4
push esi
call fcn.004019d5
push 0x18
lea eax, [ebp - 0x30]
push eax
call fcn.00401bee
mov dword [ebp - 0x30], 0x18
cmp byte [0x402020], 1
mov eax, 0
lea ecx, [ebp - 0x10]
adc eax, 0xffffffff
and eax, 2
or al, 5
cmp dword [0x402024], 1
mov dword [ebp - 0x20], 0x4011f2
mov dword [ebp - 0x2c], eax
mov eax, 0
adc eax, 0xffffffff
and eax, ecx
lea ecx, [ebp - 0x30]
push ecx
mov dword [ebp - 0x1c], eax
call dword [ebp - 0x18]
cmp dword [edi], 0x4547
je 0x4015e1
push str.Internal_error_:_2__
lea eax, [ebp - 0x25c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
jmp 0x401642
push 0
push 0x27
push edi
call dword [ebp - 0x14]
mov esi, eax
call dword [ebp - 4]
push ebx
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
push edi
call fcn.00401bda
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebx
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
cmp dword [0x402024], 0
je 0x40163b
lea eax, [ebp - 0x45c]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
lea eax, [ebp - 0x85c]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
lea eax, [ebp - 0x65c]
push eax
call dword [sym.imp.KERNEL32.dll_RemoveDirectoryA]
push esi
call dword [sym.imp.KERNEL32.dll_ExitProcess]
lea eax, [ebp - 0xa5c]
lea ecx, [ebp - 0x45c]
push eax
push str.ERROR:
push ecx
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcatA]
push 0x10
lea ecx, [ebp - 0x45c]
push ecx
lea edx, [ebp - 0x25c]
push edx
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
push 0
call dword [sym.imp.KERNEL32.dll_ExitProcess]