Function at 0x1039080
Capabilities:
Encode data using xor

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x1c
mov edx, dword [ebp + 0x10]
xor ecx, ecx
mov dword [ebp - 0x10], ecx
mov dword [ebp - 0xc], ecx
mov dword [ebp - 4], ecx
mov ecx, dword [ebp + 0xc]
push ebx
add ecx, edx
push esi
mov esi, dword [ebp + 8]
push edi
mov eax, 0x1000
mov dword [ebp - 8], ecx
cmp ecx, 0x1020
jbe 0x10390bd
mov ecx, dword [ebp + 0x18]
cmp dword [ebp - 8], ecx
jbe 0x103913c
cmp dword [ebp - 0x10], 0
jne 0x1039305
cmp dword [ebp - 0xc], 0
jne 0x1039305
mov edx, dword [ebp - 8]
mov dword [ebp - 0xc], 1
cmp edx, 0x2020
jbe 0x1039305
cmp edx, dword [ebp + 0x18]
ja 0x1039305
mov ebx, dword [ebp + 0x14]
mov edi, dword [ebp - 4]
lea ecx, [edx + ebx - 0x400]
mov eax, 0x30
test ecx, ecx
jne 0x1039107
inc edi
sub eax, 1
jne 0x1039102
cmp edi, 0xa
mov dword [ebp - 4], edi
jg 0x1039137
push 0x80
lea edx, [edx + ebx - 0x400]
push edx
call fcn.01037d10
fcomp qword [0x100c210]
fnstsw ax
test ah, 5
jp 0x1039305
mov eax, 0x2000
mov edi, dword [ebp - 8]
sub edi, eax
mov eax, dword [ebp + 0x14]
cmp byte [edi + eax + 1], 0
lea ebx, [edi + eax]
je 0x10390bd
push 4
lea ecx, [edi - 4]
push ecx
mov edx, eax
push edx
call fcn.01037f20
test eax, eax
je 0x10390bd
xor eax, eax
mov ecx, ebx
lea esp, [esp]
cmp byte [ecx], 0xe8
je 0x1039181
inc eax
inc ecx
cmp eax, 0x40
jb 0x1039170
jmp 0x10390bd
mov eax, dword [ebp + 0x14]
lea ebx, [edi + eax]
push 0x40
push ebx
call fcn.01037d10
fcomp qword [0x100c1b0]
fnstsw ax
test ah, 0x41
jne 0x10390bd
mov ecx, dword [ebp + 0x18]
mov edx, dword [ebp + 0x14]
push esi
push ecx
push edx
call fcn.01037f80
test eax, eax
je 0x10391ed
mov eax, dword [ebp + 0x24]
cmp eax, edi
jb 0x10391c2
cmp eax, dword [ebp - 8]
jbe 0x10390bd
mov ecx, dword [esi + 0x28]
mov edx, dword [ebp - 4]
lea eax, [ecx + 0x20]
add ecx, 0x40
cmp eax, ecx
jae 0x10391e4
mov edi, dword [ebp + 0x14]
cmp byte [eax + edi], 0
jne 0x10391dc
inc edx
inc eax
cmp eax, ecx
jb 0x10391d2
mov dword [ebp - 4], edx
cmp edx, 0x10
jg 0x10390bd
mov eax, dword [esi + 0x5c]
mov eax, dword [eax]
mov ecx, ebx
mov dl, byte [ecx]
xor edi, edi
mov dword [ebp - 0x10], 1
mov dword [ebp + 8], edi
cmp dl, byte [edi + ecx]
jne 0x1039249
inc edi
cmp edi, 0x20
jl 0x1039202
lea edi, [ecx + 1]
mov dword [ebp - 0x14], 0x20
cmp dl, byte [edi - 1]
je 0x103921f
inc dword [ebp + 8]
cmp dl, byte [edi]
je 0x1039226
inc dword [ebp + 8]
cmp dl, byte [edi + 1]
je 0x103922e
inc dword [ebp + 8]
cmp dl, byte [edi + 2]
je 0x1039236
inc dword [ebp + 8]
add edi, 4
sub dword [ebp - 0x14], 1
jne 0x1039217
cmp dword [ebp + 8], 8
jl 0x10390bd
mov dword [ebp + 8], 0x20
mov edx, dword [esi + 0xc]
movzx ebx, byte [ecx]
mov edi, dword [esi + 8]
mov dword [ebp - 0x18], edx
shr edx, 0x18
movzx edx, dl
xor edx, ebx
mov ebx, dword [ebp - 0x18]
shld ebx, edi, 8
xor ebx, dword [eax + edx*8 + 4]
shl edi, 8
xor edi, dword [eax + edx*8]
mov dword [esi + 0xc], ebx
mov edx, ebx
mov dword [esi + 8], edi
movzx ebx, byte [ecx + 1]
mov dword [ebp - 0x18], edx
shr edx, 0x18
movzx edx, dl
xor edx, ebx
mov ebx, dword [ebp - 0x18]
shld ebx, edi, 8
xor ebx, dword [eax + edx*8 + 4]
shl edi, 8
xor edi, dword [eax + edx*8]
mov edx, ebx
mov dword [esi + 0xc], ebx
mov dword [ebp - 0x18], edx
mov dword [esi + 8], edi
movzx ebx, byte [ecx + 2]
shr edx, 0x18
movzx edx, dl
xor edx, ebx
mov ebx, dword [ebp - 0x18]
shld ebx, edi, 8
xor ebx, dword [eax + edx*8 + 4]
shl edi, 8
xor edi, dword [eax + edx*8]
mov edx, ebx
mov dword [esi + 0xc], ebx
mov dword [ebp - 0x18], edx
mov dword [esi + 8], edi
movzx ebx, byte [ecx + 3]
shr edx, 0x18
movzx edx, dl
xor edx, ebx
mov ebx, dword [ebp - 0x18]
shld ebx, edi, 8
xor ebx, dword [eax + edx*8 + 4]
shl edi, 8
xor edi, dword [eax + edx*8]
add ecx, 4
sub dword [ebp + 8], 1
mov dword [esi + 8], edi
mov dword [esi + 0xc], ebx
jne 0x1039250
jmp 0x10390bd
cmp dword [ebp + 0x1c], 0x40
jbe 0x1039920
mov ecx, dword [ebp + 0x10]
lea edx, [ecx + ecx]
mov eax, 0xaaaaaaab
mul edx
mov eax, ecx
shr edx, 1
shr eax, 2
lea ecx, [eax + edx]
add ecx, dword [ebp + 0xc]
cmp ecx, dword [ebp + 0x18]
jae 0x1039490
mov ecx, dword [ebp + 0xc]
add edx, ecx
mov ecx, dword [ebp + 0x14]
lea edi, [edx + ecx]
push eax
push edi
call fcn.01037d10
fst qword [ebp - 0x1c]
fcomp qword [0x100caa0]
fnstsw ax
test ah, 0x41
jne 0x1039490
mov eax, dword [ebp + 0x20]
mov edx, eax
shr eax, 1
add eax, dword [ebp + 0x14]
shr edx, 2
add eax, dword [ebp + 0x1c]
push edx
push eax
call fcn.01037d10
fadd qword [0x100c210]
fcomp qword [ebp - 0x1c]
fnstsw ax
test ah, 5
jp 0x1039490
mov eax, dword [esi + 0x5c]
mov eax, dword [eax]
mov ecx, edi
mov dl, byte [ecx]
xor edi, edi
mov dword [ebp + 0xc], edi
cmp dl, byte [edi + ecx]
jne 0x10393d8
inc edi
cmp edi, 8
jl 0x1039391
lea edi, [ecx + 1]
mov dword [ebp + 0x10], 8
cmp dl, byte [edi - 1]
je 0x10393ae
inc dword [ebp + 0xc]
cmp dl, byte [edi]
je 0x10393b5
inc dword [ebp + 0xc]
cmp dl, byte [edi + 1]
je 0x10393bd
inc dword [ebp + 0xc]
cmp dl, byte [edi + 2]
je 0x10393c5
inc dword [ebp + 0xc]
add edi, 4
sub dword [ebp + 0x10], 1
jne 0x10393a6
cmp dword [ebp + 0xc], 2
jl 0x1039490
mov dword [ebp + 0xc], 8
nop
mov edx, dword [esi + 0xc]
movzx ebx, byte [ecx]
mov edi, dword [esi + 8]
mov dword [ebp - 0x18], edx
shr edx, 0x18
movzx edx, dl
xor edx, ebx
mov ebx, dword [ebp - 0x18]
shld ebx, edi, 8
xor ebx, dword [eax + edx*8 + 4]
shl edi, 8
xor edi, dword [eax + edx*8]
mov dword [esi + 0xc], ebx
mov edx, ebx
mov dword [esi + 8], edi
movzx ebx, byte [ecx + 1]
mov dword [ebp - 0x18], edx
shr edx, 0x18
movzx edx, dl
xor edx, ebx
mov ebx, dword [ebp - 0x18]
shld ebx, edi, 8
xor ebx, dword [eax + edx*8 + 4]
shl edi, 8
xor edi, dword [eax + edx*8]
mov edx, ebx
mov dword [esi + 0xc], ebx
mov dword [ebp - 0x18], edx
mov dword [esi + 8], edi
movzx ebx, byte [ecx + 2]
shr edx, 0x18
movzx edx, dl
xor edx, ebx
mov ebx, dword [ebp - 0x18]
shld ebx, edi, 8
xor ebx, dword [eax + edx*8 + 4]
shl edi, 8
xor edi, dword [eax + edx*8]
mov edx, ebx
mov dword [esi + 0xc], ebx
mov dword [ebp - 0x18], edx
mov dword [esi + 8], edi
movzx ebx, byte [ecx + 3]
shr edx, 0x18
movzx edx, dl
xor edx, ebx
mov ebx, dword [ebp - 0x18]
shld ebx, edi, 8
xor ebx, dword [eax + edx*8 + 4]
shl edi, 8
xor edi, dword [eax + edx*8]
add ecx, 4
sub dword [ebp + 0xc], 1
mov dword [esi + 8], edi
mov dword [esi + 0xc], ebx
jne 0x10393e0
mov edx, dword [esi + 0x2c]
mov edi, dword [ebp + 0x1c]
mov ecx, dword [ebp + 0x24]
add edx, edi
cmp edx, ecx
jne 0x10394c4
mov eax, dword [ebp + 0x18]
sub eax, ecx
cmp eax, 0x20
jb 0x10394ae
mov eax, 0x20
lea edx, [esi + 8]
push edx
push eax
mov eax, dword [ebp + 0x14]
add eax, ecx
mov ecx, dword [esi + 0x5c]
mov edx, dword [ecx]
push eax
push edx
call fcn.01031840
mov eax, dword [esi + 0x2c]
mov ecx, dword [ebp + 0x18]
add edi, eax
add ecx, 0xffffffc0
mov dword [ebp + 0xc], edi
cmp edi, ecx
jae 0x10396f0
mov edx, dword [ebp + 0x14]
mov ecx, dword [ebp + 0x1c]
add eax, edx
add eax, ecx
push 0x20
push eax
mov dword [ebp + 0x10], eax
call fcn.01037d10
fcomp qword [0x100c1b0]
fnstsw ax
test ah, 0x41
jne 0x10396f0
mov eax, dword [ebp + 0x1c]
mov ecx, dword [ebp + 0x20]
add eax, ecx
xor edx, edx
cmp eax, dword [ebp + 0x18]
ja 0x1039536
mov edi, dword [ebp + 0x14]
lea ecx, [edx + 1]
lea eax, [eax + edi - 1]
lea esp, [esp]
cmp byte [eax], 0
je 0x103952f
inc edx
cmp edx, 2
je 0x10396f0
inc ecx
dec eax
cmp ecx, 8
jb 0x1039520
mov edx, dword [ebp + 0xc]
mov eax, dword [ebp + 0x14]
xor edi, edi
xor ebx, ebx
xor ecx, ecx
lea edx, [edx + eax + 1]
mov al, byte [edx + ecx - 1]
test al, al
jne 0x1039551
inc edi
jmp 0x103955a
cmp al, 0x41
jb 0x103955a
cmp al, 0x7a
ja 0x103955a
inc ebx
mov al, byte [edx + ecx]
test al, al
jne 0x1039564
inc edi
jmp 0x103956d
cmp al, 0x41
jb 0x103956d
cmp al, 0x7a
ja 0x103956d
inc ebx
mov al, byte [edx + ecx + 1]
test al, al
jne 0x1039578
inc edi
jmp 0x1039581
cmp al, 0x41
jb 0x1039581
cmp al, 0x7a
ja 0x1039581
inc ebx
mov al, byte [edx + ecx + 2]
test al, al
jne 0x103958c
inc edi
jmp 0x1039595
cmp al, 0x41
jb 0x1039595
cmp al, 0x7a
ja 0x1039595
inc ebx
add ecx, 4
cmp ecx, 0x40
jb 0x1039546
mov ecx, dword [ebp + 0x18]
add ecx, 0xfffffe80
cmp dword [ebp + 0xc], ecx
jae 0x10395c4
mov edx, dword [ebp + 0x10]
push 3
push 0x100ca98
push 0x180
push edx
call fcn.0102af10
test eax, eax
jne 0x10395df
cmp edi, 4
jle 0x10396f0
cmp ebx, 0x14
jge 0x10396f0
cmp edi, 0x20
jge 0x10396f0
mov ecx, dword [ebp + 0x10]
mov eax, dword [esi + 0x5c]
mov eax, dword [eax]
mov dl, byte [ecx]
xor edi, edi
mov dword [ebp + 0xc], edi
mov edi, edi
cmp dl, byte [edi + ecx]
jne 0x1039637
inc edi
cmp edi, 8
jl 0x10395f0
lea edi, [ecx + 1]
mov dword [ebp + 0x10], 8
cmp dl, byte [edi - 1]
je 0x103960d
inc dword [ebp + 0xc]
cmp dl, byte [edi]
je 0x1039614
inc dword [ebp + 0xc]
cmp dl, byte [edi + 1]
je 0x103961c
inc dword [ebp + 0xc]
cmp dl, byte [edi + 2]
je 0x1039624
inc dword [ebp + 0xc]
add edi, 4
sub dword [ebp + 0x10], 1
jne 0x1039605
cmp dword [ebp + 0xc], 2
jl 0x10396f0
mov dword [ebp + 0xc], 8
mov edi, edi
mov edx, dword [esi + 0xc]
movzx ebx, byte [ecx]
mov edi, dword [esi + 8]
mov dword [ebp - 0x18], edx
shr edx, 0x18
movzx edx, dl
xor edx, ebx
mov ebx, dword [ebp - 0x18]
shld ebx, edi, 8
xor ebx, dword [eax + edx*8 + 4]
shl edi, 8
xor edi, dword [eax + edx*8]
mov dword [esi + 0xc], ebx
mov edx, ebx
mov dword [esi + 8], edi
movzx ebx, byte [ecx + 1]
mov dword [ebp - 0x18], edx
shr edx, 0x18
movzx edx, dl
xor edx, ebx
mov ebx, dword [ebp - 0x18]
shld ebx, edi, 8
xor ebx, dword [eax + edx*8 + 4]
shl edi, 8
xor edi, dword [eax + edx*8]
mov edx, ebx
mov dword [esi + 0xc], ebx
mov dword [ebp - 0x18], edx
mov dword [esi + 8], edi
movzx ebx, byte [ecx + 2]
shr edx, 0x18
movzx edx, dl
xor edx, ebx
mov ebx, dword [ebp - 0x18]
shld ebx, edi, 8
xor ebx, dword [eax + edx*8 + 4]
shl edi, 8
xor edi, dword [eax + edx*8]
mov edx, ebx
mov dword [esi + 0xc], ebx
mov dword [ebp - 0x18], edx
mov dword [esi + 8], edi
movzx ebx, byte [ecx + 3]
shr edx, 0x18
movzx edx, dl
xor edx, ebx
mov ebx, dword [ebp - 0x18]
shld ebx, edi, 8
xor ebx, dword [eax + edx*8 + 4]
shl edi, 8
xor edi, dword [eax + edx*8]
add ecx, 4
sub dword [ebp + 0xc], 1
mov dword [esi + 8], edi
mov dword [esi + 0xc], ebx
jne 0x1039640
mov eax, dword [esi + 0x2c]
mov ecx, dword [ebp + 0x1c]
mov edi, dword [ebp + 0x18]
add ecx, eax
mov dword [ebp + 0xc], ecx
cmp ecx, edi
jae 0x1039920
mov ebx, dword [ebp + 0x14]
mov edx, dword [ebp + 0x1c]
add eax, ebx
add eax, edx
mov dword [ebp + 0x10], eax
push 0x20
add eax, 0xffffffc0
push eax
call fcn.01037d10
fcomp qword [0x100c1b0]
fnstsw ax
test ah, 0x41
jne 0x1039920
mov eax, dword [ebp + 0x1c]
mov ecx, dword [ebp + 0x20]
xor edx, edx
add eax, ecx
mov dword [ebp + 0x14], edx
cmp eax, edi
ja 0x103975d
lea ecx, [edx + 1]
lea eax, [eax + ebx - 1]
cmp byte [eax], 0
je 0x1039756
inc edx
cmp edx, 2
je 0x1039920
inc ecx
dec eax
cmp ecx, 6
jb 0x1039747
mov edx, dword [ebp + 0xc]
lea ecx, [edx + ebx - 0x42]
mov ebx, dword [ebp + 0x14]
mov edx, 0x10
mov edi, ebx
mov edi, edi
mov al, byte [ecx + 2]
test al, al
jne 0x103977a
inc edi
jmp 0x1039783
cmp al, 0x41
jb 0x1039783
cmp al, 0x7a
ja 0x1039783
inc ebx
mov al, byte [ecx + 1]
test al, al
jne 0x103978d
inc edi
jmp 0x1039796
cmp al, 0x41
jb 0x1039796
cmp al, 0x7a
ja 0x1039796
inc ebx
mov al, byte [ecx]
test al, al
jne 0x103979f
inc edi
jmp 0x10397a8
cmp al, 0x41
jb 0x10397a8
cmp al, 0x7a
ja 0x10397a8
inc ebx
mov al, byte [ecx - 1]
test al, al
jne 0x10397b2
inc edi
jmp 0x10397bb
cmp al, 0x41
jb 0x10397bb
cmp al, 0x7a
ja 0x10397bb
inc ebx
sub ecx, 4
sub edx, 1
jne 0x1039770
cmp dword [ebp + 0xc], 0x180
jbe 0x10397ea
mov eax, dword [ebp + 0x10]
push 3
push 0x100ca98
push 0x180
add eax, 0xfffffe80
push eax
call fcn.0102af10
test eax, eax
jne 0x1039805
cmp edi, 4
jle 0x1039920
cmp ebx, 0x14
jge 0x1039920
cmp edi, 0x20
jge 0x1039920
mov ecx, dword [ebp + 0x10]
mov edx, dword [esi + 0x5c]
mov eax, dword [edx]
mov dl, byte [ecx - 0x20]
add ecx, 0xffffffe0
xor edi, edi
mov dword [ebp + 0x14], edi
cmp dl, byte [edi + ecx]
jne 0x1039862
inc edi
cmp edi, 8
jl 0x1039818
lea edi, [ecx + 1]
mov dword [ebp + 0x18], 8
lea ecx, [ecx]
cmp dl, byte [edi - 1]
je 0x1039838
inc dword [ebp + 0x14]
cmp dl, byte [edi]
je 0x103983f
inc dword [ebp + 0x14]
cmp dl, byte [edi + 1]
je 0x1039847
inc dword [ebp + 0x14]
cmp dl, byte [edi + 2]
je 0x103984f
inc dword [ebp + 0x14]
add edi, 4
sub dword [ebp + 0x18], 1
jne 0x1039830
cmp dword [ebp + 0x14], 2
jl 0x1039920
mov dword [ebp + 0x14], 8
lea esp, [esp]
mov edx, dword [esi + 0xc]
movzx ebx, byte [ecx]
mov edi, dword [esi + 8]
mov dword [ebp - 0x18], edx
shr edx, 0x18
movzx edx, dl
xor edx, ebx
mov ebx, dword [ebp - 0x18]
shld ebx, edi, 8
xor ebx, dword [eax + edx*8 + 4]
shl edi, 8
xor edi, dword [eax + edx*8]
mov dword [esi + 0xc], ebx
mov edx, ebx
mov dword [esi + 8], edi
movzx ebx, byte [ecx + 1]
mov dword [ebp - 0x18], edx
shr edx, 0x18
movzx edx, dl
xor edx, ebx
mov ebx, dword [ebp - 0x18]
shld ebx, edi, 8
xor ebx, dword [eax + edx*8 + 4]
shl edi, 8
xor edi, dword [eax + edx*8]
mov edx, ebx
mov dword [esi + 0xc], ebx
mov dword [ebp - 0x18], edx
mov dword [esi + 8], edi
movzx ebx, byte [ecx + 2]
shr edx, 0x18
movzx edx, dl
xor edx, ebx
mov ebx, dword [ebp - 0x18]
shld ebx, edi, 8
xor ebx, dword [eax + edx*8 + 4]
shl edi, 8
xor edi, dword [eax + edx*8]
mov edx, ebx
mov dword [esi + 0xc], ebx
mov dword [ebp - 0x18], edx
mov dword [esi + 8], edi
movzx ebx, byte [ecx + 3]
shr edx, 0x18
movzx edx, dl
xor edx, ebx
mov ebx, dword [ebp - 0x18]
shld ebx, edi, 8
xor ebx, dword [eax + edx*8 + 4]
shl edi, 8
xor edi, dword [eax + edx*8]
add ecx, 4
sub dword [ebp + 0x14], 1
mov dword [esi + 8], edi
mov dword [esi + 0xc], ebx
jne 0x1039870
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x20