Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

I was attacked by dselect as a small child and have since avoided debian. -- Andrew Morton


devel / comp.lang.awk / Yet another obfuscated Awk code

SubjectAuthor
* Yet another obfuscated Awk codeJanis Papanagnou
+- Re: Yet another obfuscated Awk codeKpop 2GM
+* Re: Yet another obfuscated Awk codeKpop 2GM
|+- Re: Yet another obfuscated Awk codeKpop 2GM
|`- Re: Yet another obfuscated Awk codeKpop 2GM
`* [solved] (Spoilers!) Re: Yet another obfuscated Awk codeJanis Papanagnou
 `* Re: [solved] (Spoilers!) Re: Yet another obfuscated Awk codeKpop 2GM
  `* Re: [solved] (Spoilers!) Re: Yet another obfuscated Awk codeKpop 2GM
   `* Re: [solved] (Spoilers!) Re: Yet another obfuscated Awk codeKpop 2GM
    `* Re: [solved] (Spoilers!) Re: Yet another obfuscated Awk codeKpop 2GM
     `- Re: [solved] (Spoilers!) Re: Yet another obfuscated Awk codeJanis Papanagnou

1
Yet another obfuscated Awk code

<ssgl1b$36s$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1014&group=comp.lang.awk#1014

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: janis_papanagnou@hotmail.com (Janis Papanagnou)
Newsgroups: comp.lang.awk
Subject: Yet another obfuscated Awk code
Date: Sat, 22 Jan 2022 11:07:38 +0100
Organization: A noiseless patient Spider
Lines: 10
Message-ID: <ssgl1b$36s$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 22 Jan 2022 10:07:39 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="3f4d5abc5fe945d8ae1dfa98ae1d3342";
logging-data="3292"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19I8pn47Q4KbFHA9RmREDHo"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:CZbolLQ2j6r18oAHbIYxOZxjHHg=
X-Mozilla-News-Host: news://news.eternal-september.org:119
X-Enigmail-Draft-Status: N1110
 by: Janis Papanagnou - Sat, 22 Jan 2022 10:07 UTC

Just for recreational purposes here's yet another obfuscated Awk code.

func ___(_) { return __(_,x^x,x^x^x) }
func __(_,_x,x_) { return --_?__(_,x_,_x+x_):_x+x_ }
{ print ___($_) }

Solutions, guesses, comments, improvements, fixes, requests for hints,
etc. are all welcome.

Janis

Re: Yet another obfuscated Awk code

<a5b83012-6163-4480-a9e6-5c780ef12f7an@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1015&group=comp.lang.awk#1015

  copy link   Newsgroups: comp.lang.awk
X-Received: by 2002:ad4:5e87:: with SMTP id jl7mr8404390qvb.130.1642873537934; Sat, 22 Jan 2022 09:45:37 -0800 (PST)
X-Received: by 2002:a05:6902:709:: with SMTP id k9mr1977029ybt.641.1642873537769; Sat, 22 Jan 2022 09:45:37 -0800 (PST)
Path: i2pn2.org!i2pn.org!aioe.org!feeder1.feed.usenet.farm!feed.usenet.farm!tr1.eu1.usenetexpress.com!feeder.usenetexpress.com!tr1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.awk
Date: Sat, 22 Jan 2022 09:45:37 -0800 (PST)
In-Reply-To: <ssgl1b$36s$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2603:7000:3c3d:41c0:5567:7330:ffb2:1b50; posting-account=n74spgoAAAAZZyBGGjbj9G0N4Q659lEi
NNTP-Posting-Host: 2603:7000:3c3d:41c0:5567:7330:ffb2:1b50
References: <ssgl1b$36s$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a5b83012-6163-4480-a9e6-5c780ef12f7an@googlegroups.com>
Subject: Re: Yet another obfuscated Awk code
From: jason.cy.kwan@gmail.com (Kpop 2GM)
Injection-Date: Sat, 22 Jan 2022 17:45:37 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 10
 by: Kpop 2GM - Sat, 22 Jan 2022 17:45 UTC

On Saturday, January 22, 2022 at 5:07:41 AM UTC-5, Janis Papanagnou wrote:
> Just for recreational purposes here's yet another obfuscated Awk code.
>
> func ___(_) { return __(_,x^x,x^x^x) }
> func __(_,_x,x_) { return --_?__(_,x_,_x+x_):_x+x_ }
> { print ___($_) }
>
> Solutions, guesses, comments, improvements, fixes, requests for hints,
> etc. are all welcome.
>
> Janis

Re: Yet another obfuscated Awk code

<a4946705-80d6-464e-90c5-e5dd04dceccdn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1016&group=comp.lang.awk#1016

  copy link   Newsgroups: comp.lang.awk
X-Received: by 2002:a05:622a:508:: with SMTP id l8mr7310731qtx.412.1642874387527;
Sat, 22 Jan 2022 09:59:47 -0800 (PST)
X-Received: by 2002:a05:6902:20d:: with SMTP id j13mr13556892ybs.18.1642874387409;
Sat, 22 Jan 2022 09:59:47 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!3.eu.feeder.erje.net!feeder.erje.net!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.awk
Date: Sat, 22 Jan 2022 09:59:47 -0800 (PST)
In-Reply-To: <ssgl1b$36s$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2603:7000:3c3d:41c0:5567:7330:ffb2:1b50;
posting-account=n74spgoAAAAZZyBGGjbj9G0N4Q659lEi
NNTP-Posting-Host: 2603:7000:3c3d:41c0:5567:7330:ffb2:1b50
References: <ssgl1b$36s$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a4946705-80d6-464e-90c5-e5dd04dceccdn@googlegroups.com>
Subject: Re: Yet another obfuscated Awk code
From: jason.cy.kwan@gmail.com (Kpop 2GM)
Injection-Date: Sat, 22 Jan 2022 17:59:47 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 6
 by: Kpop 2GM - Sat, 22 Jan 2022 17:59 UTC

hmmmmmm ……..i dunno ….. maybe full length of each row of input, determines which Lucas number it'll print out. if original input were greater than zero, and integer, but degenerate into an infinite loop if original input were less-than-or-equal-zero, or is a non-integer real number, or contains bytes other than 0-9, +/-, space, to the left of the first position with a number-like value (e.g. decrementing capital "A" makes it -1, thus degenerate into the infinite loop case) ??

Re: Yet another obfuscated Awk code

<16bbc58f-a87e-4eb8-8665-c45a563b1de1n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1017&group=comp.lang.awk#1017

  copy link   Newsgroups: comp.lang.awk
X-Received: by 2002:ac8:5f13:: with SMTP id x19mr7416108qta.575.1642874950421;
Sat, 22 Jan 2022 10:09:10 -0800 (PST)
X-Received: by 2002:a5b:f89:: with SMTP id q9mr13450201ybh.452.1642874950270;
Sat, 22 Jan 2022 10:09:10 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!3.eu.feeder.erje.net!feeder.erje.net!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.awk
Date: Sat, 22 Jan 2022 10:09:10 -0800 (PST)
In-Reply-To: <a4946705-80d6-464e-90c5-e5dd04dceccdn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2603:7000:3c3d:41c0:5567:7330:ffb2:1b50;
posting-account=n74spgoAAAAZZyBGGjbj9G0N4Q659lEi
NNTP-Posting-Host: 2603:7000:3c3d:41c0:5567:7330:ffb2:1b50
References: <ssgl1b$36s$1@dont-email.me> <a4946705-80d6-464e-90c5-e5dd04dceccdn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <16bbc58f-a87e-4eb8-8665-c45a563b1de1n@googlegroups.com>
Subject: Re: Yet another obfuscated Awk code
From: jason.cy.kwan@gmail.com (Kpop 2GM)
Injection-Date: Sat, 22 Jan 2022 18:09:10 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 11
 by: Kpop 2GM - Sat, 22 Jan 2022 18:09 UTC

it's not even limited by 2^-1023 or 2^-1074. since once you're past -2^53, unitary pre-decrementing a number keeps it stuck there, since it lacks the ability to accumulate your non-representable odd numbers in double precision, and will go on for quite some time until the either input position 2 or 3 in the two-underscore function reaches 2^1024 infinity

just my random uneducated guess

as for function called by print, the 3-underscore one, all of those are pure distractions, since those reduce to calling two-underscore function with

__( original-input, 1, 1, 1)

Re: Yet another obfuscated Awk code

<7f97383c-fbc4-4e39-88f8-ff67dd8c49e4n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1018&group=comp.lang.awk#1018

  copy link   Newsgroups: comp.lang.awk
X-Received: by 2002:a05:620a:148f:: with SMTP id w15mr6561057qkj.680.1642875064585;
Sat, 22 Jan 2022 10:11:04 -0800 (PST)
X-Received: by 2002:a05:6902:85:: with SMTP id h5mr13590200ybs.697.1642875064462;
Sat, 22 Jan 2022 10:11:04 -0800 (PST)
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!feeder1.cambriumusenet.nl!feed.tweak.nl!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.awk
Date: Sat, 22 Jan 2022 10:11:04 -0800 (PST)
In-Reply-To: <a4946705-80d6-464e-90c5-e5dd04dceccdn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2603:7000:3c3d:41c0:5567:7330:ffb2:1b50;
posting-account=n74spgoAAAAZZyBGGjbj9G0N4Q659lEi
NNTP-Posting-Host: 2603:7000:3c3d:41c0:5567:7330:ffb2:1b50
References: <ssgl1b$36s$1@dont-email.me> <a4946705-80d6-464e-90c5-e5dd04dceccdn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <7f97383c-fbc4-4e39-88f8-ff67dd8c49e4n@googlegroups.com>
Subject: Re: Yet another obfuscated Awk code
From: jason.cy.kwan@gmail.com (Kpop 2GM)
Injection-Date: Sat, 22 Jan 2022 18:11:04 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Kpop 2GM - Sat, 22 Jan 2022 18:11 UTC

it's not even limited by 2^-1023 or 2^-1074. since once you're past -2^53, unitary pre-decrementing a number keeps it stuck there, since it lacks the ability to accumulate your non-representable odd numbers in double precision, and will go on for quite some time until the either input position 2 or 3 in the two-underscore function reaches 2^1024 infinity

just my random uneducated guess

as for function called by print, the 3-underscore one, all of those are pure distractions, since those reduce to calling two-underscore function with

__( original-input, 1, 0)

wait … then that's Fibonacci then not Lucas …. i'm confused

[solved] (Spoilers!) Re: Yet another obfuscated Awk code

<ssibc2$9pe$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1023&group=comp.lang.awk#1023

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: janis_papanagnou@hotmail.com (Janis Papanagnou)
Newsgroups: comp.lang.awk
Subject: [solved] (Spoilers!) Re: Yet another obfuscated Awk code
Date: Sun, 23 Jan 2022 02:34:58 +0100
Organization: A noiseless patient Spider
Lines: 65
Message-ID: <ssibc2$9pe$1@dont-email.me>
References: <ssgl1b$36s$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 23 Jan 2022 01:34:58 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="39d49e44c7a78558a7e4f79c9192fed4";
logging-data="10030"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18CVQHf152sXoRIU+IWwJJu"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:34CDPqRBBt8f1ZvR54OWi4boZ+4=
In-Reply-To: <ssgl1b$36s$1@dont-email.me>
X-Enigmail-Draft-Status: N1110
 by: Janis Papanagnou - Sun, 23 Jan 2022 01:34 UTC

On 22.01.2022 11:07, Janis Papanagnou wrote:
> Just for recreational purposes here's yet another obfuscated Awk code.
>
> func ___(_) { return __(_,x^x,x^x^x) }
> func __(_,_x,x_) { return --_?__(_,x_,_x+x_):_x+x_ }
> { print ___($_) }
>
> Solutions, guesses, comments, improvements, fixes, requests for hints,
> etc. are all welcome.
>
> Janis
>

On 22.01.2022 19:11, Kpop 2GM wrote:
> it's not even limited by 2^-1023 or 2^-1074. since once you're past
> -2^53, unitary pre-decrementing a number keeps it stuck there, since
> it lacks the ability to accumulate your non-representable odd numbers
> in double precision, and will go on for quite some time until the
> either input position 2 or 3 in the two-underscore function reaches
> 2^1024 infinity
>
> just my random uneducated guess
>
> as for function called by print, the 3-underscore one, all of those
> are pure distractions, since those reduce to calling two-underscore
> function with
>
> __( original-input, 1, 0)
>
> wait … then that's Fibonacci then not Lucas …. i'm confused
>

You've identified it!

A couple notes. Since numbers grow extremely there's some limit as
you noticed. I admit it was unfair that I didn't define the domain
of the function, but you got it anyway. I could of course have had
a condition added to make life easier, e.g. $_&&!/[^0-9]/ { ... }
or, to obfuscate it a bit, even _=int(sqrt(-($_*-$_))) { ... } .
The two constant parameters are indeed 1 and 0 (not the values you
assumed in an earlier post). I used a reduced pattern of what I saw
in your other thread's post (_^_^_^...^_) for these constants (with
my observation that the reduced subexpression toggles between 0 and
1). The function is the one you suspected, and (in obfuscated form)
simpler written as just

# defined for integer args>0
func __(_) { return _>2?__(--_)+__(--_):1 } { print __($_) }

I like this form even more (with those nasty --_ side effects) and
the underlying mathematical function is more obvious, but the time
complexity is extremely bad since we have a cascading recursion in
that simple form. There's a transformation of the function possible
to generate an equivalent linear recursion with good (linear) time
complexity (and no supporting arrays and the like), and that is

func ___(_) { return __(_,x^x,x^x^x) }
func __(_,_x,x_) { return --_?__(_,x_,_x+x_):_x+x_ }
$_&&!/[^0-9]/ { print ___($_) }

And where the first version is rarely usable for arguments >35 the
second one runs smoothly for large arguments in no time.

Janis

Re: [solved] (Spoilers!) Re: Yet another obfuscated Awk code

<f05a8894-1fff-43b7-a90e-d1ba7a111731n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1024&group=comp.lang.awk#1024

  copy link   Newsgroups: comp.lang.awk
X-Received: by 2002:a05:6214:c85:: with SMTP id r5mr16374906qvr.90.1643058935824;
Mon, 24 Jan 2022 13:15:35 -0800 (PST)
X-Received: by 2002:a25:6e8a:: with SMTP id j132mr23176841ybc.561.1643058935680;
Mon, 24 Jan 2022 13:15:35 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.awk
Date: Mon, 24 Jan 2022 13:15:35 -0800 (PST)
In-Reply-To: <ssibc2$9pe$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2603:7000:3c3d:41c0:6537:8397:db4f:85af;
posting-account=n74spgoAAAAZZyBGGjbj9G0N4Q659lEi
NNTP-Posting-Host: 2603:7000:3c3d:41c0:6537:8397:db4f:85af
References: <ssgl1b$36s$1@dont-email.me> <ssibc2$9pe$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f05a8894-1fff-43b7-a90e-d1ba7a111731n@googlegroups.com>
Subject: Re: [solved] (Spoilers!) Re: Yet another obfuscated Awk code
From: jason.cy.kwan@gmail.com (Kpop 2GM)
Injection-Date: Mon, 24 Jan 2022 21:15:35 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 19
 by: Kpop 2GM - Mon, 24 Jan 2022 21:15 UTC

it's not your fault whatsoever you haven't defined the domain - that's what a code challenge is all about anyway :

to identify both the core feature(s), and edge cases. you're entirely within your rights to only define what you want to define, and it's up to the participants to complete the puzzle. I'm not a mathematician whatsoever and still don't really understand what a Lucas number sequence is anyway.

i was only able to identify it as Fib cuz i already have 2 variants of the fib( ) function coded in a similar fashion (but both failing to capture some edge cases) :

function fib2(_,__) {
return (__=!-"")+_<+__?+__\
: fib2(_-__)+fib2(_-__-__) }

function fib3(__,_,___){
return !__?___:_""""""\
? fib3(__-(_~_),_+___,_)\
: fib3(__-(_=_~_),___+_,_) }

Re: [solved] (Spoilers!) Re: Yet another obfuscated Awk code

<ff32981e-fe0b-4e8a-89b2-049e29320befn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1044&group=comp.lang.awk#1044

  copy link   Newsgroups: comp.lang.awk
X-Received: by 2002:a05:620a:2804:: with SMTP id f4mr21965974qkp.462.1643889096821;
Thu, 03 Feb 2022 03:51:36 -0800 (PST)
X-Received: by 2002:a25:783:: with SMTP id 125mr44654979ybh.58.1643889096630;
Thu, 03 Feb 2022 03:51:36 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.awk
Date: Thu, 3 Feb 2022 03:51:36 -0800 (PST)
In-Reply-To: <f05a8894-1fff-43b7-a90e-d1ba7a111731n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2603:7000:3c3d:41c0:107e:dd:2fb1:482f;
posting-account=n74spgoAAAAZZyBGGjbj9G0N4Q659lEi
NNTP-Posting-Host: 2603:7000:3c3d:41c0:107e:dd:2fb1:482f
References: <ssgl1b$36s$1@dont-email.me> <ssibc2$9pe$1@dont-email.me> <f05a8894-1fff-43b7-a90e-d1ba7a111731n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ff32981e-fe0b-4e8a-89b2-049e29320befn@googlegroups.com>
Subject: Re: [solved] (Spoilers!) Re: Yet another obfuscated Awk code
From: jason.cy.kwan@gmail.com (Kpop 2GM)
Injection-Date: Thu, 03 Feb 2022 11:51:36 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 17
 by: Kpop 2GM - Thu, 3 Feb 2022 11:51 UTC

Hi Janis,

if you care for an even more challenging obfuscated one :what is contained within that exactly 1.00 GB being outputted from this function in 95 miliseconds , given the sample input of 7 in argument position 1, and 30 in position 2 ? This code shouldn't have any trouble executing on just about any awk variant one can imagine. It's also fully self-contained,.

% ( time ( gnice mawk2 'function __(_,___,____) { if (_!~"."||___<-____) { return "" } else if (((____+=++____)*++____+--____)<=+___) { _=__(_,____=int(___/=____)); gsub(".",_,_); return ___-____?(_)_:_ } else { return (""<"")<--___?(_=__(_,--___))(_)(_)_:___?_:(_)_ } } BEGIN { print length(__(7,30)) }' ) )

( gnice mawk2 ; ) 0.03s user 0.07s system 96% cpu 0.095 total
1073741824

The 4Chan Teller

Re: [solved] (Spoilers!) Re: Yet another obfuscated Awk code

<0d9f53b4-b6ff-4ca4-b16e-fa0b56bb2070n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1208&group=comp.lang.awk#1208

  copy link   Newsgroups: comp.lang.awk
X-Received: by 2002:a05:620a:3189:b0:69c:3afd:728a with SMTP id bi9-20020a05620a318900b0069c3afd728amr866667qkb.493.1649723899311;
Mon, 11 Apr 2022 17:38:19 -0700 (PDT)
X-Received: by 2002:ad4:5f87:0:b0:444:2eee:a42 with SMTP id
jp7-20020ad45f87000000b004442eee0a42mr12487699qvb.122.1649723899161; Mon, 11
Apr 2022 17:38:19 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.awk
Date: Mon, 11 Apr 2022 17:38:18 -0700 (PDT)
In-Reply-To: <ff32981e-fe0b-4e8a-89b2-049e29320befn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2603:7000:3c3d:41c0:0:0:0:3c3;
posting-account=n74spgoAAAAZZyBGGjbj9G0N4Q659lEi
NNTP-Posting-Host: 2603:7000:3c3d:41c0:0:0:0:3c3
References: <ssgl1b$36s$1@dont-email.me> <ssibc2$9pe$1@dont-email.me>
<f05a8894-1fff-43b7-a90e-d1ba7a111731n@googlegroups.com> <ff32981e-fe0b-4e8a-89b2-049e29320befn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0d9f53b4-b6ff-4ca4-b16e-fa0b56bb2070n@googlegroups.com>
Subject: Re: [solved] (Spoilers!) Re: Yet another obfuscated Awk code
From: jason.cy.kwan@gmail.com (Kpop 2GM)
Injection-Date: Tue, 12 Apr 2022 00:38:19 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 90
 by: Kpop 2GM - Tue, 12 Apr 2022 00:38 UTC

@Janus : This next one should be straight forward enough. For your convenience, I'm including the profiler output from gawk to show how it's being executed using gawk -P (posix) mode as well as mawk 1.3.4's debugger

what does this function that's non-recursive, non-gawk-extension-dependent, and fully self-encapsulated return ?

(self-encapsulating to a point it neither makes any calls to built-in functions, nor does it reference any system-wide variable)

# gawk profile, created Mon Apr 11 20:27:37 2022

# BEGIN rule(s)

BEGIN {
1 OFMT = CONVFMT = "%.50g"
1 print _____()
}

# Functions, listed alphabetically

1 function _____(_, __, ___, ____)
{
1 __ = ! (____ += ____ += ____ *= ____ *= ____ *= ____ = (___ = _ = _ ~ _) - +-++_ * _--)
1562499 while (--____) {
1562499 __ += (___ / _++) - (___ / _++)
}
1 return __
}

====================== below is what the debugger from mawk 1.3.4 prints out ===============

function _____
000 . l_pusha 1
002 . l_pusha 3
004 . l_pusha 3
006 . l_pusha 3
008 . l_pusha 3
010 . l_pusha 3
012 . l_pusha 3
014 . l_pusha 2
016 . l_pusha 0
018 . l_pushi 0 # frame-number
020 . l_pushi 0 # frame-number
022 . match2
023 . assign
024 . assign
025 . l_pusha 0
027 . pre_inc
028 . uminus
029 . uplus
030 . l_pusha 0
032 . post_dec
033 . mul
034 . sub
035 . assign
036 . mul_asg
037 . mul_asg
038 . mul_asg
039 . add_asg
040 . add_asg
041 . not
042 . assign
043 . pop
044 . jmp 063
046 . l_pusha 1
048 . l_pushi 2 # frame-number
050 . l_pusha 0
052 . post_inc
053 . div
054 . l_pushi 2 # frame-number
056 . l_pusha 0
058 . post_inc
059 . div
060 . sub
061 . add_asg
062 . pop
063 . l_pusha 3
065 . pre_dec
066 . jnz 046
068 . l_pushi 1 # frame-number
070 . ret
071 . ret0
BEGIN
000 . f_pusha OFMT
002 . f_pusha CONVFMT
004 . pushs "%.50g"
006 . f_assign
007 . f_assign
008 . pop
009 . call _____ 0
012 . pushint 1
014 . print
016 . exit0

Re: [solved] (Spoilers!) Re: Yet another obfuscated Awk code

<6136eea8-6938-4607-92b3-764dcce36260n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1257&group=comp.lang.awk#1257

  copy link   Newsgroups: comp.lang.awk
X-Received: by 2002:a05:6214:186d:b0:435:b8a0:1fe9 with SMTP id eh13-20020a056214186d00b00435b8a01fe9mr5022395qvb.54.1653739660719;
Sat, 28 May 2022 05:07:40 -0700 (PDT)
X-Received: by 2002:a25:d186:0:b0:65c:29bf:19bd with SMTP id
i128-20020a25d186000000b0065c29bf19bdmr3694533ybg.97.1653739660512; Sat, 28
May 2022 05:07:40 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.awk
Date: Sat, 28 May 2022 05:07:40 -0700 (PDT)
In-Reply-To: <0d9f53b4-b6ff-4ca4-b16e-fa0b56bb2070n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2603:7000:3c3d:41c0:0:0:0:3c3;
posting-account=n74spgoAAAAZZyBGGjbj9G0N4Q659lEi
NNTP-Posting-Host: 2603:7000:3c3d:41c0:0:0:0:3c3
References: <ssgl1b$36s$1@dont-email.me> <ssibc2$9pe$1@dont-email.me>
<f05a8894-1fff-43b7-a90e-d1ba7a111731n@googlegroups.com> <ff32981e-fe0b-4e8a-89b2-049e29320befn@googlegroups.com>
<0d9f53b4-b6ff-4ca4-b16e-fa0b56bb2070n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <6136eea8-6938-4607-92b3-764dcce36260n@googlegroups.com>
Subject: Re: [solved] (Spoilers!) Re: Yet another obfuscated Awk code
From: jason.cy.kwan@gmail.com (Kpop 2GM)
Injection-Date: Sat, 28 May 2022 12:07:40 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1770
 by: Kpop 2GM - Sat, 28 May 2022 12:07 UTC

@Janus : i just realized because your code doesn't perform any data scrubbing, anything that's not a positive integer immediately stack overflow due to infinite loop

here's the version that fixes both of those :

function ___(_) { return (_ = int(_)) <= _^(_<_) ? -_<+_ : __(_,_~_,_<_) }
function __(_,____,_____) { return (_ -= (____ += +_____)^(_<_)) ? __(_,_____,____) : +____ }{ print ___($-_) }

Re: [solved] (Spoilers!) Re: Yet another obfuscated Awk code

<t6t5d0$fb5$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1258&group=comp.lang.awk#1258

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: janis_papanagnou@hotmail.com (Janis Papanagnou)
Newsgroups: comp.lang.awk
Subject: Re: [solved] (Spoilers!) Re: Yet another obfuscated Awk code
Date: Sat, 28 May 2022 14:43:11 +0200
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <t6t5d0$fb5$1@dont-email.me>
References: <ssgl1b$36s$1@dont-email.me> <ssibc2$9pe$1@dont-email.me>
<f05a8894-1fff-43b7-a90e-d1ba7a111731n@googlegroups.com>
<ff32981e-fe0b-4e8a-89b2-049e29320befn@googlegroups.com>
<0d9f53b4-b6ff-4ca4-b16e-fa0b56bb2070n@googlegroups.com>
<6136eea8-6938-4607-92b3-764dcce36260n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 28 May 2022 12:43:12 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="dc2958b99611d3da5962b21a3af109de";
logging-data="15717"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+VhWTKvO2oknCSlGj1TJ7f"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:efbYIdT0gjl3aUmP3pKcTL10Ofk=
In-Reply-To: <6136eea8-6938-4607-92b3-764dcce36260n@googlegroups.com>
X-Enigmail-Draft-Status: N1110
 by: Janis Papanagnou - Sat, 28 May 2022 12:43 UTC

On 28.05.2022 14:07, Kpop 2GM wrote:
> @Janus : i just realized because your code doesn't perform any data
> scrubbing, anything that's not a positive integer immediately stack
> overflow due to infinite loop

This is a correct observation, and I think I've addressed that in my
last post of this sub-thread where I suggested adding a condition to
keep the numbers in the domain of valid numbers.

(BTW, I suggest, in Usenet posts, to quote context to make it easier
to see what you are referring to. Thanks.)

Janis

> [...]

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor