Function at 0x408ec0
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push 0xffffffffffffffff
push 0x582ae5
mov eax, dword fs:[0]
push eax
sub esp, 0x58
push ebx
push ebp
push esi
push edi
mov eax, dword [0x6a3b20]
xor eax, esp
push eax
lea eax, [esp + 0x6c]
mov dword fs:[0], eax
xor ebp, ebp
mov dword [esp + 0x68], ebp
mov eax, dword [esp + 0x80]
mov ecx, dword [eax]
mov dword [esp + 0x74], 1
cmp ecx, 1
je 0x408f1e
cmp ecx, ebp
je 0x408f1e
mov eax, dword [eax + 4]
push eax
lea ecx, [esp + 0x84]
call fcn.00407310
mov eax, dword [esp + 0x80]
mov ecx, dword [eax + 8]
mov ebx, dword [eax + ecx*4 + 0x10]
mov ecx, dword [eax]
mov dword [esp + 0x24], ebx
cmp ecx, 1
je 0x408f4b
cmp ecx, ebp
je 0x408f4b
mov edx, dword [eax + 4]
push edx
lea ecx, [esp + 0x84]
call fcn.00407310
mov eax, dword [esp + 0x80]
mov ecx, dword [eax + 0xc]
mov edx, dword [eax + 8]
mov edi, dword [eax + ecx*4 + 0xc]
sub ecx, edx
mov dword [esp + 0x20], ebp
cmp ecx, ebp
jle 0x408f81
lea eax, [eax + edx*4 + 0x10]
mov edx, dword [eax]
mov esi, dword [edx + 0xbc]
cmp dword [esi + 4], 0
je 0x408f7b
test ebp, ebp
jne 0x408f77
mov ebp, edx
mov dword [esp + 0x20], edx
add eax, 4
dec ecx
jne 0x408f63
mov esi, dword [0x5a7d34]
push 0
push 0x5a9974
call esi
mov dword [esp + 0x1c], eax
push 0xf
push str.yyyyMMdd_HHmmss
mov byte [esp + 0x84], 2
call esi
mov dword [esp + 0x2c], eax
push 0xf
push str.yyyyMMdd_HHmmss
mov byte [esp + 0x8c], 3
call esi
add esp, 0x18
mov dword [esp + 0x18], eax
lea eax, [esp + 0x48]
push eax
lea ecx, [ebx + 0x8c]
mov byte [esp + 0x78], 4
call fcn.00402ff0
mov ebx, eax
lea ecx, [esp + 0x1c]
push ecx
lea edx, [esp + 0x48]
lea ecx, [edi + 0xd4]
mov edi, dword [0x5a7c7c]
push edx
mov byte [esp + 0x7c], 5
call edi
mov dword [esp + 0x2c], eax
lea eax, [esp + 0x18]
push eax
lea ecx, [esp + 0x44]
push ecx
mov ecx, dword [esp + 0x2c]
add ecx, 0xd4
mov byte [esp + 0x7c], 6
call edi
push 0x5aa83c
push eax
lea edx, [esp + 0x44]
push edx
mov byte [esp + 0x80], 7
call fcn.00402ed0
mov ecx, dword [esp + 0x38]
push ecx
push eax
lea edx, [esp + 0x4c]
push edx
mov byte [esp + 0x8c], 8
call fcn.00402e60
push 0x5aa838
push eax
lea eax, [esp + 0x54]
push eax
mov byte [esp + 0x98], 9
call fcn.00402ed0
push ebx
push eax
lea ecx, [esp + 0x5c]
push ecx
mov byte [esp + 0xa4], 0xa
call fcn.00402e60
push str..AVI
push eax
lea edx, [esp + 0x60]
push edx
mov byte [esp + 0xb0], 0xb
call fcn.00402ed0
add esp, 0x3c
lea ecx, [esp + 0x30]
mov byte [esp + 0x74], 0xd
call dword [0x5a7d90]
lea ecx, [esp + 0x34]
mov byte [esp + 0x74], 0xe
call dword [0x5a7d90]
lea ecx, [esp + 0x38]
mov byte [esp + 0x74], 0xf
call dword [0x5a7d90]
lea ecx, [esp + 0x3c]
mov byte [esp + 0x74], 0x10
call dword [0x5a7d90]
lea ecx, [esp + 0x40]
mov byte [esp + 0x74], 0x11
call dword [0x5a7d90]
lea ecx, [esp + 0x44]
mov byte [esp + 0x74], 0x12
call dword [0x5a7d90]
lea ecx, [esp + 0x48]
mov byte [esp + 0x74], 0x13
call dword [0x5a7d90]
lea ecx, [esp + 0x18]
mov byte [esp + 0x74], 0x14
call dword [0x5a7d90]
lea ecx, [esp + 0x1c]
mov byte [esp + 0x74], 0x15
call dword [0x5a7d90]
test ebp, ebp
je 0x4092a1
mov ebx, dword [esp + 0x20]
test ebx, ebx
je 0x4092a1
push 0xf
push str.yyyyMMdd_HHmmss
call esi
mov dword [esp + 0x2c], eax
push 0xf
push str.yyyyMMdd_HHmmss
mov byte [esp + 0x84], 0x16
call esi
add esp, 0x10
mov dword [esp + 0x20], eax
lea eax, [esp + 0x64]
push eax
lea ecx, [ebp + 0x8c]
mov byte [esp + 0x78], 0x17
call fcn.00402ff0
mov esi, eax
lea ecx, [esp + 0x24]
push ecx
lea edx, [esp + 0x64]
push edx
lea ecx, [ebx + 0xd4]
mov byte [esp + 0x7c], 0x18
call edi
mov ebx, eax
lea eax, [esp + 0x20]
push eax
lea ecx, [esp + 0x60]
push ecx
lea ecx, [ebp + 0xd4]
mov byte [esp + 0x7c], 0x19
call edi
push 0x5aa83c
push eax
lea edx, [esp + 0x60]
push edx
mov byte [esp + 0x80], 0x1a
call fcn.00402ed0
push ebx
push eax
lea eax, [esp + 0x68]
push eax
mov byte [esp + 0x8c], 0x1b
call fcn.00402e60
push 0x5aa82c
push eax
lea ecx, [esp + 0x70]
push ecx
mov byte [esp + 0x98], 0x1c
call fcn.00402ed0
push esi
push eax
lea edx, [esp + 0x78]
mov bl, 0x1d
push edx
mov byte [esp + 0xa4], bl
call fcn.00402e60
push str..AVI
push eax
lea eax, [esp + 0x64]
push eax
mov byte [esp + 0xb0], 0x1e
call fcn.00402ed0
add esp, 0x3c
push eax
lea ecx, [esp + 0x18]
call dword [0x5a7cc4]
lea ecx, [esp + 0x2c]
call dword [0x5a7d90]
lea ecx, [esp + 0x4c]
mov byte [esp + 0x74], bl
call dword [0x5a7d90]
mov byte [esp + 0x74], 0x1c
lea ecx, [esp + 0x50]
call dword [0x5a7d90]
lea ecx, [esp + 0x54]
mov byte [esp + 0x74], 0x1b
call dword [0x5a7d90]
lea ecx, [esp + 0x58]
mov byte [esp + 0x74], 0x1a
call dword [0x5a7d90]
lea ecx, [esp + 0x5c]
mov byte [esp + 0x74], 0x19
call dword [0x5a7d90]
lea ecx, [esp + 0x60]
mov byte [esp + 0x74], 0x18
call dword [0x5a7d90]
lea ecx, [esp + 0x64]
mov byte [esp + 0x74], 0x17
call dword [0x5a7d90]
lea ecx, [esp + 0x20]
mov byte [esp + 0x74], 0x16
call dword [0x5a7d90]
lea ecx, [esp + 0x24]
mov byte [esp + 0x74], 0x15
call dword [0x5a7d90]
mov esi, dword [esp + 0x7c]
lea ecx, [esp + 0x28]
push ecx
mov ecx, esi
call dword [0x5a7cbc]
lea edx, [esp + 0x14]
push edx
lea ecx, [esi + 4]
call dword [0x5a7cbc]
lea ecx, [esp + 0x28]
mov dword [esp + 0x68], 1
mov byte [esp + 0x74], 2
call dword [0x5a7d90]
lea ecx, [esp + 0x14]
mov byte [esp + 0x74], 1
call dword [0x5a7d90]
mov ecx, dword [esp + 0x80]
mov eax, dword [ecx]
mov byte [esp + 0x74], 0
test eax, eax
je 0x409312
cmp eax, 0xffffffff
je 0x40931c
or eax, 0xffffffff
lock xadd dword [ecx], eax
setne al
test al, al
jne 0x40931c
mov ecx, dword [esp + 0x80]
push ecx
call dword [0x5a7d8c]
add esp, 4
mov eax, esi
mov ecx, dword [esp + 0x6c]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x64
ret