(stack_size=0x1000, upper_pad=0x10000)
| 176 | // upper_pad: the amount of extra space above stack |
| 177 | export class ChainBase { |
| 178 | constructor(stack_size=0x1000, upper_pad=0x10000) { |
| 179 | this._is_dirty = false; |
| 180 | this.position = 0; |
| 181 | |
| 182 | const return_value = new Uint32Array(4); |
| 183 | this._return_value = return_value; |
| 184 | this.retval_addr = get_view_vector(return_value); |
| 185 | |
| 186 | const errno = new Uint32Array(1); |
| 187 | this._errno = errno; |
| 188 | this.errno_addr = get_view_vector(errno); |
| 189 | |
| 190 | const full_stack_size = upper_pad + stack_size; |
| 191 | const stack_buffer = new ArrayBuffer(full_stack_size); |
| 192 | const stack = new DataView(stack_buffer, upper_pad); |
| 193 | this.stack = stack; |
| 194 | this.stack_addr = get_view_vector(stack); |
| 195 | this.stack_size = stack_size; |
| 196 | this.full_stack_size = full_stack_size; |
| 197 | } |
| 198 | |
| 199 | // use this if you want to write a new ROP chain but don't want to allocate |
| 200 | // a new instance |
nothing calls this directly
no test coverage detected