Function at 0x40e390
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x53d59e
mov eax, dword fs:[0]
push eax
sub esp, 0x3c
push ebx
push esi
push edi
mov eax, dword [0x58fa50]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ebx, ecx
cmp dword [ebx + 0x29c], 2
jne 0x40e778
push 0x5698d8
lea ecx, [ebp - 0x10]
call fcn.00403bc0
lea eax, [ebp - 0x24]
xor esi, esi
push eax
mov dword [ebp - 4], esi
call fcn.00403c80
lea ecx, [ebp - 0x10]
push ecx
push eax
lea edx, [ebp - 0x20]
push edx
mov byte [ebp - 4], 1
call fcn.004149e0
add esp, 0x10
push eax
lea ecx, [ebp - 0x10]
mov byte [ebp - 4], 2
call fcn.00403660
mov byte [ebp - 4], 1
mov eax, dword [ebp - 0x20]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40e427
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [ebp - 4], 0
mov eax, dword [ebp - 0x24]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40e44a
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x1c], esi
mov dword [ebp - 0x18], esi
mov dword [ebp - 0x28], esi
mov dword [ebp - 0x14], esi
mov edx, dword [eax - 8]
mov ecx, 1
sub ecx, dword [eax - 4]
or edx, ecx
jge 0x40e474
push esi
lea ecx, [ebp - 0x10]
call fcn.004014e0
mov eax, dword [ebp - 0x10]
lea ecx, [ebp - 0x14]
push ecx
lea edx, [ebp - 0x28]
push edx
lea ecx, [ebp - 0x18]
push ecx
lea edx, [ebp - 0x1c]
push edx
push eax
call dword [sym.imp.PNG_16.dll_int___cdecl_PNG_GetImageInfo_char___int___int___int___int__]
mov edx, dword [ebp - 0x18]
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x1c]
imul eax, edx
imul eax, ecx
mov word [ebx + 0xee], dx
cdq
and edx, 7
lea esi, [edx + eax]
sar esi, 3
push esi
mov word [ebx + 0xec], cx
mov byte [ebx + 0xf0], 1
mov byte [ebx + 0x14e], 2
call fcn.00515042
push esi
mov edi, eax
push 0
push edi
call fcn.00516de0
mov esi, dword [ebp - 0x10]
mov ecx, dword [esi - 8]
mov eax, 1
sub eax, dword [esi - 4]
add esp, 0x24
or ecx, eax
jge 0x40e4f3
push 0
lea ecx, [ebp - 0x10]
call fcn.004014e0
mov esi, dword [ebp - 0x10]
mov eax, dword [ebp - 0x14]
imul eax, dword [ebp - 0x18]
imul eax, dword [ebp - 0x1c]
cdq
and edx, 7
add eax, edx
sar eax, 3
push eax
push edi
push esi
call dword [sym.imp.PNG_16.dll_int___cdecl_PNG_Read_char___unsigned_char___int_]
movzx eax, word [ebx + 0xee]
movzx esi, word [ebx + 0xec]
imul esi, eax
push esi
call fcn.00515042
push esi
push 0
push eax
mov dword [ebx + 0x1ac], eax
call fcn.00516de0
add esp, 0x1c
xor eax, eax
test esi, esi
jle 0x40e551
nop
mov dl, byte [edi + eax*2]
mov ecx, dword [ebx + 0x1ac]
mov byte [eax + ecx], dl
inc eax
cmp eax, esi
jl 0x40e540
push edi
call fcn.005150d6
add esp, 4
cmp dword [ebx + 0xbc], 0
jne 0x40e56d
mov dword [ebx + 0xbc], 0
push 0xb54
call fcn.004163de
add esp, 4
mov dword [ebp - 0x24], eax
mov byte [ebp - 4], 3
test eax, eax
je 0x40e5be
mov ecx, dword [ebx + 0x298]
push ecx
mov ecx, dword [ebx + 0x29c]
lea edx, [ebx + 0x5a0]
push edx
push ecx
lea edx, [ebx + 0x1e8]
push edx
sub esp, 0xa4
mov edi, esp
mov ecx, 0x29
lea esi, [ebx + 0xec]
push eax
rep movsd dword es:[edi], dword [esi]
call fcn.00401ac0
jmp 0x40e5c0
xor eax, eax
mov dword [ebx + 0xbc], eax
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0x10]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40e5ec
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
movzx edx, word [ebx + 0xec]
movzx eax, word [ebx + 0xee]
imul eax, edx
xor ecx, ecx
lea esi, [eax + eax*2 + 0x400]
mov eax, dword [ebx + 0xbc]
mov dword [ebx + 0x1d8], ecx
mov edx, dword [eax + 0xc]
push esi
mov dword [ebx + 0x190], edx
mov dword [ebx + 0xe8], ecx
call fcn.00515042
mov edi, eax
push esi
mov dword [ebx + 0x194], edi
call fcn.00515042
push esi
mov dword [ebp - 0x28], eax
mov dword [ebx + 0x19c], eax
call fcn.00515042
push esi
mov dword [ebp - 0x20], eax
mov dword [ebx + 0x198], eax
call fcn.00515042
push esi
mov dword [ebp - 0x18], eax
mov dword [ebx + 0x1a4], eax
call fcn.00515042
mov dword [ebp - 0x1c], eax
mov dword [ebx + 0x1a0], eax
lea eax, [esi*4]
push eax
mov dword [ebp - 0x14], eax
call fcn.00515042
add esp, 0x18
mov dword [ebx + 0x1a8], eax
test edi, edi
je 0x40e933
cmp dword [ebp - 0x28], 0
je 0x40e933
cmp dword [ebp - 0x20], 0
je 0x40e933
cmp dword [ebp - 0x1c], 0
je 0x40e933
cmp dword [ebp - 0x18], 0
je 0x40e933
push esi
push 0
push edi
call fcn.00516de0
mov eax, dword [ebx + 0x19c]
push esi
push 0
push eax
call fcn.00516de0
mov ecx, dword [ebx + 0x198]
push esi
push 0
push ecx
call fcn.00516de0
mov edx, dword [ebx + 0x1a0]
push esi
push 0
push edx
call fcn.00516de0
mov eax, dword [ebx + 0x1a4]
push esi
push 0
push eax
call fcn.00516de0
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebx + 0x1a8]
push ecx
push 0
push edx
call fcn.00516de0
mov esi, dword [sym.imp.KERNEL32.dll_CreateEventA]
add esp, 0x48
push 0
push 0
push 1
push 0
call esi
push 0
push 0
push 1
push 0
mov dword [ebx + 0x1b0], eax
call esi
push ebx
push 0
push 0x414df0
mov dword [ebx + 0x1b4], eax
call fcn.005152b8
push ebx
push 0
push 0x415130
call fcn.005152b8
mov eax, dword [ebx + 0x20]
add esp, 0x18
push 0
push 0x64
push 0
push eax
call dword [sym.imp.USER32.dll_SetTimer]
mov eax, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
call fcn.0040d080
mov edi, ebx
call fcn.004141c0
push 4
call dword [sym.imp.USER32.dll_GetSystemMetrics]
xor esi, esi
cmp dword [ebx + 0xbc], esi
jne 0x40e79c
mov dword [ebx + 0xbc], esi
push 0xb54
call fcn.004163de
add esp, 4
mov dword [ebp - 0x28], eax
mov dword [ebp - 4], 4
cmp eax, esi
je 0x40e7f2
mov ecx, dword [ebx + 0x298]
push ecx
mov ecx, dword [ebx + 0x29c]
lea edx, [ebx + 0x5a0]
push edx
push ecx
lea edx, [ebx + 0x1e8]
push edx
sub esp, 0xa4
mov edi, esp
lea esi, [ebx + 0xec]
mov ecx, 0x29
push eax
rep movsd dword es:[edi], dword [esi]
call fcn.00401ac0
xor esi, esi
jmp 0x40e7f4
xor eax, eax
mov dword [ebp - 4], 0xffffffff
mov dword [ebx + 0xbc], eax
cmp dword [ebx + 0x29c], esi
jne 0x40e8d9
xor eax, eax
mov dword [ebp - 0x44], eax
mov dword [ebp - 0x40], eax
mov dword [ebp - 0x3c], eax
mov dword [ebp - 0x38], eax
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x2c], eax
lea eax, [ebp - 0x24]
push eax
lea ecx, [ebp - 0x48]
push 8
push ecx
mov dword [ebp - 0x24], esi
mov dword [ebp - 0x48], esi
call dword [sym.imp.dtccm2.dll_EnumerateDevice]
mov dword [ebp - 0x1c], esi
add esp, 0xc
lea esi, [ebx + 0x200]
mov ecx, dword [esi]
cmp dword [ecx - 0xc], 0
mov edi, dword [ecx - 0x10]
lea eax, [ecx - 0x10]
je 0x40e899
cmp dword [eax + 0xc], 0
lea edx, [eax + 0xc]
jge 0x40e875
cmp dword [ecx - 8], 0
jl 0x40e929
mov dword [ecx - 0xc], 0
mov edx, dword [esi]
mov byte [edx], 0
jmp 0x40e899
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40e88b
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov edx, dword [edi]
mov eax, dword [edx + 0xc]
mov ecx, edi
call eax
add eax, 0x10
mov dword [esi], eax
mov edi, dword [ebp - 0x1c]
mov eax, dword [ebp + edi*4 - 0x48]
lea edi, [ebp + edi*4 - 0x48]
test eax, eax
je 0x40e8c6
push eax
push 0x5698e4
push esi
call fcn.00401650
mov ecx, dword [edi]
add esp, 0xc
push ecx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov dword [edi], 0
mov eax, dword [ebp - 0x1c]
inc eax
add esi, 4
mov dword [ebp - 0x1c], eax
cmp eax, 8
jl 0x40e846
push ecx
lea edx, [ebx + 0x200]
mov dword [ebp - 0x28], esp
mov ecx, esp
push edx
call fcn.00404580
mov esi, dword [ebx + 0xbc]
call fcn.00402140
mov ecx, dword [ebx + 0xbc]
call fcn.004025f0
test eax, eax
jne 0x40e5ec
push eax
push eax
mov eax, dword [ebx + 0xbc]
mov ecx, dword [eax + 0x190]
push ecx
call fcn.00417747
mov ebx, dword [ebx + 0xbc]
mov edx, dword [ebx + 8]
push edx
jmp 0x40e94b
push 0x80070057
call fcn.00401580
push 0
push 0
push str.Memory_error_
call fcn.00417747
mov ebx, dword [ebx + 0xbc]
mov ecx, dword [ebx + 8]
push ecx
call dword [sym.imp.dtccm2.dll_CloseDevice]
add esp, 4
cmp eax, 1
je 0x40e967
push 0
push 0
push str.Close_Device_failed__
call fcn.00417747
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret