Function at 0x40b690
Capabilities:
Delete file

Disassembly:
sub esp, 0x124
mov eax, dword [0x445750]
xor eax, esp
mov dword [esp + 0x120], eax
call fcn.0040bf60
test eax, eax
jne 0x40b6c2
mov ecx, dword [esp + 0x120]
xor ecx, esp
call fcn.0041e904
add esp, 0x124
ret
push ebx
push ebp
push esi
mov esi, dword [0x447274]
imul esi, dword [0x447278]
xor ecx, ecx
mov eax, esi
mov edx, 2
mul edx
seto cl
push edi
mov dword [esp + 0x18], esi
neg ecx
or ecx, eax
push ecx
call fcn.0040fab4
mov ebx, eax
lea eax, [esi + esi]
push eax
push 0
push ebx
mov dword [esp + 0x2c], eax
call fcn.0041e700
add esp, 0x10
push str.BrightCalibration
mov ecx, 0x446d9c
call fcn.00403850
push 0x33
push str.ValidMedRel_Min
mov ecx, 0x446d9c
call fcn.00403b30
push 0x8c
mov edi, eax
push str.ValidMedRel_Max
mov ecx, 0x446d9c
mov dword [esp + 0x28], edi
call fcn.00403b30
push 0x57
mov ebp, eax
push str.ValidDiag_Min
mov ecx, 0x446d9c
mov dword [esp + 0x2c], ebp
call fcn.00403b30
push 0x6e
push str.ValidDiag_Max
mov ecx, 0x446d9c
mov dword [esp + 0x30], eax
call fcn.00403b30
push eax
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0x2c]
push eax
push ebp
push edi
lea ecx, [esp + 0x40]
push str.auto_BPM:_std_d.._d_diag_d.._d
push ecx
call fcn.0041e808
lea edx, [esp + 0x48]
push 0
push edx
call fcn.00404200
xor ebp, ebp
xor edi, edi
add esp, 0x20
cmp dword [0x447a70], edi
mov dword [esp + 0x14], 1
mov dword [esp + 0x10], ebp
jle 0x40b7f0
lea esp, [esp]
mov eax, dword [edi*4 + 0x4482f4]
mov ecx, dword [edi*4 + 0x447a74]
push ebx
push eax
lea eax, [esp + 0x28]
call fcn.0040b280
mov edx, dword [edi*4 + 0x4482f4]
lea ecx, [esp + 0x28]
push ecx
push ebx
push edx
add ebp, eax
call fcn.0040b310
inc edi
add esp, 0x14
add ebp, eax
cmp edi, dword [0x447a70]
jl 0x40b7b0
mov dword [esp + 0x10], ebp
call fcn.0040be40
fild dword [esp + 0x10]
sub esp, 8
lea eax, [esp + 0x38]
fidiv dword [esp + 0x20]
fmul qword [0x438608]
fstp qword [esp]
push ebp
push str.Found__d_bad_pixels___.1f___
push eax
call fcn.0041e808
lea ecx, [esp + 0x44]
push 0
push ecx
call fcn.00404200
mov eax, 0x38e38e39
imul esi
sar edx, 1
mov eax, edx
shr eax, 0x1f
add eax, edx
add esp, 0x1c
cmp ebp, eax
jle 0x40b855
push 0
push str.ERR:_Too_many_bad_pixels
call fcn.00404200
mov dword [esp + 0x1c], 0
jmp 0x40b8f5
mov ecx, dword [0x447278]
mov edx, dword [0x447274]
push ecx
push edx
push 0x446ff0
lea eax, [esp + 0x3c]
push str._sCAL_dx_dbpm.raw
push eax
call fcn.0041e808
add esp, 0x14
test ebp, ebp
jg 0x40b88b
lea ecx, [esp + 0x30]
push ecx
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
jmp 0x40b8f8
mov edx, dword [esp + 0x1c]
push ebx
push edx
lea eax, [esp + 0x38]
push eax
push 1
call fcn.0040e6d0
mov eax, dword [0x447288]
add esp, 0x10
test eax, eax
je 0x40b8c5
mov ecx, dword [0x447274]
mov edx, dword [0x447278]
push ecx
push edx
push ecx
xor eax, 3
push ebx
push eax
call fcn.0040f7f0
add esp, 0x14
mov eax, dword [0x447284]
test eax, eax
je 0x40b8ed
mov ecx, dword [0x447274]
mov edx, dword [0x447278]
push ecx
push edx
mov ecx, 3
sub ecx, eax
push ebx
push ecx
call fcn.0040f6a0
add esp, 0x10
push 5
push ebx
call fcn.00408fa0
add esp, 8
push ebx
call fcn.0040faa9
mov ecx, dword [esp + 0x134]
mov eax, dword [esp + 0x18]
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0041e904
add esp, 0x124
ret