def SetRegValue(value, name):
    rv = idaapi.regval_t()
    if type(value) == types.StringType:
        value = int(value, 16)
    elif type(value) != types.IntType and type(value) != types.LongType:
        print "SetRegValue: value must be integer!"
        return BADADDR

    if value < 0:
        #ival_set cannot handle negative numbers
        value &= 0xFFFFFFFF

    rv.ival = value
    return idaapi.set_reg_val(name, rv)
Set register value
dataset/ETHPy150Open EiNSTeiN-/idapython/python/idc.py/SetRegValue