Function at 0x4124e0
Capabilities:
Check if file exists
Check mutex on windows
Create process on windows
Delete file
Query environment variable
Self delete
Write and execute a file
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xb8c
cmp byte [0x513234], 0
push ebx
push esi
push edi
je 0x412547
push str.1D6FC66E_D1F3_422C_8A53_C0BBCF3D900D
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
mov dword [0x513238], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push dword [0x513238]
cmp eax, 0xb7
jne 0x412533
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [0x513238], 0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
mov dword [0x513238], 0
jmp 0x412597
push str.FBB4BCC6_05C7_4ADD_B67B_A98A697323C1
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
mov dword [0x513230], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push dword [0x513230]
cmp eax, 0xb7
jne 0x412585
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [0x513230], 0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
mov dword [0x513230], 0
call fcn.00412360
test al, al
je 0x4125ac
call fcn.00412440
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 0x104
lea eax, [ebp - 0x270]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
push 0x104
lea eax, [ebp - 0x270]
push eax
push eax
call dword [sym.imp.KERNEL32.dll_GetShortPathNameA]
push 0x104
lea eax, [ebp - 0x788]
push eax
push str.TEMP
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
mov ebx, dword [sym.imp.KERNEL32.dll_lstrcpyA]
xor ecx, ecx
cmp ecx, eax
lea ecx, [ebp - 0x788]
sbb eax, eax
and eax, ecx
push eax
lea eax, [ebp - 0x168]
push eax
call ebx
mov edi, dword [sym.imp.KERNEL32.dll_lstrcatA]
lea eax, [ebp - 0x168]
push 0x4fff08
push eax
call edi
push str.delself.bat
lea eax, [ebp - 0x168]
push eax
call edi
push str._echo_off_r_n:try_r_ndel__
lea eax, [ebp - 0x680]
push eax
call ebx
lea eax, [ebp - 0x270]
push eax
lea eax, [ebp - 0x680]
push eax
call edi
push str.__r_nif_exist__
lea eax, [ebp - 0x680]
push eax
call edi
lea eax, [ebp - 0x270]
push eax
lea eax, [ebp - 0x680]
push eax
call edi
push str.__goto_try_r_n
lea eax, [ebp - 0x680]
push eax
call edi
push str.del__
lea eax, [ebp - 0x680]
push eax
call edi
lea eax, [ebp - 0x168]
push eax
lea eax, [ebp - 0x680]
push eax
call edi
push 0x500000
lea eax, [ebp - 0x680]
push eax
call edi
lea eax, [ebp - 0x168]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
test eax, eax
je 0x4126be
lea eax, [ebp - 0x168]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
push 0
push 0x80
push 2
push 0
push 3
push 0xc0000000
lea eax, [ebp - 0x168]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
lea ecx, [ebp - 0x680]
mov ebx, eax
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4126e8
push 0
lea eax, [ebp - 4]
sub ecx, edx
push eax
push ecx
lea eax, [ebp - 0x680]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
push ebx
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
push ebx
call esi
push 0x44
lea eax, [ebp - 0x60]
push 0
push eax
call fcn.0042b420
add esp, 0xc
mov dword [ebp - 0x60], 0x44
xor eax, eax
mov dword [ebp - 0x34], 1
mov word [ebp - 0x30], ax
push eax
call dword [sym.imp.KERNEL32.dll_SetLastError]
push 0x500000
lea eax, [ebp - 0xb88]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea eax, [ebp - 0x168]
push eax
lea eax, [ebp - 0xb88]
push eax
call edi
push 0x500000
lea eax, [ebp - 0xb88]
push eax
call edi
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0x60]
push eax
push 0
push 0
push 0
push 0
push 0
push 0
lea eax, [ebp - 0xb88]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
push dword [ebp - 0x10]
call esi
push dword [ebp - 0x14]
call esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret