Function at 0x10087260
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x488
mov dword [ebp - 0x64], edx
lea edx, [ebp - 0x88]
push esi
mov esi, ecx
mov dword [ebp - 0xc], 0
mov dword [ebp - 0x6c], 0xff
call fcn.10086d70
test eax, eax
je 0x100872ba
mov eax, dword [esi + 4]
mov dword [ebp - 0x50], eax
cdq
xor eax, edx
sub eax, edx
mov dword [esi + 4], eax
cmp eax, 0x1000000
jbe 0x100872c1
mov ecx, dword [0x10228440]
mov eax, dword fs:[0x2c]
mov eax, dword [eax + ecx*4]
mov dword [eax + 0xc], 0x101c71e4
xor eax, eax
pop esi
mov esp, ebp
pop ebp
ret
mov ecx, dword [esi]
mov dword [ebp - 0x18], ecx
cmp ecx, 0x1000000
jbe 0x100872ee
mov ecx, dword [0x10228440]
mov eax, dword fs:[0x2c]
pop esi
mov eax, dword [eax + ecx*4]
mov dword [eax + 0xc], 0x101c7174
xor eax, eax
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x7c]
mov edx, dword [ebp - 0x88]
mov dword [ebp - 0x34], eax
mov eax, dword [ebp - 0x78]
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x74]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x70]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x6c]
push ebx
mov ebx, dword [ebp - 0x84]
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 0x80]
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x44], ebx
mov dword [ebp - 0x28], edx
push edi
mov edi, dword [ebp - 0x68]
mov dword [ebp - 0x38], edi
cmp eax, 0xc
jne 0x10087350
cmp edx, 0x18
jge 0x10087366
mov ecx, ebx
mov eax, 0x55555556
sub ecx, edi
sub ecx, 0x18
imul ecx
mov ecx, dword [ebp - 0x18]
mov edi, edx
shr edi, 0x1f
add edi, edx
jmp 0x1008735f
cmp edx, 0x10
jge 0x10087366
mov edi, ebx
sub edi, dword [ebp - 0x38]
sub edi, eax
sar edi, 2
mov dword [ebp - 0xc], edi
test edi, edi
jne 0x100873ce
mov eax, dword [esi + 0xa8]
sub eax, dword [esi + 0xb4]
add eax, dword [esi + 0xac]
cmp ebx, eax
je 0x10087393
push 0x1515
push 0x101c7180
push str.info.offset__s__callback_already_read___int___s__img_buffer___s__img_buffer_original_
call fcn.10140c96
add esp, 0xc
mov ecx, dword [esi + 0xa8]
mov eax, dword [esi + 0xac]
sub ecx, esi
add eax, 0xffffffd8
add eax, ecx
cmp ebx, eax
je 0x100873cc
mov ecx, dword [0x10228440]
mov eax, dword fs:[0x2c]
pop edi
pop ebx
pop esi
mov eax, dword [eax + ecx*4]
mov dword [eax + 0xc], str.bad_offset
xor eax, eax
mov esp, ebp
pop ebp
ret
mov ecx, dword [esi]
cmp dword [ebp - 0x28], 0x18
mov edx, dword [ebp - 0x1c]
jne 0x100873e8
cmp edx, 0xff000000
jne 0x100873e6
mov eax, 3
jmp 0x100873f2
mov ecx, dword [esi]
xor eax, eax
test edx, edx
setne al
add eax, 3
mov dword [esi + 8], eax
mov edi, dword [esi + 4]
test ecx, ecx
js 0x1008804f
je 0x10087422
mov eax, 0x7fffffff
cdq
idiv ecx
cmp eax, 4
jl 0x1008804f
lea eax, [ecx*4]
test eax, eax
js 0x1008804f
test edi, edi
js 0x1008804f
je 0x10087443
mov eax, 0x7fffffff
cdq
idiv edi
lea edx, [ecx*4]
cmp edx, eax
jg 0x1008804f
test ecx, ecx
je 0x10087458
mov eax, 0x7fffffff
cdq
idiv ecx
cmp eax, 4
jl 0x1008802d
test edi, edi
je 0x10087473
mov eax, 0x7fffffff
cdq
idiv edi
lea edx, [ecx*4]
cmp edx, eax
jg 0x1008802d
imul ecx, edi
lea eax, [ecx*4]
push eax
call fcn.101412cf
mov edx, eax
add esp, 4
mov dword [ebp - 0x20], edx
test edx, edx
je 0x1008802d
mov ecx, dword [ebp - 0x28]
xor edi, edi
cmp ecx, 0x10
jge 0x10087a0b
mov eax, dword [ebp - 0xc]
test eax, eax
je 0x100879e0
cmp eax, 0x100
jg 0x100879e0
mov ebx, dword [ebp - 0x20]
xor edx, edx
mov dword [ebp - 0x14], edx
mov dword [ebp - 0x30], ebx
test eax, eax
jle 0x10087616
lea ecx, [esi + 0x20]
mov ebx, eax
mov dword [ebp - 8], ecx
mov eax, dword [esi + 0xac]
cmp eax, dword [esi + 0xb0]
jae 0x100874f1
mov bl, byte [eax]
inc eax
mov byte [ebp - 1], bl
mov ebx, dword [ebp - 0xc]
mov dword [esi + 0xac], eax
jmp 0x10087525
cmp dword [esi + 0x20], 0
lea ecx, [esi + 0x20]
mov dword [ebp - 8], ecx
je 0x1008751e
mov ecx, esi
call fcn.1007dd60
mov eax, dword [esi + 0xac]
mov edx, dword [ebp - 0x14]
mov cl, byte [eax]
inc eax
mov byte [ebp - 1], cl
mov ecx, dword [ebp - 8]
mov dword [esi + 0xac], eax
jmp 0x10087525
mov byte [ebp - 1], 0
mov dword [ebp - 8], ecx
lea edi, [ebp - 0x488]
lea edx, [edi + edx*4]
mov dword [ebp - 0x10], edx
mov edi, edx
mov dl, byte [ebp - 1]
mov byte [edi + 2], dl
cmp eax, dword [esi + 0xb0]
jae 0x1008754c
mov cl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
jmp 0x1008756b
cmp dword [ecx], 0
je 0x10087569
mov ecx, esi
call fcn.1007dd60
mov eax, dword [esi + 0xac]
mov cl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
jmp 0x1008756b
xor cl, cl
mov edx, dword [ebp - 0x10]
mov byte [edx + 1], cl
cmp eax, dword [esi + 0xb0]
jae 0x1008758a
mov cl, byte [eax]
inc eax
mov byte [ebp - 1], cl
lea ecx, [esi + 0x20]
mov dword [esi + 0xac], eax
jmp 0x100875b4
mov ecx, dword [ebp - 8]
cmp dword [ecx], 0
je 0x100875b0
mov ecx, esi
call fcn.1007dd60
mov eax, dword [esi + 0xac]
mov cl, byte [eax]
inc eax
mov byte [ebp - 1], cl
mov ecx, dword [ebp - 8]
mov dword [esi + 0xac], eax
jmp 0x100875b4
mov byte [ebp - 1], 0
cmp dword [ebp - 0x24], 0xc
mov edx, ecx
mov edi, dword [ebp - 0x10]
mov cl, byte [ebp - 1]
mov byte [edi], cl
mov ecx, edx
mov dword [ebp - 8], ecx
je 0x100875fa
cmp eax, dword [esi + 0xb0]
jae 0x100875dd
inc eax
lea ecx, [esi + 0x20]
mov dword [esi + 0xac], eax
jmp 0x100875f7
cmp dword [edx], 0
mov ecx, edx
mov dword [ebp - 8], ecx
je 0x100875fa
mov ecx, esi
call fcn.1007dd60
inc dword [esi + 0xac]
mov ecx, dword [ebp - 8]
mov dword [ebp - 8], ecx
mov edx, dword [ebp - 0x14]
mov byte [ebp + edx*4 - 0x485], 0xff
inc edx
mov dword [ebp - 0x14], edx
cmp edx, ebx
jl 0x100874d2
mov ebx, dword [ebp - 0x30]
xor edi, edi
mov ecx, dword [ebp - 0x44]
xor eax, eax
cmp dword [ebp - 0x24], 0xc
setne al
add eax, 3
imul eax, dword [ebp - 0xc]
sub ecx, eax
sub ecx, dword [ebp - 0x38]
sub ecx, dword [ebp - 0x24]
je 0x10087679
test ecx, ecx
jns 0x10087645
mov eax, dword [esi + 0xb0]
mov dword [esi + 0xac], eax
jmp 0x10087679
cmp dword [esi + 0x10], 0
je 0x10087673
mov edx, dword [esi + 0xb0]
mov eax, edx
sub eax, dword [esi + 0xac]
cmp eax, ecx
jge 0x10087673
sub ecx, eax
mov dword [esi + 0xac], edx
mov eax, dword [esi + 0x14]
push ecx
push dword [esi + 0x1c]
call eax
add esp, 8
jmp 0x10087679
add dword [esi + 0xac], ecx
mov edx, dword [ebp - 0x28]
cmp edx, 1
jne 0x1008768b
mov eax, dword [esi]
add eax, 7
shr eax, 3
jmp 0x100876a2
cmp edx, 4
jne 0x10087697
mov eax, dword [esi]
inc eax
shr eax, 1
jmp 0x100876a2
cmp edx, 8
jne 0x100879b5
mov eax, dword [esi]
mov ecx, dword [esi + 4]
neg eax
and eax, 3
cmp edx, 1
mov dword [ebp - 0x14], eax
mov edx, ecx
jne 0x1008782b
mov dword [ebp - 0x3c], 0
test ecx, ecx
jle 0x10087f2d
nop word [eax + eax]
mov ecx, dword [esi + 0xac]
mov eax, 7
mov dword [ebp - 0xc], eax
cmp ecx, dword [esi + 0xb0]
jae 0x100876f6
mov dl, byte [ecx]
lea eax, [ecx + 1]
mov dword [esi + 0xac], eax
mov eax, dword [ebp - 0xc]
jmp 0x10087719
cmp dword [esi + 0x20], 0
je 0x10087717
mov ecx, esi
call fcn.1007dd60
mov eax, dword [esi + 0xac]
mov dl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
mov eax, dword [ebp - 0xc]
jmp 0x10087719
xor dl, dl
cmp dword [esi], 0
movzx ecx, dl
mov dword [ebp - 0x40], ecx
mov dword [ebp - 0x10], 0
jle 0x100877d7
nop
mov edx, ecx
mov ecx, eax
sar edx, cl
and edx, 1
movzx eax, byte [ebp + edx*4 - 0x488]
mov byte [ebx + edi], al
movzx eax, byte [ebp + edx*4 - 0x487]
mov byte [ebx + edi + 1], al
movzx eax, byte [ebp + edx*4 - 0x486]
mov byte [ebx + edi + 2], al
mov eax, dword [ebp - 0x10]
inc eax
mov byte [ebx + edi + 3], 0xff
mov ecx, dword [esi]
add edi, 4
mov edx, eax
mov dword [ebp - 0x10], edx
cmp eax, ecx
je 0x100877d7
mov eax, dword [ebp - 0xc]
sub eax, 1
mov dword [ebp - 0xc], eax
jns 0x100877cc
mov eax, dword [esi + 0xac]
mov dword [ebp - 0xc], 7
cmp eax, dword [esi + 0xb0]
jae 0x1008779e
mov dl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
jmp 0x100877c0
cmp dword [esi + 0x20], 0
je 0x100877be
mov ecx, esi
call fcn.1007dd60
mov eax, dword [esi + 0xac]
mov dl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
mov ecx, dword [esi]
jmp 0x100877c0
xor dl, dl
movzx eax, dl
mov edx, dword [ebp - 0x10]
mov dword [ebp - 0x40], eax
mov eax, dword [ebp - 0xc]
cmp edx, ecx
mov ecx, dword [ebp - 0x40]
jl 0x10087730
mov eax, dword [ebp - 0x14]
test eax, eax
je 0x10087812
cmp dword [esi + 0x10], 0
je 0x1008780c
mov edx, dword [esi + 0xb0]
mov ecx, edx
sub ecx, dword [esi + 0xac]
cmp ecx, eax
jge 0x1008780c
sub eax, ecx
mov dword [esi + 0xac], edx
push eax
push dword [esi + 0x1c]
mov eax, dword [esi + 0x14]
call eax
add esp, 8
jmp 0x10087812
add dword [esi + 0xac], eax
mov eax, dword [ebp - 0x3c]
mov ecx, dword [esi + 4]
inc eax
mov dword [ebp - 0x3c], eax
mov edx, ecx
cmp eax, ecx
jl 0x100876d0
jmp 0x10087f2d
mov dword [ebp - 0x1c], 0
test ecx, ecx
jle 0x10087f2d
nop word [eax + eax]
cmp dword [esi], 0
mov dword [ebp - 0x10], 0
jle 0x10087964
mov eax, dword [esi + 0xac]
cmp eax, dword [esi + 0xb0]
jae 0x10087869
mov cl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
jmp 0x10087889
cmp dword [esi + 0x20], 0
je 0x10087887
mov ecx, esi
call fcn.1007dd60
mov eax, dword [esi + 0xac]
mov cl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
jmp 0x10087889
xor cl, cl
mov edx, 0x20
movzx ecx, cl
mov eax, esi
add eax, edx
xor edx, edx
cmp dword [ebp - 0x28], 4
mov dword [ebp - 0x18], eax
jne 0x100878a8
mov edx, ecx
and edx, 0xf
shr ecx, 4
movzx eax, byte [ebp + ecx*4 - 0x488]
mov byte [ebx + edi], al
movzx eax, byte [ebp + ecx*4 - 0x487]
mov byte [ebx + edi + 1], al
movzx eax, byte [ebp + ecx*4 - 0x486]
mov ecx, dword [ebp - 0x10]
mov byte [ebx + edi + 2], al
mov byte [ebx + edi + 3], 0xff
add edi, 4
lea eax, [ecx + 1]
cmp eax, dword [esi]
je 0x10087961
cmp dword [ebp - 0x28], 8
jne 0x10087928
mov eax, dword [esi + 0xac]
cmp eax, dword [esi + 0xb0]
jae 0x10087900
mov cl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
jmp 0x10087922
mov eax, dword [ebp - 0x18]
cmp dword [eax], 0
je 0x10087920
mov ecx, esi
call fcn.1007dd60
mov eax, dword [esi + 0xac]
mov cl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
jmp 0x10087922
xor cl, cl
movzx edx, cl
mov ecx, dword [ebp - 0x10]
movzx eax, byte [ebp + edx*4 - 0x488]
add ecx, 2
mov byte [ebx + edi], al
movzx eax, byte [ebp + edx*4 - 0x487]
mov byte [ebx + edi + 1], al
movzx eax, byte [ebp + edx*4 - 0x486]
mov byte [ebx + edi + 2], al
mov byte [ebx + edi + 3], 0xff
add edi, 4
mov dword [ebp - 0x10], ecx
cmp ecx, dword [esi]
jl 0x10087850
mov eax, dword [ebp - 0x14]
test eax, eax
je 0x1008799f
cmp dword [esi + 0x10], 0
je 0x10087999
mov edx, dword [esi + 0xb0]
mov ecx, edx
sub ecx, dword [esi + 0xac]
cmp ecx, eax
jge 0x10087999
sub eax, ecx
mov dword [esi + 0xac], edx
push eax
push dword [esi + 0x1c]
mov eax, dword [esi + 0x14]
call eax
mov eax, dword [ebp - 0x14]
add esp, 8
jmp 0x1008799f
add dword [esi + 0xac], eax
inc dword [ebp - 0x1c]
mov ecx, dword [esi + 4]
mov edx, ecx
cmp dword [ebp - 0x1c], ecx
jl 0x10087840
jmp 0x10087f2d
push ebx
call fcn.10140444
mov ecx, dword [0x10228440]
add esp, 4
mov eax, dword fs:[0x2c]
pop edi
mov eax, dword [eax + ecx*4]
pop ebx
pop esi
mov dword [eax + 0xc], str.bad_bpp
xor eax, eax
mov esp, ebp
pop ebp
ret
push edx
call fcn.10140444
mov ecx, dword [0x10228440]
add esp, 4
mov eax, dword fs:[0x2c]
pop edi
mov eax, dword [eax + ecx*4]
pop ebx
pop esi
mov dword [eax + 0xc], str.invalid
xor eax, eax
mov esp, ebp
pop ebp
ret
sub ebx, dword [ebp - 0x38]
mov dword [ebp - 0x54], 0
mov dword [ebp - 0x58], 0
mov dword [ebp - 0x5c], 0
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x48], 0
mov dword [ebp - 0x4c], 0
mov dword [ebp - 0x3c], 0
mov dword [ebp - 0x44], 0
mov dword [ebp - 0x40], edi
mov dword [ebp - 0xc], edi
sub ebx, dword [ebp - 0x24]
je 0x10087a99
test ebx, ebx
jns 0x10087a63
mov eax, dword [esi + 0xb0]
mov dword [esi + 0xac], eax
jmp 0x10087a99
cmp dword [esi + 0x10], edi
je 0x10087a93
mov edx, dword [esi + 0xb0]
mov eax, edx
sub eax, dword [esi + 0xac]
cmp eax, ebx
jge 0x10087a93
sub ebx, eax
mov dword [esi + 0xac], edx
mov eax, dword [esi + 0x14]
push ebx
push dword [esi + 0x1c]
call eax
mov ecx, dword [ebp - 0x28]
add esp, 8
jmp 0x10087a99
add dword [esi + 0xac], ebx
cmp ecx, 0x18
jne 0x10087aa5
mov eax, dword [esi]
lea eax, [eax + eax*2]
jmp 0x10087ab2
cmp ecx, 0x10
jne 0x10087ab0
mov eax, dword [esi]
add eax, eax
jmp 0x10087ab2
xor eax, eax
neg eax
and eax, 3
mov dword [ebp - 0x60], eax
cmp ecx, 0x18
jne 0x10087ad1
mov ebx, dword [ebp - 0x20]
mov dword [ebp - 0xc], 1
mov dword [ebp - 0x30], ebx
jmp 0x10087cb7
mov eax, dword [ebp - 0x20]
mov ebx, eax
mov edx, dword [ebp - 0x10]
cmp ecx, 0x20
jne 0x10087b15
cmp edx, 0xff
jne 0x10087b15
cmp dword [ebp - 0x14], 0xff00
mov ecx, dword [ebp - 0x34]
jne 0x10087b18
cmp ecx, 0xff0000
jne 0x10087b18
cmp dword [ebp - 0x1c], 0xff000000
mov dword [ebp - 0x30], ebx
jne 0x10087b3f
mov dword [ebp - 0xc], 2
mov dword [ebp - 0x30], ebx
jmp 0x10087cb7
mov ecx, dword [ebp - 0x34]
xor eax, eax
mov dword [ebp - 0xc], eax
test ecx, ecx
je 0x10088002
cmp dword [ebp - 0x14], eax
je 0x10088002
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x30], ebx
mov dword [ebp - 0x20], eax
test edx, edx
je 0x10088002
call fcn.10086c90
sub eax, 7
mov dword [ebp - 0x54], eax
mov eax, dword [ebp - 0x34]
mov edx, eax
and eax, 0x55555555
shr edx, 1
and edx, 0x55555555
add edx, eax
mov eax, edx
and edx, 0x33333333
shr eax, 2
and eax, 0x33333333
add eax, edx
mov ecx, eax
shr ecx, 4
add ecx, eax
and ecx, 0xf0f0f0f
mov eax, ecx
shr eax, 8
add ecx, eax
mov eax, ecx
shr eax, 0x10
add eax, ecx
mov ecx, dword [ebp - 0x14]
movzx eax, al
mov dword [ebp - 0x48], eax
call fcn.10086c90
sub eax, 7
mov dword [ebp - 0x58], eax
mov eax, dword [ebp - 0x14]
mov edx, eax
and eax, 0x55555555
shr edx, 1
and edx, 0x55555555
add edx, eax
mov eax, edx
and edx, 0x33333333
shr eax, 2
and eax, 0x33333333
add eax, edx
mov ecx, eax
shr ecx, 4
add ecx, eax
and ecx, 0xf0f0f0f
mov eax, ecx
shr eax, 8
add ecx, eax
mov eax, ecx
shr eax, 0x10
add eax, ecx
mov ecx, dword [ebp - 0x10]
movzx eax, al
mov dword [ebp - 0x4c], eax
call fcn.10086c90
sub eax, 7
mov dword [ebp - 0x5c], eax
mov eax, dword [ebp - 0x10]
mov edx, eax
and eax, 0x55555555
shr edx, 1
and edx, 0x55555555
add edx, eax
mov eax, edx
and edx, 0x33333333
shr eax, 2
and eax, 0x33333333
add eax, edx
mov ecx, eax
shr ecx, 4
add ecx, eax
and ecx, 0xf0f0f0f
mov eax, ecx
shr eax, 8
add ecx, eax
mov eax, ecx
shr eax, 0x10
add eax, ecx
mov ecx, dword [ebp - 0x1c]
movzx eax, al
mov dword [ebp - 0x3c], eax
call fcn.10086c90
sub eax, 7
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x1c]
mov edx, eax
and eax, 0x55555555
shr edx, 1
and edx, 0x55555555
add edx, eax
mov eax, edx
and edx, 0x33333333
shr eax, 2
and eax, 0x33333333
add eax, edx
mov ecx, eax
shr ecx, 4
add ecx, eax
and ecx, 0xf0f0f0f
mov eax, ecx
shr eax, 8
add ecx, eax
mov eax, ecx
shr eax, 0x10
add eax, ecx
cmp dword [ebp - 0x48], 8
movzx eax, al
mov dword [ebp - 0x44], eax
ja 0x10087fd7
cmp dword [ebp - 0x4c], 8
ja 0x10087fd7
cmp dword [ebp - 0x3c], 8
ja 0x10087fd7
cmp eax, 8
ja 0x10087fd7
mov ecx, dword [esi + 4]
mov edx, ecx
mov dword [ebp - 0x38], edi
test ecx, ecx
jle 0x10087f2d
nop word [eax + eax]
cmp dword [ebp - 0xc], 0
mov eax, dword [esi]
mov dword [ebp - 0x24], 0
je 0x10087e32
test eax, eax
jle 0x10087edc
lea ecx, [esi + 0x20]
nop
mov eax, dword [esi + 0xac]
mov dword [ebp - 8], ecx
cmp eax, dword [esi + 0xb0]
jae 0x10087d0c
mov dl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
jmp 0x10087d38
cmp dword [esi + 0x20], 0
lea ecx, [esi + 0x20]
mov dword [ebp - 8], ecx
je 0x10087d33
mov ecx, esi
call fcn.1007dd60
mov eax, dword [esi + 0xac]
mov ecx, dword [ebp - 8]
mov dl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
jmp 0x10087d38
xor dl, dl
mov dword [ebp - 8], ecx
mov eax, dword [ebp - 0x20]
mov byte [edi + eax + 2], dl
mov eax, dword [esi + 0xac]
cmp eax, dword [esi + 0xb0]
jae 0x10087d58
mov cl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
jmp 0x10087d77
cmp dword [ecx], 0
je 0x10087d75
mov ecx, esi
call fcn.1007dd60
mov eax, dword [esi + 0xac]
mov cl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
jmp 0x10087d77
xor cl, cl
mov eax, dword [ebp - 0x20]
mov byte [edi + eax + 1], cl
mov eax, dword [esi + 0xac]
cmp eax, dword [esi + 0xb0]
jae 0x10087d9a
mov dl, byte [eax]
lea ecx, [esi + 0x20]
inc eax
mov dword [esi + 0xac], eax
jmp 0x10087dbf
mov ecx, dword [ebp - 8]
cmp dword [ecx], 0
je 0x10087dbd
mov ecx, esi
call fcn.1007dd60
mov eax, dword [esi + 0xac]
mov ecx, dword [ebp - 8]
mov dl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
jmp 0x10087dc2
xor dl, dl
mov dword [ebp - 8], ecx
cmp dword [ebp - 0xc], 2
mov byte [ebx + edi], dl
jne 0x10087e0b
mov eax, dword [esi + 0xac]
cmp eax, dword [esi + 0xb0]
jae 0x10087de7
mov dl, byte [eax]
lea ecx, [esi + 0x20]
inc eax
mov dword [esi + 0xac], eax
jmp 0x10087e0e
cmp dword [ecx], 0
je 0x10087e07
mov ecx, esi
call fcn.1007dd60
mov eax, dword [esi + 0xac]
mov ecx, dword [ebp - 8]
mov dl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
jmp 0x10087e0e
xor dl, dl
jmp 0x10087e0e
or dl, 0xff
mov byte [ebx + edi + 3], dl
add edi, 4
movzx eax, dl
mov edx, dword [ebp - 0x24]
or dword [ebp - 0x2c], eax
inc edx
mov dword [ebp - 0x24], edx
cmp edx, dword [esi]
jl 0x10087cf0
mov dword [ebp - 0x40], edi
jmp 0x10087edc
test eax, eax
jle 0x10087edc
nop word [eax + eax]
mov ecx, esi
call fcn.1007de50
cmp dword [ebp - 0x28], 0x10
je 0x10087e5e
mov ecx, esi
mov edi, eax
call fcn.1007de50
shl eax, 0x10
add eax, edi
mov edi, dword [ebp - 0x40]
push dword [ebp - 0x48]
mov edx, dword [ebp - 0x54]
mov ecx, eax
and ecx, dword [ebp - 0x34]
mov dword [ebp - 8], eax
call fcn.10086cf0
mov ecx, dword [ebp - 8]
push dword [ebp - 0x4c]
and ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x58]
mov byte [ebx + edi], al
call fcn.10086cf0
mov ecx, dword [ebp - 8]
push dword [ebp - 0x3c]
and ecx, dword [ebp - 0x10]
mov edx, dword [ebp - 0x5c]
mov byte [ebx + edi + 1], al
call fcn.10086cf0
mov ecx, dword [ebp - 0x1c]
add esp, 0xc
mov byte [ebx + edi + 2], al
test ecx, ecx
je 0x10087ebb
push dword [ebp - 0x44]
and ecx, dword [ebp - 8]
mov edx, dword [ebp - 0x18]
call fcn.10086cf0
add esp, 4
jmp 0x10087ec0
mov eax, 0xff
or dword [ebp - 0x2c], eax
mov byte [ebx + edi + 3], al
add edi, 4
mov eax, dword [ebp - 0x24]
inc eax
mov dword [ebp - 0x40], edi
mov dword [ebp - 0x24], eax
cmp eax, dword [esi]
jl 0x10087e40
mov edx, dword [ebp - 0x60]
test edx, edx
je 0x10087f19
cmp dword [esi + 0x10], 0
je 0x10087f13
mov eax, dword [esi + 0xb0]
mov ecx, eax
sub ecx, dword [esi + 0xac]
cmp ecx, edx
jge 0x10087f13
mov dword [esi + 0xac], eax
mov eax, edx
sub eax, ecx
push eax
push dword [esi + 0x1c]
mov eax, dword [esi + 0x14]
call eax
add esp, 8
jmp 0x10087f19
add dword [esi + 0xac], edx
mov eax, dword [ebp - 0x38]
mov ecx, dword [esi + 4]
inc eax
mov dword [ebp - 0x38], eax
mov edx, ecx
cmp eax, ecx
jl 0x10087cd0
cmp dword [ebp - 0x2c], 0
jne 0x10087f52
mov eax, dword [esi]
imul eax, ecx
lea eax, [eax*4 - 1]
test eax, eax
js 0x10087f52
mov ecx, dword [ebp - 0x20]
mov byte [eax + ecx], 0xff
sub eax, 4
jns 0x10087f46
mov edx, dword [esi + 4]
cmp dword [ebp - 0x50], 0
jle 0x10087fbf
xor edi, edi
mov dword [ebp - 0x18], edi
test edx, 0xfffffffe
jle 0x10087fbf
mov ecx, dword [esi]
sub edx, edi
mov eax, ecx
dec edx
imul eax, edi
xor edi, edi
imul edx, ecx
lea eax, [ebx + eax*4]
mov dword [ebp - 0x50], eax
lea edx, [ebx + edx*4]
lea eax, [ecx*4]
test eax, eax
jle 0x10087fad
mov ebx, dword [ebp - 0x50]
sub ebx, edx
nop dword [eax]
mov al, byte [edx]
lea edx, [edx + 1]
mov cl, byte [edx + ebx - 1]
inc edi
mov byte [edx + ebx - 1], al
mov byte [edx - 1], cl
mov eax, dword [esi]
shl eax, 2
cmp edi, eax
jl 0x10087f90
mov ebx, dword [ebp - 0x30]
mov edi, dword [ebp - 0x18]
mov edx, dword [esi + 4]
inc edi
mov eax, edx
mov dword [ebp - 0x18], edi
sar eax, 1
cmp edi, eax
jl 0x10087f65
mov eax, dword [ebp - 0x64]
mov ecx, dword [esi]
pop edi
mov dword [eax], ecx
mov eax, ebx
mov ecx, dword [ebp + 8]
mov edx, dword [esi + 4]
pop ebx
pop esi
mov dword [ecx], edx
mov esp, ebp
pop ebp
ret
push ebx
call fcn.10140444
mov ecx, dword [0x10228440]
add esp, 4
mov eax, dword fs:[0x2c]
pop edi
mov eax, dword [eax + ecx*4]
pop ebx
pop esi
mov dword [eax + 0xc], str.bad_masks
xor eax, eax
mov esp, ebp
pop ebp
ret
push ebx
call fcn.10140444
mov ecx, dword [0x10228440]
add esp, 4
mov eax, dword fs:[0x2c]
pop edi
mov eax, dword [eax + ecx*4]
pop ebx
pop esi
mov dword [eax + 0xc], 0x101c74b0
xor eax, eax
mov esp, ebp
pop ebp
ret
mov ecx, dword [0x10228440]
mov eax, dword fs:[0x2c]
pop edi
pop ebx
pop esi
mov eax, dword [eax + ecx*4]
mov dword [eax + 0xc], 0x101c73e0
xor eax, eax
mov esp, ebp
pop ebp
ret
mov ecx, dword [0x10228440]
mov eax, dword fs:[0x2c]
pop edi
pop ebx
pop esi
mov eax, dword [eax + ecx*4]
mov dword [eax + 0xc], 0x101c73d4
xor eax, eax
mov esp, ebp
pop ebp
ret