GithubHelp home page GithubHelp logo

Comments (8)

psychowood avatar psychowood commented on July 18, 2024

Fyi, the Go implementation is working correctly. PHP was served from a windows machine, if it matters.

from henkaku.

yifanlu avatar yifanlu commented on July 18, 2024

I think they should be the same. Does PHP work? If not, your PHP might be misconfigured.

from henkaku.

pythonicca avatar pythonicca commented on July 18, 2024

I noticed this as well. I'm not a PHP guru but in my environment PHP had a hard integer limit which it silently returned when the value was exceeded. (there's no outward indication that your values have been replaced and stage2.php doesn't explicitly check for this).

(Example) if stage2.php is passed these parameters:

a1=89f02000&a2=81b009a0&a3=e000dd00&a4=811c0cc0&&a5=e0607c80&a6=e01302b0&a7=e0047bf0&

a1-a7 values are all returned as 2147483647 and the binary created won't function the way it was intended.

The culprit in stage2.php is:

$args[$i] = intval($_GET["a$i"], 16);

An option might be to convert it to a string instead but that might require some changes elsewhere as well..

function hex2dec($hex)
{
    $dec = 0;
    $len = strlen($hex);
    for ($i = 1; $i <= $len; $i++) {
        $dec = bcadd($dec, bcmul(strval(hexdec($hex[$i - 1])), bcpow('16', strval($len - $i))));
    }
    return $dec;
}

$args[$i] = hex2dec($_GET["a$i"]);

from henkaku.

xyzz avatar xyzz commented on July 18, 2024

can we just remove the PHP version? the Go one is very simple to run

from henkaku.

psychowood avatar psychowood commented on July 18, 2024

Especially with a (shameless hint :) ) java version available.

from henkaku.

pythonicca avatar pythonicca commented on July 18, 2024

If we could get a python implementation of stage2 it would be even simpler (with Python being the sole requirement). If whoever wrote preprocess.py and write_pkg_url.py could also write a working stage2.py (that outputs the same binary as the go version) I can contribute the code I've already written that ties everything together.

from henkaku.

yifanlu avatar yifanlu commented on July 18, 2024

This whole package is for hackers and tinkerers, so if you have a suggestion, make it and send a pull request :)

from henkaku.

xyzz avatar xyzz commented on July 18, 2024

You don't need these files anymore, since we just require static webserver now.

from henkaku.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.