Function at 0x409340
Capabilities:
Delete file

Disassembly:
push 0xffffffffffffffff
push 0x4cb3cb
mov eax, dword fs:[0]
push eax
sub esp, 0x4ac
mov eax, dword [0x50a4c0]
xor eax, esp
mov dword [esp + 0x4a8], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x50a4c0]
xor eax, esp
push eax
lea eax, [esp + 0x4c0]
mov dword fs:[0], eax
xor ebx, ebx
cmp byte [0x513ee9], bl
je 0x4095d3
mov eax, dword [0x513ee0]
sub eax, dword [0x513edc]
sar eax, 2
test eax, eax
jbe 0x4095d3
push 0x208
lea edx, [esp + 0xaa]
xor ecx, ecx
push ebx
push edx
mov word [esp + 0xb0], cx
call fcn.004a7380
add esp, 0xc
push str.sgs1003.tmp
push 0x511210
push 0x4ef484
lea edx, [esp + 0xb0]
call fcn.00409f80
add esp, 0xc
lea eax, [esp + 0xa4]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
mov byte [esp + 0x20], bl
mov dword [esp + 0x1c], ebx
push 0x20
mov dword [esp + 0x4cc], ebx
call fcn.004a5359
add esp, 4
cmp eax, ebx
je 0x409438
mov dword [eax + 4], fcn.004a4b5c
mov dword [eax + 8], fcn.004a50d2
mov dword [eax + 0xc], fcn.004a4a7f
mov dword [eax + 0x10], ebx
mov dword [eax + 0x14], 0x8000
mov dword [eax], vtable.t_heap.0
mov dword [eax + 0x18], ebx
mov byte [eax + 0x1c], 1
mov esi, eax
jmp 0x40943a
xor esi, esi
mov dword [esp + 0x14], ebx
xor ecx, ecx
mov ebx, str.count
mov edi, str.system
call fcn.00433e00
push 0x513eb8
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [0x513ee0]
sub eax, dword [0x513edc]
xor edi, edi
sar eax, 2
mov dword [esp + 0x18], edi
test eax, eax
jle 0x409537
cmp edi, eax
jb 0x40947f
call fcn.004a68c5
mov ecx, dword [0x513edc]
mov ebp, dword [ecx + edi*4]
test ebp, ebp
je 0x40951c
cmp dword [ebp], 0
je 0x40951c
cmp dword [ebp + 4], 0
je 0x40951c
xor edx, edx
push 0x7e
push edx
lea eax, [esp + 0x2e]
push eax
mov word [esp + 0x30], dx
call fcn.004a7380
mov edi, dword [esp + 0x20]
add esp, 0xc
push edi
push str.image_d
lea edx, [esp + 0x2c]
call fcn.00409fa0
mov ecx, dword [ebp]
add esp, 8
push ecx
inc edi
push 0x4ef4bc
lea eax, [esp + 0x2c]
mov ecx, esi
mov dword [esp + 0x1c], edi
call fcn.00433e50
mov edx, dword [ebp + 4]
push edx
push 0x4ef070
lea eax, [esp + 0x2c]
mov ecx, esi
call fcn.00433e50
mov ecx, dword [ebp + 0xc]
mov ebx, 0x4ef4cc
lea edi, [esp + 0x24]
call fcn.00433e00
mov ecx, dword [ebp + 8]
mov ebx, 0x4ef4c4
call fcn.00433e00
mov edi, dword [esp + 0x18]
mov eax, dword [0x513ee0]
sub eax, dword [0x513edc]
inc edi
sar eax, 2
cmp edi, eax
mov dword [esp + 0x18], edi
jl 0x409478
xor ebx, ebx
push 0x513eb8
mov byte [0x513ee9], bl
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [esp + 0x14]
push 0xa
push 0x104
lea eax, [esp + 0x2bc]
push eax
push ecx
call fcn.004a7d13
add esp, 0x10
lea edx, [esp + 0x2b4]
push edx
push str.count
mov eax, str.system
mov ecx, esi
call fcn.00433e50
lea eax, [esp + 0x1c]
push eax
lea edx, [esp + 0xa8]
mov ecx, esi
call fcn.004345c0
cmp dword [esi + 0x10], ebx
je 0x4095ae
mov eax, dword [esi + 0x10]
mov ecx, dword [eax + 4]
mov edx, dword [esi + 0xc]
push eax
mov dword [esi + 0x10], ecx
call edx
add esp, 4
cmp dword [esi + 0x10], ebx
jne 0x409597
mov dword [esi + 0x10], ebx
mov dword [esi + 0x18], ebx
mov ecx, esi
mov dword [esi], vtable.allocator_unsigned_char__class_TAllocDefault_.0
call fcn.00404a60
push esi
call fcn.004a4a1a
add esp, 4
lea ecx, [esp + 0x1c]
call fcn.0042c930
mov ecx, dword [esp + 0x4c0]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x4a8]
xor ecx, esp
call fcn.004a4a25
add esp, 0x4b8
ret