Function at 0x406480
Capabilities:
Encrypt data using rc4 prga
Resolve function by parsing pe exports

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x5c
mov edi, dword [esp + 0xa4]
mov eax, dword [ecx + 0x48]
mov esi, dword [eax + 4]
mov dword [esp + 0x58], esi
test edi, edi
je 0x4064ae
cmp dword [eax + 0x34], 0
jne 0x4064ae
mov dword [ecx + 0x1c], 3
jmp 0x406a05
mov dword [esp + 0x50], edi
mov dword [esp + 0x54], edx
mov dword [esp + 4], ecx
mov dword [esp], eax
movzx edx, word [esp + 0x70]
xor ecx, ecx
mov eax, edx
mov dword [esp + 0x44], edx
mov dword [esp + 8], esi
add edx, esi
setb cl
add edx, 0x2e
adc ecx, 0
movzx eax, word [esp + 0x78]
movzx edi, ax
mov esi, edx
and esi, edi
add esi, esi
mov eax, edi
mov dword [esp + 0x40], edi
xor edx, edi
mov ebp, dword [esp + 0xb0]
movzx eax, word [esp + 0x80]
xor ebx, ebx
mov edi, eax
mov dword [esp + 0x3c], eax
add ebp, eax
setb bl
add ebp, edx
adc ebx, ecx
add ebp, esi
adc ebx, 0
cmp ebp, 0xffffffff
sbb ebx, 0
jb 0x40652c
mov eax, dword [esp + 4]
mov dword [eax + 0x1c], 0xf
jmp 0x406a05
mov esi, dword [esp + 0x90]
mov eax, dword [esp + 0x88]
mov dword [esp + 0x48], eax
movzx eax, word [esp + 0x9c]
mov dword [esp + 0x12], 0
mov dword [esp + 0x16], 0
mov dword [esp + 0x1e], 0
mov dword [esp + 0x22], 0
mov dword [esp + 0x26], 0
mov dword [esp + 0x2a], 0
mov dword [esp + 0x2e], 0
mov word [esp + 0x32], 0
mov dword [esp + 0x1a], 0
mov dword [esp + 0xe], 0x2014b50
movzx ebp, word [esp + 0x98]
mov edx, dword [esp + 0x94]
movzx ecx, word [esp + 0x78]
mov edi, dword [esp + 0xb0]
add ecx, edi
mov dword [esp + 0x4c], ecx
xor ebx, ebx
mov ecx, 0
mov edi, ebp
test bp, bp
je 0x4065c6
mov cl, 0x14
mov byte [esp + 0x14], cl
mov byte [esp + 0x16], al
mov byte [esp + 0x17], ah
mov eax, edi
mov byte [esp + 0x18], al
mov byte [esp + 0x19], ah
mov byte [esp + 0x1e], dl
mov byte [esp + 0x1f], dh
mov ecx, edx
shr ecx, 0x10
mov byte [esp + 0x20], cl
shr edx, 0x18
neg esi
mov ecx, 0
sbb ecx, ecx
mov byte [esp + 0x21], dl
or ecx, dword [esp + 0x8c]
mov byte [esp + 0x22], cl
mov byte [esp + 0x23], ch
mov edx, ecx
shr edx, 0x10
mov byte [esp + 0x24], dl
shr ecx, 0x18
neg dword [esp + 0x48]
mov edx, 0
sbb edx, edx
mov byte [esp + 0x25], cl
or edx, dword [esp + 0x84]
mov byte [esp + 0x26], dl
mov byte [esp + 0x27], dh
mov ecx, edx
shr ecx, 0x10
mov byte [esp + 0x28], cl
shr edx, 0x18
mov byte [esp + 0x29], dl
movzx eax, word [esp + 0x70]
mov byte [esp + 0x2a], al
mov byte [esp + 0x2b], ah
mov eax, dword [esp + 0x4c]
mov byte [esp + 0x2c], al
mov byte [esp + 0x2d], ah
movzx eax, word [esp + 0x80]
mov byte [esp + 0x2e], al
mov byte [esp + 0x2f], ah
mov eax, dword [esp + 0xa8]
mov byte [esp + 0x34], al
mov byte [esp + 0x35], ah
mov ecx, eax
shr ecx, 0x10
mov byte [esp + 0x36], cl
shr eax, 0x18
neg dword [esp + 0x50]
sbb ebx, ebx
mov byte [esp + 0x37], al
or ebx, dword [esp + 0xa0]
mov byte [esp + 0x38], bl
mov byte [esp + 0x39], bh
mov eax, ebx
shr eax, 0x10
mov byte [esp + 0x3a], al
shr ebx, 0x18
mov byte [esp + 0x3b], bl
mov ebp, dword [esp + 8]
lea esi, [ebp + 0x2e]
mov ecx, dword [esp]
mov eax, dword [ecx + 8]
cmp eax, esi
mov edi, dword [esp + 0x54]
jae 0x406702
cmp eax, 1
adc eax, 0
nop
nop
mov ebx, eax
add eax, eax
cmp ebx, esi
jb 0x4066d0
push ebx
push dword [ecx + 0xc]
push dword [ecx]
mov eax, dword [esp + 0x10]
push dword [eax + 0x34]
call dword [eax + 0x30]
mov ecx, dword [esp + 0x10]
add esp, 0x10
test eax, eax
je 0x4069d2
mov dword [ecx], eax
mov dword [ecx + 8], ebx
mov ebp, dword [esp + 8]
jmp 0x406704
mov eax, dword [ecx]
mov dword [ecx + 4], esi
mov ecx, dword [ecx + 0xc]
mov esi, ecx
not esi
and esi, ebp
mov edx, ebp
not edx
and edx, ecx
imul edx, esi
mov esi, ecx
or esi, ebp
imul ebx, ecx, 0x2e
and ecx, ebp
imul ecx, esi
add ecx, eax
add ecx, edx
lea eax, [esp + 0xe]
push ebx
push eax
push ecx
call fcn.00408a60
mov ecx, dword [esp + 0xc]
add esp, 0xc
mov esi, dword [ecx + 4]
mov ebp, dword [ecx + 8]
mov eax, dword [esp + 0x44]
lea ebx, [esi + eax]
cmp ebp, ebx
jae 0x40678c
cmp ebp, 1
adc ebp, 0
mov eax, ebp
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov ebp, eax
add eax, eax
cmp ebp, ebx
jb 0x406760
push ebp
push dword [ecx + 0xc]
push dword [ecx]
mov eax, dword [esp + 0x10]
push dword [eax + 0x34]
call dword [eax + 0x30]
mov ecx, dword [esp + 0x10]
add esp, 0x10
test eax, eax
je 0x4069d2
mov dword [ecx], eax
mov dword [ecx + 8], ebp
mov dword [ecx + 4], ebx
cmp word [esp + 0x70], 0
je 0x4067d5
mov eax, dword [ecx + 0xc]
mov edx, eax
not edx
and edx, esi
mov ecx, esi
not ecx
and ecx, eax
imul ecx, edx
mov edx, eax
or edx, esi
and esi, eax
imul esi, edx
mov edx, dword [esp]
add esi, dword [edx]
add esi, ecx
mov ecx, dword [esp + 0x44]
imul ecx, eax
push ecx
push edi
push esi
call fcn.00408a60
mov ecx, dword [esp + 0xc]
add esp, 0xc
mov ebx, dword [ecx + 4]
mov ebp, dword [ecx + 8]
mov eax, dword [esp + 0x40]
lea edi, [ebx + eax]
cmp ebp, edi
jae 0x40681c
cmp ebp, 1
adc ebp, 0
mov eax, ebp
nop
nop
nop
nop
nop
nop
nop
nop
mov ebp, eax
add eax, eax
cmp ebp, edi
jb 0x4067f0
push ebp
push dword [ecx + 0xc]
push dword [ecx]
mov eax, dword [esp + 0x10]
push dword [eax + 0x34]
call dword [eax + 0x30]
mov ecx, dword [esp + 0x10]
add esp, 0x10
test eax, eax
je 0x4069d2
mov dword [ecx], eax
mov dword [ecx + 8], ebp
mov dword [ecx + 4], edi
movzx eax, word [esp + 0x78]
test ax, ax
mov esi, dword [esp + 0xb0]
je 0x406871
mov eax, dword [ecx + 0xc]
mov edx, eax
not edx
and edx, ebx
mov ecx, ebx
not ecx
and ecx, eax
imul ecx, edx
mov edx, eax
or edx, ebx
and ebx, eax
imul ebx, edx
mov edx, dword [esp]
add ebx, dword [edx]
add ebx, ecx
mov ecx, dword [esp + 0x40]
imul ecx, eax
push ecx
push dword [esp + 0x78]
push ebx
call fcn.00408a60
mov ecx, dword [esp + 0xc]
add esp, 0xc
mov edi, dword [ecx + 4]
mov ebp, dword [ecx + 8]
lea ebx, [edi + esi]
cmp ebp, ebx
jae 0x4068b3
cmp ebp, 1
adc ebp, 0
mov eax, ebp
mov ebp, eax
add eax, eax
cmp ebp, ebx
jb 0x406880
push ebp
push dword [ecx + 0xc]
push dword [ecx]
mov eax, dword [esp + 0x10]
push dword [eax + 0x34]
call dword [eax + 0x30]
mov ecx, dword [esp + 0x10]
add esp, 0x10
test eax, eax
je 0x4069d2
mov dword [ecx], eax
mov dword [ecx + 8], ebp
mov esi, dword [esp + 0xb0]
mov dword [ecx + 4], ebx
test esi, esi
je 0x4068fa
mov eax, dword [ecx + 0xc]
mov edx, eax
not edx
and edx, edi
mov ecx, edi
not ecx
and ecx, eax
imul ecx, edx
mov edx, eax
or edx, edi
and edi, eax
imul edi, edx
mov edx, dword [esp]
add edi, dword [edx]
add edi, ecx
imul esi, eax
push esi
push dword [esp + 0xb0]
push edi
call fcn.00408a60
mov ecx, dword [esp + 0xc]
add esp, 0xc
mov ebx, dword [ecx + 4]
mov ebp, dword [ecx + 8]
mov eax, dword [esp + 0x3c]
lea esi, [ebx + eax]
cmp ebp, esi
jae 0x406923
mov ecx, dword [esp + 4]
mov edx, dword [esp]
push 1
push esi
call fcn.004089a0
mov ecx, dword [esp + 8]
add esp, 8
test eax, eax
je 0x4069d2
mov dword [ecx + 4], esi
cmp word [esp + 0x80], 0
je 0x40696f
mov eax, dword [ecx + 0xc]
mov edx, eax
not edx
and edx, ebx
mov ecx, ebx
not ecx
and ecx, eax
imul ecx, edx
mov edx, eax
or edx, ebx
and ebx, eax
imul ebx, edx
mov edx, dword [esp]
add ebx, dword [edx]
add ebx, ecx
mov ecx, dword [esp + 0x3c]
imul ecx, eax
push ecx
push dword [esp + 0x80]
push ebx
call fcn.00408a60
mov ecx, dword [esp + 0xc]
add esp, 0xc
mov esi, dword [ecx + 0x14]
lea edi, [esi + 1]
cmp dword [ecx + 0x18], edi
jae 0x406997
mov eax, dword [esp]
lea edx, [eax + 0x10]
mov ecx, dword [esp + 4]
push 1
push edi
call fcn.004089a0
mov ecx, dword [esp + 8]
add esp, 8
test eax, eax
je 0x4069d2
mov dword [ecx + 0x14], edi
mov eax, dword [ecx + 0x1c]
mov edi, ecx
mov edx, eax
not edx
and edx, esi
mov ecx, esi
not ecx
and ecx, eax
imul ecx, edx
mov edx, eax
or edx, esi
and esi, eax
imul esi, edx
add esi, dword [edi + 0x10]
add esi, ecx
lea ecx, [esp + 0x58]
push eax
push ecx
push esi
call fcn.00408a60
add esp, 0xc
mov eax, 1
jmp 0x406a07
mov ebx, dword [esp + 8]
cmp dword [ecx + 8], ebx
mov edi, dword [esp + 4]
jae 0x4069fb
push ebx
push dword [ecx + 0xc]
push dword [ecx]
push dword [edi + 0x34]
mov esi, ecx
call dword [edi + 0x30]
add esp, 0x10
test eax, eax
je 0x4069fe
mov dword [esi], eax
mov dword [esi + 8], ebx
mov ecx, esi
mov dword [ecx + 4], ebx
mov dword [edi + 0x1c], 0x10
xor eax, eax
add esp, 0x5c
pop esi
pop edi
pop ebx
pop ebp
ret