Function at 0x46f3f0
Capabilities:
Encrypt data using rc4 ksa
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x48c
mov eax, dword [0x59da54]
xor eax, esp
mov dword [esp + 0x488], eax
mov eax, dword [esp + 0x494]
push ebx
push ebp
mov ebp, dword [esp + 0x4a8]
xor ebx, ebx
mov dword [esp + 0x84], eax
mov eax, dword [esp + 0x4a0]
push esi
mov esi, dword [esp + 0x49c]
mov dword [esp + 0x8c], eax
mov eax, dword [esp + 0x4a8]
mov dword [esp + 0x90], eax
lea eax, [esp + 0x40]
push edi
push eax
push esi
mov dword [esp + 0x6c], esi
mov dword [esp + 0x90], ebp
mov dword [esp + 0x68], 0xff
call fcn.0046fe60
add esp, 8
test eax, eax
je 0x46fe36
mov eax, dword [esi + 4]
mov ecx, dword [esp + 0x4c]
mov dword [esp + 0x84], eax
cdq
mov edi, eax
mov eax, dword [esp + 0x60]
xor edi, edx
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x48]
sub edi, edx
mov edx, dword [esp + 0x44]
mov dword [esi + 4], edi
mov dword [esp + 0x18], edx
cmp ecx, 0xc
jne 0x46f4b4
cmp edx, 0x18
jge 0x46f4c3
lea ecx, [eax - 0x26]
mov eax, 0x55555556
imul ecx
mov ebx, edx
shr ebx, 0x1f
add ebx, edx
jmp 0x46f4c3
cmp edx, 0x10
jge 0x46f4c3
mov ebx, eax
sub ebx, ecx
sub ebx, 0xe
sar ebx, 2
xor eax, eax
cmp dword [esp + 0x5c], eax
setne al
add eax, 3
mov dword [esp + 0x14], eax
mov dword [esi + 8], eax
test ebp, ebp
je 0x46f4e5
cmp ebp, 3
jl 0x46f4e5
mov eax, ebp
mov dword [esp + 0x14], eax
mov ecx, dword [esi]
test eax, eax
js 0x46fe2c
test ecx, ecx
js 0x46fe2c
je 0x46f50f
mov eax, accept
cdq
idiv ecx
cmp dword [esp + 0x14], eax
jg 0x46fe2c
mov eax, dword [esp + 0x14]
mov ebp, ecx
imul ebp, eax
test ebp, ebp
js 0x46fe2c
test edi, edi
js 0x46fe2c
je 0x46f536
mov eax, accept
cdq
idiv edi
cmp ebp, eax
jg 0x46fe2c
test ecx, ecx
js 0x46fe51
je 0x46f552
mov eax, accept
cdq
idiv ecx
cmp dword [esp + 0x14], eax
jg 0x46fe51
test ebp, ebp
js 0x46fe51
test edi, edi
js 0x46fe51
je 0x46f574
mov eax, accept
cdq
idiv edi
cmp ebp, eax
jg 0x46fe51
imul ecx, edi
imul ecx, dword [esp + 0x14]
push ecx
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov edi, eax
add esp, 4
mov dword [esp + 0x10], edi
test edi, edi
je 0x46fe51
cmp dword [esp + 0x18], 0x10
jge 0x46f8d6
xor edi, edi
test ebx, ebx
je 0x46fe1a
cmp ebx, 0x100
jg 0x46fe1a
xor ebp, ebp
test ebx, ebx
jle 0x46f6bf
mov eax, dword [esi + 0xa8]
mov ecx, dword [esi + 0xac]
cmp eax, ecx
jae 0x46f5da
mov dl, byte [eax]
inc eax
mov dword [esi + 0xa8], eax
jmp 0x46f601
cmp dword [esi + 0x20], edi
je 0x46f5ff
push esi
call fcn.0047aa60
mov eax, dword [esi + 0xa8]
add esp, 4
mov ecx, dword [esi + 0xac]
mov dl, byte [eax]
inc eax
mov dword [esi + 0xa8], eax
jmp 0x46f601
xor dl, dl
mov byte [esp + ebp*4 + 0x9a], dl
cmp eax, ecx
jae 0x46f617
mov dl, byte [eax]
inc eax
mov dword [esi + 0xa8], eax
jmp 0x46f63e
cmp dword [esi + 0x20], edi
je 0x46f63c
push esi
call fcn.0047aa60
mov eax, dword [esi + 0xa8]
add esp, 4
mov ecx, dword [esi + 0xac]
mov dl, byte [eax]
inc eax
mov dword [esi + 0xa8], eax
jmp 0x46f63e
xor dl, dl
mov byte [esp + ebp*4 + 0x99], dl
cmp eax, ecx
jae 0x46f654
mov cl, byte [eax]
inc eax
mov dword [esi + 0xa8], eax
jmp 0x46f675
cmp dword [esi + 0x20], edi
je 0x46f673
push esi
call fcn.0047aa60
mov eax, dword [esi + 0xa8]
add esp, 4
mov cl, byte [eax]
inc eax
mov dword [esi + 0xa8], eax
jmp 0x46f675
xor cl, cl
cmp dword [esp + 0x4c], 0xc
mov byte [esp + ebp*4 + 0x98], cl
je 0x46f6ae
cmp eax, dword [esi + 0xac]
jae 0x46f694
inc eax
mov dword [esi + 0xa8], eax
jmp 0x46f6ae
cmp dword [esi + 0x20], edi
je 0x46f6ae
push esi
call fcn.0047aa60
add esp, 4
inc dword [esi + 0xa8]
mov eax, dword [esi + 0xa8]
mov byte [esp + ebp*4 + 0x9b], 0xff
inc ebp
cmp ebp, ebx
jl 0x46f5c5
mov ecx, dword [esp + 0x48]
xor eax, eax
cmp dword [esp + 0x4c], 0xc
setne al
add eax, 3
imul eax, ebx
sub ecx, eax
sub ecx, dword [esp + 0x4c]
sub ecx, 0xe
push ecx
push esi
call fcn.0047b130
mov eax, dword [esp + 0x20]
add esp, 8
cmp eax, 4
jne 0x46f6f6
mov edx, dword [esi]
inc edx
shr edx, 1
jmp 0x46f701
cmp eax, 8
jne 0x46fe1e
mov edx, dword [esi]
mov ecx, dword [esi + 4]
neg edx
and edx, 3
xor ebx, ebx
mov dword [esp + 0x24], edx
mov dword [esp + 0x20], ebx
test ecx, ecx
jle 0x46fd1f
nop dword [eax + eax]
xor ebp, ebp
cmp dword [esi], ebp
jle 0x46f887
nop word [eax + eax]
mov eax, dword [esi + 0xa8]
cmp eax, dword [esi + 0xac]
jae 0x46f749
mov cl, byte [eax]
inc eax
mov dword [esi + 0xa8], eax
jmp 0x46f7a8
cmp dword [esi + 0x20], 0
je 0x46f7a6
push dword [esi + 0x24]
mov eax, dword [esi + 0x10]
lea ebx, [esi + 0x28]
push ebx
push dword [esi + 0x1c]
call eax
add esp, 0xc
mov dword [esi + 0xa8], ebx
test eax, eax
jne 0x46f78d
mov dword [esi + 0x20], eax
lea eax, [esi + 0x29]
mov dword [esi + 0xac], eax
mov eax, ebx
mov byte [eax], 0
mov eax, dword [esi + 0xa8]
mov cl, byte [eax]
inc eax
mov dword [esi + 0xa8], eax
jmp 0x46f7a8
add eax, ebx
mov dword [esi + 0xac], eax
mov eax, dword [esi + 0xa8]
mov cl, byte [eax]
inc eax
mov dword [esi + 0xa8], eax
jmp 0x46f7a8
xor cl, cl
xor edx, edx
movzx ecx, cl
cmp dword [esp + 0x18], 4
jne 0x46f7bc
mov edx, ecx
and edx, 0xf
shr ecx, 4
mov ebx, dword [esp + 0x10]
movzx eax, byte [esp + ecx*4 + 0x98]
mov byte [edi + ebx], al
movzx eax, byte [esp + ecx*4 + 0x99]
mov byte [edi + ebx + 1], al
movzx eax, byte [esp + ecx*4 + 0x9a]
mov byte [edi + ebx + 2], al
add edi, 3
cmp dword [esp + 0x14], 4
jne 0x46f7f2
mov byte [edi + ebx], 0xff
inc edi
lea eax, [ebp + 1]
cmp eax, dword [esi]
je 0x46f87f
cmp dword [esp + 0x18], 8
jne 0x46f842
mov eax, dword [esi + 0xa8]
cmp eax, dword [esi + 0xac]
jae 0x46f81d
mov cl, byte [eax]
inc eax
mov dword [esi + 0xa8], eax
jmp 0x46f83f
cmp dword [esi + 0x20], 0
je 0x46f83d
push esi
call fcn.0047aa60
mov eax, dword [esi + 0xa8]
add esp, 4
mov cl, byte [eax]
inc eax
mov dword [esi + 0xa8], eax
jmp 0x46f83f
xor cl, cl
movzx edx, cl
movzx eax, byte [esp + edx*4 + 0x98]
mov byte [edi + ebx], al
movzx eax, byte [esp + edx*4 + 0x99]
mov byte [edi + ebx + 1], al
movzx eax, byte [esp + edx*4 + 0x9a]
mov byte [edi + ebx + 2], al
add edi, 3
cmp dword [esp + 0x14], 4
jne 0x46f874
mov byte [edi + ebx], 0xff
inc edi
add ebp, 2
cmp ebp, dword [esi]
jl 0x46f730
mov edx, dword [esp + 0x24]
mov ebx, dword [esp + 0x20]
cmp dword [esi + 0x10], 0
je 0x46f8bb
mov eax, dword [esi + 0xac]
mov ecx, eax
sub ecx, dword [esi + 0xa8]
cmp ecx, edx
jge 0x46f8bb
mov dword [esi + 0xa8], eax
mov eax, edx
sub eax, ecx
push eax
push dword [esi + 0x1c]
mov eax, dword [esi + 0x14]
call eax
mov edx, dword [esp + 0x2c]
add esp, 8
jmp 0x46f8c1
add dword [esi + 0xa8], edx
mov ecx, dword [esi + 4]
inc ebx
mov dword [esp + 0x20], ebx
cmp ebx, ecx
jl 0x46f720
jmp 0x46fd1f
xor eax, eax
xor ebp, ebp
mov dword [esp + 0x24], eax
xor ebx, ebx
mov dword [esp + 0x68], eax
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0x48]
sub eax, dword [esp + 0x4c]
sub eax, 0xe
mov dword [esp + 0x34], ebp
push eax
push esi
mov dword [esp + 0x44], ebp
mov dword [esp + 0x28], ebp
mov dword [esp + 0x74], ebp
mov dword [esp + 0x40], ebp
mov dword [esp + 0x48], ebp
mov dword [esp + 0x24], ebx
call fcn.0047b130
mov ecx, dword [esp + 0x20]
add esp, 8
cmp ecx, 0x18
jne 0x46f929
mov eax, dword [esi]
lea eax, [eax + eax*2]
jmp 0x46f936
cmp ecx, 0x10
jne 0x46f934
mov eax, dword [esi]
add eax, eax
jmp 0x46f936
xor eax, eax
mov edx, dword [esp + 0x54]
neg eax
and eax, 3
cmp ecx, 0x18
mov ecx, dword [esp + 0x58]
mov dword [esp + 0x80], eax
mov eax, dword [esp + 0x50]
jne 0x46f961
mov edx, 1
mov dword [esp + 0x30], edx
jmp 0x46fa2e
cmp dword [esp + 0x18], 0x20
jne 0x46f99b
cmp ecx, 0xff
jne 0x46f99b
cmp edx, 0xff00
jne 0x46f99b
cmp eax, 0xff0000
jne 0x46f99b
mov ebp, dword [esp + 0x5c]
cmp ebp, 0xff000000
jne 0x46f9b7
mov edx, 2
xor ebp, ebp
mov dword [esp + 0x30], edx
jmp 0x46fa2e
test eax, eax
je 0x46fe22
test edx, edx
je 0x46fe22
test ecx, ecx
je 0x46fe22
mov ebp, dword [esp + 0x5c]
push eax
call fcn.00474420
push dword [esp + 0x54]
sub eax, 7
mov dword [esp + 0x3c], eax
call fcn.0046f3a0
push dword [esp + 0x5c]
mov dword [esp + 0x44], eax
call fcn.00474420
push dword [esp + 0x60]
sub eax, 7
mov dword [esp + 0x4c], eax
call fcn.0046f3a0
push dword [esp + 0x68]
mov dword [esp + 0x54], eax
call fcn.00474420
push dword [esp + 0x6c]
sub eax, 7
mov dword [esp + 0x38], eax
call fcn.0046f3a0
push ebp
mov dword [esp + 0x40], eax
call fcn.00474420
sub eax, 7
push ebp
mov dword [esp + 0x8c], eax
call fcn.0046f3a0
mov ebp, dword [esp + 0x54]
add esp, 0x20
mov dword [esp + 0x68], eax
xor edx, edx
mov ecx, dword [esi + 4]
mov dword [esp + 0x2c], ebx
test ecx, ecx
jle 0x46fd1f
mov eax, ebp
neg eax
mov dword [esp + 0x74], eax
mov eax, dword [esp + 0x3c]
neg eax
mov dword [esp + 0x78], eax
mov eax, dword [esp + 0x20]
neg eax
mov dword [esp + 0x7c], eax
nop dword [eax]
mov eax, dword [esi]
test edx, edx
je 0x46fbaa
xor ebp, ebp
test eax, eax
jle 0x46fcf7
nop dword [eax]
nop dword [eax + eax]
mov eax, dword [esi + 0xa8]
cmp eax, dword [esi + 0xac]
jae 0x46fa99
mov cl, byte [eax]
inc eax
mov dword [esi + 0xa8], eax
jmp 0x46fabb
cmp dword [esi + 0x20], 0
je 0x46fab9
push esi
call fcn.0047aa60
mov eax, dword [esi + 0xa8]
add esp, 4
mov cl, byte [eax]
inc eax
mov dword [esi + 0xa8], eax
jmp 0x46fabb
xor cl, cl
mov byte [edi + ebx + 2], cl
mov eax, dword [esi + 0xa8]
cmp eax, dword [esi + 0xac]
jae 0x46fad8
mov cl, byte [eax]
inc eax
mov dword [esi + 0xa8], eax
jmp 0x46fafa
cmp dword [esi + 0x20], 0
je 0x46faf8
push esi
call fcn.0047aa60
mov eax, dword [esi + 0xa8]
add esp, 4
mov cl, byte [eax]
inc eax
mov dword [esi + 0xa8], eax
jmp 0x46fafa
xor cl, cl
mov byte [edi + ebx + 1], cl
mov eax, dword [esi + 0xa8]
cmp eax, dword [esi + 0xac]
jae 0x46fb17
mov cl, byte [eax]
inc eax
mov dword [esi + 0xa8], eax
jmp 0x46fb39
cmp dword [esi + 0x20], 0
je 0x46fb37
push esi
call fcn.0047aa60
mov eax, dword [esi + 0xa8]
add esp, 4
mov cl, byte [eax]
inc eax
mov dword [esi + 0xa8], eax
jmp 0x46fb39
xor cl, cl
mov byte [ebx + edi], cl
add ebx, 3
cmp dword [esp + 0x30], 2
jne 0x46fb83
mov eax, dword [esi + 0xa8]
cmp eax, dword [esi + 0xac]
jae 0x46fb5f
mov cl, byte [eax]
inc eax
mov dword [esi + 0xa8], eax
jmp 0x46fb86
cmp dword [esi + 0x20], 0
je 0x46fb7f
push esi
call fcn.0047aa60
mov eax, dword [esi + 0xa8]
add esp, 4
mov cl, byte [eax]
inc eax
mov dword [esi + 0xa8], eax
jmp 0x46fb86
xor cl, cl
jmp 0x46fb86
or cl, 0xff
movzx eax, cl
or dword [esp + 0x28], eax
cmp dword [esp + 0x14], 4
jne 0x46fb98
mov byte [ebx + edi], cl
inc ebx
inc ebp
cmp ebp, dword [esi]
jl 0x46fa80
mov dword [esp + 0x1c], ebx
jmp 0x46fcf7
mov dword [esp + 0x70], 0
test eax, eax
jle 0x46fcf7
nop word [eax + eax]
push esi
call fcn.004728d0
add esp, 4
mov ebp, eax
cmp dword [esp + 0x18], 0x10
je 0x46fbe0
push esi
call fcn.004728d0
shl eax, 0x10
add esp, 4
add ebp, eax
mov ebx, dword [esp + 0x34]
mov edx, ebp
and edx, dword [esp + 0x50]
mov ecx, ebx
mov eax, edx
sar eax, cl
mov ecx, dword [esp + 0x74]
shl edx, cl
test ebx, ebx
mov ecx, dword [esp + 0x38]
cmovns edx, eax
mov ebx, edx
cmp ecx, 8
jge 0x46fc19
mov edi, ecx
mov eax, edx
sar eax, cl
add ecx, edi
add ebx, eax
cmp ecx, 8
jl 0x46fc08
mov edi, dword [esp + 0x10]
mov eax, dword [esp + 0x1c]
mov edx, dword [esp + 0x3c]
mov ecx, edx
mov byte [eax + edi], bl
mov edi, ebp
and edi, dword [esp + 0x54]
mov ebx, eax
mov eax, edi
sar eax, cl
mov ecx, dword [esp + 0x78]
shl edi, cl
test edx, edx
mov ecx, dword [esp + 0x40]
cmovns edi, eax
mov edx, edi
cmp ecx, 8
jge 0x46fc61
mov esi, ecx
nop word [eax + eax]
mov eax, edi
sar eax, cl
add ecx, esi
add edx, eax
cmp ecx, 8
jl 0x46fc50
mov esi, dword [esp + 0x64]
mov ecx, dword [esp + 0x10]
mov edi, ebp
and edi, dword [esp + 0x58]
mov eax, edi
mov byte [ebx + ecx + 1], dl
mov edx, dword [esp + 0x20]
mov ecx, edx
sar eax, cl
mov ecx, dword [esp + 0x7c]
shl edi, cl
test edx, edx
mov ecx, dword [esp + 0x24]
cmovns edi, eax
mov edx, edi
cmp ecx, 8
jge 0x46fca2
mov esi, ecx
mov eax, edi
sar eax, cl
add ecx, esi
add edx, eax
cmp ecx, 8
jl 0x46fc91
mov esi, dword [esp + 0x64]
mov edi, dword [esp + 0x10]
mov eax, dword [esp + 0x5c]
mov byte [ebx + edi + 2], dl
add ebx, 3
mov dword [esp + 0x1c], ebx
test eax, eax
je 0x46fcce
push dword [esp + 0x68]
and ebp, eax
push dword [esp + 0x70]
push ebp
call fcn.0047b0f0
add esp, 0xc
jmp 0x46fcd3
mov eax, 0xff
or dword [esp + 0x28], eax
cmp dword [esp + 0x14], 4
jne 0x46fce6
mov byte [ebx + edi], al
inc ebx
mov dword [esp + 0x1c], ebx
mov eax, dword [esp + 0x70]
inc eax
mov dword [esp + 0x70], eax
cmp eax, dword [esi]
jl 0x46fbc0
push dword [esp + 0x80]
push esi
call fcn.0047b130
mov eax, dword [esp + 0x34]
add esp, 8
mov ecx, dword [esi + 4]
inc eax
mov edx, dword [esp + 0x30]
mov dword [esp + 0x2c], eax
cmp eax, ecx
jl 0x46fa60
mov edi, dword [esp + 0x14]
mov edx, dword [esp + 0x10]
cmp edi, 4
jne 0x46fd4c
cmp dword [esp + 0x28], 0
jne 0x46fd4c
mov eax, dword [esi]
imul eax, ecx
lea eax, [eax*4 - 1]
test eax, eax
js 0x46fd4c
mov byte [eax + edx], 0xff
sub eax, 4
jns 0x46fd43
cmp dword [esp + 0x84], 0
jle 0x46fdc6
mov ecx, dword [esi + 4]
xor ebp, ebp
mov dword [esp + 0x2c], ebp
test ecx, 0xfffffffe
jle 0x46fdc6
mov eax, dword [esi]
sub ecx, ebp
dec ecx
mov ebx, eax
imul ecx, eax
imul eax, dword [esp + 0x14]
imul ebx, ebp
imul ecx, edi
imul ebx, edi
xor edi, edi
add edx, ecx
test eax, eax
jle 0x46fdae
mov ebp, dword [esp + 0x14]
sub ebx, ecx
nop dword [eax]
mov al, byte [edx]
lea edx, [edx + 1]
mov cl, byte [ebx + edx - 1]
inc edi
mov byte [ebx + edx - 1], al
mov byte [edx - 1], cl
mov eax, dword [esi]
imul eax, ebp
cmp edi, eax
jl 0x46fd90
mov ebp, dword [esp + 0x2c]
mov ecx, dword [esi + 4]
inc ebp
mov edx, dword [esp + 0x10]
mov eax, ecx
mov edi, dword [esp + 0x14]
sar eax, 1
mov dword [esp + 0x2c], ebp
cmp ebp, eax
jl 0x46fd67
mov eax, dword [esp + 0x88]
mov ecx, dword [esp + 0x10]
test eax, eax
je 0x46fdef
cmp eax, edi
je 0x46fdef
push dword [esi + 4]
push dword [esi]
push eax
push edi
push ecx
call fcn.00470ba0
mov ecx, eax
add esp, 0x14
test ecx, ecx
je 0x46fe36
mov edx, dword [esp + 0x8c]
mov eax, dword [esi]
mov dword [edx], eax
mov edx, dword [esp + 0x90]
mov eax, dword [esi + 4]
mov dword [edx], eax
mov edx, dword [esp + 0x94]
test edx, edx
je 0x46fe16
mov eax, dword [esi + 8]
mov dword [edx], eax
mov eax, ecx
jmp 0x46fe38
mov edi, eax
jmp 0x46fe22
mov edi, dword [esp + 0x10]
push edi
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 4
mov dword [0x59f984], str.Corrupt_BMP
xor eax, eax
mov ecx, dword [esp + 0x498]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.00493440
add esp, 0x48c
ret
mov dword [0x59f984], str.Out_of_memory
jmp 0x46fe36