Function at 0x40e840
Capabilities:
Create thread
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x53f2f3
mov eax, dword fs:[0]
push eax
sub esp, 0x244
mov eax, dword [0x591a60]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ebx, ecx
cmp dword [ebx + 0x2a0], 2
jne 0x40ef16
lea eax, [ebp - 0x218]
push eax
call fcn.00403ec0
add esp, 4
push 0x56a1ae
lea ecx, [ebp - 0x220]
mov dword [ebp - 4], 0
call fcn.00403e00
push 1
push 0
push 0
push 0x56ba24
push 4
push 0
push 0
push 1
lea ecx, [ebp - 0x214]
mov byte [ebp - 4], 1
call fcn.0042a8f5
mov byte [ebp - 4], 2
mov edx, dword [ebp - 0x218]
mov eax, dword [edx - 8]
mov ecx, 1
sub ecx, dword [edx - 4]
sub eax, 0x104
or eax, ecx
jge 0x40e8f9
push 0x104
lea ecx, [ebp - 0x218]
call fcn.004014d0
mov edx, dword [ebp - 0x218]
lea ecx, [ebp - 0x214]
mov esi, edx
call fcn.004aee34
lea ecx, [ebp - 0x214]
mov dword [eax + 0x1c], esi
call fcn.004aee34
lea ecx, [ebp - 0x214]
mov dword [eax + 0x20], 0x104
call fcn.0042b116
test eax, eax
je 0x40e972
lea ecx, [ebp - 0x228]
push ecx
lea ecx, [ebp - 0x214]
call fcn.0042b263
push eax
lea ecx, [ebp - 0x220]
mov byte [ebp - 4], 3
call fcn.004038a0
mov byte [ebp - 4], 2
mov eax, dword [ebp - 0x228]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40e972
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp - 0x218]
mov ecx, dword [eax - 8]
push ecx
push eax
call fcn.00516da6
add esp, 8
test eax, eax
js 0x40ef0c
mov ecx, dword [ebp - 0x218]
cmp eax, dword [ecx - 8]
jg 0x40ef0c
mov dword [ecx - 0xc], eax
mov ecx, dword [ebp - 0x218]
mov byte [eax + ecx], 0
mov edx, dword [ebp - 0x220]
push 0x56a8cc
push edx
call fcn.00516728
mov edi, eax
add esp, 8
test edi, edi
jne 0x40ea2a
lea ecx, [ebp - 0x214]
mov byte [ebp - 4], 1
call fcn.0042a773
mov byte [ebp - 4], 0
mov eax, dword [ebp - 0x220]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40e9f8
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0x218]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40f13b
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
jmp 0x40f13b
mov ecx, dword [ebp - 0x220]
mov eax, dword [ecx - 0xc]
push 3
add eax, 0xfffffffd
push eax
lea edx, [ebp - 0x228]
push edx
lea ecx, [ebp - 0x220]
call fcn.00416490
mov ecx, ebx
mov byte [ebp - 4], 4
call fcn.0040d510
mov esi, dword [ebp - 0x228]
push 0x56ba4c
push esi
call fcn.005174c5
add esp, 8
test eax, eax
sete al
test al, al
je 0x40eb05
movzx eax, word [ebx + 0xec]
movzx esi, word [ebx + 0xee]
imul esi, eax
add esi, esi
push esi
call fcn.00516910
push esi
push 0
push eax
mov dword [ebx + 0x1b0], eax
call fcn.00518800
mov ecx, dword [ebx + 0x1b0]
push edi
push esi
push 1
push ecx
call fcn.005173a9
movzx edx, word [ebx + 0xee]
movzx ecx, word [ebx + 0xec]
imul edx, ecx
add esp, 0x20
xor eax, eax
test edx, edx
jle 0x40ec4e
lea ecx, [ecx]
mov edi, dword [ebx + 0x1b0]
movzx ecx, byte [edi + eax*2 + 1]
movzx edx, byte [edi + eax*2]
shl ecx, 8
add ecx, edx
sar ecx, 2
mov byte [edi + eax], cl
movzx edx, word [ebx + 0xee]
movzx ecx, word [ebx + 0xec]
imul edx, ecx
inc eax
cmp eax, edx
jl 0x40ead0
jmp 0x40ec4e
push 0x56ba50
push esi
call fcn.005174c5
xor esi, esi
add esp, 8
cmp eax, esi
sete al
test al, al
je 0x40ec4e
mov eax, dword [ebp - 0x218]
mov dword [ebp - 0x21c], 0x780
mov dword [ebp - 0x224], 0x438
mov dword [ebp - 0x22c], esi
mov dword [ebp - 0x230], esi
mov edx, dword [eax - 8]
mov ecx, 1
sub ecx, dword [eax - 4]
or edx, ecx
jge 0x40eb69
push esi
lea ecx, [ebp - 0x218]
call fcn.004014d0
mov eax, dword [ebp - 0x218]
lea edx, [ebp - 0x230]
push edx
lea ecx, [ebp - 0x22c]
push ecx
lea edx, [ebp - 0x224]
push edx
lea ecx, [ebp - 0x21c]
push ecx
push eax
call dword [sym.imp.PNG_16.dll_int___cdecl_PNG_GetImageInfo_char___int___int___int___int__]
mov ecx, dword [ebp - 0x21c]
mov eax, dword [ebp - 0x224]
mov word [ebx + 0xee], ax
movzx eax, ax
movzx edx, cx
imul eax, edx
lea esi, [eax + eax*2]
push esi
mov word [ebx + 0xec], cx
mov byte [ebx + 0xf0], 1
call fcn.00516910
push esi
push 0
push eax
mov dword [ebx + 0x1b0], eax
call fcn.00518800
mov edx, dword [ebp - 0x218]
mov ecx, dword [edx - 8]
mov eax, 1
sub eax, dword [edx - 4]
add esp, 0x24
or ecx, eax
jge 0x40ebf9
push 0
lea ecx, [ebp - 0x218]
call fcn.004014d0
mov edx, dword [ebp - 0x218]
mov eax, dword [ebp - 0x224]
imul eax, dword [ebp - 0x21c]
mov ecx, dword [ebx + 0x1b0]
add eax, eax
push eax
push ecx
push edx
call dword [sym.imp.PNG_16.dll_int___cdecl_PNG_Read_char___unsigned_char___int_]
mov edx, dword [ebp - 0x224]
imul edx, dword [ebp - 0x21c]
add esp, 0xc
xor eax, eax
test edx, edx
jle 0x40ec4e
lea ecx, [ecx]
mov esi, dword [ebx + 0x1b0]
mov cl, byte [esi + eax*2]
mov byte [esi + eax], cl
mov edx, dword [ebp - 0x224]
imul edx, dword [ebp - 0x21c]
inc eax
cmp eax, edx
jl 0x40ec30
mov esi, dword [ebx + 0xbc]
test esi, esi
je 0x40ec71
push esi
call fcn.00401f70
push esi
call fcn.0041756d
add esp, 4
mov dword [ebx + 0xbc], 0
push 0xb54
call fcn.0041753e
add esp, 4
mov dword [ebp - 0x22c], eax
mov byte [ebp - 4], 5
test eax, eax
je 0x40ecc5
mov ecx, dword [ebx + 0x29c]
push ecx
mov ecx, dword [ebx + 0x2a0]
lea edx, [ebx + 0x5a8]
push edx
push ecx
lea edx, [ebx + 0x1ec]
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.00401ab0
jmp 0x40ecc7
xor eax, eax
mov dword [ebx + 0xbc], eax
mov byte [ebp - 4], 2
mov eax, dword [ebp - 0x228]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40ecf3
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea ecx, [ebp - 0x214]
mov byte [ebp - 4], 1
call fcn.0042a773
mov byte [ebp - 4], 0
mov eax, dword [ebp - 0x220]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40ed28
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0x218]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40ed51
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
lea esi, [eax + eax*2 + 0x400]
mov eax, dword [ebx + 0xbc]
xor ecx, ecx
mov dword [ebx + 0x1dc], ecx
mov eax, dword [eax + 0xc]
push esi
mov dword [ebx + 0x190], eax
mov dword [ebx + 0xe8], ecx
call fcn.00516910
mov edi, eax
push esi
mov dword [ebx + 0x194], edi
call fcn.00516910
push esi
mov dword [ebp - 0x230], eax
mov dword [ebx + 0x19c], eax
call fcn.00516910
push esi
mov dword [ebp - 0x228], eax
mov dword [ebx + 0x198], eax
call fcn.00516910
push esi
mov dword [ebp - 0x224], eax
mov dword [ebx + 0x1a8], eax
call fcn.00516910
push esi
mov dword [ebp - 0x21c], eax
mov dword [ebx + 0x1a4], eax
call fcn.00516910
mov dword [ebx + 0x1a0], eax
lea eax, [esi*4]
push eax
mov dword [ebp - 0x220], eax
call fcn.00516910
add esp, 0x1c
mov dword [ebx + 0x1ac], eax
test edi, edi
je 0x40f107
cmp dword [ebp - 0x230], 0
je 0x40f107
cmp dword [ebp - 0x228], 0
je 0x40f107
cmp dword [ebp - 0x21c], 0
je 0x40f107
cmp dword [ebp - 0x224], 0
je 0x40f107
push esi
push 0
push edi
call fcn.00518800
mov ecx, dword [ebx + 0x19c]
push esi
push 0
push ecx
call fcn.00518800
mov edx, dword [ebx + 0x198]
push esi
push 0
push edx
call fcn.00518800
mov eax, dword [ebx + 0x1a4]
push esi
push 0
push eax
call fcn.00518800
mov ecx, dword [ebx + 0x1a0]
push esi
push 0
push ecx
call fcn.00518800
mov edx, dword [ebx + 0x1a8]
push esi
push 0
push edx
call fcn.00518800
mov eax, dword [ebp - 0x220]
mov ecx, dword [ebx + 0x1ac]
add esp, 0x48
push eax
push 0
push ecx
call fcn.00518800
mov esi, dword [sym.imp.KERNEL32.dll_CreateEventA]
add esp, 0xc
push 0
push 0
push 1
push 0
call esi
push 0
push 0
push 1
push 0
mov dword [ebx + 0x1b4], eax
call esi
push ebx
push 0
push 0x416880
mov dword [ebx + 0x1b8], eax
call fcn.00516b86
push ebx
push 0
push 0x416ba0
call fcn.00516b86
mov edx, dword [ebx + 0x20]
add esp, 0x18
push 0
push 0x32
push 0
push edx
call dword [sym.imp.USER32.dll_SetTimer]
mov eax, 1
jmp 0x40f13d
push 0x80070057
call fcn.00401570
call fcn.0040d510
mov edi, ebx
call fcn.00415ce0
push 4
call dword [sym.imp.USER32.dll_GetSystemMetrics]
xor esi, esi
cmp dword [ebx + 0xbc], esi
jne 0x40ef3a
mov dword [ebx + 0xbc], esi
push 0xb54
call fcn.0041753e
add esp, 4
mov dword [ebp - 0x22c], eax
mov dword [ebp - 4], 6
cmp eax, esi
je 0x40ef93
mov ecx, dword [ebx + 0x29c]
push ecx
mov ecx, dword [ebx + 0x2a0]
lea edx, [ebx + 0x5a8]
push edx
push ecx
lea edx, [ebx + 0x1ec]
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.00401ab0
xor esi, esi
jmp 0x40ef95
xor eax, eax
mov dword [ebp - 4], 0xffffffff
mov dword [ebx + 0xbc], eax
cmp dword [ebx + 0x2a0], esi
jne 0x40f0b2
xor eax, eax
mov dword [ebp - 0x24c], eax
mov dword [ebp - 0x248], eax
mov dword [ebp - 0x244], eax
mov dword [ebp - 0x240], eax
mov dword [ebp - 0x23c], eax
mov dword [ebp - 0x238], eax
mov dword [ebp - 0x234], eax
lea eax, [ebp - 0x22c]
push eax
lea ecx, [ebp - 0x250]
push 8
push ecx
mov dword [ebp - 0x22c], esi
mov dword [ebp - 0x250], esi
call dword [sym.imp.dtccm2.dll_EnumerateDevice]
mov dword [ebp - 0x21c], esi
add esp, 0xc
lea esi, [ebx + 0x204]
jmp 0x40f010
mov ecx, dword [esi]
cmp dword [ecx - 0xc], 0
mov edi, dword [ecx - 0x10]
lea eax, [ecx - 0x10]
je 0x40f063
cmp dword [eax + 0xc], 0
lea edx, [eax + 0xc]
jge 0x40f03f
cmp dword [ecx - 8], 0
jl 0x40ef0c
mov dword [ecx - 0xc], 0
mov edx, dword [esi]
mov byte [edx], 0
jmp 0x40f063
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40f055
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 - 0x21c]
mov eax, dword [ebp + edi*4 - 0x250]
lea edi, [ebp + edi*4 - 0x250]
test eax, eax
je 0x40f099
push eax
push 0x56ba54
push esi
call fcn.00401640
mov ecx, dword [edi]
add esp, 0xc
push ecx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov dword [edi], 0
mov eax, dword [ebp - 0x21c]
inc eax
add esi, 4
mov dword [ebp - 0x21c], eax
cmp eax, 8
jl 0x40f010
push ecx
lea edx, [ebx + 0x204]
mov dword [ebp - 0x230], esp
mov ecx, esp
push edx
call fcn.004047c0
mov esi, dword [ebx + 0xbc]
call fcn.00402130
mov ecx, dword [ebx + 0xbc]
call fcn.00402770
test eax, eax
jne 0x40ed51
mov eax, dword [ebx + 0xbc]
mov eax, dword [eax + 0x190]
push 0
push 0
push eax
call fcn.00418898
mov ebx, dword [ebx + 0xbc]
mov ecx, dword [ebx + 8]
push ecx
jmp 0x40f11f
push 0
push 0
push str.Memory_error_
call fcn.00418898
mov ebx, dword [ebx + 0xbc]
mov eax, dword [ebx + 8]
push eax
call dword [sym.imp.dtccm2.dll_CloseDevice]
add esp, 4
cmp eax, 1
je 0x40f13b
push 0
push 0
push str.Close_Device_failed__
call fcn.00418898
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.005162b5
mov esp, ebp
pop ebp
ret