Fuzzing TPT

  • d4zk1tty
    2nd Apr 2016 Member 0 Permalink

    I created a fuzzer for TPT, it can cause crashes in around 20 seconds but not in uploaded saves for some reason.

    Heres the code if you wanna test it out:

    local fuzzer = elem.allocate("d4zk1tty", "FUZZ")
    elem.element(fuzzer, elem.element(elem.DEFAULT_PT_LOLZ))
    elem.property(fuzzer, "Name", "FUZZ")
    elem.property(fuzzer, "Description", "TPT Fuzzer, can cause crashes easily :3")
    elem.property(fuzzer, "Color", 0xDEADBEAF)
    elem.property(fuzzer, "MenuSection", elem.SC_SPECIAL)
    elem.property(fuzzer, "Update", function (i)
        pcall(tpt.set_property, "type", math.random(1,255), i)
        pcall(tpt.set_property, "life", math.random(1,65535), i)
        pcall(tpt.set_property, "ctype", math.random(1,255), i)
        pcall(tpt.set_property, "vx", math.random(1,65535), i)
        pcall(tpt.set_property, "vy", math.random(1,65535), i)
        pcall(tpt.set_property, "temp", math.random(1,65535), i)
        pcall(tpt.set_property, "tmp", math.random(1,65535), i)
        pcall(tpt.set_property, "tmp2", math.random(1,65535), i)
        pcall(tpt.set_property, "dcolour", math.random(1,65535), i)
    end)

    Add pcall(tpt.set_property, "pavg0", math.random(1,65535), i) for instant crash :3

     

    I also created a save PROVING TPT will NOT crash in uploaded saves here: id:1964454

     

    Have fun guys, let me know what you think :D

    Edited once by d4zk1tty. Last: 2nd Apr 2016
  • jeffluo35
    3rd Apr 2016 Member 2 Permalink

    Too complicated. This one is much simpler, but doesn't introduce an element.

     

    tpt.start_getPartIndex()
    tpt.register_step(function()
        while tpt.set_pause() == 0 and dorandom do
            tpt.set_property("type",math.random(1,188),tpt.getPartIndex())
            tpt.next_getPartIndex()
        end
    end)
    dorandom = true

     

    Also causes memory read/write errors.

    Edited once by jeffluo35. Last: 3rd Apr 2016
  • d4zk1tty
    4th Apr 2016 Member 0 Permalink

    @jeffluo35 (View Post)

     Sorry I didnt mean to + your comment. Personnaly I think the code is crap. This isnt even a fuzzer. https://en.wikipedia.org/wiki/Fuzz_testing