Function at 0x40cfa0
Capabilities:
Print debug messages
Read .ini file
Resolve function by parsing pe exports

Disassembly:
mov ecx, dword [0x43e5c8]
xor eax, eax
sub esp, 0x70
cmp ecx, eax
je 0x40d4c9
push ebx
push ebp
push esi
push edi
push 0x43eb20
push 0x64
or ebx, 0xffffffff
push str.TakePicture_SXGA_Wait
push str.annie
mov dword [0x43f370], 1
mov dword [esp + 0x40], ebx
mov dword [esp + 0x38], ebx
mov ebp, ebx
mov dword [esp + 0x30], ebx
mov dword [esp + 0x24], eax
mov dword [esp + 0x3c], eax
mov dword [esp + 0x28], eax
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileIntA]
mov ecx, eax
mov eax, 0x66666667
imul ecx
sar edx, 2
mov eax, edx
shr eax, 0x1f
add edx, eax
mov eax, dword [0x43e5c8]
mov dword [esp + 0x3c], edx
lea edx, [esp + 0x24]
mov ecx, dword [eax]
push edx
push eax
call dword [ecx + 0x10]
test eax, eax
jl 0x40d4bb
mov eax, dword [esp + 0x24]
mov ecx, 4
mov edi, 0x430914
xor edx, edx
lea esi, [eax + 0x2c]
repe cmpsd dword [esi], dword es:[edi]
jne 0x40d08f
lea ecx, [esp + 0x30]
add eax, 0x10
push ecx
push eax
call fcn.0040c830
mov edx, dword [esp + 0x2c]
mov byte [esp + 0x1b], al
mov eax, dword [edx + 0x44]
mov ebx, dword [eax + 0x34]
mov eax, dword [eax + 0x38]
cdq
mov ebp, eax
lea eax, [esp + 0x30]
xor ebp, edx
push eax
sub ebp, edx
push ebp
push ebx
call fcn.0040c880
mov cl, byte [esp + 0x27]
add esp, 0x14
test cl, cl
je 0x40d08f
test al, al
je 0x40d08f
mov esi, dword [esp + 0x30]
mov eax, dword [esp + 0x28]
shl esi, 0x10
or esi, eax
mov dword [esp + 0x20], esi
jmp 0x40d093
mov esi, dword [esp + 0x20]
mov ecx, dword [esp + 0x24]
push ecx
call fcn.0041a4b0
cmp esi, 0xffffffff
je 0x40d4bb
cmp dword [esp + 0x28], 7
jne 0x40d0cb
push 1
push 1
call fcn.00402b80
add esp, 8
mov dword [0x43f370], 0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x70
ret
mov eax, dword [0x43f344]
mov esi, dword [sym.imp.KERNEL32.dll_Sleep]
cmp eax, 4
jne 0x40d1dc
mov eax, ebp
mov ecx, 0xb
imul eax, ebx
lea edi, [esp + 0x54]
lea edx, [eax + eax*2]
xor eax, eax
rep stosd dword es:[edi], eax
xor ecx, ecx
mov edi, 1
mov eax, 0xb12
push ecx
push ecx
mov dword [esp + 0x20], edx
mov dword [esp + 0x5c], 0x28
mov dword [esp + 0x60], ebx
mov dword [esp + 0x64], ebp
mov word [esp + 0x68], di
mov word [esp + 0x6a], 0x18
mov dword [esp + 0x6c], ecx
mov dword [esp + 0x70], edx
mov dword [esp + 0x74], eax
mov dword [esp + 0x78], eax
mov dword [esp + 0x7c], ecx
mov dword [esp + 0x80], ecx
call fcn.00402b80
add esp, 8
mov eax, dword [0x43e5f8]
test eax, eax
je 0x40d173
call fcn.0040ca20
test eax, eax
jl 0x40d4bb
push 0xa
call esi
mov edx, edi
inc edi
cmp edx, 0x12c
jl 0x40d145
mov eax, dword [0x43e5f8]
test eax, eax
jne 0x40d1b4
mov eax, dword [0x43ea90]
test eax, eax
je 0x40d1b4
lea eax, [esp + 0x2c]
mov ecx, 0x43e868
push eax
push 0
call fcn.004107a0
test eax, eax
je 0x40d1dc
mov ecx, dword [esp + 0x2c]
push ecx
call fcn.0041d1ae
add esp, 4
lea edx, [esp + 0x2c]
mov ecx, 0x43e868
mov dword [esp + 0x14], eax
push edx
push eax
call fcn.004107a0
jmp 0x40d1dc
mov ebx, dword [esp + 0x18]
push ebx
call fcn.0041d1ae
mov ecx, ebx
mov edi, eax
mov edx, ecx
mov eax, 0x80808080
shr ecx, 2
mov dword [esp + 0x18], edi
add esp, 4
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
mov eax, dword [0x43e5b0]
xor ebx, ebx
cmp eax, ebx
je 0x40d1fa
mov ecx, dword [eax]
push ebx
push eax
call dword [ecx + 0x4c]
mov eax, dword [0x43e5b0]
push ebx
push eax
mov edx, dword [eax]
call dword [edx + 0x3c]
cmp dword [0x43f344], 4
jne 0x40d21a
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x14]
push eax
lea edx, [esp + 0x58]
push ecx
push edx
call fcn.0040ce80
add esp, 0xc
mov eax, dword [0x43e5d4]
lea edx, [esp + 0x1c]
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x38], ebx
mov ecx, dword [eax]
push edx
push 0x42f524
push eax
call dword [ecx]
test eax, eax
jl 0x40d260
mov eax, dword [esp + 0x1c]
lea edx, [esp + 0x40]
push edx
lea edx, [esp + 0x3c]
mov ecx, dword [eax]
push edx
push 8
push eax
call dword [ecx + 0x14]
mov eax, dword [esp + 0x1c]
push 2
push 2
push 8
mov ecx, dword [eax]
push eax
call dword [ecx + 0x10]
mov eax, dword [0x43f500]
lea edx, [esp + 0x44]
push edx
push eax
call dword [sym.imp.USER32.dll_GetClientRect]
mov ecx, dword [0x43eae0]
mov edx, dword [0x43f360]
push ecx
push edx
call fcn.00415640
mov edi, dword [esp + 0x58]
mov ecx, dword [0x43f35c]
add esp, 8
sub edi, eax
mov eax, dword [0x43eae0]
push eax
push ecx
mov ecx, 0x4401d8
call fcn.00418690
sub edi, eax
dec edi
mov dword [esp + 0x50], edi
jns 0x40d2b3
xor edi, edi
mov dword [esp + 0x50], edi
mov edx, dword [esp + 0x4c]
push edi
push edx
push 0x10007
call fcn.0040c8c0
mov eax, dword [0x43e5b0]
add esp, 0xc
cmp eax, ebx
je 0x40d2e2
mov ecx, dword [eax]
push ebx
push eax
call dword [ecx + 0x4c]
mov eax, dword [0x43e5b0]
push ebx
push eax
mov edx, dword [eax]
call dword [edx + 0x3c]
cmp dword [0x43f344], 4
jne 0x40d302
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x14]
push eax
lea edx, [esp + 0x58]
push ecx
push edx
call fcn.0040ce80
add esp, 0xc
cmp dword [0x43e5b8], ebx
jne 0x40d317
push 0x43e5b8
call fcn.0040ce20
add esp, 4
push 0x43eb20
push 1
push str.TakePicture_SXGA_WaitFrames
push str.annie
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileIntA]
mov ebx, dword [esp + 0x3c]
xor edi, edi
test ebx, ebx
mov ebp, eax
jle 0x40d367
mov eax, dword [0x43e5b8]
lea edx, [esp + 0x34]
mov dword [esp + 0x34], 0
push edx
mov ecx, dword [eax]
push eax
call dword [ecx + 0x10]
cmp dword [esp + 0x34], ebp
jg 0x40d363
push 0xa
inc edi
call esi
cmp edi, ebx
jl 0x40d33a
jmp 0x40d367
cmp edi, ebx
jl 0x40d372
push str.No_video_arrived._n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
cmp dword [0x43f344], 4
jne 0x40d394
mov ebp, dword [esp + 0x18]
mov ebx, dword [esp + 0x14]
push ebp
lea eax, [esp + 0x58]
push ebx
push eax
call fcn.0040ce80
add esp, 0xc
jmp 0x40d39c
mov ebx, dword [esp + 0x14]
mov ebp, dword [esp + 0x18]
push 1
push 1
call fcn.00402b80
mov eax, dword [0x43e5b0]
add esp, 8
test eax, eax
je 0x40d3c6
mov ecx, dword [eax]
push 0
push eax
call dword [ecx + 0x4c]
mov eax, dword [0x43e5b0]
push 0
push eax
mov edx, dword [eax]
call dword [edx + 0x3c]
mov eax, dword [0x43f344]
cmp eax, 4
jne 0x40d415
push ebp
lea eax, [esp + 0x58]
push ebx
push eax
call fcn.0040ce80
mov eax, dword [0x43f344]
add esp, 0xc
cmp eax, 4
jne 0x40d415
mov edi, 1
mov eax, dword [0x43e5f8]
test eax, eax
je 0x40d440
call fcn.0040ca20
test eax, eax
jl 0x40d4ae
push 5
call esi
mov ecx, edi
inc edi
cmp ecx, 0x3e8
jl 0x40d3ee
jmp 0x40d440
cmp eax, 2
jne 0x40d440
mov edi, 1
mov eax, dword [0x43e848]
test eax, eax
je 0x40d440
call fcn.0040ca20
test eax, eax
jl 0x40d4ae
push 5
call esi
mov edx, edi
inc edi
cmp edx, 0x3e8
jl 0x40d41f
mov eax, dword [0x43e5b0]
test eax, eax
je 0x40d45e
mov ecx, dword [eax]
push 0
push eax
call dword [ecx + 0x4c]
mov eax, dword [0x43e5b0]
push 0
push eax
mov edx, dword [eax]
call dword [edx + 0x3c]
cmp dword [0x43f344], 4
jne 0x40d476
push ebp
lea eax, [esp + 0x58]
push ebx
push eax
call fcn.0040ce80
add esp, 0xc
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x40d497
mov edx, dword [esp + 0x38]
mov ecx, dword [eax]
push 2
push edx
push 8
push eax
call dword [ecx + 0x10]
mov eax, dword [esp + 0x1c]
push eax
mov ecx, dword [eax]
call dword [ecx + 8]
mov edx, dword [esp + 0x50]
mov eax, dword [esp + 0x4c]
mov ecx, dword [esp + 0x20]
push edx
push eax
push ecx
call fcn.0040c8c0
add esp, 0xc
test ebx, ebx
je 0x40d4bb
push ebx
call fcn.0041d1bc
add esp, 4
pop edi
pop esi
pop ebp
mov dword [0x43f370], 0
pop ebx
add esp, 0x70
ret