Function at 0x510901
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
mov eax, dword [ebp + 0x30]
push ebx
mov ebx, dword [ebp + 0x1c]
push esi
xor esi, esi
mov dword [eax], esi
cmp dword [ebx + 0x1c], 3
push edi
jne 0x5109b0
mov eax, dword [ebx + 0xc]
cmp eax, esi
je 0x510938
push dword [eax + 0x8c]
push dword [ebx + 0x8c]
call fcn.005183d3
jmp 0x51094b
mov esi, dword [ebp + 0x10]
push 9
add esi, 4
lea edi, [ebx + 0x90]
pop ecx
rep movsd dword es:[edi], dword [esi]
xor esi, esi
lea eax, [ebx + 0x22]
push eax
mov eax, dword [ebx + 0x8c]
add eax, 0x28
push eax
push dword [ebp + 0x30]
lea eax, [ebp - 0x14]
push eax
lea eax, [ebx + 0x10]
push eax
mov ax, word [ebx + 0x20]
push eax
push dword [ebp + 8]
call fcn.0051ce84
cmp eax, esi
jne 0x510d6d
lea eax, [ebx + 0xb8]
push eax
lea eax, [ebx + 0x30]
push eax
lea eax, [ebx + 0x2e]
push eax
lea eax, [ebx + 0x2c]
push eax
lea eax, [ebx + 0x2a]
push eax
mov ax, word [ebx + 0x20]
push eax
push dword [ebp + 8]
call fcn.0051e9a9
cmp eax, esi
jne 0x510d6d
xor eax, eax
cmp dword [ebp - 0x14], esi
setne al
mov dword [ebx + 0x1c], eax
mov eax, dword [ebx + 0x1c]
cmp eax, esi
jne 0x510b28
push dword [ebp + 0x38]
mov eax, dword [ebx + 0x8c]
push dword [ebp + 0x34]
mov dx, word [eax + 0x28]
lea esi, [ebx + 0x88]
push esi
lea edi, [ebx + 0x86]
push edi
push dword [eax + 0x20]
lea ecx, [ebx + 0x10]
push dword [eax + 0x1c]
mov dword [ebp + 0x14], edi
push edx
mov edx, dword [ebp + 0x30]
push dword [edx]
mov dword [ebp + 0x20], ecx
push dword [ebp + 0xc]
push ecx
push dword [eax + 0x10]
push dword [eax + 0x14]
push dword [eax + 0x18]
call fcn.0051d043
test eax, eax
jne 0x510d6d
push dword [ebx + 0x8c]
call fcn.00510332
lea eax, [ebp - 8]
push eax
lea eax, [ebp - 4]
push eax
lea eax, [ebp + 0x1e]
push eax
push dword [esi]
mov ax, word [edi]
mov edi, dword [ebp + 0x10]
push eax
lea eax, [ebx + 0x22]
push eax
lea eax, [ebx + 0x90]
push eax
mov ax, word [ebx + 0xb8]
push dword [ebx + 0xb4]
push eax
mov ax, word [ebx + 0x30]
push eax
mov ax, word [ebx + 0x2e]
push eax
mov ax, word [ebx + 0x2c]
push eax
mov ax, word [ebx + 0x2a]
push eax
mov ax, word [edi]
push eax
push dword [ebp + 0x28]
push dword [ebp + 0x2c]
push dword [ebx + 0x8c]
push dword [ebp + 0x24]
push dword [ebp + 0x18]
call fcn.0050e3a5
test eax, eax
jne 0x510d6d
push dword [edi + 0x38]
push dword [ebp - 4]
call fcn.0050e6a6
test eax, eax
jne 0x510a92
mov word [ebx + 0x84], 2
jmp 0x510a9d
mov ax, word [ebp + 0x1e]
mov word [ebx + 0x84], ax
push dword [ebx + 0x54]
push dword [ebx + 0x44]
call fcn.0050b3ad
push dword [ebx + 0x50]
mov edi, eax
push dword [ebx + 0x48]
call fcn.0050b3ad
sub edi, eax
jns 0x510ae9
mov edx, dword [ebx + 0x8c]
xor eax, eax
xor ecx, ecx
cmp word [edx + 0x28], ax
jle 0x510ae9
mov edx, dword [ebx + 0x8c]
mov edx, dword [edx + 0x2c]
add eax, edx
xor byte [eax], 1
mov edx, dword [ebx + 0x8c]
movsx edx, word [edx + 0x28]
inc ecx
movzx eax, cx
cmp eax, edx
jl 0x510ac9
xor edi, edi
cmp dword [ebx + 0xc], edi
je 0x510b08
mov eax, dword [ebp + 0x10]
mov ax, word [eax]
push eax
push ebx
push dword [ebp + 0x18]
call fcn.0050fd23
cmp eax, edi
jne 0x510d6d
push dword [ebp + 0x20]
push dword [ebp + 8]
call fcn.0051d565
cmp eax, edi
jne 0x510d6d
mov eax, dword [ebp + 0x14]
mov dword [esi], edi
mov word [eax], di
jmp 0x510d6b
push 2
pop edi
cmp eax, edi
jne 0x510c22
lea eax, [ebp - 8]
push eax
lea eax, [ebp - 4]
push eax
lea eax, [ebp + 0x1e]
push eax
push dword [ebx + 0x88]
mov ax, word [ebx + 0x86]
mov esi, dword [ebp + 0x10]
push eax
lea eax, [ebx + 0x22]
push eax
lea eax, [ebx + 0x90]
push eax
mov ax, word [ebx + 0xb8]
push dword [ebx + 0xb4]
push eax
mov ax, word [ebx + 0x30]
push eax
mov ax, word [ebx + 0x2e]
push eax
mov ax, word [ebx + 0x2c]
push eax
mov ax, word [ebx + 0x2a]
push eax
mov ax, word [esi]
push eax
push dword [ebp + 0x28]
push dword [ebp + 0x2c]
push dword [ebx + 0x8c]
push dword [ebp + 0x24]
push dword [ebp + 0x18]
call fcn.0050e4c5
test eax, eax
jne 0x510d6d
cmp dword [ebx + 0x68], eax
je 0x510bb8
lea eax, [ebx + 0x7c]
push eax
lea eax, [ebx + 0x74]
push eax
push dword [ebx + 0x8c]
call fcn.005181fc
cmp dword [ebp - 8], 0
je 0x510be1
push dword [esi + 0x38]
push dword [ebp - 4]
call fcn.0050e6a6
test eax, eax
jne 0x510bd6
mov word [ebx + 0x84], di
jmp 0x510be1
mov ax, word [ebp + 0x1e]
mov word [ebx + 0x84], ax
cmp dword [ebx + 0xc], 0
je 0x510bfc
mov ax, word [esi]
push eax
push ebx
push dword [ebp + 0x18]
call fcn.0050fd23
test eax, eax
jne 0x510d6d
lea eax, [ebx + 0x10]
push eax
push dword [ebp + 8]
call fcn.0051d565
test eax, eax
jne 0x510d6d
and dword [ebx + 0x88], eax
and word [ebx + 0x86], ax
jmp 0x510d6b
cmp eax, 1
jne 0x510d6b
mov dword [ebp - 0x10], esi
mov dword [ebp - 0xc], esi
mov dword [ebp + 0x18], esi
mov dword [ebx + 0x1c], edi
mov dword [ebp + 0x10], esi
mov eax, dword [ebp + 0xc]
mov cx, word [eax + 0x1e]
cmp cx, 1
jbe 0x510c4c
movzx ecx, cx
jmp 0x510c4f
xor ecx, ecx
inc ecx
movzx edx, word [ebx + 0x32]
inc edx
cmp edx, ecx
ja 0x510d3e
mov ax, word [eax + 0x1c]
inc dword [ebp + 0x10]
cmp ax, 3
jbe 0x510c6e
movzx eax, ax
jmp 0x510c71
push 3
pop eax
movzx ecx, word [ebp + 0x10]
cmp ecx, eax
ja 0x510d3e
lea eax, [ebp + 8]
push eax
push dword [ebp + 0x20]
push dword [ebp + 0x14]
call fcn.0050e70b
cmp eax, esi
jne 0x510d6d
mov ax, word [ebx + 0x32]
inc ax
push eax
push esi
push dword [ebp + 0x20]
mov esi, dword [ebp + 8]
push esi
call fcn.0050e773
push esi
push ebx
call fcn.0050e5f3
lea ecx, [ebp - 0x10]
push ecx
lea ecx, [ebp - 0x18]
push ecx
lea eax, [esi + 0x44]
push eax
lea eax, [esi + 0x42]
push eax
lea eax, [esi + 0x40]
push eax
lea eax, [esi + 0x3e]
push eax
lea eax, [esi + 0x3c]
push eax
lea edi, [esi + 0x20]
push edi
lea eax, [ebp - 0xc]
push eax
lea eax, [esi + 0x70]
push eax
lea eax, [esi + 0x6c]
push eax
lea eax, [esi + 0x38]
push eax
lea eax, [esi + 0x34]
push eax
lea eax, [ebx + 0x10]
push eax
call fcn.0051d367
mov ecx, dword [ebp + 0xc]
mov dword [ebp + 0x30], eax
mov ax, word [edi]
cmp ax, word [ecx + 4]
jae 0x510d45
cmp dword [ebp - 0x18], 0
je 0x510d21
lea eax, [esi + 0x90]
push eax
lea edi, [esi + 0x44]
push edi
call fcn.0050b690
push edi
call fcn.0050b7ce
test eax, eax
jne 0x510d21
and dword [esi + 0xb4], eax
mov eax, dword [ebp + 0x30]
test eax, eax
jne 0x510d6d
mov eax, dword [ebp + 0x18]
or eax, dword [ebp - 0xc]
cmp dword [ebp - 0x10], 0
mov dword [ebp + 0x18], eax
jne 0x510d4c
xor esi, esi
jmp 0x510c3a
mov eax, 0x140b
jmp 0x510d6d
mov eax, 0x1410
jmp 0x510d6d
test eax, eax
je 0x510d6b
lea eax, [ebx + 0x86]
push eax
lea eax, [ebx + 0x88]
push eax
add ebx, 0x10
push ebx
call fcn.0051d530
test eax, eax
jne 0x510d6d
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret 0x38