Function at 0x6040e480
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x848
mov dword [ebp - 0x82c], 0
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x10]
shl eax, 2
push eax
call sym.exchndl.dll_bfd_malloc
add esp, 0x10
test eax, eax
mov dword [ebp - 0x81c], eax
je 0x6040e66c
lea edi, [ebp - 0x418]
mov eax, dword [ebp - 0x82c]
cld
mov edx, edi
mov ecx, 0x100
rep stosd dword es:[edi], eax
xor edi, edi
mov eax, edx
mov dword [ebp + edi*4 - 0x818], eax
add eax, 4
inc edi
cmp edi, 0xff
jbe 0x6040e4d0
mov ecx, dword [ebp + 8]
mov edx, dword [ebp - 0x81c]
mov edi, 1
mov dword [ebp - 0x820], edx
mov edx, dword [ecx + 0x10]
mov ecx, edx
cmp edi, edx
jae 0x6040e52a
mov ebx, dword [ebp + 8]
mov edx, dword [ebx + 0x1c]
mov eax, dword [edx + edi*4]
mov ebx, dword [eax + 0x10]
test ebx, ebx
je 0x6040e811
mov ebx, dword [ebp - 0x820]
mov dword [ebx], eax
add ebx, 4
mov dword [ebp - 0x820], ebx
inc edi
cmp edi, ecx
jb 0x6040e506
mov eax, dword [ebp - 0x81c]
mov ebx, dword [ebp - 0x820]
sub ebx, eax
push 0x6040e3b0
sar ebx, 2
mov eax, dword [ebp - 0x81c]
push 4
push ebx
shl ebx, 2
push eax
call sub.msvcrt.dll_qsort
pop edi
pop eax
push sub.msvcrt.dll_free
push sub.msvcrt.dll_calloc
push 0
push 0x6040e400
push 0
push ebx
call sym.exchndl.dll_htab_create_alloc
add esp, 0x20
test eax, eax
mov dword [ebp - 0x82c], eax
je 0x6040e650
mov eax, dword [ebp - 0x81c]
add ebx, eax
mov dword [ebp - 0x820], eax
mov dword [ebp - 0x824], ebx
cmp eax, ebx
jae 0x6040e650
mov edx, dword [ebp - 0x820]
mov edx, dword [edx]
mov dword [ebp - 0x828], edx
mov ecx, dword [edx + 0xc]
mov dword [ebp - 0x840], ecx
mov dword [ebp - 0x830], ecx
cmp ecx, 4
jbe 0x6040e786
mov ebx, dword [edx + 4]
mov esi, dword [ebp - 0x840]
add esi, ebx
xor ebx, ebx
mov dword [ebp - 0x840], esi
xor esi, esi
mov ecx, dword [ebp - 0x840]
dec ecx
dec ecx
xor edx, edx
inc esi
mov dl, byte [ecx]
mov eax, edx
shl eax, 0x11
lea eax, [eax + edx]
add ebx, eax
mov eax, ebx
shr eax, 2
xor ebx, eax
cmp esi, 3
jbe 0x6040e5dc
mov ecx, dword [ebp - 0x828]
mov edx, dword [ebp - 0x82c]
push 1
push ebx
push ecx
push edx
call sym.exchndl.dll_htab_find_slot_with_hash
add esp, 0x10
test eax, eax
je 0x6040e650
mov edx, dword [eax]
test edx, edx
je 0x6040e733
mov eax, dword [ebp - 0x828]
mov dword [eax + 0x14], edx
mov dword [eax + 0xc], 0
mov eax, dword [ebp - 0x820]
mov ebx, dword [ebp - 0x824]
add eax, 4
mov dword [ebp - 0x820], eax
cmp dword [ebp - 0x820], ebx
jb 0x6040e59a
mov eax, dword [ebp - 0x81c]
test eax, eax
je 0x6040e66c
sub esp, 0xc
mov eax, dword [ebp - 0x81c]
push eax
call sub.msvcrt.dll_free
add esp, 0x10
mov eax, dword [ebp - 0x82c]
test eax, eax
je 0x6040e688
sub esp, 0xc
mov edi, dword [ebp - 0x82c]
push edi
call sym.exchndl.dll_htab_delete
add esp, 0x10
mov eax, dword [ebp + 8]
mov edi, 1
mov ebx, 1
mov edx, dword [eax + 0x10]
cmp edi, edx
jae 0x6040e6cc
mov ecx, dword [ebp + 8]
mov eax, dword [ecx + 0x1c]
mov eax, dword [eax + edi*4]
mov dword [ebp - 0x828], eax
mov esi, dword [eax + 0x10]
test esi, esi
je 0x6040e6c7
mov eax, dword [eax + 0xc]
test eax, eax
je 0x6040e6c7
mov edx, dword [ebp - 0x828]
mov dword [edx + 0x14], ebx
add ebx, eax
mov edx, dword [ecx + 0x10]
inc edi
cmp edi, edx
jb 0x6040e69c
mov ecx, dword [ebp + 8]
mov edi, 1
cmp edi, edx
mov dword [ecx + 0x18], ebx
jae 0x6040e6fd
mov ebx, dword [ebp + 8]
mov eax, dword [ebx + 0x1c]
mov eax, dword [eax + edi*4]
mov dword [ebp - 0x828], eax
mov ebx, dword [eax + 0x10]
test ebx, ebx
je 0x6040e6f8
mov ecx, dword [eax + 0xc]
test ecx, ecx
je 0x6040e705
inc edi
cmp edi, edx
jb 0x6040e6db
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
sub esp, 0xc
mov esi, dword [eax + 4]
mov ebx, dword [eax + 0x14]
push esi
call sub.msvcrt.dll_strlen
mov edx, dword [ebx + 0xc]
mov ecx, dword [ebx + 0x14]
sub edx, eax
add esp, 0x10
add edx, ecx
mov eax, dword [ebp - 0x828]
dec edx
mov ecx, dword [ebp + 8]
mov dword [eax + 0x14], edx
mov edx, dword [ecx + 0x10]
jmp 0x6040e6f8
mov edx, dword [ebp - 0x828]
mov dword [eax], edx
mov ecx, dword [edx + 0xc]
mov ebx, dword [edx + 4]
mov dword [ebp - 0x840], ecx
mov dword [ebp - 0x83c], ebx
mov ecx, dword [ebp - 0x83c]
mov ebx, dword [ebp - 0x840]
xor edx, edx
mov dl, byte [ebx + ecx - 2]
mov ecx, dword [ebp - 0x828]
mov eax, dword [ebp + edx*4 - 0x818]
mov dword [eax], ecx
mov eax, ecx
add eax, 0x14
mov dword [ebp + edx*4 - 0x818], eax
mov dword [ecx + 0x14], 0
jmp 0x6040e62f
mov eax, dword [ebp - 0x828]
mov ecx, dword [ebp - 0x840]
xor edx, edx
mov eax, dword [eax + 4]
mov dword [ebp - 0x83c], eax
mov dword [ebp - 0x834], eax
mov dl, byte [ecx + eax - 2]
mov ebx, dword [ebp + edx*4 - 0x418]
test ebx, ebx
je 0x6040e74d
dec ecx
mov dword [ebp - 0x838], ecx
mov eax, dword [ebx + 0xc]
cmp eax, dword [ebp - 0x830]
jbe 0x6040e7e8
mov esi, eax
mov edi, dword [ebp - 0x834]
mov eax, dword [ebp - 0x830]
sub esi, eax
mov eax, dword [ebx + 4]
add esi, eax
mov eax, dword [ebp - 0x838]
cld
cmp eax, eax
mov ecx, eax
repe cmpsb byte [esi], byte es:[edi]
je 0x6040e7f4
mov ebx, dword [ebx + 0x14]
test ebx, ebx
jne 0x6040e7b9
jmp 0x6040e74d
test ebx, ebx
je 0x6040e74d
mov edx, dword [ebp - 0x828]
mov dword [edx + 0x14], ebx
mov dword [edx + 0xc], 0
jmp 0x6040e62f
mov dword [eax + 0xc], 0
jmp 0x6040e525