Function at 0x4c1770
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
lea esp, [esp - 0x44]
push ebx
push esi
push edi
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x30], edx
mov dword [ebp - 0x2c], ecx
mov dword [ebp - 0x24], 0
xor eax, eax
push fcn.004c1750
push ebp
push 0x4135b0
push dword fs:[eax]
mov dword fs:[eax], esp
mov edx, dword [ebp - 0x28]
mov eax, dword [edx + 0x48]
call fcn.004c4590
mov byte [ebp - 0x40], al
mov edx, dword [ebp - 0x2c]
add edx, 0x800
mov ecx, dword [ebp - 0x28]
mov eax, dword [ecx + 0x14]
lea ecx, [ebp - 0xc]
call fcn.004c8cd0
lea eax, [ebp - 8]
lea edx, [ebp - 0xc]
mov edx, dword [edx]
mov eax, dword [eax]
add eax, edx
mov dword [ebp - 0xc], eax
mov dword [ebp - 8], 0
mov dword [ebp - 0x34], 5
mov eax, dword [ebp - 0x28]
cmp dword [eax + 0x18], 0
je 0x4c1e28
cmp byte [ebp - 0x40], 4
jne 0x4c180e
mov edx, dword [ebp - 0x28]
mov eax, dword [edx + 0x4c]
cmp byte [eax + 4], 0
jne 0x4c180e
mov edx, dword [ebp - 0x28]
mov eax, dword [edx + 0x48]
cmp byte [eax + 0x15], 0
jne 0x4c1e28
mov dword [ebp - 0x38], 0
movzx eax, byte [ebp - 0x40]
sub eax, 2
cmp eax, 2
jae 0x4c1833
mov edx, dword [ebp - 0x28]
mov eax, dword [edx + 0x18]
cmp byte [eax + 0x18], 1
jne 0x4c1833
mov byte [ebp - 0x3c], 1
jmp 0x4c1837
mov byte [ebp - 0x3c], 0
mov al, byte [ebp - 0x3c]
test al, al
je 0x4c188f
mov edx, dword [ebp - 0x28]
mov eax, dword [edx + 0x18]
mov ecx, dword [eax + 0x150]
mov edx, dword [ebp - 0xc]
add edx, dword [ebp - 0x34]
mov ebx, dword [ebp - 0x28]
mov eax, dword [ebx + 8]
mov esi, dword [ebp - 0x28]
mov ebx, dword [esi + 8]
mov ebx, dword [ebx]
call dword [ebx + 0x14]
mov eax, dword [ebp - 0x28]
mov edx, dword [eax + 0x18]
push dword [edx + 0x150]
mov edx, dword [ebp - 0x28]
mov eax, dword [edx + 0x18]
mov edx, dword [ebp - 0xc]
mov ecx, dword [ebp - 0x34]
call fcn.00486220
mov edx, dword [ebp - 0x28]
mov eax, dword [edx + 0x18]
mov eax, dword [eax + 0x150]
add dword [ebp - 0x34], eax
jmp 0x4c18fc
mov edx, dword [ebp - 0x28]
mov eax, dword [edx + 0x18]
cmp byte [eax + 0x18], 3
jne 0x4c18fc
cmp byte [ebp - 0x40], 4
je 0x4c18fc
mov eax, dword [ebp - 0xc]
mov ecx, dword [ebp - 0x34]
lea edx, [eax + ecx]
mov eax, dword [ebp - 0x28]
mov ecx, dword [eax + 0x20]
lea eax, [ecx + 4]
mov ecx, 8
call fcn.00402d40
add dword [ebp - 0x34], 8
mov dword [ebp - 0x38], 8
mov eax, dword [ebp - 0x28]
mov edx, dword [eax + 0x20]
test edx, edx
je 0x4c18d8
mov edx, dword [edx - 4]
add edx, 1
push edx
mov eax, dword [ebp - 0x28]
mov edx, dword [eax + 0x20]
mov ecx, dword [ebp - 0x28]
mov eax, dword [ecx + 0x18]
xor ecx, ecx
call fcn.00486220
mov eax, dword [ebp - 0x28]
lea edx, [eax + 0x20]
mov ecx, dword [ebp - 0x28]
mov eax, dword [ecx]
call fcn.004c16a0
mov eax, dword [ebp - 0x28]
cmp dword [eax + 0x3c], 0
je 0x4c1947
cmp dword [ebp - 0x2c], 0
jle 0x4c1947
mov eax, dword [ebp - 4]
sub eax, dword [ebp - 0x34]
mov dword [ebp - 0x1c], eax
push dword [ebp - 0x2c]
push dword [ebp - 0xc]
push dword [ebp - 0x34]
lea eax, [ebp - 0x1c]
push eax
push 1
mov edx, dword [ebp - 0x28]
mov eax, dword [edx + 0x3c]
mov edx, dword [ebp - 0x30]
xor ecx, ecx
mov esi, dword [ebp - 0x28]
mov ebx, dword [esi + 0x3c]
mov ebx, dword [ebx]
call dword [ebx + 0xc]
mov eax, dword [ebp - 0x28]
mov edx, dword [eax + 0x4c]
mov eax, dword [ebp - 0x1c]
mov dword [edx + 0xc], eax
jmp 0x4c1970
cmp dword [ebp - 0x2c], 0
jle 0x4c1964
mov eax, dword [ebp - 0xc]
mov ecx, dword [ebp - 0x34]
lea edx, [eax + ecx]
mov eax, dword [ebp - 0x30]
mov ecx, dword [ebp - 0x2c]
call fcn.00402d40
lea esi, [esi]
mov eax, dword [ebp - 0x28]
mov edx, dword [eax + 0x4c]
mov eax, dword [ebp - 0x2c]
mov dword [edx + 0xc], eax
mov eax, dword [ebp - 0x28]
cmp dword [eax + 0x34], 0
je 0x4c1a7a
mov edx, dword [ebp - 0x28]
mov eax, dword [edx + 0x4c]
mov ecx, dword [eax + 0xc]
mov edx, dword [ebp - 0x28]
mov eax, dword [edx + 0x4c]
mov edx, dword [ebp - 0xc]
call fcn.004c7b30
mov edx, dword [ebp - 0x28]
mov eax, dword [edx + 0x34]
mov edx, dword [ebp - 0x28]
mov ecx, dword [edx + 0x34]
mov edx, dword [ecx]
call dword [edx + 0x74]
push 8
mov eax, dword [ebp - 0x28]
push dword [eax + 0x74]
mov eax, dword [ebp - 0x28]
push dword [eax + 0x70]
mov edx, dword [ebp - 0x28]
mov eax, dword [edx]
lea edx, [ebp - 0x24]
call fcn.004c16e0
mov edx, dword [ebp - 0x24]
mov ecx, dword [ebp - 0x28]
mov eax, dword [ecx + 0x34]
xor ecx, ecx
call fcn.0049a720
test byte [ebp - 0x40], 0xff
jne 0x4c1a10
push 1
push dword [ebp - 0xc]
push 0
mov edx, dword [ebp - 0x28]
mov eax, dword [edx + 0x34]
mov edx, dword [ebp - 0xc]
xor ecx, ecx
call fcn.0049a740
mov edx, dword [ebp - 0x28]
mov eax, dword [edx + 0x4c]
mov eax, dword [eax + 0xc]
add eax, 2
mov ecx, eax
mov eax, dword [ebp - 0xc]
add eax, 3
mov edx, eax
mov ebx, dword [ebp - 0x28]
mov eax, dword [ebx + 0x34]
call fcn.0049a850
jmp 0x4c1a43
push 5
push dword [ebp - 0xc]
push 0
mov edx, dword [ebp - 0x28]
mov eax, dword [edx + 0x34]
mov edx, dword [ebp - 0xc]
xor ecx, ecx
call fcn.0049a740
mov edx, dword [ebp - 0x28]
mov eax, dword [edx + 0x4c]
mov ecx, dword [eax + 0xc]
mov eax, dword [ebp - 0xc]
add eax, dword [ebp - 0x34]
mov edx, eax
mov ebx, dword [ebp - 0x28]
mov eax, dword [ebx + 0x34]
call fcn.0049a850
mov edx, dword [ebp - 0x28]
mov eax, dword [edx + 0x34]
mov edx, dword [ebp - 0x28]
mov ecx, dword [edx + 0x34]
mov edx, dword [ecx]
call dword [edx + 0x6c]
mov esi, eax
mov ecx, dword [ebp - 0xc]
mov edx, dword [ebp - 0x28]
mov eax, dword [edx + 0x4c]
mov eax, dword [eax + 0xc]
add eax, dword [ebp - 0x34]
lea edx, [ecx + eax]
mov eax, dword [ebp - 0x28]
mov ecx, dword [eax + 0x34]
mov eax, dword [ecx + 0x10]
mov ecx, esi
call fcn.00402d40
jmp 0x4c1a7c
xor esi, esi
mov edx, dword [ebp - 0x28]
mov eax, dword [edx + 0x18]
mov al, byte [eax + 0x18]
test al, al
je 0x4c1a9c
sub al, 1
je 0x4c1ab0
sub al, 2
je 0x4c1b88
jmp 0x4c1d50
mov eax, dword [ebp - 0x28]
mov edx, dword [eax + 0x4c]
mov eax, dword [edx + 0xc]
add eax, esi
mov dword [edx + 8], eax
jmp 0x4c1d68
mov edx, dword [ebp - 0x28]
mov eax, dword [edx + 0x18]
mov ecx, dword [eax + 0x150]
mov eax, dword [ebp - 0x28]
mov edx, dword [eax + 0x4c]
mov eax, dword [edx + 0xc]
add eax, esi
add eax, 1
cdq
idiv ecx
mov eax, ecx
sub eax, edx
cdq
idiv ecx
mov byte [ebp - 0x44], dl
mov eax, dword [ebp - 0x28]
mov edx, dword [eax + 0x4c]
mov eax, dword [edx + 0xc]
add eax, esi
movzx ecx, byte [ebp - 0x44]
add eax, ecx
add eax, 1
mov dword [edx + 8], eax
test byte [ebp - 0x40], 0xff
jne 0x4c1b3a
mov edx, dword [ebp - 0xc]
mov eax, dword [ebp - 0x28]
mov ecx, dword [eax + 0x4c]
mov eax, dword [ecx + 0xc]
add eax, dword [ebp - 0x34]
add eax, esi
add edx, eax
mov ecx, dword [ebp - 0x28]
mov eax, dword [ecx + 8]
movzx ecx, byte [ebp - 0x44]
mov edi, dword [ebp - 0x28]
mov ebx, dword [edi + 8]
mov ebx, dword [ebx]
call dword [ebx + 0x14]
mov ecx, dword [ebp - 0xc]
mov eax, dword [ebp - 0x28]
mov edx, dword [eax + 0x4c]
mov eax, dword [edx + 8]
mov ebx, dword [ebp - 0x34]
lea edx, [eax + ebx]
mov al, byte [ebp - 0x44]
mov byte [ecx + edx - 1], al
jmp 0x4c1d68
mov edx, dword [ebp - 0x28]
mov eax, dword [edx + 0x4c]
mov eax, dword [eax + 0xc]
lea ecx, [eax + esi]
mov edx, dword [ebp - 0x28]
mov eax, dword [edx + 0x4c]
mov eax, dword [eax + 8]
sub eax, 1
mov edx, eax
cmp edx, ecx
jl 0x4c1d68
mov ebx, ecx
sub ebx, 1
lea esi, [esi]
add ebx, 1
mov ecx, dword [ebp - 0xc]
mov eax, dword [ebp - 0x34]
lea esi, [eax + ebx]
mov al, byte [ebp - 0x44]
mov byte [ecx + esi], al
cmp edx, ebx
jg 0x4c1b68
mov esi, esi
jmp 0x4c1d68
cmp byte [ebp - 0x40], 4
jne 0x4c1ca9
mov eax, dword [ebp - 0x28]
push dword [eax + 0x74]
mov eax, dword [ebp - 0x28]
push dword [eax + 0x70]
lea eax, [ebp - 0x18]
mov edx, 4
call fcn.00485bc0
mov edx, dword [ebp - 0x28]
mov eax, dword [edx + 0x20]
lea edx, [ebp - 0x18]
mov ecx, 4
call fcn.00402d40
mov ebx, 3
lea esi, [esi]
nop
add ebx, 1
mov edx, dword [ebp - 0x28]
mov eax, dword [edx + 0x20]
mov al, byte [eax + ebx]
xor byte [ebp + ebx - 0x18], al
cmp ebx, 0xb
jl 0x4c1bc8
push 0xc
mov edx, dword [ebp - 0x28]
mov eax, dword [edx + 0x18]
lea edx, [ebp - 0x18]
xor ecx, ecx
call fcn.00486220
mov ecx, dword [ebp - 0xc]
mov eax, dword [ebp - 0x28]
mov ebx, dword [eax + 0x4c]
mov eax, dword [ebx + 0xc]
mov edx, dword [ebp - 0x34]
lea esi, [edx + eax]
movzx eax, byte [ebx + 4]
mov al, byte [eax + 0x4f02a0]
mov byte [ecx + esi], al
mov edx, dword [ebp - 0x28]
mov eax, dword [edx + 0x4c]
mov byte [eax + 4], 3
mov eax, dword [ebp - 0x28]
mov edx, dword [eax + 0x4c]
add dword [edx + 0xc], 1
mov eax, dword [ebp - 0x28]
mov edx, dword [eax + 0x4c]
mov eax, dword [edx + 0xc]
mov dword [edx + 8], eax
mov eax, dword [ebp - 0x28]
mov edx, dword [eax + 0x4c]
mov eax, dword [ebp - 0x28]
mov ecx, dword [eax + 0x18]
mov edx, dword [edx + 8]
add edx, dword [ecx + 0x150]
mov eax, dword [ebp - 0x28]
mov ecx, dword [eax + 0x24]
mov al, byte [0x4f02a3]
mov byte [ecx], al
mov eax, dword [ebp - 0x28]
mov ebx, dword [eax + 0x4c]
mov eax, dword [ebp - 0x28]
mov ecx, dword [eax + 0x24]
mov al, byte [ebx + 5]
mov byte [ecx + 1], al
mov eax, dword [ebp - 0x28]
mov ecx, dword [eax + 0x4c]
mov eax, dword [ebp - 0x28]
mov ebx, dword [eax + 0x24]
mov al, byte [ecx + 6]
mov byte [ebx + 2], al
mov ecx, edx
shr ecx, 8
mov eax, dword [ebp - 0x28]
mov ebx, dword [eax + 0x24]
mov byte [ebx + 3], cl
mov eax, dword [ebp - 0x28]
mov ecx, dword [eax + 0x24]
mov byte [ecx + 4], dl
mov ecx, 0x537ef0
mov eax, dword [ebp - 0x28]
mov edx, dword [eax + 0x18]
lea eax, [edx + 0x38]
mov ebx, dword [ebp - 0x28]
mov edx, dword [ebx + 0x24]
call fcn.0040bd80
jmp 0x4c1d68
mov eax, dword [ebp - 0x28]
push dword [eax + 0x74]
mov eax, dword [ebp - 0x28]
push dword [eax + 0x70]
mov edx, dword [ebp - 0x28]
mov eax, dword [edx + 0x24]
xor edx, edx
call fcn.00485bc0
mov eax, dword [ebp - 0x28]
mov edx, dword [eax + 0x4c]
movzx eax, byte [edx + 4]
mov edx, dword [ebp - 0x28]
mov ecx, dword [edx + 0x24]
mov al, byte [eax + 0x4f02a0]
mov byte [ecx + 8], al
mov eax, dword [ebp - 0x28]
mov edx, dword [eax + 0x4c]
mov eax, dword [ebp - 0x28]
mov ecx, dword [eax + 0x24]
mov al, byte [edx + 5]
mov byte [ecx + 9], al
mov eax, dword [ebp - 0x28]
mov ecx, dword [eax + 0x4c]
mov eax, dword [ebp - 0x28]
mov edx, dword [eax + 0x24]
mov al, byte [ecx + 6]
mov byte [edx + 0xa], al
mov eax, dword [ebp - 0x28]
mov edx, dword [eax + 0x4c]
mov ecx, dword [edx + 0xc]
shr ecx, 8
mov eax, dword [ebp - 0x28]
mov edx, dword [eax + 0x24]
mov byte [edx + 0xb], cl
mov eax, dword [ebp - 0x28]
mov edx, dword [eax + 0x4c]
mov eax, dword [ebp - 0x28]
mov ecx, dword [eax + 0x24]
mov al, byte [edx + 0xc]
mov byte [ecx + 0xc], al
mov ecx, 0x537ef0
mov eax, dword [ebp - 0x28]
mov edx, dword [eax + 0x18]
lea eax, [edx + 0x38]
mov ebx, dword [ebp - 0x28]
mov edx, dword [ebx + 0x24]
call fcn.0040bd80
mov eax, dword [ebp - 0x28]
mov edx, dword [eax + 0x4c]
mov eax, dword [edx + 0xc]
mov dword [edx + 8], eax
jmp 0x4c1d68
push ebp
mov ecx, 0x400
mov edx, str._fScLayers.pas
mov eax, 0x57473c
call fcn.0040e7c0
lea esi, [esi]
mov eax, dword [ebp - 0x28]
mov edx, dword [eax + 0x4c]
push dword [edx + 8]
push dword [ebp - 0xc]
push dword [ebp - 0x34]
mov edx, dword [ebp - 0x28]
mov eax, dword [edx + 0x18]
mov edx, dword [ebp - 0xc]
mov ecx, dword [ebp - 0x34]
call fcn.00486ae0
mov edx, dword [ebp - 0x28]
mov eax, dword [edx + 0x4c]
mov eax, dword [eax + 8]
add dword [ebp - 0x34], eax
mov al, byte [ebp - 0x3c]
test al, al
je 0x4c1db5
mov eax, dword [ebp - 0x28]
mov edx, dword [eax + 0x18]
mov eax, dword [ebp - 0x28]
mov ecx, dword [eax + 0x4c]
mov eax, dword [edx + 0x150]
add eax, dword [ecx + 8]
mov dword [ecx + 8], eax
jmp 0x4c1e18
mov edx, dword [ebp - 0x28]
mov eax, dword [edx + 0x18]
cmp byte [eax + 0x18], 3
jne 0x4c1e18
mov edx, dword [ebp - 0x28]
mov eax, dword [edx + 0x18]
lea edx, [ebp - 0x24]
call fcn.00486380
mov eax, dword [ebp - 0x24]
mov edx, dword [ebp - 0x28]
mov ecx, dword [edx + 0x18]
mov ecx, dword [ecx + 0x150]
mov edx, dword [ebp - 0xc]
mov ebx, dword [ebp - 0x34]
add edx, ebx
call fcn.00402d40
mov eax, dword [ebp - 0x28]
mov edx, dword [eax + 0x18]
mov eax, dword [edx + 0x150]
add dword [ebp - 0x34], eax
mov eax, dword [ebp - 0x28]
mov ecx, dword [eax + 0x18]
mov eax, dword [ebp - 0x28]
mov ebx, dword [eax + 0x4c]
mov eax, dword [ebx + 8]
add eax, dword [ebp - 0x38]
add eax, dword [ecx + 0x150]
mov dword [ebx + 8], eax
lea esi, [esi]
mov eax, dword [ebp - 0x28]
add dword [eax + 0x70], 1
mov eax, dword [ebp - 0x28]
adc dword [eax + 0x74], 0
jmp 0x4c1e58
cmp dword [ebp - 0x2c], 0
jle 0x4c1e4c
mov eax, dword [ebp - 0xc]
mov ecx, dword [ebp - 0x34]
lea edx, [eax + ecx]
mov eax, dword [ebp - 0x30]
mov ecx, dword [ebp - 0x2c]
call fcn.00402d40
mov eax, dword [ebp - 0x34]
add eax, dword [ebp - 0x2c]
mov dword [ebp - 0x34], eax
nop
mov eax, dword [ebp - 0x28]
mov edx, dword [eax + 0x4c]
mov eax, dword [ebp - 0x2c]
mov dword [edx + 8], eax
mov edx, dword [ebp - 0x28]
mov eax, dword [edx + 0x4c]
mov ecx, dword [eax + 8]
mov edx, dword [ebp - 0x28]
mov eax, dword [edx + 0x4c]
mov edx, dword [ebp - 0xc]
call fcn.004c7b30
mov edx, dword [ebp - 0x28]
mov eax, dword [edx + 0x14]
mov edx, dword [ebp - 0x34]
call fcn.004c8d70
mov edx, dword [ebp - 0x28]
mov eax, dword [edx + 0x14]
xor ecx, ecx
mov edx, 0xffffffff
call fcn.004c8ce0
mov word [ebp - 0x20], ax
mov dl, byte [ebp - 0x20]
mov al, byte [ebp - 0x1f]
or al, dl
je 0x4c1eb0
mov edx, dword [ebp - 0x28]
mov eax, dword [edx + 0x48]
mov cx, 0x6e
mov dl, 1
call fcn.004c4140
mov esi, esi
xor edx, edx
pop eax
add esp, 0xc
mov dword fs:[edx], eax
mov eax, ebp
call fcn.004c1750
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret