Function at 0x40b390
Capabilities:
Check mutex on windows
Create thread
Delete file
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x47f9c3
mov eax, dword fs:[0]
push eax
sub esp, 0x1cc
mov eax, dword [0x49b024]
xor eax, ebp
mov dword [ebp - 0x10], eax
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x1c8], ecx
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x148], eax
cmp dword [ebp + 0x10], 0xa
jle 0x40b3da
mov dword [ebp - 0x148], 0xa
mov dword [ebp - 0x34], 0
mov dword [ebp - 0x38], 0
mov dword [ebp - 0x16c], 0
mov dword [ebp - 0x168], 0
mov ecx, dword [ebp + 8]
push ecx
lea ecx, [ebp - 0x2c]
call fcn.004086f0
mov dword [ebp - 0x1cc], eax
mov edx, dword [ebp - 0x1cc]
mov dword [ebp - 0x1d0], edx
mov dword [ebp - 4], 0
mov eax, dword [ebp - 0x1d0]
push eax
lea ecx, [ebp - 0x164]
push ecx
call fcn.0040a9f0
add esp, 8
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x2c]
call fcn.00408830
push 0
push 0
push 0
lea ecx, [ebp - 0x164]
call fcn.00409b80
push eax
mov ecx, dword [ebp - 0x1c8]
call fcn.0040cb10
movzx edx, al
test edx, edx
jne 0x40b48b
mov byte [ebp - 0x199], 0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x164]
call fcn.00409b30
mov al, byte [ebp - 0x199]
jmp 0x40ba62
lea eax, [ebp - 0x38]
push eax
mov ecx, dword [ebp - 0x1c8]
call fcn.0040c2a0
movzx ecx, al
test ecx, ecx
jne 0x40b4d2
mov edx, dword [ebp - 0x1c8]
mov dword [edx + 0x28], 4
mov byte [ebp - 0x19a], 0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x164]
call fcn.00409b30
mov al, byte [ebp - 0x19a]
jmp 0x40ba62
mov ecx, dword [ebp - 0x1c8]
call fcn.0040acc0
mov al, byte [0x48ad3e]
mov byte [ebp - 0x144], al
push 0x103
push 0
lea ecx, [ebp - 0x143]
push ecx
call fcn.00437410
add esp, 0xc
mov edx, dword [ebp + 0xc]
push edx
push 0x48e3e0
push 0x104
lea eax, [ebp - 0x144]
push eax
call fcn.0042eddb
add esp, 0x10
lea ecx, [ebp - 0x144]
push ecx
call dword [sym.imp.SHLWAPI.dll_PathRemoveExtensionA]
mov byte [ebp - 0x2d], 0
cmp dword [ebp - 0x38], 0
jbe 0x40ba41
mov eax, dword [ebp - 0x38]
xor edx, edx
div dword [ebp - 0x148]
mov dword [ebp - 0x178], eax
mov dword [ebp - 0x174], 0
mov dword [ebp - 0x17c], 1
jmp 0x40b56c
mov edx, dword [ebp - 0x17c]
add edx, 1
mov dword [ebp - 0x17c], edx
mov eax, dword [ebp - 0x17c]
cmp eax, dword [ebp - 0x148]
ja 0x40b6de
mov dword [ebp - 0x1a0], 0x21c
mov ecx, dword [ebp - 0x1a0]
push ecx
call fcn.0042fa5e
add esp, 4
mov dword [ebp - 0x1a4], eax
cmp dword [ebp - 0x1a4], 0
je 0x40b5cc
mov edx, dword [ebp - 0x1a0]
push edx
push 0
mov eax, dword [ebp - 0x1a4]
push eax
call fcn.00437410
add esp, 0xc
mov ecx, dword [ebp - 0x1a4]
mov dword [ebp - 0x1d4], ecx
jmp 0x40b5d6
mov dword [ebp - 0x1d4], 0
mov edx, dword [ebp - 0x1d4]
mov dword [ebp - 0x180], edx
mov eax, dword [ebp + 8]
push eax
push 0x48e3e4
push 0x104
mov ecx, dword [ebp - 0x180]
push ecx
call fcn.0042eddb
add esp, 0x10
mov edx, dword [ebp - 0x17c]
push edx
lea eax, [ebp - 0x144]
push eax
push str._s__d.temp
push 0x104
mov ecx, dword [ebp - 0x180]
add ecx, 0x104
push ecx
call fcn.0042eddb
add esp, 0x14
mov edx, dword [ebp - 0x180]
mov byte [edx + 0x218], 0
mov eax, dword [ebp - 0x180]
mov ecx, dword [ebp - 0x17c]
mov dword [eax + 0x208], ecx
mov edx, dword [ebp - 0x180]
mov eax, dword [ebp - 0x174]
mov dword [edx + 0x20c], eax
mov ecx, dword [ebp - 0x38]
sub ecx, dword [ebp - 0x174]
cmp ecx, dword [ebp - 0x178]
jbe 0x40b69a
mov edx, dword [ebp - 0x38]
sub edx, dword [ebp - 0x174]
mov eax, dword [ebp - 0x178]
shl eax, 1
cmp edx, eax
jae 0x40b69a
mov ecx, dword [ebp - 0x38]
sub ecx, dword [ebp - 0x174]
mov edx, dword [ebp - 0x180]
mov dword [edx + 0x214], ecx
jmp 0x40b6ac
mov eax, dword [ebp - 0x180]
mov ecx, dword [ebp - 0x178]
mov dword [eax + 0x214], ecx
mov edx, dword [ebp - 0x180]
mov eax, dword [ebp - 0x174]
add eax, dword [edx + 0x214]
mov dword [ebp - 0x174], eax
lea ecx, [ebp - 0x180]
push ecx
mov ecx, dword [ebp - 0x1c8]
add ecx, 0x2c
call fcn.0040d090
jmp 0x40b55d
mov dword [ebp - 0x184], 0
jmp 0x40b6f9
mov edx, dword [ebp - 0x184]
add edx, 1
mov dword [ebp - 0x184], edx
mov eax, dword [ebp - 0x184]
cmp eax, dword [ebp - 0x148]
jae 0x40b734
push 0
push 0
mov ecx, dword [ebp - 0x184]
push ecx
mov ecx, dword [ebp - 0x1c8]
add ecx, 0x2c
call fcn.0040d060
mov edx, dword [eax]
push edx
push 0x40ca40
push 0
push 0
call dword [sym.imp.KERNEL32.DLL_CreateThread]
jmp 0x40b6ea
push 0x48ad3f
push 0
push 0
call dword [sym.imp.KERNEL32.DLL_CreateMutexA]
mov dword [0x49e714], eax
push 0
push 0x80
push 2
push 0
push 2
push 0x40000000
mov eax, dword [ebp + 0xc]
push eax
call dword [sym.imp.KERNEL32.DLL_CreateFileA]
mov dword [ebp - 0x170], eax
cmp dword [ebp - 0x170], 0xffffffff
jne 0x40b7a4
mov ecx, dword [ebp - 0x1c8]
mov dword [ecx + 0x28], 7
mov byte [ebp - 0x1a5], 0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x164]
call fcn.00409b30
mov al, byte [ebp - 0x1a5]
jmp 0x40ba62
push 0
push 0
mov edx, dword [ebp - 0x38]
push edx
mov eax, dword [ebp - 0x170]
push eax
call dword [sym.imp.KERNEL32.DLL_SetFilePointer]
mov ecx, dword [ebp - 0x170]
push ecx
call dword [sym.imp.KERNEL32.DLL_SetEndOfFile]
push 0
push 0
push 0
mov edx, dword [ebp - 0x170]
push edx
call dword [sym.imp.KERNEL32.DLL_SetFilePointer]
push 0xffffffffffffffff
mov eax, dword [0x49e714]
push eax
call dword [sym.imp.KERNEL32.DLL_WaitForSingleObject]
mov dword [ebp - 0x18c], eax
lea ecx, [ebp - 0x188]
push ecx
mov ecx, dword [ebp - 0x1c8]
add ecx, 0x2c
call fcn.0040cfe0
jmp 0x40b818
push 0
lea edx, [ebp - 0x1ac]
push edx
lea ecx, [ebp - 0x188]
call fcn.0040d220
lea eax, [ebp - 0x1b0]
push eax
mov ecx, dword [ebp - 0x1c8]
add ecx, 0x2c
call fcn.0040d010
push eax
lea ecx, [ebp - 0x188]
call fcn.00423070
movzx ecx, al
test ecx, ecx
je 0x40b9f2
lea ecx, [ebp - 0x188]
call fcn.0040d200
mov edx, dword [eax]
movzx eax, byte [edx + 0x218]
test eax, eax
je 0x40b9ed
mov dword [ebp - 0x190], 0
push 0
push 0
lea ecx, [ebp - 0x188]
call fcn.0040d200
mov ecx, dword [eax]
mov edx, dword [ecx + 0x20c]
push edx
mov eax, dword [ebp - 0x170]
push eax
call dword [sym.imp.KERNEL32.DLL_SetFilePointer]
push 0
push 0x80
push 3
push 0
push 1
push 1
lea ecx, [ebp - 0x188]
call fcn.0040d200
mov ecx, dword [eax]
add ecx, 0x104
push ecx
call dword [sym.imp.KERNEL32.DLL_CreateFileA]
mov dword [ebp - 0x198], eax
lea ecx, [ebp - 0x188]
call fcn.0040d200
mov edx, dword [eax]
mov eax, dword [edx + 0x214]
mov dword [ebp - 0x1b4], eax
mov ecx, dword [ebp - 0x1b4]
push ecx
call fcn.0042f601
add esp, 4
mov dword [ebp - 0x1b8], eax
cmp dword [ebp - 0x1b8], 0
je 0x40b91b
mov edx, dword [ebp - 0x1b4]
push edx
push 0
mov eax, dword [ebp - 0x1b8]
push eax
call fcn.00437410
add esp, 0xc
mov ecx, dword [ebp - 0x1b8]
mov dword [ebp - 0x1d8], ecx
jmp 0x40b925
mov dword [ebp - 0x1d8], 0
mov edx, dword [ebp - 0x1d8]
mov dword [ebp - 0x194], edx
push 0
lea eax, [ebp - 0x190]
push eax
lea ecx, [ebp - 0x188]
call fcn.0040d200
mov ecx, dword [eax]
mov edx, dword [ecx + 0x214]
push edx
mov eax, dword [ebp - 0x194]
push eax
mov ecx, dword [ebp - 0x198]
push ecx
call dword [sym.imp.KERNEL32.DLL_ReadFile]
cmp dword [ebp - 0x198], 0
je 0x40b978
mov edx, dword [ebp - 0x198]
push edx
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
push 0
lea eax, [ebp - 0x190]
push eax
lea ecx, [ebp - 0x188]
call fcn.0040d200
mov ecx, dword [eax]
mov edx, dword [ecx + 0x214]
push edx
mov eax, dword [ebp - 0x194]
push eax
mov ecx, dword [ebp - 0x170]
push ecx
call dword [sym.imp.KERNEL32.DLL_WriteFile]
lea ecx, [ebp - 0x188]
call fcn.0040d200
mov edx, dword [eax]
add edx, 0x104
push edx
call dword [sym.imp.KERNEL32.DLL_DeleteFileA]
mov eax, dword [ebp - 0x188]
mov dword [ebp - 0x1bc], eax
mov ecx, dword [ebp - 0x1bc]
push ecx
lea edx, [ebp - 0x1c0]
push edx
mov ecx, dword [ebp - 0x1c8]
add ecx, 0x2c
call fcn.0040d190
jmp 0x40b9f2
jmp 0x40b804
mov eax, dword [0x49e714]
push eax
call dword [sym.imp.KERNEL32.DLL_ReleaseMutex]
push 0x64
call dword [sym.imp.KERNEL32.DLL_Sleep]
mov ecx, dword [ebp - 0x1c8]
add ecx, 0x2c
call fcn.0040d040
test eax, eax
jne 0x40ba34
cmp dword [ebp - 0x170], 0
je 0x40ba2e
mov ecx, dword [ebp - 0x170]
push ecx
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
mov byte [ebp - 0x2d], 1
jmp 0x40ba41
mov edx, 1
test edx, edx
jne 0x40b7d9
mov al, byte [ebp - 0x2d]
mov byte [ebp - 0x1c1], al
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x164]
call fcn.00409b30
mov al, byte [ebp - 0x1c1]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0042ec7a
mov esp, ebp
pop ebp
ret 0xc