Function at 0x502715
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x38
cmp dword [esp + 0x44], 0
push esi
mov esi, ecx
jne 0x502723
xor eax, eax
pop esi
add esp, 0x38
ret 0x18
mov eax, dword [esp + 0x40]
test eax, eax
jne 0x502735
or eax, 0xffffffff
pop esi
add esp, 0x38
ret 0x18
mov ecx, dword [esp + 0x44]
test ecx, ecx
je 0x50272b
mov edx, dword [esp + 0x4c]
test edx, edx
je 0x50272b
mov dword [esi + 0x414], eax
dec eax
mov dword [esi + 0x420], eax
mov dword [esi + 0x410], ecx
mov eax, 0xabeefbee
xor ecx, ecx
push edi
movzx edi, byte [ecx + str._r_n_r_naPLib_v1.01_____the_smaller_the_better_:__r_nCopyright__c__1998_2009_by_Joergen_Ibsen__All_Rights_Reserved._r_n_r_nMore_information:_http:__www.ibsensoftware.com__r_n_r_n]
rol eax, 1
xor eax, edi
movzx edi, byte [ecx + 0x5b4281]
rol eax, 1
xor eax, edi
movzx edi, byte [ecx + 0x5b4282]
rol eax, 1
xor eax, edi
movzx edi, byte [ecx + 0x5b4283]
rol eax, 1
add ecx, 4
xor eax, edi
cmp ecx, 0x100
jb 0x502760
test eax, eax
jne 0x50315a
push ebx
mov dword [esi], edx
lea ecx, [esi + 4]
add edx, 0x5a018
mov edi, 0x100
lea ebx, [eax + 1]
push ebp
mov dword [ecx], edx
xor eax, eax
add eax, 0
mov ebp, dword [ecx]
mov dword [ebp + eax], 0
add eax, 4
cmp eax, 0x400
jb 0x5027bd
add edx, 0x400
add ecx, 4
sub edi, ebx
jne 0x5027b4
mov ecx, dword [esi + 0x414]
mov edx, dword [esi]
or eax, 0xffffffff
mov dword [esi + 0x424], eax
mov dword [esi + 0x408], ecx
mov dword [esi + 0x404], ebx
mov dword [esi + 0x40c], edi
mov dword [edx], edi
mov ecx, dword [esi + 0x414]
mov edx, dword [esi + 0x410]
mov dword [esi + 0x428], edi
mov cl, byte [ecx]
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x54]
mov byte [edx], cl
add dword [esi + 0x414], ebx
add dword [esi + 0x410], ebx
dec eax
mov dword [esp + 0x10], edi
mov dword [esp + 0x18], edi
mov dword [esi + 0x41c], ebx
mov dword [esp + 0x58], ebx
cmp eax, ebx
jbe 0x50303b
lea ebx, [ebx]
mov eax, dword [esp + 0x5c]
test eax, eax
je 0x502890
mov ecx, dword [esp + 0x18]
inc ecx
mov dword [esp + 0x18], ecx
test cl, cl
jne 0x502890
mov edx, dword [esp + 0x60]
mov ecx, dword [esi + 0x410]
sub ecx, dword [esp + 0x50]
push edx
mov edx, dword [esi + 0x414]
sub edx, dword [esp + 0x50]
push ecx
mov ecx, dword [esp + 0x5c]
push edx
push ecx
call eax
add esp, 0x10
test eax, eax
je 0x503005
cmp ebx, dword [esp + 0x1c]
jne 0x5028a8
mov ebp, dword [esp + 0x44]
mov edx, dword [esp + 0x40]
mov dword [esp + 0x2c], ebp
mov dword [esp + 0x28], edx
jmp 0x5028c7
mov eax, dword [esp + 0x54]
mov ecx, dword [esi + 0x414]
sub eax, ebx
push eax
push ebx
push ecx
lea edx, [esp + 0x34]
push edx
mov ecx, esi
call fcn.00502446
mov ebp, dword [esp + 0x2c]
cmp ebp, 2
jl 0x502e76
mov eax, dword [esi + 0x424]
mov dword [esp + 0x14], 0
cmp dword [esp + 0x28], eax
jne 0x502946
cmp edi, 1
jbe 0x502c3f
cmp dword [esp + 0x38], eax
je 0x502c3f
mov eax, dword [esp + 0x10]
push edi
sub ebx, edi
push ebx
push eax
mov ecx, esi
call fcn.00501de9
mov ecx, dword [esp + 0x38]
push edi
push ecx
mov ecx, esi
mov ebx, eax
call fcn.005020ca
cmp eax, ebx
jge 0x502c3b
mov eax, dword [esp + 0x38]
cmp eax, 0x500
jl 0x502932
cmp edi, 2
je 0x502c3b
cmp eax, 0x7d00
jl 0x502942
cmp edi, 3
je 0x502c3b
mov ebx, dword [esp + 0x58]
mov eax, dword [esp + 0x54]
mov edx, dword [esi + 0x414]
sub eax, ebx
mov dword [esp + 0x20], eax
dec eax
push eax
lea ecx, [ebx + 1]
push ecx
inc edx
push edx
lea eax, [esp + 0x4c]
push eax
mov ecx, esi
call fcn.00502446
mov ecx, dword [esp + 0x28]
cmp dword [esp + 0x40], ecx
lea eax, [ebx + 1]
mov dword [esp + 0x1c], eax
push ebp
jl 0x5029b5
mov edx, ecx
push edx
mov ecx, esi
call fcn.005020ca
mov ecx, dword [esp + 0x40]
mov dword [esp + 0x24], eax
mov eax, dword [esp + 0x44]
push eax
push ecx
mov ecx, esi
call fcn.005020ca
mov ecx, dword [esp + 0x24]
sub ecx, eax
add ecx, ecx
mov eax, 0x38e38e39
imul ecx
sar edx, 1
mov eax, edx
shr eax, 0x1f
add eax, edx
jmp 0x5029e5
mov ecx, dword [esp + 0x2c]
push ecx
mov ecx, esi
call fcn.005020ca
mov edx, dword [esp + 0x44]
mov ebx, eax
mov eax, dword [esp + 0x40]
push edx
push eax
mov ecx, esi
call fcn.005020ca
sub ebx, eax
mov eax, ebx
mov ebx, dword [esp + 0x58]
cdq
and edx, 3
add eax, edx
sar eax, 2
add eax, dword [esp + 0x44]
cmp ebp, eax
jge 0x5029f5
mov dword [esp + 0x14], 1
test edi, edi
jbe 0x502a31
cmp dword [esp + 0x44], ebp
jl 0x502a2f
mov ecx, dword [esp + 0x28]
push ebp
push ecx
mov ecx, esi
call fcn.005020ca
mov edx, dword [esp + 0x44]
mov ebx, eax
mov eax, dword [esp + 0x40]
push edx
push eax
mov ecx, esi
call fcn.005020ca
cmp eax, ebx
mov ebx, dword [esp + 0x58]
jge 0x502a2f
mov dword [esp + 0x14], 1
test edi, edi
jne 0x502a80
cmp dword [esp + 0x44], ebp
jge 0x502a80
mov ecx, dword [esi + 0x414]
push 1
push ebx
push ecx
mov ecx, esi
call fcn.00501de9
mov edx, dword [esp + 0x44]
mov ebx, eax
mov eax, dword [esp + 0x40]
push edx
push eax
mov ecx, esi
call fcn.005020ca
mov ecx, dword [esp + 0x28]
push ebp
push ecx
mov ecx, esi
lea ebx, [eax + ebx + 1]
call fcn.005020ca
cmp ebx, eax
mov ebx, dword [esp + 0x58]
jle 0x502a80
mov dword [esp + 0x14], 0
jmp 0x502a8b
cmp dword [esp + 0x14], 0
jne 0x502e59
cmp ebp, 2
jle 0x502c3f
mov edx, dword [esp + 0x20]
mov eax, dword [esi + 0x414]
add edx, 0xfffffffe
push edx
add ebx, 2
push ebx
add eax, 2
push eax
lea ecx, [esp + 0x3c]
push ecx
mov ecx, esi
call fcn.00502446
mov eax, dword [esp + 0x30]
cmp eax, dword [esp + 0x28]
mov edx, dword [esp + 0x34]
push edx
mov ecx, esi
push eax
jl 0x502aeb
call fcn.005020ca
mov ebx, eax
mov eax, dword [esp + 0x28]
push ebp
push eax
mov ecx, esi
call fcn.005020ca
sub eax, ebx
cdq
and edx, 3
add eax, edx
mov ecx, eax
sar ecx, 2
jmp 0x502b15
call fcn.005020ca
mov ebx, eax
mov eax, dword [esp + 0x28]
push ebp
push eax
mov ecx, esi
call fcn.005020ca
mov ecx, eax
sub ecx, ebx
add ecx, ecx
mov eax, 0x2e8ba2e9
imul ecx
sar edx, 1
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
mov eax, dword [esp + 0x34]
add ecx, eax
cmp ebp, ecx
jge 0x502b27
mov dword [esp + 0x14], 1
test edi, edi
jbe 0x502b53
cmp eax, ebp
jl 0x502b53
mov edx, dword [esp + 0x30]
push eax
push edx
mov ecx, esi
call fcn.005020ca
mov ebx, eax
mov eax, dword [esp + 0x28]
push ebp
push eax
mov ecx, esi
call fcn.005020ca
cmp ebx, eax
jl 0x502e55
cmp dword [esp + 0x14], 0
jne 0x502e55
cmp ebp, 3
jle 0x502c3b
mov ecx, dword [esp + 0x20]
mov edx, dword [esp + 0x58]
mov eax, dword [esi + 0x414]
add ecx, 0xfffffffd
push ecx
add edx, 3
push edx
add eax, 3
push eax
lea ecx, [esp + 0x3c]
push ecx
mov ecx, esi
call fcn.00502446
mov eax, dword [esp + 0x30]
mov edx, dword [esp + 0x34]
mov ebx, dword [esp + 0x28]
cmp eax, ebx
push edx
mov ecx, esi
push eax
jl 0x502bc6
call fcn.005020ca
push ebp
push ebx
mov ecx, esi
mov dword [esp + 0x2c], eax
call fcn.005020ca
mov ecx, dword [esp + 0x24]
sub eax, ecx
cdq
and edx, 3
add eax, edx
mov ecx, eax
sar ecx, 2
jmp 0x502bf2
call fcn.005020ca
push ebp
push ebx
mov ecx, esi
mov dword [esp + 0x2c], eax
call fcn.005020ca
mov ecx, eax
mov eax, dword [esp + 0x24]
sub ecx, eax
add ecx, ecx
mov eax, 0x2e8ba2e9
imul ecx
sar edx, 1
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
mov eax, dword [esp + 0x34]
add ecx, eax
cmp ebp, ecx
jge 0x502c04
mov dword [esp + 0x14], 1
test edi, edi
jbe 0x502c30
cmp eax, ebp
jl 0x502c30
mov edx, dword [esp + 0x30]
push eax
push edx
mov ecx, esi
call fcn.005020ca
mov ebx, eax
mov eax, dword [esp + 0x28]
push ebp
push eax
mov ecx, esi
call fcn.005020ca
cmp ebx, eax
jl 0x502e55
cmp dword [esp + 0x14], 0
jne 0x502e55
mov ebx, dword [esp + 0x58]
test edi, edi
je 0x502db2
cmp edi, 1
jbe 0x502da0
mov edx, dword [esp + 0x54]
mov ecx, edi
sub ecx, ebx
lea eax, [edx + ecx]
cmp eax, edi
jbe 0x502c61
mov eax, edi
push eax
mov eax, dword [esp + 0x14]
sub ebx, edi
push ebx
push eax
lea ecx, [esp + 0x3c]
push ecx
mov ecx, esi
mov dword [esp + 0x24], ebx
call fcn.00502446
cmp dword [esp + 0x34], edi
jb 0x502cb4
mov edx, dword [esp + 0x30]
push edi
push edx
mov ecx, esi
call fcn.005020ca
mov ebx, eax
mov eax, dword [esp + 0x38]
push edi
push eax
mov ecx, esi
call fcn.005020ca
cmp eax, ebx
mov ebx, dword [esp + 0x14]
jle 0x502cb4
mov ecx, dword [esp + 0x30]
mov edx, dword [esp + 0x34]
mov dword [esp + 0x38], ecx
mov dword [esp + 0x3c], edx
mov eax, dword [esp + 0x10]
push edi
push ebx
push eax
mov ecx, esi
call fcn.00501de9
mov ecx, dword [esp + 0x38]
push edi
push ecx
mov ecx, esi
mov ebx, eax
call fcn.005020ca
cmp eax, ebx
jge 0x502d80
mov ebx, dword [esp + 0x28]
cmp ebx, dword [esi + 0x424]
jne 0x502d3d
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0x10]
push edi
push edx
push eax
mov ecx, esi
call fcn.00501de9
push ebp
push ebx
mov ecx, esi
mov dword [esp + 0x2c], eax
call fcn.005020ca
mov ecx, dword [esp + 0x24]
add ecx, eax
mov edx, ebx
push ebp
inc edx
mov dword [esp + 0x28], ecx
push edx
mov ecx, esi
call fcn.005020ca
mov ebx, eax
mov eax, dword [esp + 0x38]
push edi
push eax
mov ecx, esi
call fcn.005020ca
mov ebp, dword [esp + 0x2c]
add ebx, eax
mov eax, dword [esp + 0x24]
cmp eax, ebx
mov ebx, dword [esp + 0x58]
jle 0x502d84
jmp 0x502d41
mov ebx, dword [esp + 0x58]
mov eax, dword [esp + 0x38]
cmp eax, dword [esi + 0x424]
jne 0x502d56
cmp dword [esi + 0x428], 0
je 0x502d71
cmp eax, 0x500
jl 0x502d62
cmp edi, 2
je 0x502d84
cmp dword [esp + 0x38], 0x7d00
jl 0x502d71
cmp edi, 3
je 0x502d84
mov ecx, dword [esp + 0x38]
push edi
push ecx
mov ecx, esi
call fcn.0050214c
jmp 0x502db0
mov ebx, dword [esp + 0x58]
mov eax, dword [esp + 0x10]
mov edx, ebx
sub edx, edi
push edx
push eax
mov ecx, esi
call fcn.00501e42
inc dword [esp + 0x10]
sub edi, 1
jne 0x502d84
jmp 0x502db2
mov edx, dword [esp + 0x10]
lea ecx, [ebx - 1]
push ecx
push edx
mov ecx, esi
call fcn.00501e42
xor edi, edi
cmp ebp, 3
jg 0x502e3c
mov eax, dword [esi + 0x414]
push ebp
push ebx
push eax
mov ecx, esi
call fcn.00501de9
mov ecx, dword [esp + 0x28]
push ebp
push ecx
mov ecx, esi
mov ebx, eax
call fcn.005020ca
cmp eax, ebx
jg 0x502e06
mov eax, dword [esp + 0x28]
cmp eax, dword [esi + 0x424]
jne 0x502df3
cmp dword [esi + 0x428], 0
je 0x502e38
cmp eax, 0x500
jl 0x502dff
cmp ebp, 2
je 0x502e06
cmp eax, 0x7d00
jl 0x502e38
mov ebx, dword [esp + 0x58]
mov dword [esp + 0x14], ebp
test ebp, ebp
je 0x502e32
mov edx, dword [esi + 0x414]
push ebx
push edx
mov ecx, esi
call fcn.00501e42
mov eax, 1
add dword [esi + 0x414], eax
sub dword [esp + 0x14], eax
jne 0x502e12
lea ebx, [ebp + ebx - 1]
jmp 0x502e92
mov ebx, dword [esp + 0x58]
mov eax, dword [esp + 0x28]
push ebp
push eax
mov ecx, esi
call fcn.0050214c
add dword [esi + 0x414], ebp
lea ebx, [ebp + ebx - 1]
jmp 0x502e92
mov ebx, dword [esp + 0x58]
test edi, edi
jne 0x502e73
mov ecx, dword [esp + 0x28]
mov edx, dword [esi + 0x414]
mov dword [esp + 0x3c], ebp
mov dword [esp + 0x38], ecx
mov dword [esp + 0x10], edx
inc edi
jmp 0x502e8c
test edi, edi
je 0x502e7d
inc edi
jmp 0x502e8c
mov eax, dword [esi + 0x414]
push ebx
push eax
mov ecx, esi
call fcn.00501e42
inc dword [esi + 0x414]
test edi, edi
je 0x502f85
cmp edi, dword [esp + 0x3c]
jne 0x502f85
mov edx, dword [esp + 0x54]
mov ecx, edi
sub ecx, ebx
lea eax, [edx + ecx]
cmp eax, edi
jbe 0x502eb5
mov eax, edi
push eax
mov eax, dword [esp + 0x14]
mov ebp, ebx
sub ebp, edi
push ebp
push eax
lea ecx, [esp + 0x3c]
push ecx
mov ecx, esi
mov dword [esp + 0x24], ebp
call fcn.00502446
cmp dword [esp + 0x34], edi
jb 0x502f0a
mov edx, dword [esp + 0x30]
push edi
push edx
mov ecx, esi
call fcn.005020ca
mov ebp, eax
mov eax, dword [esp + 0x38]
push edi
push eax
mov ecx, esi
call fcn.005020ca
cmp eax, ebp
mov ebp, dword [esp + 0x14]
jle 0x502f0a
mov ecx, dword [esp + 0x30]
mov edx, dword [esp + 0x34]
mov dword [esp + 0x38], ecx
mov dword [esp + 0x3c], edx
mov eax, dword [esp + 0x10]
push edi
push ebp
push eax
mov ecx, esi
call fcn.00501de9
mov ecx, dword [esp + 0x38]
push edi
push ecx
mov ecx, esi
mov ebp, eax
call fcn.005020ca
cmp eax, ebp
jge 0x502f65
mov eax, dword [esp + 0x38]
cmp eax, dword [esi + 0x424]
jne 0x502f40
cmp dword [esi + 0x428], 0
je 0x502f58
cmp eax, 0x500
jl 0x502f4c
cmp edi, 2
je 0x502f65
cmp eax, 0x7d00
jl 0x502f58
cmp edi, 3
je 0x502f65
push edi
push eax
mov ecx, esi
call fcn.0050214c
xor edi, edi
jmp 0x502f85
mov ebp, dword [esp + 0x10]
add eax, 0
mov edx, ebx
sub edx, edi
push edx
push ebp
mov ecx, esi
call fcn.00501e42
inc ebp
sub edi, 1
jne 0x502f6e
mov dword [esp + 0x10], ebp
mov eax, dword [esp + 0x54]
inc ebx
dec eax
mov dword [esp + 0x58], ebx
cmp ebx, eax
jb 0x50284e
test edi, edi
je 0x50303b
cmp edi, 1
jbe 0x50302b
mov ecx, dword [esp + 0x10]
push edi
mov eax, ebx
sub eax, edi
push eax
push ecx
mov ecx, esi
call fcn.00501de9
mov edx, dword [esp + 0x38]
push edi
push edx
mov ecx, esi
mov ebp, eax
call fcn.005020ca
cmp eax, ebp
jg 0x503012
mov eax, dword [esp + 0x38]
cmp eax, dword [esi + 0x424]
jne 0x502fe2
cmp dword [esi + 0x428], 0
je 0x502ffa
cmp eax, 0x500
jl 0x502fee
cmp edi, 2
je 0x503012
cmp eax, 0x7d00
jl 0x502ffa
cmp edi, 3
je 0x503012
push edi
push eax
mov ecx, esi
call fcn.0050214c
jmp 0x50303b
pop ebp
pop ebx
pop edi
or eax, 0xffffffff
pop esi
add esp, 0x38
ret 0x18
mov ebp, dword [esp + 0x10]
mov eax, ebx
sub eax, edi
push eax
push ebp
mov ecx, esi
call fcn.00501e42
inc ebp
sub edi, 1
jne 0x503016
jmp 0x50303b
mov edx, dword [esp + 0x10]
lea ecx, [ebx - 1]
push ecx
push edx
mov ecx, esi
call fcn.00501e42
mov edi, dword [esp + 0x54]
mov ebp, 1
cmp ebx, edi
jae 0x503069
lea ebx, [ebx]
mov eax, dword [esi + 0x414]
push ebx
push eax
mov ecx, esi
call fcn.00501e42
add dword [esi + 0x414], ebp
add ebx, ebp
cmp ebx, edi
jb 0x50304e
or ebx, 0xffffffff
add dword [esi + 0x41c], ebx
lea ecx, [ebx + 9]
jne 0x503090
mov eax, dword [esi + 0x410]
mov dword [esi + 0x418], eax
inc eax
mov dword [esi + 0x41c], ecx
mov dword [esi + 0x410], eax
mov eax, dword [esi + 0x418]
mov dl, byte [eax]
add dl, dl
inc dl
mov byte [eax], dl
add dword [esi + 0x41c], ebx
jne 0x5030bf
mov eax, dword [esi + 0x410]
mov dword [esi + 0x418], eax
inc eax
mov dword [esi + 0x41c], ecx
mov dword [esi + 0x410], eax
mov eax, dword [esi + 0x418]
mov dl, byte [eax]
add dl, dl
inc dl
mov byte [eax], dl
add dword [esi + 0x41c], ebx
jne 0x5030ee
mov eax, dword [esi + 0x410]
mov dword [esi + 0x418], eax
inc eax
mov dword [esi + 0x41c], ecx
mov dword [esi + 0x410], eax
mov eax, dword [esi + 0x418]
shl byte [eax], 1
mov eax, dword [esi + 0x410]
mov byte [eax], 0
mov ecx, dword [esi + 0x41c]
mov eax, dword [esi + 0x418]
add dword [esi + 0x410], ebp
sub ecx, ebp
shl byte [eax], cl
mov eax, dword [esp + 0x5c]
test eax, eax
je 0x50314e
mov ecx, dword [esp + 0x60]
mov edx, dword [esi + 0x410]
sub edx, dword [esp + 0x50]
push ecx
mov ecx, dword [esi + 0x414]
sub ecx, dword [esp + 0x50]
push edx
push ecx
push edi
call eax
add esp, 0x10
test eax, eax
jne 0x50314e
pop ebp
mov eax, ebx
pop ebx
pop edi
pop esi
add esp, 0x38
ret 0x18
mov eax, dword [esi + 0x410]
sub eax, dword [esp + 0x50]
pop ebp
pop ebx
pop edi
pop esi
add esp, 0x38
ret 0x18