Function at 0x10040ac0
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x11c
mov eax, dword [0x10063068]
xor eax, esp
mov dword [esp + 0x118], eax
mov eax, dword [ebp + 8]
push ebx
push esi
xor esi, esi
mov ebx, edx
lea edx, [eax - 2]
push edi
mov dword [esp + 0x10], ebx
mov dword [esp + 0x38], eax
mov dword [esp + 0x20], ecx
mov dword [esp + 0x40], esi
mov dword [esp + 0x3c], esi
mov dword [esp + 0x54], esi
mov dword [esp + 0x1c], esi
mov dword [esp + 0x24], esi
mov dword [esp + 0x30], esi
mov dword [esp + 0x2c], esi
mov dword [esp + 0x18], eax
mov dword [esp + 0x34], esi
mov dword [esp + 0x4c], edx
cmp ebx, esi
je 0x10041531
cmp eax, esi
je 0x10041531
cmp ecx, esi
je 0x10041531
cmp dword [ebp + 0xc], esi
jge 0x10040b50
lea eax, [esi - 0x20]
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x118]
xor ecx, esp
call fcn.10045a28
mov esp, ebp
pop ebp
ret
mov eax, dword [ebx]
cmp eax, 0x50435245
je 0x10040b7d
sub eax, 0x45524350
neg eax
sbb eax, eax
and eax, 0x19
add eax, 0xffffffe3
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x118]
xor ecx, esp
call fcn.10045a28
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebx + 0xc]
test cl, 2
jne 0x10040b9f
mov eax, 0xffffffe4
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x118]
xor ecx, esp
call fcn.10045a28
mov esp, ebp
pop ebp
ret
mov eax, dword [ebx + 8]
movzx edi, word [ebx + 0x22]
mov edx, eax
shr edx, 0xb
and edx, 1
mov dword [esp + 0xb0], edx
lea edx, [ebx + edi*2]
mov dword [esp + 0x90], edx
movzx edx, word [ebx + 0x26]
mov dword [esp + 0x80], edx
movzx edx, word [ebx + 0x24]
mov dword [esp + 0xec], esi
mov dword [esp + 0x10c], esi
mov esi, dword [ebx + 0x30]
mov dword [esp + 0x84], edx
mov dword [esp + 0x64], 0x989680
mov dword [esp + 0x68], 0x989680
test ecx, 0x2000
je 0x10040c11
mov ebx, dword [ebx + 0x10]
cmp ebx, 0x989680
jae 0x10040c0d
mov dword [esp + 0x64], ebx
mov ebx, dword [esp + 0x10]
test ecx, 0x4000
je 0x10040c28
mov ebx, dword [ebx + 0x14]
cmp ebx, 0x989680
jae 0x10040c28
mov dword [esp + 0x68], ebx
test esi, esi
jne 0x10040c31
mov esi, 0x10052b98
mov ebx, eax
shr ebx, 4
and ebx, 1
mov dword [esp + 0x50], ebx
mov ebx, ecx
shr ebx, 8
and ebx, 1
mov dword [esp + 0x58], ebx
mov ebx, eax
shr ebx, 0x12
and ebx, 1
mov dword [esp + 0x44], ebx
mov ebx, dword [esp + 0x10]
movzx ebx, word [ebx + 0x26]
imul edx, ebx
mov ebx, dword [ebp + 0xc]
add edx, edi
mov edi, dword [esp + 0x10]
lea edx, [edi + edx*2]
mov edi, dword [esp + 0x38]
mov dword [esp + 0xd8], edi
lea edi, [edi + ebx*2]
mov dword [esp + 0xdc], edi
mov dword [esp + 0x28], edi
mov edi, eax
shr edi, 5
and edi, 1
mov dword [esp + 0xbc], edi
mov edi, eax
shr edi, 0x1d
and edi, 1
shr ecx, 0xc
mov dword [esp + 0xb8], edi
and ecx, 1
mov edi, eax
shr edi, 0x19
mov dword [esp + 0xd0], ecx
lea ecx, [esi + 0x100]
mov dword [esp + 0xd4], edx
xor edx, edx
and edi, 1
mov dword [esp + 0x9c], esi
add esi, 0x340
mov dword [esp + 0xf8], edx
mov dword [esp + 0xb4], edi
mov dword [esp + 0x8c], edx
mov dword [esp + 0xa8], edx
mov dword [esp + 0xac], edx
mov dword [esp + 0xc0], edx
mov dword [esp + 0xc4], edx
mov dword [esp + 0xc8], edx
mov dword [esp + 0x114], edx
mov dword [esp + 0x110], edx
mov dword [esp + 0x108], edx
mov dword [esp + 0xa0], ecx
mov dword [esp + 0xa4], esi
test eax, 0x1800000
je 0x10040d3e
mov edx, eax
shr edx, 0x17
and edx, 1
and eax, 0x700000
mov dword [esp + 0xcc], edx
cmp eax, 0x300000
ja 0x10040daf
je 0x10040da8
test eax, eax
je 0x10040d65
cmp eax, 0x100000
je 0x10040da1
cmp eax, 0x200000
jne 0x10040dbd
mov eax, 0xa
mov dword [esp + 0x78], 0
cmp eax, 0xff
jle 0x10040deb
mov ecx, eax
sar ecx, 8
movzx edx, al
and ecx, 0xff
mov dword [esp + 0x7c], 2
mov word [esp + 0x94], cx
mov word [esp + 0x96], dx
jmp 0x10040dfb
mov eax, 0xd
jmp 0x10040d6a
mov eax, 0xd0a
jmp 0x10040d6a
cmp eax, 0x400000
je 0x10040de1
cmp eax, 0x500000
je 0x10040dd7
mov eax, 0xffffffe9
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x118]
xor ecx, esp
call fcn.10045a28
mov esp, ebp
pop ebp
ret
mov dword [esp + 0x78], 2
jmp 0x10040dfb
mov dword [esp + 0x78], 1
jmp 0x10040dfb
mov dword [esp + 0x7c], 1
mov word [esp + 0x94], ax
mov eax, 0x55555556
imul dword [ebp + 0x10]
mov eax, edx
shr eax, 0x1f
add eax, edx
lea esi, [eax + eax*2]
lea ecx, [esi + esi]
mov eax, 0x55555556
imul ecx
mov eax, edx
shr eax, 0x1f
add eax, edx
mov dword [esp + 0x48], eax
mov eax, dword [esp + 0x10]
movzx eax, word [eax + 0x20]
test ax, ax
je 0x10040e84
mov ecx, eax
mov eax, 0x55555556
imul esi
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp ecx, eax
jl 0x10040e84
lea esi, [ecx + ecx*2 + 3]
lea ecx, [esi*4]
push ecx
call dword [0x10065740]
mov edi, eax
add esp, 4
mov dword [esp + 0x6c], edi
test edi, edi
jne 0x10040e7a
lea eax, [edi - 6]
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x118]
xor ecx, esp
call fcn.10045a28
mov esp, ebp
pop ebp
ret
mov dword [esp + 0x40], 1
jmp 0x10040e8c
mov edi, dword [esp + 0x20]
mov dword [esp + 0x6c], edi
mov ebx, dword [esp + 0xdc]
lea ecx, [esi + esi]
mov eax, 0x55555556
imul ecx
mov eax, edx
shr eax, 0x1f
add eax, edx
mov dword [esp + 0x70], esi
mov dword [esp + 0x74], eax
mov dword [esp + 0xf4], 0
test edi, edi
je 0x10040f09
mov ecx, dword [esp + 0x10]
movzx edx, word [ecx + 0x1e]
add edx, edx
lea eax, [edi + esi*4]
add edx, edx
mov ecx, eax
sub ecx, edx
lea edx, [edi + 8]
cmp ecx, edx
jae 0x10040ed7
mov ecx, edx
sub eax, 4
cmp eax, ecx
jb 0x10040ef1
mov edi, edi
mov dword [eax], 0xffffffff
sub eax, 4
cmp eax, ecx
jae 0x10040ee0
mov edi, dword [esp + 0x6c]
mov dword [edi + 4], 0xffffffff
mov eax, dword [esp + 0x6c]
mov dword [eax], 0xffffffff
mov ebx, dword [esp + 0xdc]
cmp dword [esp + 0x50], 0
mov esi, dword [esp + 0x7c]
mov edx, dword [esp + 0x10]
jne 0x10040f58
mov eax, dword [edx + 0xc]
test al, 0x10
je 0x10040f58
movzx ecx, word [edx + 0x18]
movzx edi, cx
mov dword [esp + 0x3c], 1
mov dword [esp + 0x24], ecx
mov dword [esp + 0x1c], edi
test al, 0x20
je 0x10040f5c
mov eax, 0xff
cmp cx, ax
ja 0x10040f5c
mov eax, dword [esp + 0xa0]
movzx ecx, cx
movzx ecx, byte [ecx + eax]
mov dword [esp + 0x24], ecx
jmp 0x10040f5c
mov ecx, dword [esp + 0x24]
mov eax, dword [edx + 0xc]
test al, 0x40
je 0x10040f9a
movzx edx, word [edx + 0x1a]
movzx edi, dx
mov dword [esp + 0x54], 1
mov dword [esp + 0x2c], edx
mov dword [esp + 0x30], edi
test al, al
jns 0x10040f9a
mov eax, 0xff
cmp dx, ax
ja 0x10040f9a
mov eax, dword [esp + 0xa0]
movzx edx, dx
movzx eax, byte [edx + eax]
mov dword [esp + 0x2c], eax
mov edi, dword [esp + 0x18]
cmp dword [esp + 0x44], 0
mov edx, dword [esp + 0x28]
mov eax, dword [esp + 0x1c]
mov dword [esp + 0x14], edx
je 0x10041028
mov ecx, edi
cmp edi, ebx
jae 0x1004101a
cmp dword [esp + 0x78], 0
je 0x10040fe8
mov edx, dword [esp + 0x78]
push edx
lea esi, [esp + 0x80]
mov edx, ebx
call fcn.10041630
mov esi, dword [esp + 0x80]
add esp, 4
test eax, eax
jne 0x1004101a
mov ebx, dword [esp + 0xdc]
jmp 0x10041013
lea eax, [esi + esi]
mov edx, ebx
sub edx, eax
cmp ecx, edx
ja 0x10041013
mov ax, word [esp + 0x94]
cmp word [ecx], ax
jne 0x10041013
cmp esi, 1
je 0x1004101a
mov dx, word [esp + 0x96]
cmp word [ecx + 2], dx
je 0x1004101a
add ecx, 2
cmp ecx, ebx
jb 0x10040fb7
mov eax, dword [esp + 0x1c]
mov edx, ecx
mov ecx, dword [esp + 0x24]
mov dword [esp + 0x28], edx
mov ebx, dword [esp + 0x10]
mov ebx, dword [ebx + 8]
and ebx, 0x4000000
jne 0x10041150
cmp dword [esp + 0x3c], ebx
je 0x10041095
cmp ax, cx
je 0x10041073
cmp edi, edx
jae 0x10041150
mov esi, dword [esp + 0x1c]
movzx eax, word [edi]
cmp ax, si
je 0x10041150
cmp ax, cx
je 0x10041150
add edi, 2
cmp edi, edx
jb 0x10041052
jmp 0x10041150
cmp edi, edx
jae 0x10041150
jmp 0x10041080
cmp word [edi], ax
je 0x10041150
add edi, 2
cmp edi, edx
jb 0x10041080
jmp 0x10041150
cmp dword [esp + 0x58], 0
je 0x10041150
cmp edi, dword [esp + 0xd8]
jbe 0x10041150
cmp edi, edx
jae 0x10041127
cmp dword [esp + 0x78], 0
je 0x100410ec
cmp edi, dword [esp + 0xd8]
jbe 0x10041120
mov eax, dword [esp + 0x78]
mov edx, dword [esp + 0xd8]
push eax
lea esi, [esp + 0x80]
mov ecx, edi
call fcn.100416c0
mov edx, dword [esp + 0x2c]
add esp, 4
test eax, eax
jne 0x10041127
mov esi, dword [esp + 0x7c]
jmp 0x10041120
mov eax, dword [esp + 0xd8]
lea ecx, [esi + esi]
add eax, ecx
cmp edi, eax
jb 0x10041120
mov eax, edi
sub eax, ecx
mov cx, word [esp + 0x94]
cmp word [eax], cx
jne 0x10041120
cmp esi, 1
je 0x10041127
mov cx, word [esp + 0x96]
cmp word [eax + 2], cx
je 0x10041127
add edi, 2
cmp edi, edx
jb 0x100410b1
cmp word [edi - 2], 0xd
jne 0x10041150
mov eax, dword [esp + 0x78]
cmp eax, 1
je 0x1004113c
cmp eax, 2
jne 0x10041150
cmp edi, edx
jae 0x10041150
cmp word [edi], 0xa
jne 0x10041150
add edi, 2
lea esp, [esp]
mov edx, dword [esp + 0x14]
mov dword [esp + 0x28], edx
test ebx, ebx
jne 0x1004120f
cmp dword [esp + 0xec], ebx
jne 0x1004120f
cmp dword [esp + 0x54], ebx
je 0x1004120f
mov eax, edx
sub eax, edi
and eax, 0xfffffffe
cmp eax, 0x7d0
jge 0x1004120f
xor ecx, ecx
cmp dword [esp + 0x3c], ecx
setne cl
lea eax, [edi + ecx*2]
cmp eax, dword [esp + 0x4c]
jbe 0x1004120f
mov dx, word [esp + 0x2c]
cmp word [esp + 0x30], dx
je 0x100411da
cmp eax, dword [esp + 0x14]
jae 0x100411cd
movzx edx, word [esp + 0x30]
mov esi, dword [esp + 0x14]
movzx ecx, word [eax]
add eax, 2
cmp ecx, edx
je 0x10041204
movzx ebx, word [esp + 0x2c]
cmp ecx, ebx
je 0x10041204
cmp eax, esi
jb 0x100411b6
mov dword [esp + 0x18], 0
jmp 0x100413c5
cmp eax, dword [esp + 0x14]
jae 0x100411cd
mov cx, word [eax]
add eax, 2
cmp cx, word [esp + 0x30]
je 0x10041200
cmp eax, dword [esp + 0x14]
jb 0x100411e0
mov dword [esp + 0x18], 0
jmp 0x100413c5
mov esi, dword [esp + 0x14]
sub eax, 2
cmp eax, esi
jae 0x100411cd
mov dword [esp + 0x4c], eax
mov eax, dword [esp + 0xd4]
xor esi, esi
push esi
push esi
lea edx, [esp + 0x68]
push edx
push 2
push edi
push eax
push edi
mov dword [esp + 0xfc], edi
mov dword [esp + 0x104], edi
mov dword [esp + 0x7c], esi
mov dword [esp + 0x118], esi
mov dword [esp + 0x10c], esi
mov dword [esp + 0xa4], esi
call fcn.1003beb0
add esp, 0x1c
mov ecx, eax
mov dword [esp + 0x18], ecx
cmp dword [esp + 0xc8], esi
je 0x10041277
cmp dword [esp + 0x34], esi
jne 0x10041277
mov edx, dword [esp + 0xe8]
mov dword [esp + 0x34], edx
mov dword [esp + 0x5c], edi
cmp ecx, esi
jg case.default.0x10041290
je case.0x10041290.995
lea eax, [ecx + 0x3e4]
cmp eax, 4
ja case.default.0x10041290
jmp dword [eax*4 + 0x1004154c]
mov eax, dword [esp + 0x88]
mov ebx, edi
mov dword [esp + 0x8c], eax
jmp 0x100412c2
mov eax, dword [esp + 0xe0]
cmp eax, edi
jbe case.0x10041290.995
mov ebx, eax
jmp 0x100412c2
mov dword [esp + 0x8c], esi
lea ebx, [edi + 2]
mov dword [esp + 0x18], esi
cmp dword [esp + 0x44], esi
je 0x1004133e
cmp dword [esp + 0x78], esi
je 0x10041302
cmp edi, dword [esp + 0xdc]
jae 0x1004133e
mov ecx, dword [esp + 0x78]
mov edx, dword [esp + 0xdc]
push ecx
lea esi, [esp + 0x80]
mov ecx, edi
call fcn.10041630
add esp, 4
test eax, eax
jne 0x100413c5
jmp 0x1004133e
mov eax, dword [esp + 0x7c]
mov ecx, dword [esp + 0xdc]
lea edx, [eax + eax]
sub ecx, edx
cmp edi, ecx
ja 0x1004133e
mov dx, word [edi]
cmp dx, word [esp + 0x94]
jne 0x1004133e
cmp eax, 1
je 0x100413c5
mov ax, word [edi + 2]
cmp ax, word [esp + 0x96]
je 0x100413c5
cmp dword [esp + 0x50], 0
mov edi, ebx
jne 0x100413c5
mov eax, dword [esp + 0x14]
cmp ebx, eax
ja 0x100413c5
cmp ebx, dword [esp + 0x38]
jbe 0x1004138b
cmp word [ebx - 2], 0xd
jne 0x1004138b
cmp ebx, eax
jae 0x1004138b
cmp word [ebx], 0xa
jne 0x1004138b
mov ecx, dword [esp + 0x10]
test dword [ecx + 0xc], 0x800
jne 0x1004138b
mov eax, dword [esp + 0x78]
cmp eax, 1
je 0x10041388
cmp eax, 2
je 0x10041388
cmp dword [esp + 0x7c], 2
jne 0x1004138b
lea edi, [ebx + 2]
mov esi, dword [esp + 0x7c]
mov ebx, dword [esp + 0xdc]
mov ecx, dword [esp + 0x24]
mov dword [esp + 0x110], 0
jmp 0x10040f9e
mov dword [esp + 0x18], esi
jmp 0x100413c5
cmp ecx, 1
je 0x1004144b
cmp ecx, 0xfffffc19
je 0x10041449
cmp dword [esp + 0x40], 0
je 0x100413da
mov edx, dword [esp + 0x6c]
push edx
call dword [0x10065744]
add esp, 4
mov eax, dword [esp + 0x18]
test eax, eax
je 0x100413eb
cmp eax, 0xfffffff4
jne 0x10041536
mov eax, dword [esp + 0x34]
test eax, eax
je 0x10041431
mov ecx, dword [esp + 0x38]
mov edx, dword [esp + 0x20]
sub eax, ecx
sar eax, 1
mov dword [edx], eax
mov eax, dword [esp + 0x14]
sub eax, ecx
sar eax, 1
mov dword [edx + 4], eax
mov eax, dword [esp + 0x5c]
sub eax, ecx
sar eax, 1
mov dword [edx + 8], eax
mov eax, 0xfffffff4
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x118]
xor ecx, esp
call fcn.10045a28
mov esp, ebp
pop ebp
ret
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x118]
xor ecx, esp
call fcn.10045a28
mov esp, ebp
pop ebp
ret
xor esi, esi
mov edi, dword [esp + 0x48]
mov ebx, 0x10000
cmp dword [esp + 0x40], esi
je 0x10041499
mov esi, dword [esp + 0x6c]
cmp edi, 4
jl 0x1004147f
mov edx, dword [esp + 0x20]
lea eax, [edi*4 - 8]
push eax
lea ecx, [esi + 8]
push ecx
add edx, 8
push edx
call sub.MSVCR100.dll_memcpy
add esp, 0xc
cmp dword [esp + 0xf0], edi
jle 0x1004148f
or dword [esp + 0xf4], ebx
push esi
call dword [0x10065744]
add esp, 4
mov esi, dword [esp + 0xf0]
test dword [esp + 0xf4], ebx
je 0x100414b1
cmp esi, edi
jl 0x100414b1
xor ebx, ebx
jmp 0x100414ba
mov eax, esi
cdq
sub eax, edx
mov ebx, eax
sar ebx, 1
mov eax, dword [esp + 0x10]
movzx ecx, word [eax + 0x1e]
mov eax, esi
cdq
sub eax, edx
sar eax, 1
cmp eax, ecx
jg 0x100414f4
lea eax, [ecx + ecx + 2]
mov ecx, dword [ebp + 0x10]
cmp eax, ecx
jle 0x100414da
mov eax, ecx
mov ecx, dword [esp + 0x20]
lea edi, [ecx + esi*4]
lea ecx, [ecx + eax*4]
cmp edi, ecx
jae 0x100414f4
sub ecx, edi
dec ecx
shr ecx, 2
inc ecx
or eax, 0xffffffff
rep stosd dword es:[edi], eax
mov eax, dword [esp + 0xd8]
mov edx, dword [esp + 0xe0]
mov ecx, dword [esp + 0x20]
sub edx, eax
sar edx, 1
mov dword [ecx], edx
mov edx, dword [esp + 0xe4]
sub edx, eax
sar edx, 1
mov dword [ecx + 4], edx
mov eax, ebx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x118]
xor ecx, esp
call fcn.10045a28
mov esp, ebp
pop ebp
ret
mov eax, 0xfffffffe
mov ecx, dword [esp + 0x124]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.10045a28
mov esp, ebp
pop ebp
ret