Remove len and cap fields

This commit is contained in:
M. Mert Yildiran 2022-05-31 00:50:47 +03:00
parent fbdbe1a9f1
commit af40e814a4
No known key found for this signature in database
GPG Key ID: D42ADB236521BF7A
5 changed files with 2 additions and 12 deletions

View File

@ -17,8 +17,6 @@ struct golang_read_write {
__u32 fd;
__u32 conn_addr;
bool is_request;
__u32 len;
__u32 cap;
__u8 data[BUFFER_SIZE_READ_WRITE];
};
@ -54,8 +52,6 @@ static __always_inline int golang_crypto_tls_write_uprobe(struct pt_regs *ctx) {
// ctx->rsi is common between golang_crypto_tls_write_uprobe and golang_crypto_tls_read_uprobe
b->conn_addr = ctx->rsi; // go.itab.*net.TCPConn,net.Conn address
b->is_request = true;
b->len = ctx->rcx;
b->cap = ctx->rdi;
status = bpf_probe_read_str(&b->data, sizeof(b->data), (void*)ctx->rbx);
if (status < 0) {
@ -82,8 +78,6 @@ static __always_inline int golang_crypto_tls_read_uprobe(struct pt_regs *ctx) {
// ctx->rsi is common between golang_crypto_tls_write_uprobe and golang_crypto_tls_read_uprobe
b->conn_addr = ctx->rsi; // go.itab.*net.TCPConn,net.Conn address
b->is_request = false;
b->len = ctx->rax;
b->cap = ctx->r10;
// Address at ctx->rbx - 0x2bf holds the data
__u32 status = bpf_probe_read_str(&b->data, sizeof(b->data), (void*)(ctx->rbx - 0x2bf));

View File

@ -18,10 +18,8 @@ type tlsTapperGolangReadWrite struct {
Fd uint32
ConnAddr uint32
IsRequest bool
_ [3]byte
Len uint32
Cap uint32
Data [524288]uint8
_ [3]byte
}
type tlsTapperTlsChunk struct {

Binary file not shown.

View File

@ -18,10 +18,8 @@ type tlsTapperGolangReadWrite struct {
Fd uint32
ConnAddr uint32
IsRequest bool
_ [3]byte
Len uint32
Cap uint32
Data [524288]uint8
_ [3]byte
}
type tlsTapperTlsChunk struct {

Binary file not shown.