<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Funktionsverständnisproblem]]></title><description><![CDATA[<p>Hi Leute, ich hab probleme diese Funktion zu kapieren (ich möchte sie in python umschreiben):</p>
<pre><code class="language-cpp">int gslame( int num ) 
{
    int c = (num &gt;&gt; 16) &amp; 0xffff;
    int a = num &amp; 0xffff;

    c *= 0x41a7;
    a *= 0x41a7;
    a += ( (c &amp; 0x7fff) &lt;&lt; 16 );

    if( a &lt; 0 ) 
    {
        a &amp;= 0x7fffffff;
        a++;
    }

    a += (c &gt;&gt; 15);

    if( a &lt; 0 ) 
    {
        a &amp;= 0x7fffffff;
        a++;
    }

    return a;
}

int gspassenc( char* pass ) 
{
    int passlen = strlen(pass);
    int num = 0x79707367;   // &quot;gspy&quot;

    if( !num )
        num = 1;
    else
        num &amp;= 0x7fffffff;

    int a, c, d;
    for( int i = 0; i &lt; passlen; i++ ) 
    {
        d = 0xff;
        c = 0;
        d -= c;

        if( d ) 
        {
            num = gslame( num );
            a = num % d;
            a += c;
        }
        else
            a = c;

        pass[i] ^= a;
    }

    return passlen;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/277171/funktionsverständnisproblem</link><generator>RSS for Node</generator><lastBuildDate>Wed, 26 Aug 2026 01:43:33 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/277171.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 14 Nov 2010 11:36:38 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Funktionsverständnisproblem on Sun, 14 Nov 2010 11:36:38 GMT]]></title><description><![CDATA[<p>Hi Leute, ich hab probleme diese Funktion zu kapieren (ich möchte sie in python umschreiben):</p>
<pre><code class="language-cpp">int gslame( int num ) 
{
    int c = (num &gt;&gt; 16) &amp; 0xffff;
    int a = num &amp; 0xffff;

    c *= 0x41a7;
    a *= 0x41a7;
    a += ( (c &amp; 0x7fff) &lt;&lt; 16 );

    if( a &lt; 0 ) 
    {
        a &amp;= 0x7fffffff;
        a++;
    }

    a += (c &gt;&gt; 15);

    if( a &lt; 0 ) 
    {
        a &amp;= 0x7fffffff;
        a++;
    }

    return a;
}

int gspassenc( char* pass ) 
{
    int passlen = strlen(pass);
    int num = 0x79707367;   // &quot;gspy&quot;

    if( !num )
        num = 1;
    else
        num &amp;= 0x7fffffff;

    int a, c, d;
    for( int i = 0; i &lt; passlen; i++ ) 
    {
        d = 0xff;
        c = 0;
        d -= c;

        if( d ) 
        {
            num = gslame( num );
            a = num % d;
            a += c;
        }
        else
            a = c;

        pass[i] ^= a;
    }

    return passlen;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1980235</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1980235</guid><dc:creator><![CDATA[[[global:former_user]]]]></dc:creator><pubDate>Sun, 14 Nov 2010 11:36:38 GMT</pubDate></item><item><title><![CDATA[Reply to Funktionsverständnisproblem on Sun, 14 Nov 2010 11:41:59 GMT]]></title><description><![CDATA[<p>Muss man das denn genau verstehen? Das kann man doch fast 1:1 nach Python übertragen, da dies die größtenteils gleichen Operatoren kennt wie C++. Das einzige was es glaube ich nicht gibt ist <code>&amp;=</code> , aber das ist ja trivial nach <code>&amp;</code> und <code>=</code> umschreibbar.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1980241</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1980241</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Sun, 14 Nov 2010 11:41:59 GMT</pubDate></item></channel></rss>