16
Botdev / Re: [Python] Packetbuffer
« on: July 13, 2007, 03:26:47 am »
Are you sure?
Holy shit, it's 2018 2019 2020 2021 2022 2023 2024, and the US isn't a fascist country! What a time to be alive.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
import struct
def unpack_dword(data):
return struct.unpack('I', data)[0]
def unpack_word(data):
return struct.unpack('H', data)[0]
def unpack_byte(data):
return struct.unpack('<B', data)[0]
class recv_buffer:
def __init__(self, raw_buffer):
self.raw_buffer = raw_buffer
self.position = 0
def jump(self, bytes):
self.position += bytes
def back(self, bytes):
self.position -= bytes
def set_position(self, position):
self.position = position
def next_string(self):
pos = self.raw_buffer.find(chr(0), self.position)
string = self.raw_buffer[self.position:pos]
self.set_position(pos + 1)
return string
def next_byte(self):
param = self.raw_buffer[self.position:self.position + 1]
byte = unpack_byte(param)
self.jump(1)
return byte
def next_dword(self):
param = self.raw_buffer[self.position:self.position + 4]
dword = unpack_dword(param)
self.jump(4)
return dword
def next_word(self):
param = self.raw_buffer[self.position:self.position + 2]
word = unpack_word(param)
self.jump(2)
return word
def next_dword_list(self, size):
dword_list = []
for i in xrange(size):
dword_list.append(self.next_dword())
return dword_list
def next_data(self, bytes):
return self.raw_buffer[self.position: self.position + bytes]
def dump_data(self):
self.raw_buffer = ""
I'd be interested in seeing a bot written in Python. I've never used the language - does it have a nice API including networking stuff as well, or is it more like Brainfuck where you have nothing at all?
So are you 12 now?
That was below the belt. Thank you all for the happy brithdays. I hope I get money.
Yes................................. But that wasent what I was talking about. See China is repeating all of its same mistake. Back with Mao Zedong and the Nationalist retreating to Thailand, It left them wide open for an attack from Japan. So If they are going to do what the article is stateing. Whos to say another country wont go in? North Koreia? They hate Chinese.
You think that's a good deal? My grandmother bought her house in Somers Point (near Ocean City) in the 60's for about $8,000. Her lot is currently worth around $950,000. It's rediculous.
why is linux in the right hand? Windows is clearly the superior
Are you left or right handed?
If China and Taiwan wants to fight, why should the rest of the world stick their noses in it? Until they're a harm/threat to another country, or they get oil, there's no sense in attacking another country.
Look at all the countries in Africa that are overthrown every other day. Nobody cares about them. Let the Chinese province succeed, and let China handle their own problem.
Totally agree. This isnt the frist time China has fought itself.
If China and Taiwan wants to fight, why should the rest of the world stick their noses in it? Until they're a harm/threat to another country, or they get oil, there's no sense in attacking another country.
The rest of the world already considers Taiwan as an independent state, they just haven't received worldwide recognition
Look at all the countries in Africa that are overthrown every other day. Nobody cares about them. Let the Chinese province succeed, and let China handle their own problem.
I just spent an hour washing my truck with a special soap, a water filter that sofens the water, & a special mit. After that i came inside & took a 7 minute shower using generic shampoo, hard water, & a rag.
I plan to spend another 3 hours at least today cleaning omy truck's outside. I will use a special "cleaning" liquid, then a polisher, then wax. Then I'm going to wash it all over again so it doesn't have weird dust lines. *sigh*
unprovoked hostilities against their neighbors would violate several UN policies/ treaties, and China could potentially be cut off from the rest of the world if the UN decided so
China has veto power on the UN Security Council.
China is pointing nukes at taiwan, and building up men
China regards the island as a renegade province and has vowed to invade if Taiwan moves towards declaring formal independence.
Name your sources?
They should claim it's an anti-terrorist movement, that seems to make invading countries alright.