ROOTPLOIT
Server: LiteSpeed
System: Linux in-mum-web1878.main-hosting.eu 5.14.0-570.21.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jun 11 07:22:35 EDT 2025 x86_64
User: u435929562 (435929562)
PHP: 7.4.33
Disabled: system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Upload Files
File: //opt/go/pkg/mod/github.com/gogo/[email protected]/test/t.go
package test

import (
	"encoding/json"
	"strings"

	"github.com/gogo/protobuf/proto"
)

type T struct {
	Data string
}

func (gt *T) protoType() *ProtoType {
	return &ProtoType{
		Field2: &gt.Data,
	}
}

func (gt T) Equal(other T) bool {
	return gt.protoType().Equal(other.protoType())
}

func (gt *T) Size() int {
	proto := &ProtoType{
		Field2: &gt.Data,
	}
	return proto.Size()
}

func NewPopulatedT(r randyThetest) *T {
	data := NewPopulatedProtoType(r, false).Field2
	gt := &T{}
	if data != nil {
		gt.Data = *data
	}
	return gt
}

func (r T) Marshal() ([]byte, error) {
	return proto.Marshal(r.protoType())
}

func (r *T) Unmarshal(data []byte) error {
	pr := &ProtoType{}
	err := proto.Unmarshal(data, pr)
	if err != nil {
		return err
	}

	if pr.Field2 != nil {
		r.Data = *pr.Field2
	}
	return nil
}

func (gt T) MarshalJSON() ([]byte, error) {
	return json.Marshal(gt.Data)
}

func (gt *T) UnmarshalJSON(data []byte) error {
	var s string
	err := json.Unmarshal(data, &s)
	if err != nil {
		return err
	}
	*gt = T{Data: s}
	return nil
}

func (gt T) Compare(other T) int {
	return strings.Compare(gt.Data, other.Data)
}