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

Disassembly:
mov ecx, dword [0x43f5f8]
xor eax, eax
sub esp, 0x70
cmp ecx, eax
je 0x40d656
push ebx
push ebp
push esi
push edi
push 0x43fb50
push 0x64
or ebx, 0xffffffff
push str.TakePicture_SXGA_Wait
push str.annie
mov dword [0x4403a0], 1
mov dword [esp + 0x40], ebx
mov dword [esp + 0x38], ebx
mov ebp, ebx
mov dword [esp + 0x30], ebx
mov dword [esp + 0x28], eax
mov dword [esp + 0x3c], eax
mov dword [esp + 0x24], 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 [0x43f5f8]
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 0x40d648
mov eax, dword [esp + 0x24]
mov ecx, 4
mov edi, 0x431914
xor edx, edx
lea esi, [eax + 0x2c]
repe cmpsd dword [esi], dword es:[edi]
jne 0x40d21f
lea ecx, [esp + 0x30]
add eax, 0x10
push ecx
push eax
call fcn.0040c9c0
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.0040ca10
mov cl, byte [esp + 0x27]
add esp, 0x14
test cl, cl
je 0x40d21f
test al, al
je 0x40d21f
mov esi, dword [esp + 0x30]
mov eax, dword [esp + 0x28]
shl esi, 0x10
or esi, eax
mov dword [esp + 0x20], esi
jmp 0x40d223
mov esi, dword [esp + 0x20]
mov ecx, dword [esp + 0x24]
push ecx
call fcn.0041a630
cmp esi, 0xffffffff
je 0x40d648
cmp dword [esp + 0x28], 7
jne 0x40d25b
push 1
push 1
call fcn.00402bf0
add esp, 8
mov dword [0x4403a0], 0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x70
ret
mov eax, dword [0x440374]
mov esi, dword [sym.imp.KERNEL32.dll_Sleep]
cmp eax, 4
jne 0x40d36c
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 + 0x1c], 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.00402bf0
add esp, 8
mov eax, dword [0x43f628]
test eax, eax
je 0x40d303
call fcn.0040cbb0
test eax, eax
jl 0x40d648
push 0xa
call esi
mov edx, edi
inc edi
cmp edx, 0x12c
jl 0x40d2d5
mov eax, dword [0x43f628]
test eax, eax
jne 0x40d344
mov eax, dword [0x43fac0]
test eax, eax
je 0x40d344
lea eax, [esp + 0x2c]
mov ecx, 0x43f898
push eax
push 0
call fcn.00410930
test eax, eax
je 0x40d36c
mov ecx, dword [esp + 0x2c]
push ecx
call fcn.0041d32e
add esp, 4
lea edx, [esp + 0x2c]
mov ecx, 0x43f898
mov dword [esp + 0x18], eax
push edx
push eax
call fcn.00410930
jmp 0x40d36c
mov ebx, dword [esp + 0x14]
push ebx
call fcn.0041d32e
mov ecx, ebx
mov edi, eax
mov edx, ecx
mov eax, 0x80808080
shr ecx, 2
mov dword [esp + 0x1c], 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 [0x43f5e0]
xor ebx, ebx
cmp eax, ebx
je 0x40d38a
mov ecx, dword [eax]
push ebx
push eax
call dword [ecx + 0x4c]
mov eax, dword [0x43f5e0]
push ebx
push eax
mov edx, dword [eax]
call dword [edx + 0x3c]
cmp dword [0x440374], 4
jne 0x40d3aa
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x18]
push eax
lea edx, [esp + 0x58]
push ecx
push edx
call fcn.0040d010
add esp, 0xc
mov eax, dword [0x43f604]
lea edx, [esp + 0x1c]
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x38], ebx
mov ecx, dword [eax]
push edx
push 0x430524
push eax
call dword [ecx]
test eax, eax
jl 0x40d3f0
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 [0x440530]
lea edx, [esp + 0x44]
push edx
push eax
call dword [sym.imp.USER32.dll_GetClientRect]
mov ecx, dword [0x43fb10]
mov edx, dword [0x440390]
push ecx
push edx
call fcn.004157d0
mov edi, dword [esp + 0x58]
mov ecx, dword [0x44038c]
add esp, 8
sub edi, eax
mov eax, dword [0x43fb10]
push eax
push ecx
mov ecx, 0x441208
call fcn.00418810
sub edi, eax
dec edi
mov dword [esp + 0x50], edi
jns 0x40d443
xor edi, edi
mov dword [esp + 0x50], edi
mov edx, dword [esp + 0x4c]
push edi
push edx
push 0x10007
call fcn.0040ca50
mov eax, dword [0x43f5e0]
add esp, 0xc
cmp eax, ebx
je 0x40d472
mov ecx, dword [eax]
push ebx
push eax
call dword [ecx + 0x4c]
mov eax, dword [0x43f5e0]
push ebx
push eax
mov edx, dword [eax]
call dword [edx + 0x3c]
cmp dword [0x440374], 4
jne 0x40d492
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x18]
push eax
lea edx, [esp + 0x58]
push ecx
push edx
call fcn.0040d010
add esp, 0xc
cmp dword [0x43f5e8], ebx
jne 0x40d4a7
push 0x43f5e8
call fcn.0040cfb0
add esp, 4
push 0x43fb50
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 0x40d4f7
mov eax, dword [0x43f5e8]
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 0x40d4f3
push 0xa
inc edi
call esi
cmp edi, ebx
jl 0x40d4ca
jmp 0x40d4f7
cmp edi, ebx
jl 0x40d502
push str.No_video_arrived._n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov eax, dword [0x440374]
mov ebp, dword [esp + 0x14]
cmp eax, 4
jne 0x40d525
mov ebx, dword [esp + 0x18]
push ebp
lea eax, [esp + 0x58]
push ebx
push eax
call fcn.0040d010
add esp, 0xc
jmp 0x40d529
mov ebx, dword [esp + 0x18]
push 1
push 1
call fcn.00402bf0
mov eax, dword [0x43f5e0]
add esp, 8
test eax, eax
je 0x40d553
mov ecx, dword [eax]
push 0
push eax
call dword [ecx + 0x4c]
mov eax, dword [0x43f5e0]
push 0
push eax
mov edx, dword [eax]
call dword [edx + 0x3c]
mov eax, dword [0x440374]
cmp eax, 4
jne 0x40d5a2
push ebp
lea eax, [esp + 0x58]
push ebx
push eax
call fcn.0040d010
mov eax, dword [0x440374]
add esp, 0xc
cmp eax, 4
jne 0x40d5a2
mov edi, 1
mov eax, dword [0x43f628]
test eax, eax
je 0x40d5cd
call fcn.0040cbb0
test eax, eax
jl 0x40d63b
push 5
call esi
mov ecx, edi
inc edi
cmp ecx, 0x3e8
jl 0x40d57b
jmp 0x40d5cd
cmp eax, 2
jne 0x40d5cd
mov edi, 1
mov eax, dword [0x43f878]
test eax, eax
je 0x40d5cd
call fcn.0040cbb0
test eax, eax
jl 0x40d63b
push 5
call esi
mov edx, edi
inc edi
cmp edx, 0x3e8
jl 0x40d5ac
mov eax, dword [0x43f5e0]
test eax, eax
je 0x40d5eb
mov ecx, dword [eax]
push 0
push eax
call dword [ecx + 0x4c]
mov eax, dword [0x43f5e0]
push 0
push eax
mov edx, dword [eax]
call dword [edx + 0x3c]
cmp dword [0x440374], 4
jne 0x40d603
push ebp
lea eax, [esp + 0x58]
push ebx
push eax
call fcn.0040d010
add esp, 0xc
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x40d624
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.0040ca50
add esp, 0xc
test ebx, ebx
je 0x40d648
push ebx
call fcn.0041d33c
add esp, 4
pop edi
pop esi
pop ebp
mov dword [0x4403a0], 0
pop ebx
add esp, 0x70
ret