Projects STRLCPY BananaPhone Commits 39f621cf
🤬
Revision indexing in progress... (symbol navigation in revisions will be accurate after indexed)
  • ■ ■ ■ ■ ■
    pkg/BananaPhone/asm_x64.s
    skipped 92 lines
    93 93  //based on https://golang.org/src/runtime/sys_windows_amd64.s
    94 94  #define maxargs 16
    95 95  //func Syscall(callid uint16, argh ...uintptr) (uint32, error)
    96  -TEXT ·Syscall(SB), $0-56
     96 +TEXT ·bpSyscall(SB), $0-56
    97 97   XORQ AX,AX
    98 98   MOVW callid+0(FP), AX
    99 99   PUSHQ CX
    skipped 40 lines
    140 140   // Return result.
    141 141   POPQ CX
    142 142   MOVL AX, errcode+32(FP)
    143  - // GetLastError().
    144  - MOVQ 0x30(GS), DI
    145  - MOVL 0x68(DI), AX
    146  - MOVQ AX, err_itable+40(FP)
    147 143   RET
    148 144   
  • ■ ■ ■ ■ ■ ■
    pkg/BananaPhone/functions.go
    skipped 9 lines
    10 10  )
    11 11   
    12 12  //Syscall calls the system function specified by callid with n arguments. Works much the same as syscall.Syscall - return value is the call error code and optional error text. All args are uintptrs to make it easy.
    13  -func Syscall(callid uint16, argh ...uintptr) (errcode uint32, err error)
     13 +func Syscall(callid uint16, argh ...uintptr) (errcode uint32, err error) {
     14 + errcode = bpSyscall(callid, argh...)
     15 + 
     16 + if errcode != 0 {
     17 + err = fmt.Errorf("non-zero return from syscall")
     18 + }
     19 + return errcode, err
     20 +}
     21 + 
     22 +//Syscall calls the system function specified by callid with n arguments. Works much the same as syscall.Syscall - return value is the call error code and optional error text. All args are uintptrs to make it easy.
     23 +func bpSyscall(callid uint16, argh ...uintptr) (errcode uint32)
    14 24   
    15 25  //GetPEB returns the in-memory address of the start of PEB while making no api calls
    16 26  func GetPEB() uintptr
    skipped 267 lines
Please wait...
Page is in error, reload to recover