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

Disassembly:
sub esp, 0x50
mov eax, dword [0x8a3940]
xor eax, esp
mov dword [esp + 0x4c], eax
push ebx
mov ebx, dword [esp + 0x58]
push ebp
push edi
mov dword [esp + 0x30], ebx
mov ebp, 3
mov eax, dword [ebx + 0x40]
mov dword [esp + 0x10], 0
movzx ecx, word [eax + 0x16]
movzx eax, word [eax + 0x78]
add ecx, 8
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x64]
mov edi, eax
mov dword [esp + 0x2c], ecx
xor ecx, ecx
and edi, 6
mov dword [esp + 0x18], ecx
mov dword [esp + 0x34], ecx
mov dword [esp + 0x28], edi
jne 0x52f4ed
test al, 8
jne 0x52f4ed
pop edi
pop ebp
xor eax, eax
pop ebx
mov ecx, dword [esp + 0x4c]
xor ecx, esp
call fcn.0059bb21
add esp, 0x50
ret
mov eax, dword [ebx + 0x3c]
test eax, eax
je 0x52f508
mov eax, dword [eax + 0x3c]
test eax, eax
je 0x52f508
push 0
push eax
call fcn.0052eea0
add esp, 8
xor ecx, ecx
mov edx, dword [ebx + 0xc]
push esi
cmp edx, ebp
jle 0x52f527
mov esi, dword [ebx + 0x10]
cmp esi, 1
jle 0x52f527
lea eax, [esi + 1]
cmp eax, edx
jl 0x52f524
lea esi, [edx - 3]
jmp 0x52f529
dec esi
jmp 0x52f529
xor esi, esi
sub edx, esi
mov dword [esp + 0x10], 0
cmp edx, ebp
mov dword [esp + 0x24], esi
mov eax, 8
cmovge eax, dword [esp + 0x10]
cmovl ebp, edx
mov dword [esp + 0x28], eax
test edi, edi
jne 0x52f557
cmp ebp, 2
jl 0x52fe34
mov dword [esp + 0x20], 0
test ebp, ebp
jle 0x52f681
mov eax, esi
mov edi, esi
not eax
mov dword [esp + 0x10], eax
test edi, edi
js 0x52f57a
cmp edi, dword [ebx + 0xc]
jl 0x52f590
push 0
push 0
push str.hb_cdxPageGetKeyPage:_wrong_iKey_index.
push 0x23f1
call fcn.004ecae0
add esp, 0x10
test byte [ebx + 0x20], 2
je 0x52f5ac
push 0
push 0
push str.hb_cdxPageGetKeyPage:_page_is_a_leaf.
push 0x23f1
call fcn.004ecae0
add esp, 0x10
mov edx, dword [ebx + 0x40]
lea eax, [edi + 1]
mov esi, dword [ebx + 0x3c]
movzx ecx, word [edx + 0x16]
add ecx, 8
imul ecx, eax
mov eax, dword [ecx + ebx + 0x54]
bswap eax
test esi, esi
je 0x52f5d6
cmp dword [esi], eax
jne 0x52f5d6
mov dword [ebx + 0x3c], 0
jmp 0x52f5e3
push eax
push ebx
push edx
call fcn.005314b0
add esp, 0xc
mov esi, eax
mov edx, dword [esp + 0x20]
mov dword [esp + edx*4 + 0x48], esi
test edx, edx
je 0x52f646
mov ecx, dword [esp + edx*4 + 0x44]
mov eax, dword [ecx + 8]
cmp dword [esi], eax
jne 0x52f601
mov eax, dword [esi + 4]
cmp eax, dword [ecx]
je 0x52f646
push dword [esi + 4]
mov eax, dword [esp + 0x14]
push edx
push dword [esi]
add eax, edi
push edx
push dword [ecx + 8]
push eax
push dword [ecx]
push eax
push str._r_nchilds__d___Page_lx__childs__d___Right_lx__childs__d___Page_lx__childs__d___Left_lx
call fcn.00535870
push 1
call fcn.005a0b8c
push eax
call fcn.005a6524
push 0
push 0
push str.hb_cdxPageKeyIntBalance:_index_corrupted.
push 0x23f1
call fcn.004ecae0
mov edx, dword [esp + 0x5c]
add esp, 0x3c
mov ecx, dword [esi + 0xc]
mov eax, ecx
add dword [esp + 0x14], ecx
cmp ecx, dword [esp + 0x1c]
cmovle eax, dword [esp + 0x1c]
cmp ecx, dword [esp + 0x18]
mov dword [esp + 0x1c], eax
cmovge ecx, dword [esp + 0x18]
inc edx
mov eax, ecx
mov dword [esp + 0x20], edx
inc edi
mov dword [esp + 0x18], eax
cmp edx, ebp
jl 0x52f571
mov ecx, dword [esp + 0x1c]
mov dword [esp + 0x18], eax
mov eax, dword [ebx + 0x40]
movzx esi, word [eax + 0x78]
mov eax, dword [esp + 0x14]
dec eax
add eax, esi
cdq
idiv esi
mov esi, dword [esp + 0x48]
mov edi, eax
mov dword [esp + 0x1c], esi
mov dword [esp + 0x20], edi
cmp edi, 1
jne 0x52f704
cmp ebp, 1
jle 0x52f704
cmp dword [esi + 4], 0xffffffff
je 0x52f704
mov eax, dword [esp + ebp*4 + 0x44]
cmp dword [eax + 8], 0xffffffff
je 0x52f704
mov edx, dword [esp + 0x14]
cmp edx, 6
jl 0x52f704
mov ebx, dword [ebx + 0x40]
movzx eax, word [ebx + 0x78]
mov ebx, dword [esp + 0x34]
lea eax, [eax + eax*2]
sar eax, 1
cmp edx, eax
jle 0x52f704
mov eax, dword [ebx + 0x40]
mov edi, 2
mov dword [esp + 0x20], edi
movzx edx, word [eax + 0x78]
mov eax, edx
shr eax, 1
sub ecx, eax
lea eax, [ebp - 2]
sub ecx, dword [esp + 0x18]
inc ecx
cmp ecx, eax
cmovle ecx, eax
mov eax, dword [esp + 0x14]
mov dword [esp + 0x10], ecx
jmp 0x52f737
mov eax, dword [ebx + 0x40]
movzx edx, word [eax + 0x78]
mov eax, edx
shr eax, 1
sub ecx, eax
mov eax, ebp
sub ecx, dword [esp + 0x18]
sub eax, edi
inc ecx
cmp ecx, eax
cmovle ecx, eax
mov eax, dword [esp + 0x28]
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x14]
mov dword [esp + 0x10], ecx
test eax, eax
jle 0x52f8ac
cmp ecx, 2
jge 0x52f74f
cmp dword [esp + 0x2c], 0
mov ecx, dword [esp + 0x28]
mov dword [esp + 0x18], ecx
je 0x52f8b3
cmp ebp, 1
jne 0x52f7b5
cmp eax, edx
jle 0x52f7b5
mov ecx, dword [esi + 8]
cmp ecx, 0xffffffff
je 0x52f7b5
mov eax, dword [ebx + 0x40]
push ecx
push ebx
push eax
call fcn.005314b0
mov edx, dword [esp + 0x20]
mov ebp, 2
mov dword [esp + 0x58], eax
add esp, 0xc
add edx, dword [eax + 0xc]
mov eax, dword [ebx + 0x40]
mov dword [esp + 0x14], edx
movzx ecx, word [eax + 0x78]
lea eax, [edx - 1]
add eax, ecx
cdq
idiv ecx
mov ecx, dword [esp + 0x28]
mov edi, eax
or ecx, 1
mov eax, dword [esp + 0x24]
add eax, ebp
mov dword [esp + 0x20], edi
cmp eax, dword [ebx + 0xc]
cmovle ecx, dword [esp + 0x28]
mov dword [esp + 0x18], ecx
jmp 0x52f8a8
cdq
mov ecx, 2
idiv edi
cmp eax, ecx
cmovg ecx, eax
mov eax, dword [esp + 0x14]
dec eax
add eax, edi
cdq
idiv edi
lea edx, [ebp - 1]
cmp eax, ecx
mov dword [esp + 0x18], edx
cmovle eax, ecx
cmp edx, 1
jle 0x52f831
mov ebx, dword [esp + 0x14]
mov esi, edx
mov edx, dword [esp + esi*4 + 0x48]
mov edx, dword [edx + 0xc]
cmp edx, ecx
jl 0x52f825
cmp edx, eax
jg 0x52f825
push 0
push dword [esp + esi*4 + 0x4c]
sub ebx, edx
call fcn.0052eea0
mov eax, ebx
add esp, 8
cdq
dec ebp
idiv edi
mov ecx, 2
cmp eax, ecx
cmovg ecx, eax
lea eax, [ebx - 1]
add eax, edi
dec esi
cdq
idiv edi
cmp eax, ecx
cmovle eax, ecx
cmp esi, 1
jg 0x52f7e3
mov esi, dword [esp + 0x1c]
mov dword [esp + 0x14], ebx
mov ebx, dword [esp + 0x34]
mov edx, dword [esp + 0x28]
mov dword [esp + 0x18], edx
cmp ebp, 2
jle 0x52f8a8
mov dword [esp + 0x18], edx
mov edx, dword [esi + 0xc]
cmp edx, ecx
jl 0x52f8a8
cmp edx, eax
jg 0x52f8a8
sub dword [esp + 0x14], edx
push 0
push esi
call fcn.0052eea0
dec ebp
inc dword [esp + 0x2c]
mov ecx, ebp
lea esi, [esp + 0x54]
lea edi, [esp + 0x50]
add esp, 8
rep movsd dword es:[edi], dword [esi]
mov esi, dword [esp + 0x14]
mov ecx, 2
mov edi, dword [esp + 0x20]
mov eax, esi
cdq
idiv edi
cmp eax, ecx
cmovg ecx, eax
lea eax, [esi - 1]
add eax, edi
cdq
idiv edi
cmp eax, ecx
cmovle eax, ecx
cmp ebp, 2
jle 0x52f8a0
mov esi, dword [esp + 0x48]
mov dword [esp + 0x1c], esi
jmp 0x52f842
mov eax, dword [esp + 0x48]
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x14]
cmp dword [esp + 0x2c], 0
jne 0x52f8ef
cmp ebp, 2
jl 0x52f8bf
cmp dword [esp + 0x10], 2
jge 0x52f8ef
xor esi, esi
test ebp, ebp
jle 0x52f8d8
push 0
push dword [esp + esi*4 + 0x4c]
call fcn.0052eea0
inc esi
add esp, 8
cmp esi, ebp
jl 0x52f8c5
mov eax, dword [esp + 0x18]
pop esi
pop edi
pop ebp
pop ebx
mov ecx, dword [esp + 0x4c]
xor ecx, esp
call fcn.0059bb21
add esp, 0x50
ret
test eax, eax
jle 0x52f94a
imul eax, dword [esp + 0x30]
push eax
call fcn.004a67c0
add esp, 4
mov dword [esp + 0x38], eax
xor esi, esi
mov dword [esp + 0x10], eax
test ebp, ebp
jle 0x52f94a
mov edi, dword [esp + 0x30]
mov ebx, eax
mov ecx, dword [esp + esi*4 + 0x48]
mov eax, dword [ecx + 0xc]
test eax, eax
jle 0x52f93d
imul eax, edi
push eax
lea eax, [ecx + 0x58]
push eax
push ebx
call fcn.0059ce60
mov eax, dword [esp + esi*4 + 0x54]
add esp, 0xc
mov eax, dword [eax + 0xc]
imul eax, edi
add ebx, eax
inc esi
cmp esi, ebp
jl 0x52f915
mov ebx, dword [esp + 0x34]
mov edi, dword [esp + 0x20]
cmp edi, ebp
jle 0x52fb39
cmp ebp, 2
jge 0x52f95d
mov dword [esp + 0x10], ebp
jmp 0x52f96c
lea eax, [ebp - 1]
mov dword [esp + 0x10], eax
mov eax, dword [esp + eax*4 + 0x48]
mov dword [esp + ebp*4 + 0x48], eax
mov esi, dword [ebx + 0x40]
mov eax, dword [esi + 0x7c]
movzx ecx, word [eax + 0x2e]
movzx eax, word [esi + 0x16]
add ecx, 0x54
add eax, ecx
push eax
push 0
push eax
call fcn.004a67c0
add esp, 4
push eax
call fcn.0059d510
mov edi, eax
push 0
mov byte [edi + 0x20], 0xff
mov dword [edi + 8], 0xffffffff
mov dword [edi + 4], 0xffffffff
mov dword [edi + 0x40], esi
push dword [esi + 0x7c]
call fcn.0052d5d0
mov dword [edi], eax
add esp, 0x14
mov dword [edi + 0x24], 1
mov dword [edi + 0x44], 0
mov eax, dword [esi + 0xa4]
mov dword [edi + 0x48], eax
mov dword [esi + 0xa4], edi
mov eax, dword [edi + 0x48]
test eax, eax
je 0x52f9de
mov dword [eax + 0x44], edi
mov esi, dword [esp + 0x10]
mov ecx, dword [esp + 0x24]
mov dword [edi + 0x38], ebx
add ecx, esi
mov dword [edi + 0x10], 0xffffffff
mov word [edi + 0x20], 0x100
mov dword [esp + esi*4 + 0x48], edi
mov eax, dword [esp + ebp*4 + 0x48]
mov dword [edi + 0xc], 0
mov dword [edi + 0x24], 1
mov dword [esp + 0x10], ecx
mov eax, dword [eax]
mov dword [esp + 0x1c], eax
mov eax, dword [ebx + 0x40]
movzx eax, word [eax + 0x16]
mov dword [esp + 0x20], eax
add eax, 8
mov dword [esp + 0x28], eax
imul eax, ecx
test byte [ebx + 0x20], 2
mov dword [esp + 0x2c], eax
je 0x52fa51
push 0
push 0
push str.hb_cdxPageIntSetKey:_page_is_a_leaf_
push 0x23f1
call fcn.004ecae0
mov ecx, dword [esp + 0x20]
add esp, 0x10
test ecx, ecx
js 0x52fa5d
mov eax, dword [ebx + 0xc]
inc eax
cmp ecx, eax
jl 0x52fa77
push 0
push 0
push str.hb_cdxPageIntSetKey:_wrong_iKey_index.
push 0x23f1
call fcn.004ecae0
mov ecx, dword [esp + 0x20]
add esp, 0x10
mov edx, dword [esp + 0x2c]
mov eax, dword [ebx + 0xc]
add edx, 0x58
add edx, ebx
mov dword [esp + 0x10], edx
cmp ecx, eax
jge 0x52faad
sub eax, ecx
imul eax, dword [esp + 0x28]
push eax
mov eax, dword [esp + 0x24]
add eax, 8
push edx
add eax, edx
push eax
call fcn.0059ce60
mov eax, dword [ebx + 0xc]
add esp, 0xc
mov edx, dword [esp + 0x10]
push dword [esp + 0x20]
inc eax
mov dword [ebx + 0xc], eax
mov eax, dword [ebx + 0x40]
movzx eax, byte [eax + 0x1a]
push eax
push edx
call fcn.0059d510
mov eax, dword [esp + 0x1c]
add esp, 0xc
mov ecx, dword [esp + 0x20]
mov edx, dword [esp + 0x1c]
bswap edx
mov dword [ecx + eax + 4], edx
mov ecx, dword [esp + esi*4 + 0x44]
mov dword [ebx + 0x24], 1
mov eax, dword [ecx]
mov dword [edi + 4], eax
mov eax, dword [ecx + 8]
mov dword [edi + 8], eax
mov eax, dword [edi]
mov dword [ecx + 8], eax
cmp esi, ebp
jge 0x52fb06
mov ecx, dword [esp + esi*4 + 0x4c]
inc ebp
mov eax, dword [edi]
mov dword [ecx + 4], eax
jmp 0x52fc4a
cmp dword [edi + 8], 0xffffffff
je 0x52fb33
mov eax, dword [esp + ebp*4 + 0x48]
push dword [eax + 8]
push ebx
push dword [ebx + 0x40]
call fcn.005314b0
mov ecx, dword [edi]
push 0
push eax
mov dword [eax + 4], ecx
mov dword [eax + 0x24], 1
call fcn.0052eea0
add esp, 0x14
inc ebp
jmp 0x52fc4a
jge 0x52fc4f
cmp edi, 1
jle 0x52fb67
mov edx, dword [esp + ebp*4 + 0x44]
mov ecx, dword [esp + edi*4 + 0x40]
mov eax, dword [edx]
mov dword [ecx + 8], eax
mov eax, dword [ecx]
mov dword [edx + 4], eax
mov eax, dword [esp + edi*4 + 0x44]
mov dword [esp + ebp*4 + 0x44], eax
mov dword [esp + edi*4 + 0x44], edx
jmp 0x52fbf7
mov ecx, dword [esp + 0x1c]
test edi, edi
jle 0x52fb8a
cmp dword [ecx + 4], 0xffffffff
jne 0x52fb8a
mov eax, dword [esp + ebp*4 + 0x44]
mov dword [esp + ebp*4 + 0x44], ecx
mov dword [esp + 0x48], eax
mov dword [eax + 4], 0xffffffff
jmp 0x52fbf7
mov eax, dword [esp + ebp*4 + 0x44]
mov esi, dword [eax + 8]
test edi, edi
jle 0x52fba4
mov eax, dword [esp + edi*4 + 0x44]
mov ecx, dword [eax]
mov dword [esp + 0x10], ecx
mov dword [eax + 8], esi
jmp 0x52fbcf
mov ecx, dword [ecx + 4]
mov dword [esp + 0x10], ecx
cmp ecx, 0xffffffff
je 0x52fbcf
push ecx
push ebx
push dword [ebx + 0x40]
call fcn.005314b0
push 0
push eax
mov dword [eax + 8], esi
mov dword [eax + 0x24], 1
call fcn.0052eea0
add esp, 0x14
cmp esi, 0xffffffff
je 0x52fbf7
push esi
push ebx
push dword [ebx + 0x40]
call fcn.005314b0
mov ecx, dword [esp + 0x1c]
push 0
push eax
mov dword [eax + 4], ecx
mov dword [eax + 0x24], 1
call fcn.0052eea0
add esp, 0x14
dec ebp
cmp ebp, edi
jl 0x52fc48
nop dword [eax]
mov eax, dword [esp + 0x24]
add eax, ebp
push eax
push ebx
call fcn.0052f2a0
mov eax, dword [esp + ebp*4 + 0x50]
push 0
push eax
mov dword [eax + 0x38], 0
mov dword [eax + 0x24], 0
mov byte [eax + 0x20], 0xff
mov dword [eax + 4], 0xffffffff
mov dword [eax + 8], 0xffffffff
mov dword [eax + 0xc], 0
call fcn.0052eea0
dec ebp
add esp, 0x10
cmp ebp, edi
jge 0x52fc00
mov ebp, edi
or dword [esp + 0x18], 8
mov ecx, dword [esp + 0x14]
test ecx, ecx
jle 0x52fe17
mov eax, dword [ebx + 0x40]
cmp word [eax + 0x78], 2
jne 0x52fc88
cmp ebp, 2
jle 0x52fc88
lea eax, [ebp*2 - 1]
cmp ecx, eax
jne 0x52fc88
mov edx, dword [esp + 0x38]
mov eax, 1
mov dword [esp + 0x2c], eax
mov dword [esp + 0x1c], edx
jmp 0x52fc9e
mov edx, dword [esp + 0x38]
xor eax, eax
mov dword [esp + 0x1c], edx
mov dword [esp + 0x2c], eax
test ebp, ebp
jle 0x52fe0b
xor edi, edi
test eax, eax
je 0x52fcb1
cmp edi, 1
jne 0x52fcb1
mov esi, edi
mov dword [esp + 0x10], esi
jmp 0x52fcc5
mov eax, ecx
mov ecx, ebp
sub eax, edi
sub ecx, edi
dec eax
add eax, ebp
cdq
idiv ecx
mov esi, eax
mov dword [esp + 0x10], eax
mov ecx, dword [ebx + 0x40]
movzx ecx, word [ecx + 0x78]
cmp esi, ecx
jle 0x52fce6
push 0
push 0
push str.hb_cdxPageKeyIntBalance:_iNodeKeys_calculated_wrong_
push 0x23f1
call fcn.004ecae0
add esp, 0x10
imul esi, dword [esp + 0x30]
mov eax, dword [esp + edi*4 + 0x48]
add eax, 0x58
push esi
push dword [esp + 0x20]
push eax
call fcn.0059ce60
mov ecx, dword [esp + edi*4 + 0x54]
add esp, 0xc
add dword [esp + 0x1c], esi
mov eax, dword [esp + 0x10]
mov esi, dword [esp + 0x24]
sub dword [esp + 0x14], eax
add esi, edi
mov dword [ecx + 0xc], eax
mov dword [ecx + 0x24], 1
mov edx, dword [ebx + 0xc]
cmp esi, edx
jge 0x52fdef
mov eax, dword [esp + 0x1c]
mov ecx, dword [ecx]
mov dword [esp + 0x44], ecx
mov ebx, dword [eax - 8]
sub eax, dword [esp + 0x30]
mov dword [esp + 0x40], ebx
bswap ebx
mov dword [esp + 0x3c], ebx
mov ebx, dword [esp + 0x34]
mov dword [esp + 0x28], eax
mov eax, dword [ebx + 0x40]
movzx eax, word [eax + 0x16]
mov dword [esp + 0x20], eax
add eax, 8
imul eax, esi
test byte [ebx + 0x20], 2
mov dword [esp + 0x10], eax
je 0x52fd82
push 0
push 0
push str.hb_cdxPageIntSetKey:_page_is_a_leaf_
push 0x23f1
call fcn.004ecae0
mov edx, dword [ebx + 0xc]
add esp, 0x10
test esi, esi
js 0x52fd8a
cmp esi, edx
jl 0x52fda0
push 0
push 0
push str.hb_cdxPageIntSetKey:_wrong_iKey_index.
push 0x23f1
call fcn.004ecae0
add esp, 0x10
mov eax, dword [esp + 0x28]
mov esi, dword [esp + 0x10]
test eax, eax
je 0x52fdbf
push dword [esp + 0x20]
push eax
lea eax, [ebx + 0x58]
add eax, esi
push eax
call fcn.0059ce60
add esp, 0xc
cmp dword [esp + 0x3c], 0
je 0x52fdd4
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x40]
add eax, esi
mov dword [eax + ebx + 0x58], ecx
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x44]
add eax, esi
bswap ecx
mov dword [eax + ebx + 0x5c], ecx
mov ecx, dword [esp + edi*4 + 0x48]
mov dword [ebx + 0x24], 1
push 0
push ecx
call fcn.0052eea0
mov ecx, dword [esp + 0x1c]
inc edi
mov eax, dword [esp + 0x34]
add esp, 8
cmp edi, ebp
jl 0x52fca0
push dword [esp + 0x38]
call fcn.004a6790
add esp, 4
mov eax, dword [ebx + 0x40]
mov dword [ebx + 0x24], 1
movzx ecx, word [eax + 0x78]
mov eax, dword [esp + 0x18]
or eax, 2
cmp dword [ebx + 0xc], ecx
cmovle eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x5c]
pop esi
pop edi
pop ebp
pop ebx
xor ecx, esp
call fcn.0059bb21
add esp, 0x50
ret