Function at 0x407ca0
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x368
cmp dword [ebp + 0x2c], 0x64
push ebx
push esi
push edi
jne 0x4083d8
cmp dword [ebp + 0x30], 0x64
jne 0x4083d8
mov eax, dword [ebp + 8]
mov edi, dword [sym.imp.KERNEL32.dll_GlobalLock]
mov ecx, dword [eax + 4]
mov esi, dword [eax + 8]
mov dword [ebp - 0x64], esi
mov ecx, dword [ecx]
mov ebx, dword [ecx + 4]
push ebx
call edi
test eax, eax
jne 0x407ce5
xor eax, eax
jmp 0x408bc9
movzx ecx, word [eax + 0xe]
cmp ecx, 1
mov dword [ebp - 0x44], ecx
je 0x407d00
cmp ecx, 4
je 0x407d00
cmp ecx, 8
je 0x407d00
cmp ecx, 0x18
jne 0x407cde
mov ecx, dword [eax + 4]
mov eax, dword [eax + 8]
mov dword [ebp - 0x24], eax
imul eax, esi
mov edx, dword [ebp + 0x28]
push 8
push eax
push ecx
mov dword [ebp + 0x30], ecx
mov dword [edx], eax
call fcn.00404a52
add esp, 0xc
mov dword [ebp - 0x38], eax
test eax, eax
jne 0x407d2d
push ebx
jmp 0x408474
push dword [ebp - 0x38]
call edi
test eax, eax
mov dword [ebp - 0x30], eax
push ebx
je 0x408474
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
and dword [ebp - 0x2c], 0
test esi, esi
jle 0x4083c7
mov eax, dword [ebp + 0x20]
push 0x64
imul eax, eax, 0x5fa
cdq
pop ecx
idiv ecx
dec esi
mov dword [ebp - 0x34], esi
mov dword [ebp - 0x60], eax
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 0x2c]
mov eax, dword [eax + 4]
mov eax, dword [eax + ecx*4]
mov eax, dword [eax + 4]
push eax
mov dword [ebp - 0x48], eax
call dword [sym.imp.KERNEL32.dll_GlobalLock]
mov ebx, eax
test ebx, ebx
mov dword [ebp - 0x54], ebx
je 0x407cde
mov eax, dword [ebp + 0x30]
xor ecx, ecx
mov edi, 0xc0
lea eax, [eax + eax*2]
mov dword [ebp + 0x2c], eax
mov eax, ecx
mov esi, edi
and eax, edi
imul eax, eax, 0xff
add eax, 0x60
cdq
idiv esi
mov esi, 0xe0
mov byte [ebp + ecx - 0x268], al
mov eax, ecx
and eax, 0x38
imul eax, eax, 0x3fc
add eax, 0x70
cdq
idiv esi
mov esi, edi
mov byte [ebp + ecx - 0x168], al
mov eax, ecx
and eax, 6
imul eax, eax, 0x1fe0
add eax, 0x60
cdq
idiv esi
inc ecx
mov esi, 0x100
cmp ecx, esi
mov byte [ebp + ecx - 0x369], al
jl 0x407d9c
mov ecx, dword [ebp - 0x30]
mov eax, dword [ecx]
add eax, ecx
xor ecx, ecx
inc eax
mov dl, byte [ebp + ecx - 0x268]
inc ecx
mov byte [eax + 1], dl
mov dl, byte [ebp + ecx - 0x169]
mov byte [eax], dl
mov dl, byte [ebp + ecx - 0x369]
mov byte [eax - 1], dl
add eax, 4
cmp ecx, esi
jl 0x407e00
mov edi, dword [ebx]
add edi, ebx
mov dword [ebp - 0x3c], edi
call fcn.00406115
mov eax, dword [ebp + 0x2c]
mov esi, eax
shl esi, 2
push esi
mov dword [ebp - 0x50], esi
call fcn.0042df00
push esi
mov dword [ebp - 0x18], eax
call fcn.0042df00
push esi
mov dword [ebp - 0x28], eax
call fcn.0042df00
add esp, 0xc
cmp dword [ebp - 0x18], 0
mov dword [ebp - 0x40], eax
je 0x407cde
mov esi, dword [ebp - 0x28]
test esi, esi
je 0x407cde
cmp dword [ebx + 0x10], 3
jne 0x407e7d
mov eax, dword [ebx]
lea ecx, [eax + ebx + 0xc]
jmp 0x407e87
mov eax, dword [ebx + 0x20]
mov ecx, dword [ebx]
lea ecx, [ecx + eax*4]
add ecx, ebx
xor ebx, ebx
mov dword [ebp - 0x14], ecx
cmp dword [ebp + 0x30], ebx
mov dword [ebp + 0x2c], ebx
jle 0x407fa8
lea edx, [ecx + 1]
mov dword [ebp - 0x20], edx
mov eax, dword [ebp - 0x44]
dec eax
je 0x407f34
sub eax, 3
je 0x407eef
sub eax, 4
je 0x407ed4
sub eax, 0x10
jne 0x407f7a
movzx eax, byte [edx + 1]
mov dword [ebp + 0x28], eax
movzx eax, byte [edx]
mov dword [ebp + 0x20], eax
movzx eax, byte [edx - 1]
mov dword [ebp - 4], eax
jmp 0x407f7a
movzx eax, byte [ebx + ecx]
movzx ebx, byte [edi + eax*4 + 2]
lea eax, [edi + eax*4]
mov dword [ebp + 0x28], ebx
movzx ebx, byte [eax + 1]
movzx eax, byte [eax]
mov dword [ebp + 0x20], ebx
jmp 0x407ecc
mov eax, ebx
push 2
cdq
pop ebx
idiv ebx
mov eax, dword [ebp + 0x2c]
test edx, edx
cdq
jne 0x407f0b
sub eax, edx
sar eax, 1
mov al, byte [eax + ecx]
shr al, 4
jmp 0x407f14
sub eax, edx
sar eax, 1
mov al, byte [eax + ecx]
and al, 0xf
movzx eax, al
movzx edx, byte [edi + eax*4 + 2]
lea eax, [edi + eax*4]
mov dword [ebp + 0x28], edx
movzx edx, byte [eax + 1]
movzx eax, byte [eax]
mov dword [ebp + 0x20], edx
mov edx, dword [ebp - 0x20]
mov dword [ebp - 4], eax
jmp 0x407f7a
mov eax, dword [ebp + 0x2c]
push 8
cdq
pop ecx
mov bl, 1
idiv ecx
mov eax, dword [ebp + 0x2c]
push 7
pop ecx
push 8
sub ecx, edx
shl bl, cl
cdq
pop ecx
idiv ecx
mov ecx, dword [ebp - 0x14]
and bl, byte [eax + ecx]
je 0x407f59
mov bl, 1
movzx eax, bl
movzx ecx, byte [edi + eax*4 + 2]
lea eax, [edi + eax*4]
mov edx, dword [ebp - 0x20]
mov dword [ebp + 0x28], ecx
movzx ecx, byte [eax + 1]
movzx eax, byte [eax]
mov dword [ebp + 0x20], ecx
mov ecx, dword [ebp - 0x14]
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x28]
mov ebx, dword [ebp + 0x2c]
mov dword [esi], eax
mov eax, dword [ebp + 0x20]
add esi, 4
add edx, 3
mov dword [ebp - 0x20], edx
mov dword [esi], eax
mov eax, dword [ebp - 4]
add esi, 4
mov dword [esi], eax
add esi, 4
inc ebx
cmp ebx, dword [ebp + 0x30]
mov dword [ebp + 0x2c], ebx
jl 0x407e9e
and dword [ebp - 0xc], 0
cmp dword [ebp - 0x24], 0
jle 0x408391
mov ebx, dword [ebp - 0x30]
mov eax, dword [ebp - 0x28]
mov edi, dword [ebp - 0x18]
mov edx, dword [ebp - 0xc]
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x24]
mov dword [ebp - 0x28], edi
dec eax
cmp edx, eax
je 0x40812d
mov eax, dword [ebp - 0x54]
cmp dword [eax + 0x10], 3
jne 0x407fe5
mov ecx, dword [eax]
lea ecx, [ecx + eax + 0xc]
jmp 0x407fef
mov ecx, dword [eax + 0x20]
mov esi, dword [eax]
lea ecx, [esi + ecx*4]
add ecx, eax
movzx esi, word [eax + 0xe]
imul esi, dword [eax + 4]
add esi, 0x1f
and dword [ebp + 0x2c], 0
shr esi, 3
and esi, 0x1ffffffc
inc edx
imul esi, edx
add esi, ecx
cmp dword [ebp + 0x30], 0
jle 0x40812d
lea ecx, [esi + 1]
mov dword [ebp - 0x14], ecx
mov eax, dword [ebp - 0x44]
dec eax
je 0x4080bb
sub eax, 3
je 0x408073
sub eax, 4
je 0x408053
sub eax, 0x10
jne 0x408100
movzx eax, byte [ecx + 1]
mov dword [ebp + 0x28], eax
movzx eax, byte [ecx]
mov dword [ebp + 0x20], eax
movzx eax, byte [ecx - 1]
mov dword [ebp - 4], eax
jmp 0x408100
mov eax, dword [ebp + 0x2c]
mov edx, dword [ebp - 0x3c]
movzx eax, byte [eax + esi]
lea eax, [edx + eax*4]
movzx edx, byte [eax + 2]
mov dword [ebp + 0x28], edx
movzx edx, byte [eax + 1]
movzx eax, byte [eax]
mov dword [ebp + 0x20], edx
jmp 0x40804b
mov eax, dword [ebp + 0x2c]
push 2
cdq
pop ecx
idiv ecx
mov eax, dword [ebp + 0x2c]
test edx, edx
cdq
jne 0x408090
sub eax, edx
sar eax, 1
mov al, byte [eax + esi]
shr al, 4
jmp 0x408099
sub eax, edx
sar eax, 1
mov al, byte [eax + esi]
and al, 0xf
mov ecx, dword [ebp - 0x3c]
movzx eax, al
lea eax, [ecx + eax*4]
movzx ecx, byte [eax + 2]
mov dword [ebp + 0x28], ecx
movzx ecx, byte [eax + 1]
movzx eax, byte [eax]
mov dword [ebp + 0x20], ecx
mov ecx, dword [ebp - 0x14]
mov dword [ebp - 4], eax
jmp 0x408100
mov eax, dword [ebp + 0x2c]
push 8
cdq
pop ecx
mov bl, 1
idiv ecx
mov eax, dword [ebp + 0x2c]
push 7
pop ecx
push 8
sub ecx, edx
shl bl, cl
cdq
pop ecx
idiv ecx
and bl, byte [eax + esi]
je 0x4080dd
mov bl, 1
mov ecx, dword [ebp - 0x3c]
movzx eax, bl
mov ebx, dword [ebp - 0x30]
lea eax, [ecx + eax*4]
movzx ecx, byte [eax + 2]
mov dword [ebp + 0x28], ecx
movzx ecx, byte [eax + 1]
movzx eax, byte [eax]
mov dword [ebp + 0x20], ecx
mov ecx, dword [ebp - 0x14]
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x28]
add ecx, 3
mov dword [edi], eax
mov eax, dword [ebp + 0x20]
add edi, 4
mov dword [ebp - 0x14], ecx
mov dword [edi], eax
mov eax, dword [ebp - 4]
add edi, 4
mov dword [edi], eax
add edi, 4
inc dword [ebp + 0x2c]
mov eax, dword [ebp + 0x2c]
cmp eax, dword [ebp + 0x30]
jl 0x40801d
mov eax, dword [ebp + 0x30]
add eax, 3
shr eax, 2
imul eax, dword [ebp - 0x34]
imul eax, dword [ebp - 0x24]
shl eax, 2
cmp dword [ebx + 0x10], 3
jne 0x40814f
mov ecx, dword [ebx]
lea ecx, [ecx + ebx + 0xc]
jmp 0x408159
mov ecx, dword [ebx + 0x20]
mov edx, dword [ebx]
lea ecx, [edx + ecx*4]
add ecx, ebx
movzx esi, word [ebx + 0xe]
imul esi, dword [ebx + 4]
add esi, 0x1f
push dword [ebp - 0x50]
shr esi, 3
and esi, 0x1ffffffc
push dword [ebp - 0x18]
imul esi, dword [ebp - 0xc]
push dword [ebp - 0x40]
add esi, ecx
add esi, eax
call fcn.0042d5f0
mov edx, dword [ebp - 0x40]
and dword [ebp - 0x1c], 0
mov ecx, dword [ebp - 0x18]
add esp, 0xc
cmp dword [ebp + 0x30], 0
mov dword [ebp - 0x14], edx
jle 0x408382
mov eax, dword [ebp - 0x28]
lea edi, [eax + 8]
jmp 0x4081a8
mov edx, dword [ebp - 0x14]
mov ebx, dword [ecx]
add ecx, 4
mov dword [ebp + 0x2c], ebx
mov eax, 0xff
mov ebx, dword [ecx]
add ecx, 4
mov dword [ebp - 0x10], ebx
mov ebx, dword [ecx]
add ecx, 4
cmp dword [ebp + 0x2c], 0
mov dword [ebp - 8], ebx
mov dword [ebp - 0x4c], ecx
jge 0x4081d2
and dword [ebp + 0x2c], 0
cmp dword [ebp + 0x2c], eax
jle 0x4081da
mov dword [ebp + 0x2c], eax
cmp dword [ebp - 0x10], 0
jge 0x4081e4
and dword [ebp - 0x10], 0
cmp dword [ebp - 0x10], eax
jle 0x4081ec
mov dword [ebp - 0x10], eax
cmp dword [ebp - 8], 0
jge 0x4081f6
and dword [ebp - 8], 0
cmp dword [ebp - 8], eax
jle 0x4081fe
mov dword [ebp - 8], eax
mov eax, dword [ebp - 8]
mov ebx, dword [ebp - 0x10]
sar eax, 3
and eax, 0x18
and ebx, 0xe0
or eax, ebx
mov ebx, dword [ebp + 0x2c]
sar eax, 2
and ebx, 0xc0
or eax, ebx
cmp dword [ebp + 0x24], 0
mov dword [ebp - 0x20], eax
je 0x408286
mov eax, dword [edx]
mov ebx, dword [edx + 4]
movzx ecx, byte [ebp + 0x1c]
add edx, 4
mov dword [ebp - 0x5c], eax
add edx, 4
mov eax, dword [edx]
add edx, 4
sub ecx, eax
mov dword [ebp - 0x14], edx
push ecx
call fcn.0042e0cb
mov edx, eax
movzx eax, byte [ebp + 0x18]
sub eax, ebx
mov ebx, edx
push eax
call fcn.0042e0cb
add ebx, eax
movzx eax, byte [ebp + 0x14]
sub eax, dword [ebp - 0x5c]
push eax
call fcn.0042e0cb
add ebx, eax
add esp, 0xc
cmp ebx, dword [ebp - 0x60]
jg 0x40827f
or byte [esi], 0xff
mov eax, dword [ebp - 0x20]
mov ecx, dword [ebp - 0x4c]
jmp 0x408288
mov eax, dword [ebp - 0x20]
mov byte [esi], al
jmp 0x40827a
mov byte [esi], al
movzx edx, byte [ebp + eax - 0x268]
mov ebx, 0x100
sub ebx, edx
movzx edx, byte [ebp + eax - 0x168]
add dword [ebp + 0x2c], ebx
mov ebx, 0x100
movzx eax, byte [ebp + eax - 0x368]
sub ebx, edx
mov edx, dword [ebp - 0x10]
add edx, ebx
mov ebx, 0x100
sub ebx, eax
mov eax, dword [ebp + 0x30]
add dword [ebp - 8], ebx
dec eax
cmp dword [ebp - 0x1c], eax
je 0x4082ec
mov eax, dword [ebp + 0x2c]
mov eax, dword [eax*4 + 0x453d78]
add dword [ecx], eax
mov eax, dword [edx*4 + 0x453d78]
add dword [ecx + 4], eax
mov eax, dword [ebp - 8]
mov eax, dword [eax*4 + 0x453d78]
add dword [ecx + 8], eax
mov eax, dword [ebp - 0x24]
dec eax
cmp dword [ebp - 0xc], eax
je 0x40836f
mov eax, dword [ebp + 0x2c]
shl eax, 2
shl edx, 2
mov ebx, dword [eax + 0x454578]
add dword [edi - 8], ebx
mov ebx, dword [edx + 0x454578]
add dword [edi - 4], ebx
mov ebx, dword [ebp - 8]
shl ebx, 2
mov dword [ebp + 0x2c], ebx
mov ebx, dword [ebx + 0x454578]
add dword [edi], ebx
cmp dword [ebp - 0x1c], 0
jle 0x408345
mov ebx, dword [eax + 0x454d78]
add dword [edi - 0x14], ebx
mov ebx, dword [edx + 0x454d78]
add dword [edi - 0x10], ebx
mov ebx, dword [ebp + 0x2c]
mov ebx, dword [ebx + 0x454d78]
add dword [edi - 0xc], ebx
mov ebx, dword [ebp + 0x30]
dec ebx
cmp dword [ebp - 0x1c], ebx
je 0x40836c
mov eax, dword [eax + 0x455578]
add dword [edi + 4], eax
mov eax, dword [edx + 0x455578]
add dword [edi + 8], eax
mov eax, dword [ebp + 0x2c]
mov eax, dword [eax + 0x455578]
add dword [edi + 0xc], eax
add edi, 0xc
inc dword [ebp - 0x1c]
inc esi
mov eax, dword [ebp - 0x1c]
cmp eax, dword [ebp + 0x30]
jl 0x4081a5
mov ebx, dword [ebp - 0x30]
inc dword [ebp - 0xc]
mov eax, dword [ebp - 0xc]
cmp eax, dword [ebp - 0x24]
jl 0x407fb9
push dword [ebp - 0x18]
call fcn.0042deb8
push dword [ebp - 0x28]
call fcn.0042deb8
push dword [ebp - 0x40]
call fcn.0042deb8
add esp, 0xc
push dword [ebp - 0x48]
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
inc dword [ebp - 0x2c]
dec dword [ebp - 0x34]
mov eax, dword [ebp - 0x2c]
cmp eax, dword [ebp - 0x64]
jl 0x407d66
push dword [ebp - 0x38]
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov eax, dword [ebp - 0x38]
jmp 0x408bc9
mov eax, dword [ebp + 8]
mov ebx, dword [sym.imp.KERNEL32.dll_GlobalLock]
mov ecx, dword [eax + 4]
mov edi, dword [eax + 8]
mov dword [ebp - 0x68], edi
mov ecx, dword [ecx]
mov ecx, dword [ecx + 4]
push ecx
mov dword [ebp - 0x2c], ecx
call ebx
test eax, eax
je 0x407cde
movzx ecx, word [eax + 0xe]
cmp ecx, 1
mov dword [ebp - 0x44], ecx
je 0x40841c
cmp ecx, 4
je 0x40841c
cmp ecx, 8
je 0x40841c
cmp ecx, 0x18
jne 0x407cde
mov ecx, dword [eax + 4]
mov esi, dword [eax + 8]
mov eax, ecx
push 0x64
imul eax, dword [ebp + 0x2c]
mov dword [ebp - 8], ecx
xor edx, edx
pop ecx
mov dword [ebp - 0x64], esi
div ecx
xor edx, edx
push 8
mov dword [ebp - 4], eax
mov eax, esi
imul eax, dword [ebp + 0x30]
div ecx
mov ecx, dword [ebp + 0x28]
mov dword [ebp - 0x20], eax
imul eax, edi
push eax
mov dword [ecx], eax
push dword [ebp - 4]
call fcn.00404a52
add esp, 0xc
mov dword [ebp - 0x54], eax
test eax, eax
jne 0x408467
push dword [ebp - 0x2c]
jmp 0x408474
push eax
call ebx
push dword [ebp - 0x2c]
mov dword [ebp - 0x40], eax
test eax, eax
jne 0x40847f
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
jmp 0x407cde
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
and dword [ebp - 0x30], 0
test edi, edi
jle 0x408bbd
mov eax, dword [ebp + 0x20]
push 0x64
imul eax, eax, 0x5fa
cdq
pop ecx
idiv ecx
mov dword [ebp - 0x58], eax
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 0x30]
mov eax, dword [eax + 4]
mov eax, dword [eax + ecx*4]
mov eax, dword [eax + 4]
push eax
mov dword [ebp - 0x2c], eax
call dword [sym.imp.KERNEL32.dll_GlobalLock]
mov ebx, eax
test ebx, ebx
mov dword [ebp - 0x4c], ebx
je 0x407cde
mov eax, dword [ebp - 4]
xor ecx, ecx
mov edi, 0xc0
lea eax, [eax + eax*2]
mov dword [ebp + 0x20], eax
mov eax, ecx
xor edx, edx
and eax, edi
mov esi, edi
imul eax, eax, 0xff
add eax, 0x60
div esi
xor edx, edx
mov esi, 0xe0
mov byte [ebp + ecx - 0x368], al
mov eax, ecx
and eax, 0x38
imul eax, eax, 0x3fc
add eax, 0x70
div esi
xor edx, edx
mov esi, edi
mov byte [ebp + ecx - 0x168], al
mov eax, ecx
and eax, 6
imul eax, eax, 0x1fe0
add eax, 0x60
div esi
inc ecx
mov esi, 0x100
cmp ecx, esi
mov byte [ebp + ecx - 0x269], al
jb 0x4084d9
mov ecx, dword [ebp - 0x40]
xor edi, edi
mov eax, dword [ecx]
add eax, ecx
inc eax
mov cl, byte [ebp + edi - 0x368]
inc edi
mov byte [eax + 1], cl
mov cl, byte [ebp + edi - 0x169]
mov byte [eax], cl
mov cl, byte [ebp + edi - 0x269]
mov byte [eax - 1], cl
add eax, 4
cmp edi, esi
jb 0x408540
mov eax, dword [ebx]
add eax, ebx
mov dword [ebp - 0x18], eax
call fcn.00406115
mov eax, dword [ebp + 0x20]
mov edi, eax
shl edi, 2
push edi
mov dword [ebp - 0x60], edi
call fcn.0042df00
push edi
mov dword [ebp - 0x24], eax
call fcn.0042df00
mov esi, eax
push edi
mov dword [ebp - 0x14], esi
call fcn.0042df00
xor ecx, ecx
add esp, 0xc
cmp dword [ebp - 0x24], ecx
mov dword [ebp - 0x38], eax
je 0x407cde
cmp esi, ecx
je 0x407cde
cmp eax, ecx
je 0x407cde
cmp dword [ebx + 0x10], 3
jne 0x4085c5
mov eax, dword [ebx]
lea edi, [eax + ebx + 0xc]
jmp 0x4085cf
mov eax, dword [ebx + 0x20]
mov edx, dword [ebx]
lea edi, [edx + eax*4]
add edi, ebx
cmp dword [ebp - 4], ecx
mov dword [ebp + 0x20], ecx
mov dword [ebp - 0xc], esi
jle 0x4086e6
push dword [ebp - 4]
push dword [ebp - 8]
push dword [ebp + 0x20]
call dword [sym.imp.KERNEL32.dll_MulDiv]
mov esi, eax
cmp esi, dword [ebp - 8]
jl 0x4085fa
mov eax, dword [ebp - 8]
lea esi, [eax - 1]
mov eax, dword [ebp - 0x44]
dec eax
je 0x408677
sub eax, 3
je 0x408637
sub eax, 4
je 0x408631
sub eax, 0x10
jne 0x4086b7
lea eax, [edi + esi*2]
add esi, eax
movzx eax, byte [esi + 2]
mov dword [ebp + 0x28], eax
movzx eax, byte [esi + 1]
mov dword [ebp + 0x2c], eax
movzx eax, byte [esi]
mov dword [ebp + 0x30], eax
jmp 0x4086b7
movzx eax, byte [esi + edi]
jmp 0x40865e
mov eax, esi
push 2
cdq
pop ecx
idiv ecx
mov eax, esi
test edx, edx
cdq
jne 0x408652
sub eax, edx
sar eax, 1
mov al, byte [eax + edi]
shr al, 4
jmp 0x40865b
sub eax, edx
sar eax, 1
mov al, byte [eax + edi]
and al, 0xf
movzx eax, al
mov ecx, dword [ebp - 0x18]
lea eax, [ecx + eax*4]
movzx ecx, byte [eax + 2]
mov dword [ebp + 0x28], ecx
movzx ecx, byte [eax + 1]
movzx eax, byte [eax]
mov dword [ebp + 0x2c], ecx
jmp 0x408629
mov eax, esi
push 8
cdq
pop ecx
mov bl, 1
idiv ecx
push 7
mov eax, esi
pop ecx
push 8
sub ecx, edx
shl bl, cl
cdq
pop ecx
idiv ecx
and bl, byte [eax + edi]
je 0x408697
mov bl, 1
mov ecx, dword [ebp - 0x18]
movzx eax, bl
mov ebx, dword [ebp - 0x4c]
lea eax, [ecx + eax*4]
movzx ecx, byte [eax + 2]
mov dword [ebp + 0x28], ecx
movzx ecx, byte [eax + 1]
movzx eax, byte [eax]
mov dword [ebp + 0x2c], ecx
mov dword [ebp + 0x30], eax
mov eax, dword [ebp - 0xc]
mov ecx, dword [ebp + 0x28]
mov dword [eax], ecx
mov ecx, dword [ebp + 0x2c]
add eax, 4
mov dword [eax], ecx
mov ecx, dword [ebp + 0x30]
add eax, 4
mov dword [eax], ecx
add eax, 4
inc dword [ebp + 0x20]
mov dword [ebp - 0xc], eax
mov eax, dword [ebp + 0x20]
cmp eax, dword [ebp - 4]
jl 0x4085de
xor ecx, ecx
cmp dword [ebp - 0x20], ecx
mov dword [ebp - 0x28], ecx
jle 0x408b8a
jmp 0x4086f7
mov ebx, dword [ebp - 0x4c]
mov eax, dword [ebp - 0x24]
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x20]
mov dword [ebp - 0xc], eax
mov dword [ebp - 0x24], ecx
mov ecx, dword [ebp - 0x28]
mov dword [ebp - 0x14], eax
lea eax, [edx - 1]
cmp ecx, eax
je 0x408933
mov esi, dword [ebp - 0x64]
push edx
inc ecx
push esi
push ecx
call dword [sym.imp.KERNEL32.dll_MulDiv]
cmp eax, esi
jl 0x40872b
lea eax, [esi - 1]
cmp dword [ebx + 0x10], 3
jne 0x408739
mov ecx, dword [ebx]
lea ecx, [ecx + ebx + 0xc]
jmp 0x408743
mov ecx, dword [ebx + 0x20]
mov edx, dword [ebx]
lea ecx, [edx + ecx*4]
add ecx, ebx
movzx esi, word [ebx + 0xe]
imul esi, dword [ebx + 4]
add esi, 0x1f
xor ebx, ebx
shr esi, 3
and esi, 0x1ffffffc
imul esi, eax
add esi, ecx
cmp dword [ebp - 4], ebx
jle 0x408933
push dword [ebp - 4]
push dword [ebp - 8]
push ebx
call dword [sym.imp.KERNEL32.dll_MulDiv]
mov edi, eax
cmp edi, dword [ebp - 8]
jl 0x408781
mov eax, dword [ebp - 8]
lea edi, [eax - 1]
push dword [ebp - 4]
lea eax, [ebx + 1]
mov dword [ebp - 0x48], eax
push dword [ebp - 8]
push eax
call dword [sym.imp.KERNEL32.dll_MulDiv]
cmp eax, dword [ebp - 8]
mov dword [ebp + 0x20], eax
jl 0x4087a3
mov eax, dword [ebp - 8]
dec eax
mov dword [ebp + 0x20], eax
cmp eax, edi
jne 0x4087ad
lea eax, [edi + 1]
mov dword [ebp + 0x20], eax
mov edx, dword [ebp + 0x20]
mov eax, dword [ebp - 0x44]
mov ecx, edx
xor ebx, ebx
sub ecx, edi
dec eax
mov dword [ebp - 0x34], ecx
mov dword [ebp + 0x30], ebx
mov dword [ebp + 0x2c], ebx
mov dword [ebp + 0x28], ebx
je 0x40889a
sub eax, 3
je 0x408841
sub eax, 4
je 0x408811
sub eax, 0x10
jne 0x40890c
cmp edi, edx
jge 0x4088f0
lea eax, [esi + edi*2]
mov dword [ebp + 0x28], ecx
lea eax, [edi + eax + 1]
movzx edx, byte [eax + 1]
add ebx, edx
movzx edx, byte [eax]
add dword [ebp + 0x2c], edx
movzx edx, byte [eax - 1]
add dword [ebp + 0x30], edx
add eax, 3
dec dword [ebp + 0x28]
jne 0x4087f1
jmp 0x4088f0
cmp edi, edx
jge 0x4088f0
movzx eax, byte [edi + esi]
mov ecx, dword [ebp - 0x18]
lea eax, [ecx + eax*4]
movzx ecx, byte [eax + 2]
add ebx, ecx
movzx ecx, byte [eax + 1]
movzx eax, byte [eax]
add dword [ebp + 0x2c], ecx
add dword [ebp + 0x30], eax
inc edi
cmp edi, dword [ebp + 0x20]
jl 0x408819
jmp 0x4088ed
mov eax, edi
cmp edi, edx
mov dword [ebp + 0x28], eax
jge 0x4088f0
push 2
cdq
pop edi
idiv edi
mov eax, dword [ebp + 0x28]
test edx, edx
cdq
jne 0x408869
sub eax, edx
sar eax, 1
movzx eax, byte [eax + esi]
shr eax, 4
jmp 0x408873
sub eax, edx
sar eax, 1
mov al, byte [eax + esi]
and eax, 0xf
mov edx, dword [ebp - 0x18]
lea eax, [edx + eax*4]
movzx edx, byte [eax + 2]
add ebx, edx
movzx edx, byte [eax + 1]
movzx eax, byte [eax]
add dword [ebp + 0x30], eax
mov eax, dword [ebp + 0x28]
add dword [ebp + 0x2c], edx
inc eax
cmp eax, dword [ebp + 0x20]
mov dword [ebp + 0x28], eax
jl 0x40884e
jmp 0x4088f0
cmp edi, edx
mov dword [ebp + 0x28], edi
jge 0x4088f0
mov eax, dword [ebp + 0x28]
push 8
cdq
pop ecx
idiv ecx
mov eax, dword [ebp + 0x28]
push 7
pop ecx
push 1
pop edi
push 8
sub ecx, edx
shl edi, cl
cdq
pop ecx
idiv ecx
movzx eax, byte [eax + esi]
and edi, eax
je 0x4088c8
push 1
pop edi
mov eax, dword [ebp - 0x18]
movzx ecx, byte [eax + edi*4 + 2]
lea eax, [eax + edi*4]
add ebx, ecx
movzx ecx, byte [eax + 1]
movzx eax, byte [eax]
add dword [ebp + 0x2c], ecx
add dword [ebp + 0x30], eax
inc dword [ebp + 0x28]
mov eax, dword [ebp + 0x28]
cmp eax, dword [ebp + 0x20]
jl 0x4088a1
mov ecx, dword [ebp - 0x34]
mov eax, ebx
cdq
idiv ecx
mov ebx, eax
mov eax, dword [ebp + 0x2c]
cdq
idiv ecx
mov dword [ebp + 0x28], ebx
mov dword [ebp + 0x2c], eax
mov eax, dword [ebp + 0x30]
cdq
idiv ecx
mov dword [ebp + 0x30], eax
mov eax, dword [ebp - 0xc]
mov ecx, dword [ebp + 0x2c]
mov dword [eax], ebx
mov ebx, dword [ebp - 0x48]
add eax, 4
mov dword [eax], ecx
mov ecx, dword [ebp + 0x30]
add eax, 4
mov dword [eax], ecx
add eax, 4
cmp ebx, dword [ebp - 4]
mov dword [ebp - 0xc], eax
jl 0x408767
mov eax, dword [ebp - 0x40]
cmp dword [eax + 0x10], 3
jne 0x408944
mov ecx, dword [eax]
lea ecx, [ecx + eax + 0xc]
jmp 0x40894e
mov ecx, dword [eax + 0x20]
mov edx, dword [eax]
lea ecx, [edx + ecx*4]
add ecx, eax
movzx esi, word [eax + 0xe]
imul esi, dword [eax + 4]
mov eax, dword [ebp - 0x30]
add esi, 0x1f
imul eax, dword [ebp - 0x20]
add eax, dword [ebp - 0x28]
push dword [ebp - 0x60]
shr esi, 3
and esi, 0x1ffffffc
push dword [ebp - 0x24]
imul esi, eax
push dword [ebp - 0x38]
add esi, ecx
call fcn.0042d5f0
mov edx, dword [ebp - 0x38]
and dword [ebp - 0x1c], 0
mov ecx, dword [ebp - 0x24]
add esp, 0xc
cmp dword [ebp - 4], 0
mov dword [ebp - 0x34], edx
jle 0x408b7b
mov eax, dword [ebp - 0x14]
lea edi, [eax + 8]
jmp 0x4089a4
mov edx, dword [ebp - 0x34]
mov ebx, dword [ecx]
add ecx, 4
mov dword [ebp + 0x20], ebx
mov eax, 0xff
mov ebx, dword [ecx]
add ecx, 4
mov dword [ebp - 0xc], ebx
mov ebx, dword [ecx]
add ecx, 4
cmp dword [ebp + 0x20], 0
mov dword [ebp - 0x10], ebx
mov dword [ebp - 0x50], ecx
jge 0x4089ce
and dword [ebp + 0x20], 0
cmp dword [ebp + 0x20], eax
jle 0x4089d6
mov dword [ebp + 0x20], eax
cmp dword [ebp - 0xc], 0
jge 0x4089e0
and dword [ebp - 0xc], 0
cmp dword [ebp - 0xc], eax
jle 0x4089e8
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0x10], 0
jge 0x4089f2
and dword [ebp - 0x10], 0
cmp dword [ebp - 0x10], eax
jle 0x4089fa
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x10]
mov ebx, dword [ebp - 0xc]
sar eax, 3
and eax, 0x18
and ebx, 0xe0
or eax, ebx
mov ebx, dword [ebp + 0x20]
sar eax, 2
and ebx, 0xc0
or eax, ebx
cmp dword [ebp + 0x24], 0
mov dword [ebp - 0x3c], eax
je 0x408a82
mov eax, dword [edx]
mov ebx, dword [edx + 4]
movzx ecx, byte [ebp + 0x1c]
add edx, 4
mov dword [ebp - 0x5c], eax
add edx, 4
mov eax, dword [edx]
add edx, 4
sub ecx, eax
mov dword [ebp - 0x34], edx
push ecx
call fcn.0042e0cb
mov edx, eax
movzx eax, byte [ebp + 0x18]
sub eax, ebx
mov ebx, edx
push eax
call fcn.0042e0cb
add ebx, eax
movzx eax, byte [ebp + 0x14]
sub eax, dword [ebp - 0x5c]
push eax
call fcn.0042e0cb
add ebx, eax
add esp, 0xc
cmp ebx, dword [ebp - 0x58]
jg 0x408a7b
or byte [esi], 0xff
mov eax, dword [ebp - 0x3c]
mov ecx, dword [ebp - 0x50]
jmp 0x408a84
mov eax, dword [ebp - 0x3c]
mov byte [esi], al
jmp 0x408a76
mov byte [esi], al
movzx edx, byte [ebp + eax - 0x368]
mov ebx, 0x100
sub ebx, edx
movzx edx, byte [ebp + eax - 0x168]
add dword [ebp + 0x20], ebx
mov ebx, 0x100
movzx eax, byte [ebp + eax - 0x268]
sub ebx, edx
mov edx, dword [ebp - 0xc]
add edx, ebx
mov ebx, 0x100
sub ebx, eax
mov eax, dword [ebp - 4]
add dword [ebp - 0x10], ebx
dec eax
cmp dword [ebp - 0x1c], eax
je 0x408ae8
mov eax, dword [ebp + 0x20]
mov eax, dword [eax*4 + 0x453d78]
add dword [ecx], eax
mov eax, dword [edx*4 + 0x453d78]
add dword [ecx + 4], eax
mov eax, dword [ebp - 0x10]
mov eax, dword [eax*4 + 0x453d78]
add dword [ecx + 8], eax
mov eax, dword [ebp - 0x20]
dec eax
cmp dword [ebp - 0x28], eax
je 0x408b6b
mov eax, dword [ebp + 0x20]
shl eax, 2
shl edx, 2
mov ebx, dword [eax + 0x454578]
add dword [edi - 8], ebx
mov ebx, dword [edx + 0x454578]
add dword [edi - 4], ebx
mov ebx, dword [ebp - 0x10]
shl ebx, 2
mov dword [ebp + 0x20], ebx
mov ebx, dword [ebx + 0x454578]
add dword [edi], ebx
cmp dword [ebp - 0x1c], 0
jle 0x408b41
mov ebx, dword [eax + 0x454d78]
add dword [edi - 0x14], ebx
mov ebx, dword [edx + 0x454d78]
add dword [edi - 0x10], ebx
mov ebx, dword [ebp + 0x20]
mov ebx, dword [ebx + 0x454d78]
add dword [edi - 0xc], ebx
mov ebx, dword [ebp - 4]
dec ebx
cmp dword [ebp - 0x1c], ebx
je 0x408b68
mov eax, dword [eax + 0x455578]
add dword [edi + 4], eax
mov eax, dword [edx + 0x455578]
add dword [edi + 8], eax
mov eax, dword [ebp + 0x20]
mov eax, dword [eax + 0x455578]
add dword [edi + 0xc], eax
add edi, 0xc
inc dword [ebp - 0x1c]
inc esi
mov eax, dword [ebp - 0x1c]
cmp eax, dword [ebp - 4]
jl 0x4089a1
inc dword [ebp - 0x28]
mov eax, dword [ebp - 0x28]
cmp eax, dword [ebp - 0x20]
jl 0x4086f4
push dword [ebp - 0x24]
call fcn.0042deb8
push dword [ebp - 0x14]
call fcn.0042deb8
push dword [ebp - 0x38]
call fcn.0042deb8
add esp, 0xc
push dword [ebp - 0x2c]
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
inc dword [ebp - 0x30]
mov eax, dword [ebp - 0x30]
cmp eax, dword [ebp - 0x68]
jl 0x4084a3
push dword [ebp - 0x54]
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov eax, dword [ebp - 0x54]
pop edi
pop esi
pop ebx
leave
ret