Function at 0x402fa7
Capabilities:
Encode data using xor

Disassembly:
mov eax, dword [esp + 0xc]
sub esp, 0x38
push esi
push edi
xor edi, edi
cmp eax, edi
mov esi, ecx
jne 0x402fc2
pop edi
xor eax, eax
pop esi
add esp, 0x38
ret 0x18
mov eax, dword [esp + 0x44]
cmp eax, edi
je 0x402fd2
mov ecx, dword [esp + 0x48]
cmp ecx, edi
jne 0x402fdd
pop edi
or eax, 0xffffffff
pop esi
add esp, 0x38
ret 0x18
push ebp
mov ebp, dword [esp + 0x54]
cmp ebp, edi
jne 0x402ff2
pop ebp
pop edi
or eax, 0xffffffff
pop esi
add esp, 0x38
ret 0x18
mov dword [esi + 0x414], eax
dec eax
mov dword [esi + 0x420], eax
mov dword [esi + 0x410], ecx
mov eax, 0xdd3beaab
xor edx, edx
mov ecx, eax
add eax, eax
shr ecx, 0x1f
or ecx, eax
movzx eax, byte [edx + str._r_n_r_naPLib_v0.43_____the_smaller_the_better_:__r_nCopyright__c__1998_2005_by_Joergen_Ibsen__All_Rights_Reserved._r_n_r_nThis_copy_of_aPLib_is_free_for_non_commercial_use._r_n_r_nMore_information:_http:__www.ibsensoftware.com__r_n_r_n]
xor ecx, eax
mov eax, ecx
shr eax, 0x1f
add ecx, ecx
or eax, ecx
movzx ecx, byte [edx + 0x40c2b5]
xor eax, ecx
mov ecx, eax
add eax, eax
shr ecx, 0x1f
or ecx, eax
movzx eax, byte [edx + 0x40c2b6]
xor ecx, eax
mov eax, ecx
shr eax, 0x1f
add ecx, ecx
or eax, ecx
movzx ecx, byte [edx + 0x40c2b7]
add edx, 4
xor eax, ecx
cmp edx, 0x100
jb 0x40300c
cmp eax, edi
jne 0x403a07
mov dword [esi], ebp
lea edx, [ebp + 0x5a018]
lea ecx, [esi + 4]
mov ebp, 0x100
push ebx
mov dword [ecx], edx
xor eax, eax
mov ebx, dword [ecx]
mov dword [eax + ebx], edi
add eax, 4
cmp eax, 0x400
jb 0x40307c
add edx, 0x400
add ecx, 4
dec ebp
jne 0x403078
mov edx, dword [esi + 0x414]
mov ecx, dword [esi]
or eax, 0xffffffff
mov ebp, 1
mov dword [esi + 0x408], edx
mov dword [esi + 0x424], eax
mov dword [esi + 0x404], ebp
mov dword [esi + 0x40c], edi
mov dword [ecx], edi
mov edx, dword [esi + 0x414]
mov ecx, dword [esi + 0x410]
mov dword [esi + 0x428], edi
mov dl, byte [edx]
mov byte [ecx], dl
mov ebx, dword [esi + 0x414]
mov edx, dword [esi + 0x410]
inc ebx
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x54]
inc edx
dec eax
cmp eax, ebp
mov dword [esp + 0x10], edi
mov dword [esp + 0x18], edi
mov dword [esi + 0x414], ebx
mov dword [esi + 0x410], edx
mov dword [esi + 0x41c], ebp
mov dword [esp + 0x58], ebp
jbe 0x4038e8
lea ecx, [ecx]
mov eax, dword [esp + 0x5c]
test eax, eax
je 0x40315d
mov ecx, dword [esp + 0x18]
inc ecx
test cl, cl
mov dword [esp + 0x18], ecx
jne 0x40315d
mov ecx, dword [esp + 0x60]
mov edx, dword [esi + 0x410]
mov ebx, dword [esp + 0x50]
push ecx
mov ecx, dword [esi + 0x414]
sub edx, ebx
mov ebx, dword [esp + 0x50]
push edx
mov edx, dword [esp + 0x5c]
sub ecx, ebx
push ecx
push edx
call eax
add esp, 0x10
test eax, eax
je 0x4038b1
cmp ebp, dword [esp + 0x1c]
jne 0x403175
mov ebx, dword [esp + 0x44]
mov eax, dword [esp + 0x40]
mov dword [esp + 0x34], ebx
mov dword [esp + 0x30], eax
jmp 0x403194
mov ecx, dword [esp + 0x54]
mov edx, dword [esi + 0x414]
sub ecx, ebp
push ecx
push ebp
push edx
lea eax, [esp + 0x3c]
push eax
mov ecx, esi
call fcn.00402cab
mov ebx, dword [esp + 0x34]
cmp ebx, 2
jl 0x403738
mov eax, dword [esi + 0x424]
cmp dword [esp + 0x30], eax
mov dword [esp + 0x14], 0
jne 0x403213
cmp edi, 1
jbe 0x403505
cmp dword [esp + 0x38], eax
je 0x403505
mov ecx, dword [esp + 0x10]
push edi
sub ebp, edi
push ebp
push ecx
mov ecx, esi
call fcn.0040263d
mov edx, dword [esp + 0x38]
push edi
push edx
mov ecx, esi
mov ebp, eax
call fcn.00402923
cmp eax, ebp
jge 0x403501
mov eax, dword [esp + 0x38]
cmp eax, 0x500
jl 0x4031ff
cmp edi, 2
je 0x403501
cmp eax, 0x7d00
jl 0x40320f
cmp edi, 3
je 0x403501
mov ebp, dword [esp + 0x58]
mov eax, dword [esp + 0x54]
sub eax, ebp
mov dword [esp + 0x20], eax
inc ebp
dec eax
push eax
mov eax, dword [esi + 0x414]
push ebp
inc eax
push eax
lea ecx, [esp + 0x4c]
push ecx
mov ecx, esi
call fcn.00402cab
mov eax, dword [esp + 0x40]
mov ecx, dword [esp + 0x30]
mov edx, dword [esp + 0x44]
push edx
cmp eax, ecx
mov dword [esp + 0x20], ebp
push eax
mov ecx, esi
jl 0x40327f
call fcn.00402923
mov ebp, eax
mov eax, dword [esp + 0x30]
push ebx
push eax
mov ecx, esi
call fcn.00402923
mov ecx, eax
sub ecx, ebp
shl ecx, 1
mov eax, 0x38e38e39
imul ecx
sar edx, 1
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
add ecx, dword [esp + 0x44]
cmp ebx, ecx
jmp 0x4032a6
call fcn.00402923
mov ebp, eax
mov eax, dword [esp + 0x30]
push ebx
push eax
mov ecx, esi
call fcn.00402923
sub eax, ebp
cdq
and edx, 3
add eax, edx
mov edx, dword [esp + 0x44]
sar eax, 2
add eax, edx
cmp ebx, eax
jge 0x4032b0
mov dword [esp + 0x14], 1
test edi, edi
jbe 0x4032e6
mov eax, dword [esp + 0x44]
cmp eax, ebx
jl 0x4032e4
mov ecx, dword [esp + 0x40]
push eax
push ecx
mov ecx, esi
call fcn.00402923
mov edx, dword [esp + 0x30]
push ebx
push edx
mov ecx, esi
mov ebp, eax
call fcn.00402923
cmp ebp, eax
jge 0x4032e4
mov dword [esp + 0x14], 1
test edi, edi
jne 0x403339
mov ebp, dword [esp + 0x44]
cmp ebp, ebx
jge 0x403339
mov eax, dword [esp + 0x58]
mov ecx, dword [esi + 0x414]
push 1
push eax
push ecx
mov ecx, esi
call fcn.0040263d
mov edx, dword [esp + 0x40]
push ebp
push edx
mov ecx, esi
mov dword [esp + 0x2c], eax
call fcn.00402923
mov ecx, dword [esp + 0x24]
lea ebp, [ecx + eax + 1]
mov eax, dword [esp + 0x30]
push ebx
push eax
mov ecx, esi
call fcn.00402923
cmp ebp, eax
jle 0x403339
mov dword [esp + 0x14], 0
jmp 0x403345
mov eax, dword [esp + 0x14]
test eax, eax
jne 0x403717
cmp ebx, 2
jle 0x403501
mov ecx, dword [esp + 0x20]
mov edx, dword [esp + 0x58]
mov eax, dword [esi + 0x414]
add ecx, 0xfffffffe
push ecx
add edx, 2
push edx
add eax, 2
push eax
lea ecx, [esp + 0x34]
push ecx
mov ecx, esi
call fcn.00402cab
mov eax, dword [esp + 0x28]
mov edx, dword [esp + 0x2c]
mov ebp, dword [esp + 0x30]
cmp eax, ebp
push edx
mov ecx, esi
push eax
jl 0x4033ad
call fcn.00402923
push ebx
push ebp
mov ecx, esi
mov dword [esp + 0x2c], eax
call fcn.00402923
mov ecx, dword [esp + 0x24]
sub eax, ecx
cdq
and edx, 3
add eax, edx
mov ecx, eax
sar ecx, 2
jmp 0x4033d9
call fcn.00402923
push ebx
push ebp
mov ecx, esi
mov dword [esp + 0x2c], eax
call fcn.00402923
mov ecx, eax
mov eax, dword [esp + 0x24]
sub ecx, eax
shl ecx, 1
mov eax, 0x2e8ba2e9
imul ecx
sar edx, 1
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
mov eax, dword [esp + 0x2c]
add ecx, eax
cmp ebx, ecx
jge 0x4033eb
mov dword [esp + 0x14], 1
test edi, edi
jbe 0x403417
cmp eax, ebx
jl 0x403417
mov edx, dword [esp + 0x28]
push eax
push edx
mov ecx, esi
call fcn.00402923
mov ebp, eax
mov eax, dword [esp + 0x30]
push ebx
push eax
mov ecx, esi
call fcn.00402923
cmp ebp, eax
jl 0x403717
mov eax, dword [esp + 0x14]
test eax, eax
jne 0x403717
cmp ebx, 3
jle 0x403501
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 + 0x34]
push ecx
mov ecx, esi
call fcn.00402cab
mov eax, dword [esp + 0x28]
mov edx, dword [esp + 0x2c]
mov ebp, dword [esp + 0x30]
cmp eax, ebp
push edx
mov ecx, esi
push eax
jl 0x40348b
call fcn.00402923
push ebx
push ebp
mov ecx, esi
mov dword [esp + 0x2c], eax
call fcn.00402923
mov ecx, dword [esp + 0x24]
sub eax, ecx
cdq
and edx, 3
add eax, edx
mov ecx, eax
sar ecx, 2
jmp 0x4034b7
call fcn.00402923
push ebx
push ebp
mov ecx, esi
mov dword [esp + 0x2c], eax
call fcn.00402923
mov ecx, eax
mov eax, dword [esp + 0x24]
sub ecx, eax
shl ecx, 1
mov eax, 0x2e8ba2e9
imul ecx
sar edx, 1
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
mov eax, dword [esp + 0x2c]
add ecx, eax
cmp ebx, ecx
jge 0x4034c9
mov dword [esp + 0x14], 1
test edi, edi
jbe 0x4034f5
cmp eax, ebx
jl 0x4034f5
mov edx, dword [esp + 0x28]
push eax
push edx
mov ecx, esi
call fcn.00402923
mov ebp, eax
mov eax, dword [esp + 0x30]
push ebx
push eax
mov ecx, esi
call fcn.00402923
cmp ebp, eax
jl 0x403717
mov eax, dword [esp + 0x14]
test eax, eax
jne 0x403717
mov ebp, dword [esp + 0x58]
test edi, edi
je 0x403678
cmp edi, 1
jbe 0x403666
mov edx, dword [esp + 0x54]
mov ecx, edi
sub ecx, ebp
lea eax, [ecx + edx]
cmp eax, edi
jbe 0x403527
mov eax, edi
push eax
mov eax, dword [esp + 0x14]
sub ebp, edi
push ebp
push eax
lea ecx, [esp + 0x34]
push ecx
mov ecx, esi
mov dword [esp + 0x24], ebp
call fcn.00402cab
cmp dword [esp + 0x2c], edi
jb 0x40357a
mov edx, dword [esp + 0x28]
push edi
push edx
mov ecx, esi
call fcn.00402923
mov ebp, eax
mov eax, dword [esp + 0x38]
push edi
push eax
mov ecx, esi
call fcn.00402923
cmp eax, ebp
mov ebp, dword [esp + 0x14]
jle 0x40357a
mov ecx, dword [esp + 0x28]
mov edx, dword [esp + 0x2c]
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.0040263d
mov ecx, dword [esp + 0x38]
push edi
push ecx
mov ecx, esi
mov ebp, eax
call fcn.00402923
cmp eax, ebp
jge 0x40363d
mov ebp, dword [esp + 0x30]
cmp ebp, dword [esi + 0x424]
jne 0x403603
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0x10]
push edi
push edx
push eax
mov ecx, esi
call fcn.0040263d
push ebx
push ebp
mov ecx, esi
mov dword [esp + 0x2c], eax
call fcn.00402923
mov ecx, dword [esp + 0x24]
add ecx, eax
mov edx, ebp
push ebx
inc edx
mov dword [esp + 0x28], ecx
push edx
mov ecx, esi
call fcn.00402923
mov ebx, eax
mov eax, dword [esp + 0x38]
push edi
push eax
mov ecx, esi
call fcn.00402923
mov ebp, dword [esp + 0x58]
add ebx, eax
mov eax, dword [esp + 0x24]
cmp eax, ebx
mov ebx, dword [esp + 0x34]
jle 0x403647
jmp 0x403607
mov ebp, dword [esp + 0x58]
mov eax, dword [esp + 0x38]
cmp eax, dword [esi + 0x424]
je 0x40362e
cmp eax, 0x500
jl 0x40361f
cmp edi, 2
je 0x403647
cmp dword [esp + 0x38], 0x7d00
jl 0x40362e
cmp edi, 3
je 0x403647
mov ecx, dword [esp + 0x38]
push edi
push ecx
mov ecx, esi
call fcn.004029a9
jmp 0x403676
mov ebp, dword [esp + 0x58]
lea ebx, [ebx]
mov eax, dword [esp + 0x10]
mov edx, ebp
sub edx, edi
push edx
push eax
mov ecx, esi
call fcn.0040269a
mov ecx, dword [esp + 0x10]
inc ecx
dec edi
mov dword [esp + 0x10], ecx
jne 0x403647
jmp 0x403678
mov edx, dword [esp + 0x10]
lea ecx, [ebp - 1]
push ecx
push edx
mov ecx, esi
call fcn.0040269a
xor edi, edi
cmp ebx, 3
jg 0x4036fc
mov eax, dword [esi + 0x414]
push ebx
push ebp
push eax
mov ecx, esi
call fcn.0040263d
mov ecx, dword [esp + 0x30]
push ebx
push ecx
mov ecx, esi
mov ebp, eax
call fcn.00402923
cmp eax, ebp
jg 0x4036bf
mov eax, dword [esp + 0x30]
cmp eax, dword [esi + 0x424]
je 0x4036f8
cmp eax, 0x500
jl 0x4036b8
cmp ebx, 2
je 0x4036bf
cmp eax, 0x7d00
jl 0x4036f8
test ebx, ebx
mov ebp, dword [esp + 0x58]
je 0x4036f2
mov dword [esp + 0x20], ebx
mov edx, dword [esi + 0x414]
push ebp
push edx
mov ecx, esi
call fcn.0040269a
mov ecx, dword [esi + 0x414]
mov eax, dword [esp + 0x20]
inc ecx
dec eax
mov dword [esi + 0x414], ecx
mov dword [esp + 0x20], eax
jne 0x4036cb
lea ebp, [ebx + ebp - 1]
jmp 0x40375b
mov ebp, dword [esp + 0x58]
mov eax, dword [esp + 0x30]
push ebx
push eax
mov ecx, esi
call fcn.004029a9
mov eax, dword [esi + 0x414]
add eax, ebx
lea ebp, [ebx + ebp - 1]
jmp 0x403755
test edi, edi
jne 0x403731
mov ecx, dword [esp + 0x30]
mov edx, dword [esi + 0x414]
mov dword [esp + 0x3c], ebx
mov dword [esp + 0x38], ecx
mov dword [esp + 0x10], edx
mov ebp, dword [esp + 0x58]
inc edi
jmp 0x40374e
test edi, edi
je 0x40373f
inc edi
jmp 0x40374e
mov eax, dword [esi + 0x414]
push ebp
push eax
mov ecx, esi
call fcn.0040269a
mov eax, dword [esi + 0x414]
inc eax
mov dword [esi + 0x414], eax
test edi, edi
je 0x40383e
cmp edi, dword [esp + 0x3c]
jne 0x40383e
mov edx, dword [esp + 0x54]
mov ecx, edi
sub ecx, ebp
lea eax, [ecx + edx]
cmp eax, edi
jbe 0x40377e
mov eax, edi
push eax
mov eax, dword [esp + 0x14]
mov ebx, ebp
sub ebx, edi
push ebx
push eax
lea ecx, [esp + 0x34]
push ecx
mov ecx, esi
mov dword [esp + 0x24], ebx
call fcn.00402cab
cmp dword [esp + 0x2c], edi
jb 0x4037d3
mov edx, dword [esp + 0x28]
push edi
push edx
mov ecx, esi
call fcn.00402923
mov ebx, eax
mov eax, dword [esp + 0x38]
push edi
push eax
mov ecx, esi
call fcn.00402923
cmp eax, ebx
mov ebx, dword [esp + 0x14]
jle 0x4037d3
mov ecx, dword [esp + 0x28]
mov edx, dword [esp + 0x2c]
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.0040263d
mov ecx, dword [esp + 0x38]
push edi
push ecx
mov ecx, esi
mov ebx, eax
call fcn.00402923
cmp eax, ebx
jge 0x403825
mov eax, dword [esp + 0x38]
cmp eax, dword [esi + 0x424]
je 0x403818
cmp eax, 0x500
jl 0x40380c
cmp edi, 2
je 0x403825
cmp eax, 0x7d00
jl 0x403818
cmp edi, 3
je 0x403825
push edi
push eax
mov ecx, esi
call fcn.004029a9
xor edi, edi
jmp 0x40383e
mov ebx, dword [esp + 0x10]
mov edx, ebp
sub edx, edi
push edx
push ebx
mov ecx, esi
call fcn.0040269a
inc ebx
dec edi
jne 0x403829
mov dword [esp + 0x10], ebx
mov eax, dword [esp + 0x54]
inc ebp
dec eax
cmp ebp, eax
mov dword [esp + 0x58], ebp
jb 0x403117
test edi, edi
je 0x4038e8
cmp edi, 1
jbe 0x4038d8
mov ecx, dword [esp + 0x10]
push edi
mov eax, ebp
sub eax, edi
push eax
push ecx
mov ecx, esi
call fcn.0040263d
mov edx, dword [esp + 0x38]
push edi
push edx
mov ecx, esi
mov ebx, eax
call fcn.00402923
cmp eax, ebx
jg 0x4038be
mov eax, dword [esp + 0x38]
cmp eax, dword [esi + 0x424]
je 0x4038a6
cmp eax, 0x500
jl 0x40389a
cmp edi, 2
je 0x4038be
cmp eax, 0x7d00
jl 0x4038a6
cmp edi, 3
je 0x4038be
push edi
push eax
mov ecx, esi
call fcn.004029a9
jmp 0x4038e8
pop ebx
pop ebp
pop edi
or eax, 0xffffffff
pop esi
add esp, 0x38
ret 0x18
mov ebx, dword [esp + 0x10]
add eax, 0
mov eax, ebp
sub eax, edi
push eax
push ebx
mov ecx, esi
call fcn.0040269a
inc ebx
dec edi
jne 0x4038c5
jmp 0x4038e8
mov edx, dword [esp + 0x10]
lea ecx, [ebp - 1]
push ecx
push edx
mov ecx, esi
call fcn.0040269a
mov edi, dword [esp + 0x54]
cmp ebp, edi
jae 0x403914
add eax, 0
mov eax, dword [esi + 0x414]
push ebp
push eax
mov ecx, esi
call fcn.0040269a
mov edx, dword [esi + 0x414]
inc edx
inc ebp
cmp ebp, edi
mov dword [esi + 0x414], edx
jb 0x4038f3
dec dword [esi + 0x41c]
mov ecx, 8
jne 0x40393a
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]
shl dl, 1
inc dl
mov byte [eax], dl
dec dword [esi + 0x41c]
jne 0x403969
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]
shl dl, 1
inc dl
mov byte [eax], dl
dec dword [esi + 0x41c]
jne 0x403998
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 ebp, dword [esi + 0x410]
mov eax, dword [esi + 0x418]
mov ecx, dword [esi + 0x41c]
inc ebp
mov dword [esi + 0x410], ebp
mov dl, byte [eax]
dec ecx
shl dl, cl
mov byte [eax], dl
mov eax, dword [esp + 0x5c]
test eax, eax
je 0x4039fc
mov ecx, dword [esp + 0x60]
mov edx, dword [esi + 0x410]
mov ebp, dword [esp + 0x50]
push ecx
mov ecx, dword [esi + 0x414]
sub edx, ebp
push edx
sub ecx, dword [esp + 0x54]
push ecx
push edi
call eax
add esp, 0x10
test eax, eax
je 0x4038b1
mov eax, dword [esi + 0x410]
sub eax, dword [esp + 0x50]
pop ebx
pop ebp
pop edi
pop esi
add esp, 0x38
ret 0x18