Function at 0x40eba6
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x294
mov eax, dword [0x49d040]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
xor ebx, ebx
mov dword [ebp - 0x280], edx
push 0x254
lea eax, [ebp - 0x25c]
mov dword [ebp - 0x284], ecx
push ebx
push eax
mov dword [ebp - 0x268], ebx
mov dword [ebp - 0x260], ebx
call fcn.0045e8a0
lea eax, [ebp - 0x260]
mov dword [ebp - 0xc], ebx
mov dword [ebp - 0x27c], eax
lea edx, [ebp - 0x98]
mov eax, dword [ebp + 0xc]
lea ecx, [ebp - 0x260]
mov dword [ebp - 0x14], eax
call fcn.0040efed
push ebx
push 0x49f620
call fcn.0047af30
add esp, 0x14
test eax, eax
je 0x40ec38
mov edx, dword [ebp - 0x268]
lea ecx, [ebp - 0x260]
call fcn.0040efa6
xor eax, eax
jmp 0x40ef97
mov edi, dword [ebp - 0x27c]
push ecx
mov ecx, edi
call fcn.004159a0
xor esi, esi
mov ecx, edi
inc esi
mov dword [ebp - 0x10], esi
call fcn.00415ed0
push dword [ebp - 0x280]
mov edx, dword [ebp - 0x284]
mov ecx, edi
call fcn.00416150
pop ecx
pop ecx
mov ecx, edi
call fcn.00415ce0
and dword [ebp - 0x270], ebx
cmp dword [edi + 0x2c], 4
mov dword [ebp - 0x274], ebx
je 0x40eca2
lea eax, [ebp - 0x274]
mov ecx, edi
push eax
lea edx, [ebp - 0xc]
call fcn.00415f40
mov ebx, dword [ebp - 0x274]
movzx eax, al
pop ecx
mov dword [ebp - 0x270], eax
and dword [ebp - 0x26c], 0
and dword [ebp - 0x264], 0
cmp byte [edi + 0x100], 0
je 0x40ed15
mov al, byte [edi + 0x103]
cmp al, 1
jne 0x40ecf1
movzx eax, word [edi + 0x104]
imul eax, eax, 0x1388
push 0x7f
pop esi
movzx ecx, word [edi + 0x106]
cdq
idiv esi
mov dword [ebp - 0x26c], eax
imul eax, ecx, 0x1388
cdq
idiv esi
xor esi, esi
inc esi
jmp 0x40ed0f
cmp al, 2
jne 0x40ed15
movzx eax, word [edi + 0x104]
imul eax, eax, 0x64
mov dword [ebp - 0x26c], eax
movzx eax, word [edi + 0x106]
imul eax, eax, 0x64
mov dword [ebp - 0x264], eax
mov ecx, edi
call fcn.004161c0
mov ax, word [edi + 0x68]
shl ax, 3
push 8
movzx eax, ax
pop ecx
mov dword [ebp - 0x278], eax
cmp ax, cx
jne 0x40ed46
cmp dword [edi + 0x2c], esi
jne 0x40ed41
mov esi, 0x100
jmp 0x40ed48
mov esi, dword [edi + 0x70]
jmp 0x40ed48
xor esi, esi
mov ecx, dword [edi + 0x60]
movzx eax, ax
imul eax, dword [edi + 0x5c]
push 0x28
add eax, 0x1f
shr eax, 5
shl eax, 2
imul ecx, eax
cmp dword [ebp - 0x270], 0
mov dword [ebp - 0x28c], eax
pop eax
push 0x7c
pop edx
cmovne eax, edx
mov dword [ebp - 0x294], ecx
mov dword [ebp - 0x288], eax
lea eax, [eax + esi*4]
add eax, ecx
add eax, ebx
push eax
push 0x42
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov dword [ebp - 0x268], eax
test eax, eax
jne 0x40eda1
mov edx, eax
jmp 0x40ec26
push eax
call dword [sym.imp.KERNEL32.dll_GlobalLock]
mov ebx, eax
mov dword [ebp - 0x290], ebx
test ebx, ebx
je 0x40ec20
mov eax, dword [ebp - 0x288]
xor edx, edx
mov ecx, dword [ebp - 0x26c]
inc edx
mov dword [ebx], eax
mov eax, dword [edi + 0x5c]
mov dword [ebx + 4], eax
mov eax, dword [edi + 0x60]
and dword [ebx + 0x10], 0
mov dword [ebx + 0x18], ecx
mov ecx, dword [ebp - 0x264]
push 8
mov dword [ebx + 0x1c], ecx
mov dword [ebx + 8], eax
mov eax, dword [ebp - 0x278]
pop ecx
mov word [ebx + 0xc], dx
mov word [ebx + 0xe], ax
mov dword [ebx + 0x20], esi
cmp ax, cx
jne 0x40ee59
cmp dword [edi + 0x2c], edx
jne 0x40ee22
xor eax, eax
test esi, esi
je 0x40ee59
lea ecx, [ebx + 0x29]
mov byte [ecx + 1], al
mov byte [ecx], al
lea ecx, [ecx + 4]
mov byte [ecx - 5], al
inc eax
mov byte [ecx - 2], 0
cmp eax, esi
jb 0x40ee0c
jmp 0x40ee59
xor ecx, ecx
test esi, esi
je 0x40ee59
lea edx, [ebx + 0x29]
mov eax, dword [edi + 0x74]
mov eax, dword [eax]
mov al, byte [ecx + eax]
mov byte [edx + 1], al
mov eax, dword [edi + 0x74]
mov eax, dword [eax + 4]
mov al, byte [ecx + eax]
mov byte [edx], al
lea edx, [edx + 4]
mov eax, dword [edi + 0x74]
mov eax, dword [eax + 8]
mov al, byte [ecx + eax]
inc ecx
mov byte [edx - 5], al
mov byte [edx - 2], 0
cmp ecx, esi
jb 0x40ee2b
mov ecx, ebx
call fcn.00410235
and dword [ebp - 8], 0
mov edx, eax
mov esi, dword [edi + 0x78]
mov ecx, dword [edi + 0x60]
mov dword [ebp - 0x264], edx
cmp esi, ecx
jae 0x40ef35
cmp dword [ebp + 8], 0
jne 0x40ee85
sub ecx, esi
dec ecx
mov esi, ecx
imul esi, dword [ebp - 0x28c]
push ecx
mov ecx, edi
add esi, edx
lea edx, [ebp - 8]
mov dword [ebp - 8], esi
call fcn.00416370
cmp dword [edi + 0x2c], 4
pop ecx
jne 0x40ef1b
mov eax, dword [edi + 0x5c]
shl eax, 2
test eax, eax
je 0x40ef1b
push 0xfffffffffffffffe
pop eax
sub eax, esi
lea ebx, [esi + 2]
mov dword [ebp - 0x278], eax
movzx ecx, byte [ebx + 1]
movzx eax, byte [ebx - 1]
movzx edx, byte [ebx]
movzx esi, byte [ebx - 2]
imul eax, ecx
imul edx, ecx
imul esi, ecx
mov byte [ebx + 1], 0xff
sub eax, 0xffffff80
mov ecx, eax
sub edx, 0xffffff80
shr ecx, 8
sub esi, 0xffffff80
add ecx, eax
mov eax, edx
shr eax, 8
add eax, edx
shr ecx, 8
shr eax, 8
mov byte [ebx - 2], al
mov eax, esi
shr eax, 8
add eax, esi
mov byte [ebx - 1], cl
mov ecx, dword [ebp - 0x278]
shr eax, 8
mov byte [ebx], al
add ebx, 4
mov eax, dword [edi + 0x5c]
add ecx, ebx
shl eax, 2
cmp ecx, eax
jb 0x40eebb
mov esi, dword [edi + 0x78]
mov ecx, dword [edi + 0x60]
mov edx, dword [ebp - 0x264]
cmp esi, ecx
jb 0x40ee7a
mov ebx, dword [ebp - 0x290]
cmp dword [ebp - 0x270], 0
je 0x40ef74
mov ecx, dword [ebp - 0x274]
mov eax, edx
mov esi, dword [ebp - 0x294]
sub eax, ebx
add eax, esi
mov dword [ebx + 0x38], 0x4d424544
push ecx
mov dword [ebx + 0x70], eax
mov dword [ebx + 0x6c], 4
lea eax, [edx + esi]
mov dword [ebx + 0x74], ecx
push dword [ebp - 0xc]
push eax
call fcn.0045ea00
add esp, 0xc
mov esi, dword [ebp - 0x268]
push esi
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov ecx, edi
call fcn.00415e10
xor edx, edx
lea ecx, [ebp - 0x260]
call fcn.0040efa6
mov eax, esi
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0045d68f
leave
ret