Function at 0x40c1e0
Capabilities:
Create thread
Read .ini file
Resolve function by parsing pe exports
Resume thread

Disassembly:
sub esp, 0x48
push ebx
push ebp
push esi
mov esi, dword [esp + 0x5c]
push edi
xor edi, edi
cmp esi, edi
mov dword [esp + 0x20], edi
mov dword [esp + 0x3c], edi
mov dword [esp + 0x28], edi
mov dword [esp + 0x24], edi
mov dword [esp + 0x1c], edi
mov dword [esp + 0x10], edi
jle 0x40ccd5
cmp dword [esp + 0x64], edi
jle 0x40ccd5
mov eax, dword [esp + 0x70]
mov ebp, dword [esp + 0x5c]
cmp eax, edi
je 0x40c261
lea eax, [esp + 0x48]
push ebp
push eax
call fcn.0040f560
mov edx, dword [esp + 0x50]
mov eax, dword [esp + 0x54]
sub esp, 8
mov ecx, esp
push 0x3fe5c28f
push 0x5c28f5c3
mov dword [ecx], edx
mov edx, dword [esp + 0x68]
push ebp
mov dword [ecx + 4], eax
mov eax, dword [esp + 0x70]
mov dword [ecx + 8], edx
mov dword [ecx + 0xc], eax
call fcn.0040e1f0
add esp, 0x1c
push ebp
call dword [sym.imp.KERNEL32.dll_GlobalLock]
mov ebx, eax
cmp ebx, edi
je 0x40ccd5
mov cx, word [ebx + 0xe]
cmp cx, 8
jbe 0x40c27f
mov dword [ebx + 0x20], edi
cmp esi, dword [ebx + 4]
jg 0x40c2ab
mov edx, dword [esp + 0x64]
mov eax, dword [ebx + 8]
cmp edx, eax
jg 0x40c2ab
mov edx, dword [esp + 0x74]
mov eax, dword [esp + 0x6c]
cmp edx, edi
mov dword [esp + 0x28], eax
je 0x40c2ab
cmp eax, edi
jne 0x40c2ab
mov dword [esp + 0x68], 5
cmp cx, 0x18
je 0x40c2f7
push ebx
xor esi, esi
call fcn.0040ed60
push ebx
mov dword [esp + 0x74], eax
call fcn.0040edb0
mov ecx, dword [esp + 0x74]
add esp, 8
test ecx, ecx
je 0x40c392
test eax, eax
je 0x40c2db
mov esi, 1
cmp word [ebx + 0xe], 8
jne 0x40c38a
test eax, eax
jne 0x40c38a
push ebx
call fcn.0040edf0
add esp, 4
xor ecx, ecx
mov ebp, dword [ebx + 0x20]
mov cx, word [ebx + 0xe]
imul ecx, dword [esp + 0x60]
add ecx, 0x1f
shr ecx, 5
shl ecx, 2
mov esi, ecx
imul esi, dword [esp + 0x64]
test ecx, ecx
jbe 0x40c365
test esi, esi
jbe 0x40c365
cmp ebp, 0x100
jg 0x40c365
mov edx, dword [esp + 0x60]
mov eax, 0xf3e58
cmp edx, eax
jg 0x40c365
cmp dword [esp + 0x64], eax
jg 0x40c365
mov eax, esi
xor edx, edx
div dword [esp + 0x64]
cmp eax, ecx
jb 0x40c365
cmp esi, 0xfffffbd7
ja 0x40c365
lea eax, [esi + ebp*4 + 0x28]
push eax
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
test eax, eax
mov dword [esp + 0x40], eax
jne 0x40c437
test edi, edi
je 0x40ccc0
mov esi, dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push edi
call esi
push edi
call esi
push edi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x48
ret
test esi, esi
jne 0x40c2f7
xor esi, esi
push ebp
mov si, word [ebx + 0xe]
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
cmp esi, 1
jne 0x40c3bf
push ebp
call fcn.00402d20
mov edi, eax
push ebp
mov dword [esp + 0x28], edi
call fcn.0040ecd0
add esp, 8
mov dword [esp + 0x3c], eax
jmp 0x40c406
cmp esi, 4
jne 0x40c3ee
mov eax, dword [esp + 0x6c]
push ebp
test eax, eax
je 0x40c3e7
call fcn.00402b50
mov edi, eax
push 0
push 0
push edi
mov dword [esp + 0x30], edi
call fcn.0040ee80
add esp, 0x10
jmp 0x40c406
call fcn.00403380
jmp 0x40c3fd
cmp esi, 8
jne 0x40ccd5
push ebp
call fcn.004031c0
mov edi, eax
add esp, 4
mov dword [esp + 0x20], edi
test edi, edi
je 0x40ccd5
push edi
call dword [sym.imp.KERNEL32.dll_GlobalLock]
mov ebx, eax
test ebx, ebx
jne 0x40c2f7
push edi
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push edi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x48
ret
push eax
call dword [sym.imp.KERNEL32.dll_GlobalLock]
mov edx, dword [esp + 0x60]
mov edi, dword [esp + 0x64]
mov dword [eax], 0x28
mov dword [eax + 4], edx
mov dword [eax + 8], edi
mov dword [eax + 0x20], ebp
mov cx, word [ebx + 0xe]
mov word [eax + 0xc], 1
mov word [eax + 0xe], cx
xor ecx, ecx
mov dword [eax + 0x10], ecx
mov dword [eax + 0x14], ecx
mov dword [eax + 0x24], ecx
mov edx, dword [ebx + 0x18]
mov dword [eax + 0x18], edx
mov edx, dword [ebx + 0x1c]
cmp ebp, ecx
mov dword [eax + 0x1c], edx
jle 0x40c48c
mov ecx, ebp
lea esi, [ebx + 0x28]
lea edi, [eax + 0x28]
rep movsd dword es:[edi], dword [esi]
mov edi, dword [esp + 0x64]
mov edx, dword [eax]
mov esi, dword [ebx]
lea ecx, [ebp*4]
add edx, ecx
add esi, ecx
add edx, eax
mov eax, dword [esp + 0x78]
mov dword [esp + 0x14], edx
mov edx, 1
add esi, ebx
mov ebp, edx
test eax, eax
mov dword [esp + 0x18], esi
mov dword [esp + 0x6c], ebp
je 0x40c4e9
lea eax, [esp + 0x38]
lea ecx, [esp + 0x78]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcessAffinityMask]
mov edx, dword [esp + 0x78]
push edx
call fcn.0040c1c0
mov ebp, eax
add esp, 4
mov dword [esp + 0x6c], ebp
mov edx, 1
mov eax, dword [esp + 0x28]
test eax, eax
je 0x40c81a
cmp ebp, edi
jbe 0x40c4ff
mov ebp, edi
mov dword [esp + 0x6c], ebp
cmp ebp, edx
je 0x40c7b2
push 4
push ebp
call fcn.0040fda3
add esp, 8
mov dword [esp + 0x74], eax
test eax, eax
je 0x40c66b
mov edi, dword [esp + 0x64]
push 0xc
push edi
call fcn.0040fda3
mov dword [esp + 0x2c], eax
push eax
mov eax, dword [ebx + 8]
push edi
push eax
call fcn.0040b530
fild dword [esp + 0x78]
mov ecx, dword [esp + 0x80]
xor esi, esi
mov dword [esp + 0x3c], ecx
mov dword [esp + 0x40], esi
fidiv dword [esp + 0x3c]
add esp, 0x14
fadd qword [0x43f2f0]
call fcn.0040f6c8
mov edx, dword [esp + 0x6c]
mov ebp, eax
mov dword [esp + 0x68], esi
lea eax, [edx - 1]
test eax, eax
jbe 0x40c607
push 0x48
push 1
call fcn.0040fda3
mov ecx, dword [esp + 0x7c]
mov edx, dword [esp + 0x70]
add esp, 8
test esi, esi
mov dword [ecx + edx*4], eax
jne 0x40c598
push 1
push esi
push esi
push ebp
push esi
jmp 0x40c5b3
mov edx, dword [esp + 0x24]
lea ecx, [esi + esi*2]
lea ecx, [edx + ecx*4]
mov edx, dword [ecx - 4]
push edx
mov edx, dword [ecx - 8]
mov ecx, dword [ecx - 0xc]
push edx
lea edx, [esi + ebp]
push ecx
push edx
push esi
mov edx, dword [ebx + 8]
push 1
push 0
push 0
xor ecx, ecx
push 0
push ecx
mov cx, word [ebx + 0xe]
push 0
push ecx
mov ecx, dword [ebx + 4]
push edx
mov edx, dword [esp + 0x94]
push ecx
mov ecx, dword [esp + 0x4c]
push edi
push edx
mov edx, dword [esp + 0x58]
push ecx
push edx
push eax
call fcn.0040c060
mov eax, dword [esp + 0xb4]
mov ecx, dword [esp + 0xb8]
add esp, 0x4c
add esi, ebp
inc eax
dec ecx
cmp eax, ecx
mov dword [esp + 0x68], eax
jb 0x40c575
push 0x48
push 1
call fcn.0040fda3
mov edx, dword [esp + 0x74]
mov ecx, dword [esp + 0x7c]
mov dword [ecx + edx*4 - 4], eax
mov ecx, dword [esp + 0x2c]
lea edx, [esi + esi*2]
lea ecx, [ecx + edx*4]
mov edx, dword [ecx - 4]
push edx
mov edx, dword [ecx - 8]
mov ecx, dword [ecx - 0xc]
push edx
push ecx
push edi
mov ecx, dword [ebx + 8]
push esi
push 1
push 0
push 0
xor edx, edx
mov dx, word [ebx + 0xe]
push 0
push 0
push 0
push edx
mov edx, dword [ebx + 4]
push ecx
push edx
push edi
mov ecx, dword [esp + 0xa4]
mov edx, dword [esp + 0x58]
push ecx
mov ecx, dword [esp + 0x60]
push edx
push ecx
push eax
call fcn.0040c060
add esp, 0x54
mov edi, dword [esp + 0x6c]
push 4
push edi
call fcn.0040fda3
add esp, 8
mov ebx, eax
test edi, edi
jbe 0x40c6bb
mov ebp, dword [esp + 0x74]
mov esi, ebx
sub ebp, ebx
mov dword [esp + 0x68], edi
mov edx, dword [esi + ebp]
lea ecx, [esp + 0x6c]
push ecx
push 4
push edx
push 0x40c100
push 0
push 0
call fcn.004108a5
mov dword [esi], eax
mov eax, dword [esp + 0x80]
add esp, 0x18
add esi, 4
dec eax
mov dword [esp + 0x68], eax
jne 0x40c68c
xor esi, esi
test edi, edi
jbe 0x40c6d2
mov ebp, dword [sym.imp.KERNEL32.dll_ResumeThread]
mov eax, dword [ebx + esi*4]
push eax
call ebp
inc esi
cmp esi, edi
jb 0x40c6c7
xor esi, esi
test edi, edi
jbe 0x40c712
mov ebp, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov ecx, dword [ebx + esi*4]
push 0xffffffffffffffff
push ecx
call ebp
inc esi
cmp esi, edi
jb 0x40c6de
test edi, edi
jbe 0x40c712
mov esi, dword [esp + 0x74]
mov ebp, ebx
sub ebp, esi
mov edx, dword [esi + ebp]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esi]
push eax
call fcn.0040fb3a
add esp, 4
add esi, 4
dec edi
jne 0x40c6f7
push ebx
call fcn.0040fb3a
mov ecx, dword [esp + 0x78]
push ecx
call fcn.0040fb3a
mov eax, dword [esp + 0x2c]
add esp, 8
test eax, eax
je 0x40c736
push eax
call fcn.0040fb3a
add esp, 4
mov ebx, dword [esp + 0x10]
test ebx, ebx
je 0x40c763
mov edi, dword [esp + 0x64]
test edi, edi
jbe 0x40c75a
lea esi, [ebx + 4]
mov edx, dword [esi]
push edx
call fcn.0040fb3a
add esp, 4
add esi, 8
dec edi
jne 0x40c749
push ebx
call fcn.0040fb3a
add esp, 4
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x40c794
mov edi, dword [esp + 0x60]
test edi, edi
jbe 0x40c787
lea esi, [eax + 4]
mov ecx, dword [esi]
push ecx
call fcn.0040fb3a
add esp, 4
add esi, 8
dec edi
jne 0x40c776
mov edx, dword [esp + 0x1c]
push edx
call fcn.0040fb3a
add esp, 4
mov esi, dword [esp + 0x20]
mov ebx, dword [sym.imp.KERNEL32.dll_GlobalUnlock]
test esi, esi
je 0x40cb3c
push esi
call ebx
mov ebp, dword [esp + 0x5c]
jmp 0x40cb43
push 0
push 0
call fcn.004109de
push 0x30300
push 0x20300
mov ebp, eax
call fcn.004109de
mov edx, dword [esp + 0x70]
mov ecx, dword [ebx + 8]
push 0
push 0
push 0
push edi
xor eax, eax
push 0
mov ax, word [ebx + 0xe]
push edi
push edx
mov edx, dword [ebx + 4]
push eax
mov eax, dword [esp + 0x44]
push ecx
push edx
push eax
push esi
call fcn.0040b5d0
add esp, 0x40
push 0xfffff
push 0x9001f
call fcn.004109de
push 0xffff
push ebp
call fcn.004109de
add esp, 0x10
jmp 0x40c794
mov eax, dword [esp + 0x68]
cmp eax, 0xffffffff
jne 0x40c83f
push 0x46abc0
push 5
push str.ResampleFilter
push str.Resize
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileIntW]
mov edx, 1
cmp eax, 4
ja case.default.0x40c844
jmp dword [eax*4 + 0x40cce0]
mov dword [esp + 0x74], 0x3f800000
mov dword [esp + 0x68], 0x404ac0
jmp 0x40c8b5
mov dword [esp + 0x74], 0x3f800000
mov dword [esp + 0x68], 0x404b10
jmp 0x40c8b5
mov dword [esp + 0x74], 0x3fc00000
mov dword [esp + 0x68], 0x404b50
jmp 0x40c8b5
mov dword [esp + 0x74], 0x40000000
mov dword [esp + 0x68], 0x404d30
jmp 0x40c8b5
mov dword [esp + 0x74], 0x40000000
mov dword [esp + 0x68], 0x404bc0
jmp 0x40c8b5
mov dword [esp + 0x74], 0x40400000
mov dword [esp + 0x68], 0x404c40
mov ecx, dword [ebx + 4]
cmp ecx, edx
jne 0x40c8c2
fild dword [esp + 0x60]
jmp 0x40c8ea
mov eax, dword [esp + 0x60]
dec eax
cmp eax, edx
mov dword [esp + 0x78], eax
jg 0x40c8d3
mov dword [esp + 0x78], edx
lea eax, [ecx - 1]
cmp eax, edx
mov dword [esp + 0x28], eax
jg 0x40c8e2
mov dword [esp + 0x28], edx
fild dword [esp + 0x78]
fidiv dword [esp + 0x28]
mov ecx, dword [ebx + 8]
fstp dword [esp + 0x38]
cmp ecx, edx
jne 0x40c8fb
fild dword [esp + 0x64]
jmp 0x40c921
lea eax, [edi - 1]
cmp eax, edx
mov dword [esp + 0x78], eax
jg 0x40c90a
mov dword [esp + 0x78], edx
lea eax, [ecx - 1]
cmp eax, edx
mov dword [esp + 0x28], eax
jg 0x40c919
mov dword [esp + 0x28], edx
fild dword [esp + 0x78]
fidiv dword [esp + 0x28]
fstp dword [esp + 0x78]
push 8
push edi
call fcn.0040fda3
add esp, 8
mov dword [esp + 0x10], eax
test eax, eax
je 0x40c794
mov ecx, dword [esp + 0x68]
mov edx, dword [ebx + 8]
mov eax, dword [esp + 0x74]
push ecx
mov ecx, dword [esp + 0x7c]
push edx
mov edx, dword [esp + 0x18]
push edi
push eax
push ecx
push edx
call fcn.00404dd0
mov eax, dword [esp + 0x78]
push 8
push eax
call fcn.0040fda3
mov esi, eax
add esp, 0x20
test esi, esi
mov dword [esp + 0x1c], esi
jne 0x40c999
test edi, edi
jbe 0x40c98f
mov ecx, dword [esp + 0x10]
lea esi, [ecx + 4]
mov edx, dword [esi]
push edx
call fcn.0040fb3a
add esp, 4
add esi, 8
dec edi
jne 0x40c97e
mov eax, dword [esp + 0x10]
push eax
jmp 0x40c78c
mov ecx, dword [esp + 0x68]
mov edx, dword [ebx + 4]
mov eax, dword [esp + 0x60]
push ecx
mov ecx, dword [esp + 0x78]
push edx
mov edx, dword [esp + 0x40]
push eax
push ecx
push edx
push esi
call fcn.00404dd0
mov eax, dword [ebx + 8]
add esp, 0x18
cmp ebp, eax
jbe 0x40c9c7
mov ebp, eax
mov dword [esp + 0x6c], ebp
cmp ebp, edi
jbe 0x40c9d1
mov ebp, edi
mov dword [esp + 0x6c], ebp
cmp ebp, 1
je 0x40cacb
push 4
push ebp
call fcn.0040fda3
mov dword [esp + 0x7c], eax
mov eax, dword [ebx + 8]
xor edx, edx
add esp, 8
div ebp
xor esi, esi
xor edi, edi
mov dword [esp + 0x78], eax
lea eax, [ebp - 1]
test eax, eax
jbe 0x40ca7a
push 0x48
push 1
call fcn.0040fda3
mov ecx, dword [esp + 0x7c]
mov edx, dword [esp + 0x80]
push 0
push 0
push 0
mov dword [ecx + edi*4], eax
mov ecx, dword [esp + 0x24]
push 0
lea ebp, [edx + esi]
mov edx, dword [esp + 0x34]
push 0
push 0
push ecx
mov ecx, dword [esp + 0x8c]
push edx
xor edx, edx
mov dx, word [ebx + 0xe]
push ecx
mov ecx, dword [ebx + 8]
push ebp
push esi
push edx
mov edx, dword [ebx + 4]
push ecx
mov ecx, dword [esp + 0xa0]
push edx
mov edx, dword [esp + 0xa0]
push ecx
mov ecx, dword [esp + 0x58]
push edx
mov edx, dword [esp + 0x60]
push ecx
push edx
push eax
call fcn.0040c060
mov eax, dword [esp + 0xc0]
add esp, 0x54
inc edi
dec eax
cmp edi, eax
mov esi, ebp
jb 0x40c9ff
push 0x48
push 1
call fcn.0040fda3
mov ecx, dword [esp + 0x7c]
mov edx, dword [esp + 0x74]
push 0
push 0
push 0
mov dword [ecx + edx*4 - 4], eax
mov edx, dword [esp + 0x24]
push 0
push 0
mov ecx, dword [ebx + 8]
push 0
push edx
mov edx, dword [esp + 0x40]
push edx
mov edx, dword [esp + 0x90]
push edx
xor edx, edx
mov dx, word [ebx + 0xe]
push ecx
push esi
push edx
mov edx, dword [esp + 0x9c]
push ecx
mov ecx, dword [ebx + 4]
push ecx
push edx
jmp 0x40c650
push 0
push 0
call fcn.004109de
push 0x30300
push 0x20300
mov ebp, eax
call fcn.004109de
mov edx, dword [esp + 0x20]
mov ecx, dword [esp + 0x78]
mov eax, dword [ebx + 8]
push edx
push esi
xor edx, edx
mov dx, word [ebx + 0xe]
push ecx
mov ecx, dword [esp + 0x7c]
push eax
push 0
push edx
mov edx, dword [esp + 0x40]
push eax
mov eax, dword [ebx + 4]
push eax
mov eax, dword [esp + 0x44]
push edi
push ecx
push edx
push eax
call fcn.00405080
add esp, 0x40
push 0xfffff
push 0x9001f
call fcn.004109de
push 0xffff
push ebp
call fcn.004109de
add esp, 0x10
jmp 0x40c736
mov ebp, dword [esp + 0x5c]
push ebp
call ebx
mov edi, dword [esp + 0x40]
push edi
call ebx
test esi, esi
je 0x40cb58
push esi
call ebx
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, dword [esp + 0x70]
test eax, eax
je 0x40cbd9
lea eax, [esp + 0x48]
push edi
push eax
call fcn.0040f560
mov edx, dword [esp + 0x50]
mov eax, dword [esp + 0x54]
sub esp, 8
mov ecx, esp
push 0x3ff78787
push 0x87878787
mov dword [ecx], edx
mov edx, dword [esp + 0x68]
push edi
mov dword [ecx + 4], eax
mov eax, dword [esp + 0x70]
mov dword [ecx + 8], edx
mov dword [ecx + 0xc], eax
call fcn.0040e1f0
lea ecx, [esp + 0x64]
push ebp
push ecx
call fcn.0040f560
mov eax, dword [esp + 0x6c]
mov ecx, dword [esp + 0x70]
add esp, 0x14
mov edx, esp
push 0x3ff78787
push 0x87878787
mov dword [edx], eax
mov eax, dword [esp + 0x68]
push ebp
mov dword [edx + 4], ecx
mov ecx, dword [esp + 0x70]
mov dword [edx + 8], eax
mov dword [edx + 0xc], ecx
call fcn.0040e1f0
add esp, 0x1c
mov eax, dword [esp + 0x3c]
test eax, eax
je 0x40ccb6
push 0x46abc0
push 1
push str.EnableBWGamma
push str.Viewing
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileIntW]
test eax, eax
je 0x40ccb6
push 0x46abc0
lea edx, [esp + 0x2c]
push 6
push edx
push 0x465b54
push str.BWGamma
push str.Viewing
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
lea eax, [esp + 0x28]
push eax
call fcn.0040f630
fst qword [esp + 0x44]
fcomp qword [0x43f3e0]
add esp, 4
fnstsw ax
test ah, 5
jp 0x40cc55
mov dword [esp + 0x40], 0x47ae147b
mov dword [esp + 0x44], 0x3f847ae1
jmp 0x40cc78
fld qword [esp + 0x40]
fcomp qword [0x43f3d8]
fnstsw ax
and eax, 0x4100
jne 0x40cc78
mov dword [esp + 0x40], 0x8f5c28f6
mov dword [esp + 0x44], 0x401bf5c2
lea ecx, [esp + 0x48]
push edi
push ecx
call fcn.0040f560
mov eax, dword [esp + 0x50]
mov ecx, dword [esp + 0x54]
sub esp, 8
mov edx, esp
mov dword [edx], eax
mov eax, dword [esp + 0x60]
mov dword [edx + 4], ecx
mov ecx, dword [esp + 0x64]
mov dword [edx + 8], eax
mov eax, dword [esp + 0x50]
mov dword [edx + 0xc], ecx
mov edx, dword [esp + 0x54]
push edx
push eax
push edi
call fcn.0040e1f0
add esp, 0x1c
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x48
ret
mov ecx, dword [esp + 0x5c]
push ecx
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x48
ret
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x48
ret