Function at 0x401d80
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc
push edi
mov edi, dword [ebp + 8]
mov dword [ebp - 4], 0
test edi, edi
jne 0x401d9d
lea eax, [edi - 0x66]
pop edi
mov esp, ebp
pop ebp
ret
push ebx
mov ebx, dword [edi + 0x9c]
test ebx, ebx
jne 0x401db1
lea eax, [ebx - 0x66]
pop ebx
pop edi
mov esp, ebp
pop ebp
ret
cmp dword [ebx], 0
jne 0x401dc1
pop ebx
mov eax, 0xffffff9c
pop edi
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp + 0xc]
mov dword [ebx + 0x10], eax
mov eax, dword [ebx + 0x5c]
mov dword [ebx + 0x14], 0x800
cmp eax, 0x800
jae 0x401de4
cmp dword [ebx + 0x8c], 0
jne 0x401de4
mov dword [ebx + 0x14], eax
mov eax, dword [ebx + 0x58]
add eax, dword [ebx + 8]
cmp eax, 0x800
jae 0x401dfd
cmp dword [ebx + 0x8c], 0
je 0x401dfd
mov dword [ebx + 0x14], eax
cmp dword [ebx + 0x14], 0
push esi
ja 0x401e13
mov eax, dword [ebp - 4]
pop esi
pop ebx
pop edi
mov esp, ebp
pop ebp
ret
mov edi, dword [ebp + 8]
cmp dword [ebx + 8], 0
jne 0x401efe
mov eax, dword [ebx + 0x58]
test eax, eax
je 0x401efe
mov esi, 0x4000
mov dword [ebp - 8], esi
cmp eax, esi
jae 0x401e39
mov dword [ebp - 8], eax
mov esi, eax
mov eax, dword [ebx + 0x88]
add eax, dword [ebx + 0x3c]
mov ecx, dword [ebx + 0x80]
mov edx, dword [ebx + 0x7c]
push 0
push eax
mov eax, dword [ebx + 0x70]
push ecx
push edx
call eax
add esp, 0x10
test eax, eax
jne 0x401fee
mov ecx, dword [ebx]
mov edx, dword [ebx + 0x80]
mov eax, dword [ebx + 0x7c]
push esi
push ecx
mov ecx, dword [ebx + 0x64]
push edx
push eax
call ecx
add esp, 0x10
cmp eax, esi
jne 0x401fee
cmp dword [edi + 0xa0], 0
je 0x401ef0
mov dword [ebp - 0xc], 0
test esi, esi
je 0x401ef0
lea esi, [edi + 0xa4]
lea esp, [esp]
mov edi, dword [ebp + 8]
mov ecx, dword [edi + 0xac]
mov edx, dword [ebx]
add edx, dword [ebp - 0xc]
and ecx, 0xfffd
or ecx, 2
mov eax, ecx
xor eax, 1
imul eax, ecx
movsx ecx, byte [edx]
shr eax, 8
and eax, 0xff
xor eax, ecx
mov byte [edx], al
mov edi, dword [edi + 0xb0]
movsx eax, al
call fcn.00401000
mov ecx, dword [ebp - 0xc]
mov edx, dword [ebx]
mov byte [ecx + edx], al
inc ecx
mov dword [ebp - 0xc], ecx
cmp ecx, dword [ebp - 8]
jb 0x401ea0
mov esi, dword [ebp - 8]
mov eax, dword [ebx]
add dword [ebx + 0x3c], esi
sub dword [ebx + 0x58], esi
mov dword [ebx + 4], eax
mov dword [ebx + 8], esi
mov eax, dword [ebx + 0x84]
test eax, eax
je 0x401f7b
cmp dword [ebx + 0x8c], 0
jne 0x401f7b
cmp eax, 0xc
je 0x401fda
mov ecx, dword [ebx + 0x18]
mov edx, dword [ebx + 0x10]
lea eax, [ebx + 4]
push 2
push eax
mov dword [ebp - 0xc], ecx
mov dword [ebp - 8], edx
call fcn.00429c30
mov edi, eax
add esp, 8
test edi, edi
js 0x401f45
cmp dword [ebx + 0x1c], 0
je 0x401f45
mov edi, 0xfffffffd
mov esi, dword [ebx + 0x18]
sub esi, dword [ebp - 0xc]
mov ecx, dword [ebp - 8]
mov edx, dword [ebx + 0x50]
push esi
push ecx
push edx
call fcn.004299d0
sub dword [ebx + 0x5c], esi
add dword [ebp - 4], esi
add esp, 0xc
mov dword [ebx + 0x50], eax
cmp edi, 1
je 0x401e04
test edi, edi
je 0x401fda
pop esi
pop ebx
mov eax, edi
pop edi
mov esp, ebp
pop ebp
ret
mov eax, dword [ebx + 8]
test eax, eax
jne 0x401f8b
cmp dword [ebx + 0x58], eax
je 0x401e04
mov esi, dword [ebx + 0x14]
cmp esi, eax
jb 0x401f94
mov esi, eax
xor eax, eax
test esi, esi
je 0x401fb1
lea ebx, [ebx]
mov ecx, dword [ebx + 4]
mov cl, byte [eax + ecx]
mov edx, dword [ebx + 0x10]
mov byte [eax + edx], cl
inc eax
cmp eax, esi
jb 0x401fa0
mov edx, dword [ebx + 0x10]
mov eax, dword [ebx + 0x50]
push esi
push edx
push eax
call fcn.004299d0
sub dword [ebx + 0x5c], esi
sub dword [ebx + 8], esi
sub dword [ebx + 0x14], esi
add dword [ebx + 0x10], esi
add dword [ebx + 4], esi
add dword [ebx + 0x18], esi
add esp, 0xc
add dword [ebp - 4], esi
mov dword [ebx + 0x50], eax
cmp dword [ebx + 0x14], 0
ja 0x401e10
mov eax, dword [ebp - 4]
pop esi
pop ebx
pop edi
mov esp, ebp
pop ebp
ret
pop esi
pop ebx
or eax, 0xffffffff
pop edi
mov esp, ebp
pop ebp
ret