Welcome to GameHourz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Demonstration: CloackTechnologyV4Unrolled (possible ideas ..

 
   Game Forums (Home) -> Core War RSS
Next:  Demonstration: CloackTechnologyV4 (little optimiz..  
Author Message
Skybuck Flying

External


Since: May 25, 2006
Posts: 295



(Msg. 1) Posted: Sat Jan 26, 2008 11:31 am
Post subject: Demonstration: CloackTechnologyV4Unrolled (possible ideas for future investigation ;) :) )
Archived from groups: rec>games>corewar (more info?)

;redcode
;name CloackTechnologyV4Unrolled
;author Skybuck Flying
;strategy cloack/decloack demonstration
;version 4
;date 26 january 2008
; I am a bit bored right now, so let's do something usefull and write a
; little bit of code which I might re-use later or just for demonstration
purposes.
; this piece of code / demonstration / demo / routines / CODE LOL
; will show how to completely cloack some instruction and complete de-cloack
; them by using some routines and some loops and some counters and some
p-space.
; ok v2 working, now let's try to optimize it a little bit by getting rid of
the extra
; counter Wink
; extra counter illiminated, counter is now reset by subtracting the
instruction length of it.
; code repeats it self, cloack/decloack/cloack/decloack/cloack/decloack
;
; further optimizations in version 4: post increment operators used to
increment the parameter counters
; for p-space, instead of storing a,b,a,b,a,b,a,b,a,b the parameters are now
stored:
; a,a,a,a,a,a,a,a,b,b,b,b,b,b,b,b,b thereby the counters only need to be
incremented with 1
; making the post increment operators possible with only one instruction Smile
; nop >a, >b (cloack incrementation)
; nop }a, }b (decloack incrementation)
;
; loops could be seperated:
;
;Drawback is it would make the code a bit slower because of double looping
;and counters and such.
;
;Actually it could even be seperated into multiple loops:
;
;Cloack:
;
;1. One loop to cloack parameter A
;2. One loop to cloack parameter B
;3. One loop to zero parameters
;
;Decloack:
;
;4. One loop to decloack parameter A
;5. One loop to decloack parameter B
;
;I just also had an alternative idea:
;
;The loops could be unrolled.
;
;So all instructions could simply be hard code like so:
;
;DeCloackParameterB ldp.ab #1, InstructionsBegin + 0
;DeCloackParameterB ldp.ab #2, InstructionsBegin + 1
;DeCloackParameterB ldp.ab #3, InstructionsBegin + 2
;DeCloackParameterB ldp.ab #4, InstructionsBegin + 3
;DeCloackParameterB ldp.ab #5, InstructionsBegin + 4
;
;Then the real program is stored as such:
;
;DeCloackParameterB ldp.ab #0, 0
;DeCloackParameterB ldp.ab #0, 0
;DeCloackParameterB ldp.ab #0, 0
;DeCloackParameterB ldp.ab #0, 0
;DeCloackParameterB ldp.ab #0, 0
;
;Then the only thing which needs to happen is to use a counter to fill the
;correct parameters.
;
;And then the parameters will be loaded into the final program/destination.
;
;Cool idea.
;
;Extremely fast too.
;
;No looping required, loops can remain small.
;
;Drawbacks:
;
;Easier to kill by bombers, bigger code so maybe easier to spot.
;
;So it has adventages and disadventages.
;
;I think I will try both in the near future.
;


jmp Cloack

; Instructions to be cloacked/decloacked:

InstructionsBegin
InstructionsLength equ InstructionsEnd - InstructionsBegin

nop $555, $666
mov $777, $888
add #999, #1010
spl @1111, @1212
jmp #1313, #1414
dat $1515, $1616
jmz $1717, $1818
sub $1919, $2020

InstructionsEnd

Cloack
; Store a-parameter of instructions into p-space
StoreAParameters

stp.ab $InstructionsBegin+0, #1
stp.ab $InstructionsBegin+1, #2
stp.ab $InstructionsBegin+2, #3
stp.ab $InstructionsBegin+3, #4
stp.ab $InstructionsBegin+4, #5
stp.ab $InstructionsBegin+5, #6
stp.ab $InstructionsBegin+6, #7
stp.ab $InstructionsBegin+7, #8

; Store b-parameter of instructions into p-space
StoreBParameters

stp.b $InstructionsBegin+0, #9
stp.b $InstructionsBegin+1, #10
stp.b $InstructionsBegin+2, #11
stp.b $InstructionsBegin+3, #12
stp.b $InstructionsBegin+4, #13
stp.b $InstructionsBegin+5, #14
stp.b $InstructionsBegin+6, #15
stp.b $InstructionsBegin+7, #16

; Clear a and b parameters of instructions
ClearParameters
sub $InstructionsBegin+0, $InstructionsBegin+0
sub $InstructionsBegin+1, $InstructionsBegin+1
sub $InstructionsBegin+2, $InstructionsBegin+2
sub $InstructionsBegin+3, $InstructionsBegin+3
sub $InstructionsBegin+4, $InstructionsBegin+4
sub $InstructionsBegin+5, $InstructionsBegin+5
sub $InstructionsBegin+6, $InstructionsBegin+6
sub $InstructionsBegin+7, $InstructionsBegin+7

; Clear above instruction parameters with loop
; if instructions first copied to some place else this might not be
required
; not done yet/unfinished alternative solutions thinkable
; like storing parameters on the first round and then dieing
; and then load parameters on second run when appriorate

DeCloack

; Restore a-parameter of instructions from p-space
RestoreAParameters
ldp.a #1, $InstructionsBegin+0
ldp.a #2, $InstructionsBegin+1
ldp.a #3, $InstructionsBegin+2
ldp.a #4, $InstructionsBegin+3
ldp.a #5, $InstructionsBegin+4
ldp.a #6, $InstructionsBegin+5
ldp.a #7, $InstructionsBegin+6
ldp.a #8, $InstructionsBegin+7

; Restore b-parameter of instructions from p-space
RestoreBParameters
ldp.ab #9, $InstructionsBegin+0
ldp.ab #10, $InstructionsBegin+1
ldp.ab #11, $InstructionsBegin+2
ldp.ab #12, $InstructionsBegin+3

ldp.ab #13, $InstructionsBegin+4
ldp.ab #14, $InstructionsBegin+5
ldp.ab #15, $InstructionsBegin+6
ldp.ab #16, $InstructionsBegin+7

jmp Cloack

 >> Stay informed about: Demonstration: CloackTechnologyV4Unrolled (possible ideas .. 
Back to top
Login to vote
Skybuck Flying

External


Since: May 25, 2006
Posts: 295



(Msg. 2) Posted: Sat Jan 26, 2008 11:42 am
Post subject: Re: Demonstration: CloackTechnologyV4Unrolled (possible ideas for future investigation ;) :) ) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Ok, here is a possible idea to destroy the scanner of RecycleBits Smile in case
you didn't get it yourself by now from the comments in the previous
posting/message:

The idea is as follows:

1. Use the first round to store the parameters in p-space, this can happen
lightning fast with the demonstration code. Then commit suicide.

2. When the parameters are loaded into p-space set a p-space flag to one, or
some other value indicating the parameters where stored successfully.

3. Then on round two:

Check if the parameters were stored by checking for the flag.

4. Then if the parameters were stored, delete the storing code and

5. Enter a waiting loop, to wait until the enemy scanner is done scanning.

6. Once the enemy scanner is done scanning quickly locate the enemy bomber
and bomb it !

Now the only problem that remains is that RecycledBits is a multi-warrior,
it has multiple warriors embedded in it, and it will detect it is losing
with the scanner, so it will use a different strategy after a few rounds.

So then it might not working anymore, we might get eaten or maybe not.

Maybe we can somehow detect when recycle bits is using a different strategy.

Or maybe after the bomb located attempt a different strategy could be
decloacked and executed.

But that would require extra code to remain present/active or something. Oh
yeah and the decloacking code still has to be written probably just some
counter to increment the decloack instruction parameters that will probably
work just fine and short. Without any detection, nice probably.

Well now we have come another step closer to defeating scanners Wink

The ultimate detection would be to detect how long it takes for the scanner
to find us at round one.

That could give as some indications how long the scanners takes... but
ofcourse it could have had a lucky strike.

So maybe use multiple rounds to detect it, or maybe place detectors at
different locations or so.

A possible idea could be to:

1. Simply increment a counter in p-space for as long as we live.

2. This could give us an indication how long we can expect to live on other
rounds, or how long we must remain hidden.

3. Ofcourse we can't stay hidden forever so we must use some default value
to become active.

4. So maybe we don't even need a detector...

5. However maybe we do... suppose our default value was too short and we die
fast... maybe on next round we need to increase the sleeping time up to a
certain max... like a certain percentages of total cycles or so Smile

Some nice idea's Smile

Bye,
Skybuck.

 >> Stay informed about: Demonstration: CloackTechnologyV4Unrolled (possible ideas .. 
Back to top
Login to vote
Skybuck Flying

External


Since: May 25, 2006
Posts: 295



(Msg. 3) Posted: Sat Jan 26, 2008 11:59 am
Post subject: Re: Demonstration: CloackTechnologyV4Unrolled (possible ideas for future investigation ;) :) ) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Well the suicide might not even be necessary if I manage to write some nice
looping code which erases the storing instructions and the looping code
itself then it could enter a waiting loop and below
would be the counter incrementation code waiting to run and the decloack
code which will finally be activated by a jump or so.

Re-storing the parameters on each round might be a better idea anyway if for
some reason the parameters were screwed at round 1... though unlikely but it
could happen Wink

Though re-using p-space for different rounds might be a nice programming
exercise but ofcourse ultimately I should think about good warriors and not
necessarely programming exercies Smile

Bye,
Skybuck.
 >> Stay informed about: Demonstration: CloackTechnologyV4Unrolled (possible ideas .. 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Demonstration: Cloack/Decloack Technology V3 :) - ;redcode ;name CloackTechnologyV3 ;author Skybuck Flying ;strategy cloack/decloack demonstration ;version 3 ;date 26 january 2008 ; I am a bit bored right now, so let's do something usefull and write a ; little bit of code which I might re-use later or..

Demonstration: CloackTechnologyV4 (little optimization, tw.. - ;redcode ;name CloackTechnologyV4 ;author Skybuck Flying ;strategy cloack/decloack demonstration ;version 4 ;date 26 january 2008 ; I am a bit bored right now, so let's do something usefull and write a ; little bit of code which I might re-use later or..

Score Surface for 94nop - Hi, some anonymous person (still called "bvowk" for simplicity ;-) is so kind to provide access to a pile of computers. I have suggested to calculate one score surface for standard settings. It takes roughly 1000 times the time of one "no...

Bug in pMARS - Hi, either I don't know how EQUs work or I have found a bug in the parser of pMARS. So far I cound pin it down to: ;redcode-tiny ;name test ;assert CORESIZE == 800 v3 EQU 3 * (3 / 2 + 1) + 3 v4 EQU (CORESIZE - v3) dat.f v3, v4 With the..

KOTH.ORG: Status - ICWS Experimental 94 03/06/06 - Weekly Status on 03/06/06 -=- irc.KOTH.org is up! Meetings held in #corewars -=- Tons of new features on www.KOTH.org/koth.html pages -=- *FAQ* page located at: www.KOTH.org/corewar-faq.html Current Status of the KOTH.ORG ICWS Experimental 94..
   Game Forums (Home) -> Core War All times are: Ekaterinburg, Islamabad, Karachi, Tashkent (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]