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

Disassembly:
sub esp, 0x228
push ebx
push ebp
push esi
push edi
push 0xffffffffffffffff
push 0x40f320
call sub.util.dll_gs_mutex_get_tm
add esp, 8
xor esi, esi
mov dword [esp + 0x14], esi
mov ecx, dword [esi + 0x40ff64]
mov eax, dword [esi + 0x40ff68]
cmp eax, ecx
je 0x402c46
jle 0x402989
sub eax, ecx
jmp 0x402990
sub eax, ecx
add eax, 0xbb8
mov edi, eax
mov dword [esp + 0x10], eax
cmp edi, 4
jl 0x402c46
mov eax, dword [esi + 0x40ff64]
cmp byte [eax + esi + 0x40f3ac], 0xbb
jne 0x402c29
inc eax
mov ecx, 0xbb8
cdq
idiv ecx
mov ebx, 0xbb8
mov ecx, edx
xor edx, edx
mov dl, byte [esi + ecx + 0x40f3ac]
lea eax, [ecx + 1]
mov ebp, edx
cdq
idiv ebx
xor eax, eax
mov al, byte [esi + edx + 0x40f3ac]
shl eax, 8
add ebp, eax
lea eax, [edx + 1]
cdq
idiv ebx
cmp byte [esi + edx + 0x40f3ac], 0xbb
jne 0x4029fa
cmp ebp, 0x1c0
jle 0x402a05
mov dword [esi + 0x40ff64], ecx
jmp 0x402c38
lea ecx, [ebp + 4]
cmp ecx, edi
jg 0x402c46
mov ecx, 0x70
xor eax, eax
lea edi, [esp + 0x74]
xor ebx, ebx
rep stosd dword es:[edi], eax
xor ecx, ecx
cmp ebp, ebx
stosb byte es:[edi], al
jle 0x402a41
lea eax, [edx + 1]
mov edi, 0xbb8
cdq
idiv edi
inc ecx
cmp ecx, ebp
mov al, byte [esi + edx + 0x40f3ac]
mov byte [esp + ecx + 0x73], al
jl 0x402a26
mov eax, dword [esp + 0x74]
mov dword [esi + 0x40ff70], ebx
cmp eax, 0x6d
ja case.0x402a58.8
xor ecx, ecx
mov cl, byte [eax + 0x402ca0]
jmp dword [ecx*4 + 0x402c7c]
cmp byte [esp + 0x78], 0xc9
jne 0x402b61
lea edx, [esp + 0x74]
push ebx
push edx
mov dword [esp + 0x7c], 0x52
call sub.dblib.dll_GetMsgLen
mov ecx, dword [esp + 0x1c]
add esp, 4
push eax
lea eax, [esp + 0x7c]
push eax
push ecx
call fcn.00402450
add esp, 0x10
jmp case.0x402a58.7
mov al, byte [esp + 0x78]
cmp al, 0xc9
je 0x402aa1
cmp al, 0xff
jne case.0x402a58.8
lea eax, [esp + 0x74]
mov byte [esp + 0x78], 0xff
push eax
call sub.dblib.dll_PostMsg
add esp, 4
mov byte [0x40c030], 0
lea ecx, [esp + 0x74]
push ecx
call sub.dblib.dll_PostMsg
add esp, 4
mov edx, dword [esi + 0x40ff64]
mov ecx, 0xbb8
mov edi, dword [esp + 0x10]
lea eax, [edx + ebp + 4]
cdq
idiv ecx
mov dword [esi + 0x40ff64], edx
mov edx, 0xfffffffc
sub edx, ebp
add edi, edx
jmp 0x402c39
mov eax, dword [esp + 0x14]
lea edx, [esp + 0x74]
push edx
push eax
call fcn.00402d10
add esp, 8
jmp case.0x402a58.7
mov al, byte [esp + 0x138]
xor edi, edi
test al, al
jbe 0x402b61
lea ebx, [esp + 0x78]
mov edx, dword [ebx]
lea ecx, [esp + 0x20]
push ecx
push edx
call sub.dblib.dll_GetYcPointByIndex
add esp, 8
test al, al
je 0x402b4c
mov eax, dword [ebx + 0x30]
mov cl, byte [esp + edi + 0xd8]
mov dword [esp + 0x3c], eax
mov eax, dword [ebx]
lea edx, [esp + 0x20]
mov byte [esp + 0x40], cl
push edx
push eax
call sub.dblib.dll_SetYcPointByIndex
add esp, 8
mov ecx, dword [esp + 0x138]
inc edi
and ecx, 0xff
add ebx, 4
cmp edi, ecx
jl 0x402b16
lea edx, [esp + 0x74]
push edx
jmp 0x402abf
mov ecx, dword [esp + 0x78]
lea eax, [esp + 0x44]
push eax
push ecx
call sub.dblib.dll_GetYxPointByIndex
add esp, 8
test al, al
je 0x402ba3
mov dl, byte [esp + 0x7d]
mov al, byte [esp + 0x7c]
mov byte [esp + 0x60], dl
mov edx, dword [esp + 0x78]
lea ecx, [esp + 0x44]
mov byte [esp + 0x61], al
push ecx
push edx
call sub.dblib.dll_SetYxPointByIndex
add esp, 8
lea eax, [esp + 0x18]
push eax
call sub.util.dll_getTimeVal
mov ecx, dword [esp + 0x1c]
mov edx, dword [esp + 0x20]
lea eax, [esp + 0x78]
mov dword [esp + 0x8c], ecx
push eax
mov dword [esp + 0x94], edx
call sub.dblib.dll_PostMsg
add esp, 8
jmp case.0x402a58.7
mov al, byte [esp + 0x16f]
test al, al
jbe case.0x402a58.8
lea edi, [esp + 0x78]
mov ecx, dword [edi + 0x78]
mov edx, dword [edi]
push ecx
push edx
call sub.dblib.dll_SetYmByIndex
mov eax, dword [esp + 0x177]
add esp, 8
inc ebx
and eax, 0xff
add edi, 4
cmp ebx, eax
jl 0x402be8
jmp case.0x402a58.8
mov eax, dword [esi + 0x40f3a0]
lea edx, [esp + 0x74]
push edx
push eax
call fcn.00401210
add esp, 8
jmp case.0x402a58.7
inc eax
mov ecx, 0xbb8
cdq
idiv ecx
mov dword [esi + 0x40ff64], edx
dec edi
cmp edi, 4
mov dword [esp + 0x10], edi
jge 0x40299f
mov edx, dword [esp + 0x14]
add esi, 0xbd4
inc edx
cmp esi, 0x3b24
mov dword [esp + 0x14], edx
jl 0x40296f
push 0x40f320
call sub.util.dll_gs_mutex_free
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x228
ret