Function at 0x405c30
Capabilities:
Delete file
Terminate thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x234
mov eax, dword [0x441384]
xor eax, ebp
mov dword [ebp - 0xc], eax
mov dword [ebp - 8], 0
mov dword [ebp - 4], 1
cmp dword [0x46a1d0], 0
je 0x405c70
mov eax, dword [0x46a1d0]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [0x46a1d0], 0
cmp dword [0x46a1d4], 0
je 0x405c90
mov ecx, dword [0x46a1d4]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [0x46a1d4], 0
cmp dword [0x46a1d8], 0
je 0x405cb0
mov edx, dword [0x46a1d8]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [0x46a1d8], 0
mov word [ebp - 0x214], 0
jmp 0x405ccd
mov ax, word [ebp - 0x214]
add ax, 1
mov word [ebp - 0x214], ax
movzx ecx, word [ebp - 0x214]
cmp ecx, 5
jge 0x405d3b
movzx edx, word [ebp - 0x214]
cmp dword [edx*4 + 0x46a1bc], 0
je 0x405d01
push 1
movzx eax, word [ebp - 0x214]
mov ecx, dword [eax*4 + 0x46a1bc]
push ecx
call dword [sym.imp.KERNEL32.dll_TerminateThread]
movzx edx, word [ebp - 0x214]
cmp dword [edx*4 + 0x46a1bc], 0
je 0x405d39
movzx eax, word [ebp - 0x214]
mov ecx, dword [eax*4 + 0x46a1bc]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
movzx edx, word [ebp - 0x214]
mov dword [edx*4 + 0x46a1bc], 0
jmp 0x405cbb
movzx eax, byte [ebp + 8]
test eax, eax
jne 0x405d48
jmp 0x405f6b
push 0x468f50
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
mov dword [ebp - 0x218], 0
jmp 0x405d6e
mov ecx, dword [ebp - 0x218]
add ecx, 1
mov dword [ebp - 0x218], ecx
mov edx, dword [ebp - 0x218]
cmp edx, dword [0x46901c]
jge 0x405e87
mov eax, dword [ebp - 0x218]
push eax
push str.bkgr_d.gif
push 0x200
lea ecx, [ebp - 0x210]
push ecx
call fcn.00413e53
add esp, 0x10
push 1
lea edx, [ebp - 8]
push edx
lea eax, [ebp - 0x210]
push eax
call fcn.0040ca40
add esp, 0xc
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 1
je 0x405dc3
jmp 0x405e87
cmp dword [ebp - 8], 0
jne 0x405dd5
mov dword [ebp - 4], 2
jmp 0x405e87
mov ecx, dword [ebp - 8]
push ecx
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
cmp dword [ebp - 8], 0
je 0x405e04
mov edx, dword [ebp - 8]
mov dword [ebp - 0x220], edx
mov eax, dword [ebp - 0x220]
push eax
call fcn.0041356e
add esp, 4
mov dword [ebp - 8], 0
mov ecx, dword [ebp - 0x218]
push ecx
push str.bkgr_d.txt
push 0x200
lea edx, [ebp - 0x210]
push edx
call fcn.00413e53
add esp, 0x10
push 1
lea eax, [ebp - 8]
push eax
lea ecx, [ebp - 0x210]
push ecx
call fcn.0040ca40
add esp, 0xc
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 1
je 0x405e44
jmp 0x405e87
cmp dword [ebp - 8], 0
jne 0x405e53
mov dword [ebp - 4], 2
jmp 0x405e87
mov edx, dword [ebp - 8]
push edx
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
cmp dword [ebp - 8], 0
je 0x405e82
mov eax, dword [ebp - 8]
mov dword [ebp - 0x224], eax
mov ecx, dword [ebp - 0x224]
push ecx
call fcn.0041356e
add esp, 4
mov dword [ebp - 8], 0
jmp 0x405d5f
cmp dword [0x46a538], 0
je 0x405eb5
mov edx, dword [0x46a538]
mov dword [ebp - 0x228], edx
mov eax, dword [ebp - 0x228]
push eax
call fcn.0041356e
add esp, 4
mov dword [0x46a538], 0
cmp dword [0x46a53c], 0
je 0x405f63
mov dword [ebp - 0x21c], 0
jmp 0x405edd
mov ecx, dword [ebp - 0x21c]
add ecx, 1
mov dword [ebp - 0x21c], ecx
mov edx, dword [ebp - 0x21c]
cmp edx, dword [0x46a540]
jge 0x405f35
mov eax, dword [ebp - 0x21c]
mov ecx, dword [0x46a53c]
cmp dword [ecx + eax*4], 0
je 0x405f33
mov edx, dword [ebp - 0x21c]
mov eax, dword [0x46a53c]
mov ecx, dword [eax + edx*4]
mov dword [ebp - 0x22c], ecx
mov edx, dword [ebp - 0x22c]
push edx
call fcn.0041356e
add esp, 4
mov eax, dword [ebp - 0x21c]
mov ecx, dword [0x46a53c]
mov dword [ecx + eax*4], 0
jmp 0x405ece
cmp dword [0x46a53c], 0
je 0x405f63
mov edx, dword [0x46a53c]
mov dword [ebp - 0x230], edx
mov eax, dword [ebp - 0x230]
push eax
call fcn.0041356e
add esp, 4
mov dword [0x46a53c], 0
xor ecx, ecx
jne 0x405c4a
cmp dword [ebp - 8], 0
je 0x405f90
mov edx, dword [ebp - 8]
mov dword [ebp - 0x234], edx
mov eax, dword [ebp - 0x234]
push eax
call fcn.0041356e
add esp, 4
mov dword [ebp - 8], 0
mov eax, dword [ebp - 4]
mov ecx, dword [ebp - 0xc]
xor ecx, ebp
call fcn.00413a38
mov esp, ebp
pop ebp
ret