name
stringlengths
1
473k
code
stringlengths
7
647k
asm
stringlengths
4
3.39M
file
stringlengths
8
196
JSONHandler::JSONHandler()
JSONHandler::JSONHandler() : m(new Members()) { }
pushq %r15 pushq %r14 pushq %rbx movq %rdi, %rbx movl $0x180, %edi # imm = 0x180 callq 0x191a0 movq %rax, %r14 leaq 0x128(%rax), %r15 movl $0x138, %edx # imm = 0x138 movq %rax, %rdi xorl %esi, %esi callq 0x19350 movq %r15, 0x138(%r14) movq %r15, 0x140(%r14) xorps %xmm0, %xmm0 movups %xmm0, 0x148(%r14) movups %xmm0, 0x158(%r14) movups %xmm0, 0x168(%r14) andq $0x0, 0x178(%r14) movq %r14, (%rbx) popq %rbx popq %r14 popq %r15 retq nop
/qpdf[P]qpdf/libqpdf/JSONHandler.cc
MD5::unparse[abi:cxx11]()
std::string MD5::unparse() { this->crypto->MD5_finalize(); Digest digest_val; digest(digest_val); return QUtil::hex_encode(std::string(reinterpret_cast<char*>(digest_val), 16)); }
pushq %r15 pushq %r14 pushq %rbx subq $0x30, %rsp movq %rsi, %r14 movq %rdi, %rbx movq (%rsi), %rdi movq (%rdi), %rax callq *0x28(%rax) movq %rsp, %r15 movq %r14, %rdi movq %r15, %rsi callq 0x24d3e leaq 0x20(%rsp), %rax movq %rax, -0x10(%rax) leaq 0x10(%rsp), %rdx leaq 0x10(%rsp), %r14 movq %r14, %rdi movq %r15, %rsi callq 0x1b6b2 movq %rbx, %rdi movq %r14, %rsi callq 0xf3199 leaq 0x10(%rsp), %rdi callq 0x19e78 movq %rbx, %rax addq $0x30, %rsp popq %rbx popq %r14 popq %r15 retq movq %rax, %rbx leaq 0x10(%rsp), %rdi callq 0x19e78 movq %rbx, %rdi callq 0x19750 nop
/qpdf[P]qpdf/libqpdf/MD5.cc
NNTreeIterator::NNTreeIterator(NNTreeImpl&)
NNTreeIterator::NNTreeIterator(NNTreeImpl& impl) : impl(impl), item_number(-1) { }
leaq 0x1870dd(%rip), %rax # 0x1ac098 movq %rax, (%rdi) movq %rsi, 0x8(%rdi) leaq 0x10(%rdi), %rax movq %rax, 0x18(%rdi) movq %rax, 0x10(%rdi) xorps %xmm0, %xmm0 andq $0x0, 0x30(%rdi) movups %xmm0, 0x20(%rdi) orl $-0x1, 0x38(%rdi) movups %xmm0, 0x40(%rdi) movups %xmm0, 0x50(%rdi) retq nop
/qpdf[P]qpdf/libqpdf/NNTree.cc
error(QPDF&, QPDFObjectHandle&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
static void error(QPDF& qpdf, QPDFObjectHandle& node, std::string const& msg) { throw QPDFExc(qpdf_e_damaged_pdf, qpdf.getFilename(), get_description(node), 0, msg); }
pushq %rbp pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x40, %rsp movq %rdx, %r14 movq %rsi, %r15 movq %rdi, %r12 movl $0x80, %edi callq 0x19400 movq %rax, %rbx leaq 0x20(%rsp), %rdi movq %r12, %rsi callq 0x31b38 movq %rsp, %rdi movq %r15, %rsi callq 0x28d7d movb $0x1, %bpl pushq $0x5 popq %rsi leaq 0x20(%rsp), %rdx movq %rsp, %rcx movq %rbx, %rdi xorl %r8d, %r8d movq %r14, %r9 callq 0x56b28 xorl %ebp, %ebp leaq 0x186b7f(%rip), %rsi # 0x1abd70 leaq -0x75a8(%rip), %rdx # 0x1dc50 movq %rbx, %rdi callq 0x19720 movq %rax, %r14 movq %rsp, %rdi callq 0x19e78 jmp 0x25213 movq %rax, %r14 movb $0x1, %bpl leaq 0x20(%rsp), %rdi callq 0x19e78 testb %bpl, %bpl jne 0x25227 jmp 0x2522f movq %rax, %r14 movq %rbx, %rdi callq 0x19a90 movq %r14, %rdi callq 0x19750 nop
/qpdf[P]qpdf/libqpdf/NNTree.cc
NNTreeIterator::deepen(QPDFObjectHandle, bool, bool)
bool NNTreeIterator::deepen(QPDFObjectHandle node, bool first, bool allow_empty) { // Starting at this node, descend through the first or last kid until we reach a node with // items. If we succeed, return true; otherwise return false and leave path alone. auto opath = this->path; bool failed = false; QPDFObjGen::set seen; for (auto const& i: this->path) { seen.add(i.node); } while (!failed) { if (!seen.add(node)) { QTC::TC("qpdf", "NNTree deepen: loop"); warn(impl.qpdf, node, "loop detected while traversing name/number tree"); failed = true; break; } if (!node.isDictionary()) { QTC::TC("qpdf", "NNTree node is not a dictionary"); warn(impl.qpdf, node, "non-dictionary node while traversing name/number tree"); failed = true; break; } auto kids = node.getKey("/Kids"); int nkids = kids.isArray() ? kids.getArrayNItems() : 0; auto items = node.getKey(impl.details.itemsKey()); int nitems = items.isArray() ? items.getArrayNItems() : 0; if (nitems > 0) { setItemNumber(node, first ? 0 : nitems - 2); break; } else if (nkids > 0) { int kid_number = first ? 0 : nkids - 1; addPathElement(node, kid_number); auto next = kids.getArrayItem(kid_number); if (!next.isIndirect()) { if (impl.auto_repair) { QTC::TC("qpdf", "NNTree fix indirect kid"); warn( impl.qpdf, node, ("converting kid number " + std::to_string(kid_number) + " to an indirect object")); next = impl.qpdf.makeIndirectObject(next); kids.setArrayItem(kid_number, next); } else { QTC::TC("qpdf", "NNTree warn indirect kid"); warn( impl.qpdf, node, ("kid number " + std::to_string(kid_number) + " is not an indirect object")); } } node = next; } else if (allow_empty && items.isArray()) { QTC::TC("qpdf", "NNTree deepen found empty"); setItemNumber(node, -1); break; } else { QTC::TC("qpdf", "NNTree deepen: invalid node"); warn( impl.qpdf, node, ("name/number tree node has neither non-empty " + impl.details.itemsKey() + " nor /Kids")); failed = true; break; } } if (failed) { this->path = opath; return false; } return true; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x118, %rsp # imm = 0x118 movl %ecx, 0x3c(%rsp) movl %edx, 0x14(%rsp) movq %rsi, %r13 movq %rdi, 0x8(%rsp) leaq 0x10(%rdi), %r12 leaq 0xd0(%rsp), %rdi movq %r12, %rsi callq 0x28ee8 leaq 0xf0(%rsp), %rax andl $0x0, (%rax) andq $0x0, 0x8(%rax) movq %rax, 0x10(%rax) movq %rax, 0x18(%rax) andq $0x0, 0x20(%rax) leaq 0xe8(%rsp), %rbx movq %r12, %r14 movq (%r14), %r14 cmpq %r12, %r14 je 0x258bd leaq 0x10(%r14), %rdi callq 0x9670c movq %rbx, %rdi movq %rax, %rsi callq 0x28f22 jmp 0x2589f leaq 0x18(%rsp), %r14 leaq 0xc0(%rsp), %rbx leaq 0xb0(%rsp), %r15 movl $0x0, 0x10(%rsp) movq %r12, 0x78(%rsp) testb $0x1, 0x10(%rsp) jne 0x25cbe movq %r13, %rdi callq 0x9670c leaq 0xe8(%rsp), %rdi movq %rax, %rsi callq 0x28f22 testb %al, %al je 0x25c4c movq %r13, %rdi callq 0x9873c testb %al, %al je 0x25c81 movq %r14, %rdi leaq 0xe7d10(%rip), %rsi # 0x10d634 leaq 0x48(%rsp), %rdx callq 0x1b660 movq %rbx, %rdi movq %r13, %rsi movq %r14, %rdx callq 0xc2a84 movq %r14, %rdi callq 0x19e78 movq %rbx, %r12 movq %rbx, %rdi callq 0x9872e xorl %ebx, %ebx testb %al, %al je 0x2595f movq %r12, %rdi callq 0xc0bea movl %eax, %ebx movq 0x8(%rsp), %rax movq 0x8(%rax), %rax movq (%rax), %rdi movq (%rdi), %rax callq *(%rax) movq %r15, %rbp movq %r15, %rdi movq %r13, %rsi movq %rax, %rdx callq 0xc2a84 movq %rbp, %rdi callq 0x9872e testb %al, %al je 0x259bd movq %r15, %rdi callq 0xc0bea testl %eax, %eax jle 0x259bd addl $-0x2, %eax cmpb $0x0, 0x14(%rsp) movl $0x0, %ecx cmovnel %ecx, %eax movq 0x8(%rsp), %rdi movq %r13, %rsi movl %eax, %edx callq 0x25df2 jmp 0x25b85 testl %ebx, %ebx jle 0x25b00 decl %ebx cmpb $0x0, 0x14(%rsp) movl $0x0, %eax cmovnel %eax, %ebx movq 0x8(%rsp), %rdi movq %r13, %rsi movl %ebx, %edx callq 0x276a2 leaq 0x68(%rsp), %rbp movq %rbp, %rdi movq %r12, %rsi movl %ebx, %edx callq 0xc0c96 movq %rbp, %rdi callq 0x99458 testb %al, %al jne 0x25bfb movq 0x8(%rsp), %rax movq 0x8(%rax), %rax movq 0x8(%rax), %rcx movq %rcx, 0x40(%rsp) cmpb $0x1, 0x28(%rax) jne 0x25b8c leaq 0x90(%rsp), %rbp movq %rbp, %rdi movl %ebx, %esi callq 0x1dbf7 leaq 0x48(%rsp), %r14 movq %r14, %rdi leaq 0xe7b77(%rip), %rsi # 0x10d5b9 movq %rbp, %rdx callq 0x1bb11 leaq 0x18(%rsp), %rbp movq %rbp, %rdi movq %r14, %rsi leaq 0xe7b74(%rip), %rdx # 0x10d5d0 callq 0x1baf2 movq 0x40(%rsp), %rdi movq %r13, %rsi movq %rbp, %rdx callq 0x25462 movq %rbp, %rdi callq 0x19e78 leaq 0x48(%rsp), %rdi callq 0x19e78 leaq 0x90(%rsp), %rdi callq 0x19e78 movq 0x8(%rsp), %rax movq 0x8(%rax), %rax movq 0x8(%rax), %rbp leaq 0x80(%rsp), %rdi leaq 0x68(%rsp), %rsi callq 0x2905c leaq 0x18(%rsp), %rdi movq %rdi, %r14 movq %rbp, %rsi leaq 0x80(%rsp), %rdx callq 0xe72ea leaq 0x68(%rsp), %rbp movq %rbp, %rdi movq %r14, %rsi callq 0x2902e leaq 0x20(%rsp), %rdi callq 0x1cf2a leaq 0x88(%rsp), %rdi callq 0x1cf2a movq %r12, %rdi movl %ebx, %esi movq %rbp, %rdx callq 0xc1392 jmp 0x25bfb cmpb $0x0, 0x3c(%rsp) je 0x25b1c movq %r15, %rdi callq 0x9872e movl %eax, %ecx pushq $-0x1 popq %rax testb %cl, %cl jne 0x259a9 movq 0x8(%rsp), %rax movq 0x8(%rax), %rax movq 0x8(%rax), %rbx movq (%rax), %rdi movq (%rdi), %rax callq *(%rax) leaq 0x48(%rsp), %rbp movq %rbp, %rdi leaq 0xe7ac2(%rip), %rsi # 0x10d602 movq %rax, %rdx callq 0x2282d leaq 0x18(%rsp), %r14 movq %r14, %rdi movq %rbp, %rsi leaq 0xe7ad5(%rip), %rdx # 0x10d62f callq 0x1baf2 movq %rbx, %rdi movq %r13, %rsi movq %r14, %rdx callq 0x25462 movq %r14, %rdi callq 0x19e78 leaq 0x48(%rsp), %rdi callq 0x19e78 movb $0x1, %al movl %eax, 0x10(%rsp) xorl %ebx, %ebx jmp 0x25c14 leaq 0x90(%rsp), %r14 movq %r14, %rdi movl %ebx, %esi callq 0x1dbf7 leaq 0x48(%rsp), %rbx movq %rbx, %rdi leaq 0xe7a17(%rip), %rsi # 0x10d5c4 movq %r14, %rdx callq 0x1bb11 leaq 0x18(%rsp), %r14 movq %r14, %rdi movq %rbx, %rsi leaq 0xe7a20(%rip), %rdx # 0x10d5e7 callq 0x1baf2 movq 0x40(%rsp), %rdi movq %r13, %rsi movq %r14, %rdx callq 0x25462 movq %r14, %rdi callq 0x19e78 leaq 0x48(%rsp), %rdi callq 0x19e78 leaq 0x90(%rsp), %rdi callq 0x19e78 movq %r13, %rdi leaq 0x68(%rsp), %rsi callq 0x29070 leaq 0x70(%rsp), %rdi callq 0x1cf2a movb $0x1, %bl leaq 0xb8(%rsp), %rdi callq 0x1cf2a leaq 0xc8(%rsp), %rdi callq 0x1cf2a testb %bl, %bl movq %r12, %rbx movq 0x78(%rsp), %r12 jne 0x258df movb $0x1, %bl testb $0x1, 0x10(%rsp) jne 0x25cbe jmp 0x25cd0 movq 0x8(%rsp), %rax movq 0x8(%rax), %rax movq 0x8(%rax), %rbx leaq 0xe78f3(%rip), %rsi # 0x10d553 leaq 0x18(%rsp), %rdi leaq 0x48(%rsp), %rdx callq 0x1b660 leaq 0x18(%rsp), %rdx movq %rbx, %rdi movq %r13, %rsi callq 0x25462 jmp 0x25cb4 movq 0x8(%rsp), %rax movq 0x8(%rax), %rax movq 0x8(%rax), %rbx leaq 0xe78ee(%rip), %rsi # 0x10d583 leaq 0x18(%rsp), %rdi leaq 0x48(%rsp), %rdx callq 0x1b660 leaq 0x18(%rsp), %rdx movq %rbx, %rdi movq %r13, %rsi callq 0x25462 leaq 0x18(%rsp), %rdi callq 0x19e78 leaq 0xd0(%rsp), %rsi movq %r12, %rdi callq 0x28f5a xorl %ebx, %ebx leaq 0xe8(%rsp), %rdi callq 0x2930a leaq 0xd0(%rsp), %rdi callq 0x28fee movl %ebx, %eax addq $0x118, %rsp # imm = 0x118 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq jmp 0x25d93 jmp 0x25dcc jmp 0x25d93 jmp 0x25dcc movq %rax, %rbx leaq 0x88(%rsp), %rdi callq 0x1cf2a jmp 0x25d87 jmp 0x25d2c jmp 0x25d3b jmp 0x25d4a jmp 0x25d84 movq %rax, %rbx leaq 0x18(%rsp), %rdi callq 0x19e78 jmp 0x25d3e movq %rax, %rbx leaq 0x48(%rsp), %rdi callq 0x19e78 jmp 0x25d4d movq %rax, %rbx leaq 0x90(%rsp), %rdi callq 0x19e78 jmp 0x25d87 jmp 0x25d84 jmp 0x25dcc movq %rax, %rbx leaq 0x18(%rsp), %rdi callq 0x19e78 jmp 0x25d72 movq %rax, %rbx leaq 0x48(%rsp), %rdi callq 0x19e78 jmp 0x25dae jmp 0x25dab jmp 0x25dab jmp 0x25dab movq %rax, %rbx leaq 0x70(%rsp), %rdi callq 0x1cf2a jmp 0x25dae movq %rax, %rbx leaq 0x18(%rsp), %rdi callq 0x19e78 jmp 0x25dcf jmp 0x25dcc jmp 0x25da6 movq %rax, %rbx jmp 0x25dbb movq %rax, %rbx leaq 0xb8(%rsp), %rdi callq 0x1cf2a leaq 0xc8(%rsp), %rdi callq 0x1cf2a jmp 0x25dcf jmp 0x25dcc movq %rax, %rbx leaq 0xe8(%rsp), %rdi callq 0x2930a leaq 0xd0(%rsp), %rdi callq 0x28fee movq %rbx, %rdi callq 0x19750 nop
/qpdf[P]qpdf/libqpdf/NNTree.cc
NNTreeIterator::split(QPDFObjectHandle, std::_List_iterator<NNTreeIterator::PathElement>)
void NNTreeIterator::split(QPDFObjectHandle to_split, std::list<PathElement>::iterator parent) { // Split some node along the path to the item pointed to by this iterator, and adjust the // iterator so it points to the same item. // In examples, for simplicity, /Nums is shown to just contain numbers instead of pairs. Imagine // this tree: // // root: << /Kids [ A B C D ] >> // A: << /Nums [ 1 2 3 4 ] >> // B: << /Nums [ 5 6 7 8 ] >> // C: << /Nums [ 9 10 11 12 ] >> // D: << /Kids [ E F ] // E: << /Nums [ 13 14 15 16 ] >> // F: << /Nums [ 17 18 19 20 ] >> // iter1 (points to 19) // path: // - { node: root: kid_number: 3 } // - { node: D, kid_number: 1 } // node: F // item_number: 2 // iter2 (points to 1) // path: // - { node: root, kid_number: 0} // node: A // item_number: 0 if (!valid()) { throw std::logic_error("NNTreeIterator::split called an invalid iterator"); } // Find the array we actually need to split, which is either this node's kids or items. auto kids = to_split.getKey("/Kids"); int nkids = kids.isArray() ? kids.getArrayNItems() : 0; auto items = to_split.getKey(impl.details.itemsKey()); int nitems = items.isArray() ? items.getArrayNItems() : 0; QPDFObjectHandle first_half; int n = 0; std::string key; int threshold = 0; if (nkids > 0) { QTC::TC("qpdf", "NNTree split kids"); first_half = kids; n = nkids; threshold = impl.split_threshold; key = "/Kids"; } else if (nitems > 0) { QTC::TC("qpdf", "NNTree split items"); first_half = items; n = nitems; threshold = 2 * impl.split_threshold; key = impl.details.itemsKey(); } else { throw std::logic_error("NNTreeIterator::split called on invalid node"); } if (n <= threshold) { return; } bool is_root = (parent == this->path.end()); bool is_leaf = (nitems > 0); // CURRENT STATE: tree is in original state; iterator is valid and unchanged. if (is_root) { // What we want to do is to create a new node for the second half of the items and put it in // the parent's /Kids array right after the element that points to the current to_split // node, but if we're splitting root, there is no parent, so handle that first. // In the non-root case, parent points to the path element whose /Kids contains the first // half node, and the first half node is to_split. If we are splitting the root, we need to // push everything down a level, but we want to keep the actual root object the same so that // indirect references to it remain intact (and also in case it might be a direct object, // which it shouldn't be but that case probably exists in the wild). To achieve this, we // create a new node for the first half and then replace /Kids in the root to contain it. // Then we adjust the path so that the first element is root and the second element, if any, // is the new first half. In this way, we make the root case identical to the non-root case // so remaining logic can handle them in the same way. auto first_node = impl.qpdf.makeIndirectObject(QPDFObjectHandle::newDictionary()); first_node.replaceKey(key, first_half); QPDFObjectHandle new_kids = QPDFObjectHandle::newArray(); new_kids.appendItem(first_node); to_split.removeKey("/Limits"); // already shouldn't be there for root to_split.removeKey(impl.details.itemsKey()); to_split.replaceKey("/Kids", new_kids); if (is_leaf) { QTC::TC("qpdf", "NNTree split root + leaf"); this->node = first_node; } else { QTC::TC("qpdf", "NNTree split root + !leaf"); auto next = this->path.begin(); next->node = first_node; } this->path.emplace_front(to_split, 0); parent = this->path.begin(); to_split = first_node; } // CURRENT STATE: parent is guaranteed to be defined, and we have the invariants that // parent[/Kids][kid_number] == to_split and (++parent).node == to_split. // Create a second half array, and transfer the second half of the items into the second half // array. QPDFObjectHandle second_half = QPDFObjectHandle::newArray(); int start_idx = ((n / 2) & ~1); while (first_half.getArrayNItems() > start_idx) { second_half.appendItem(first_half.getArrayItem(start_idx)); first_half.eraseItem(start_idx); } resetLimits(to_split, parent); // Create a new node to contain the second half QPDFObjectHandle second_node = impl.qpdf.makeIndirectObject(QPDFObjectHandle::newDictionary()); second_node.replaceKey(key, second_half); resetLimits(second_node, parent); // CURRENT STATE: half the items from the kids or items array in the node being split have been // moved into a new node. The new node is not yet attached to the tree. The iterator may have a // path element or leaf node that is out of bounds. // We need to adjust the parent to add the second node to /Kids and, if needed, update // kid_number to traverse through it. We need to update to_split's path element, or the node if // this is a leaf, so that the kid/item number points to the right place. auto parent_kids = parent->node.getKey("/Kids"); parent_kids.insertItem(parent->kid_number + 1, second_node); auto cur_elem = parent; ++cur_elem; // points to end() for leaf nodes int old_idx = (is_leaf ? this->item_number : cur_elem->kid_number); if (old_idx >= start_idx) { ++parent->kid_number; if (is_leaf) { QTC::TC("qpdf", "NNTree split second half item"); setItemNumber(second_node, this->item_number - start_idx); } else { QTC::TC("qpdf", "NNTree split second half kid"); cur_elem->node = second_node; cur_elem->kid_number -= start_idx; } } if (!is_root) { QTC::TC("qpdf", "NNTree split parent"); auto next = parent->node; resetLimits(next, parent); --parent; split(next, parent); } }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x148, %rsp # imm = 0x148 movq %rsi, 0x10(%rsp) cmpl $0x0, 0x38(%rdi) js 0x26b93 movq %rdx, %r15 movq %rdi, %r14 leaq 0xe7017(%rip), %rsi # 0x10d634 leaq 0xb8(%rsp), %rdi leaq 0x38(%rsp), %rdx callq 0x1b660 leaq 0xa8(%rsp), %rdi leaq 0xb8(%rsp), %rdx movq 0x10(%rsp), %rsi callq 0xc2a84 leaq 0xb8(%rsp), %rdi callq 0x19e78 leaq 0xa8(%rsp), %rdi callq 0x9872e xorl %ebp, %ebp testb %al, %al je 0x26678 leaq 0xa8(%rsp), %rdi callq 0xc0bea movl %eax, %ebp movq 0x8(%r14), %rax movq (%rax), %rdi movq (%rdi), %rax callq *(%rax) leaq 0x98(%rsp), %rdi movq 0x10(%rsp), %rsi movq %rax, %rdx callq 0xc2a84 leaq 0x98(%rsp), %rdi callq 0x9872e xorl %r12d, %r12d testb %al, %al je 0x266bd leaq 0x98(%rsp), %rdi callq 0xc0bea movl %eax, %r12d leaq 0xc8(%rsp), %rax movq %rax, -0x10(%rax) andq $0x0, -0x8(%rax) xorps %xmm0, %xmm0 movaps %xmm0, 0x60(%rsp) movb $0x0, (%rax) testl %ebp, %ebp jle 0x2670c leaq 0x60(%rsp), %rdi leaq 0xa8(%rsp), %rsi callq 0x29070 movq 0x8(%r14), %rax movl 0x10(%rax), %ebx leaq 0xe6f37(%rip), %rsi # 0x10d634 leaq 0xb8(%rsp), %rdi callq 0x19df0 jmp 0x2674b testl %r12d, %r12d jle 0x26bc3 leaq 0x60(%rsp), %rdi leaq 0x98(%rsp), %rsi callq 0x29070 movq 0x8(%r14), %rax movl 0x10(%rax), %ebx movq (%rax), %rdi movq (%rdi), %rax callq *(%rax) leaq 0xb8(%rsp), %rdi movq %rax, %rsi callq 0x19d60 addl %ebx, %ebx movl %r12d, %ebp cmpl %ebx, %ebp jle 0x26b50 movq %r14, 0x8(%rsp) leaq 0x10(%r14), %rbx movq %r15, %r14 cmpq %r15, %rbx movq %rbx, 0x80(%rsp) jne 0x268c0 movq 0x8(%rsp), %r14 movq 0x8(%r14), %rax movq 0x8(%rax), %rbx leaq 0xf8(%rsp), %rdi callq 0x9c81e leaq 0x28(%rsp), %rdi leaq 0xf8(%rsp), %rdx movq %rbx, %rsi callq 0xe72ea leaq 0x100(%rsp), %rdi callq 0x1cf2a leaq 0x28(%rsp), %rdi leaq 0xb8(%rsp), %rsi leaq 0x60(%rsp), %rdx callq 0xc2da0 leaq 0x18(%rsp), %rdi callq 0x9b194 leaq 0x18(%rsp), %rdi leaq 0x28(%rsp), %rsi callq 0xc1610 leaq 0xe6e67(%rip), %rsi # 0x10d64a leaq 0x38(%rsp), %rdi leaq 0x88(%rsp), %rdx callq 0x1b660 leaq 0x38(%rsp), %rsi movq 0x10(%rsp), %rdi callq 0xc2fa8 leaq 0x38(%rsp), %rdi callq 0x19e78 movq 0x8(%r14), %rax movq (%rax), %rdi movq (%rdi), %rax callq *(%rax) movq 0x10(%rsp), %rdi movq %rax, %rsi callq 0xc2fa8 leaq 0xe6e06(%rip), %rsi # 0x10d634 leaq 0x38(%rsp), %rdi leaq 0x88(%rsp), %rdx callq 0x1b660 leaq 0x38(%rsp), %rsi leaq 0x18(%rsp), %rdx movq 0x10(%rsp), %r13 movq %r13, %rdi callq 0xc2da0 leaq 0x38(%rsp), %rbx movq %rbx, %rdi callq 0x19e78 movq 0x10(%r14), %rax addq $0x10, %rax leaq 0x28(%r14), %rdi testl %r12d, %r12d cmovleq %rax, %rdi leaq 0x28(%rsp), %rsi callq 0x29070 andl $0x0, (%rbx) leaq 0x38(%rsp), %rdx movq 0x80(%rsp), %rbx movq %rbx, %rdi movq %r13, %rsi callq 0x28e6a movq (%rbx), %r14 leaq 0x28(%rsp), %rsi movq %r13, %rdi callq 0x29070 leaq 0x20(%rsp), %rdi callq 0x1cf2a leaq 0x30(%rsp), %rdi callq 0x1cf2a movl %r12d, 0x5c(%rsp) movq %r15, 0xe0(%rsp) leaq 0x28(%rsp), %rdi callq 0x9b194 movq 0x8(%rsp), %rax addq $0x38, %rax movq %rax, 0xd8(%rsp) leaq 0x120(%rsp), %rax movq %rax, 0x78(%rsp) shrl %ebp andl $0x3ffffffe, %ebp # imm = 0x3FFFFFFE leaq 0x40(%rsp), %r13 leaq 0x60(%rsp), %r15 leaq 0x38(%rsp), %r12 leaq 0x28(%rsp), %rbx movq %r15, %rdi callq 0xc0bea cmpl %ebp, %eax jle 0x26949 movq %r12, %rdi movq %r15, %rsi movl %ebp, %edx callq 0xc0c96 movq %rbx, %rdi movq %r12, %rsi callq 0xc1610 movq %r13, %rdi callq 0x1cf2a movq %r15, %rdi movl %ebp, %esi callq 0xc16e0 jmp 0x26911 leaq 0x138(%rsp), %rbx movq %rbx, %rdi movq 0x10(%rsp), %rsi callq 0x2905c movq 0x8(%rsp), %r15 movq %r15, %rdi movq %rbx, %rsi movq %r14, %rdx callq 0x25e1a leaq 0x140(%rsp), %rdi callq 0x1cf2a movq 0x8(%r15), %rax movq 0x8(%rax), %rbx leaq 0xe8(%rsp), %rdi callq 0x9c81e leaq 0x18(%rsp), %rdi leaq 0xe8(%rsp), %rdx movq %rbx, %rsi callq 0xe72ea leaq 0xf0(%rsp), %rdi callq 0x1cf2a leaq 0x18(%rsp), %rdi leaq 0xb8(%rsp), %rsi leaq 0x28(%rsp), %rdx callq 0xc2da0 leaq 0x128(%rsp), %rbx leaq 0x18(%rsp), %rsi movq %rbx, %rdi callq 0x2905c movq 0x8(%rsp), %rdi movq %rbx, %rsi movq %r14, %rdx callq 0x25e1a leaq 0x130(%rsp), %rdi callq 0x1cf2a leaq 0xe6c2f(%rip), %rsi # 0x10d634 leaq 0x38(%rsp), %rdi leaq 0x7(%rsp), %rdx callq 0x1b660 leaq 0x10(%r14), %r12 leaq 0x88(%rsp), %rdi leaq 0x38(%rsp), %rdx movq %r12, %rsi callq 0xc2a84 leaq 0x38(%rsp), %rdi callq 0x19e78 movl 0x20(%r14), %esi incl %esi leaq 0x88(%rsp), %rdi leaq 0x18(%rsp), %rdx callq 0xc150c movq (%r14), %rbx leaq 0x20(%rbx), %rax movl 0x5c(%rsp), %ecx testl %ecx, %ecx cmovgq 0xd8(%rsp), %rax cmpl %ebp, (%rax) jl 0x26a98 incl 0x20(%r14) testl %ecx, %ecx jle 0x26a87 movq 0x8(%rsp), %rdi movl 0x38(%rdi), %edx subl %ebp, %edx leaq 0x18(%rsp), %rsi callq 0x25df2 jmp 0x26a98 leaq 0x10(%rbx), %rdi leaq 0x18(%rsp), %rsi callq 0x29070 subl %ebp, 0x20(%rbx) movq 0x80(%rsp), %rax cmpq 0xe0(%rsp), %rax je 0x26b2f leaq 0x38(%rsp), %rbx movq %rbx, %rdi movq %r12, %rsi callq 0x2905c leaq 0x118(%rsp), %r15 movq %r15, %rdi movq %rbx, %rsi callq 0x2905c movq 0x8(%rsp), %r12 movq %r12, %rdi movq %r15, %rsi movq %r14, %rdx callq 0x25e1a leaq 0x120(%rsp), %rdi callq 0x1cf2a movq 0x8(%r14), %rbx leaq 0x108(%rsp), %r14 leaq 0x38(%rsp), %rsi movq %r14, %rdi callq 0x2905c movq %r12, %rdi movq %r14, %rsi movq %rbx, %rdx callq 0x265f0 leaq 0x110(%rsp), %rdi callq 0x1cf2a leaq 0x40(%rsp), %rdi callq 0x1cf2a leaq 0x90(%rsp), %rdi callq 0x1cf2a leaq 0x20(%rsp), %rdi callq 0x1cf2a leaq 0x30(%rsp), %rdi callq 0x1cf2a leaq 0xb8(%rsp), %rdi callq 0x19e78 leaq 0x68(%rsp), %rdi callq 0x1cf2a leaq 0xa0(%rsp), %rdi callq 0x1cf2a leaq 0xb0(%rsp), %rdi callq 0x1cf2a addq $0x148, %rsp # imm = 0x148 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq pushq $0x10 popq %rdi callq 0x19400 movq %rax, %r14 leaq 0xe687f(%rip), %rsi # 0x10d424 movq %rax, %rdi callq 0x199a0 movq 0x18b434(%rip), %rsi # 0x1b1fe8 movq 0x18b405(%rip), %rdx # 0x1b1fc0 movq %r14, %rdi callq 0x19720 pushq $0x10 popq %rdi callq 0x19400 movq %rax, %r14 leaq 0xe6880(%rip), %rsi # 0x10d455 movq %rax, %rdi callq 0x199a0 movq 0x18b404(%rip), %rsi # 0x1b1fe8 movq 0x18b3d5(%rip), %rdx # 0x1b1fc0 movq %r14, %rdi callq 0x19720 jmp 0x26c62 jmp 0x26cbf jmp 0x26c6f jmp 0x26cbf jmp 0x26c6f jmp 0x26cbf jmp 0x26d00 jmp 0x26d00 movq %rax, %rbx leaq 0x100(%rsp), %rdi jmp 0x26d08 jmp 0x26ce7 movq %rax, %rbx movq %r14, %rdi callq 0x19a90 jmp 0x26d0d movq %rax, %rbx leaq 0x110(%rsp), %rax movq %rax, 0x78(%rsp) jmp 0x26c4c movq %rax, %rbx movq 0x78(%rsp), %rdi callq 0x1cf2a leaq 0x40(%rsp), %rdi callq 0x1cf2a jmp 0x26c65 movq %rax, %rbx leaq 0x90(%rsp), %rdi jmp 0x26c8b movq %rax, %rbx leaq 0x38(%rsp), %rdi callq 0x19e78 jmp 0x26cc2 jmp 0x26cbf movq %rax, %rbx leaq 0x130(%rsp), %rdi callq 0x1cf2a jmp 0x26cc2 jmp 0x26cbf movq %rax, %rbx leaq 0xf0(%rsp), %rdi jmp 0x26cf7 jmp 0x26d00 movq %rax, %rbx leaq 0x140(%rsp), %rdi jmp 0x26cf7 jmp 0x26ce7 movq %rax, %rbx movq %r14, %rdi callq 0x19a90 jmp 0x26d3e movq %rax, %rbx leaq 0x20(%rsp), %rdi jmp 0x26cf7 movq %rax, %rbx leaq 0xb8(%rsp), %rdi callq 0x19e78 jmp 0x26d3e movq %rax, %rbx jmp 0x26d3e movq %rax, %rbx jmp 0x26d24 jmp 0x26cec movq %rax, %rbx jmp 0x26d0d movq %rax, %rbx jmp 0x26d31 movq %rax, %rbx movq %r13, %rdi callq 0x1cf2a jmp 0x26d03 jmp 0x26d00 movq %rax, %rbx leaq 0x30(%rsp), %rdi callq 0x1cf2a leaq 0xb8(%rsp), %rdi callq 0x19e78 leaq 0x68(%rsp), %rdi callq 0x1cf2a leaq 0xa0(%rsp), %rdi callq 0x1cf2a leaq 0xb0(%rsp), %rdi callq 0x1cf2a movq %rbx, %rdi callq 0x19750
/qpdf[P]qpdf/libqpdf/NNTree.cc
NNTreeIterator::insertAfter(QPDFObjectHandle, QPDFObjectHandle)
void NNTreeIterator::insertAfter(QPDFObjectHandle key, QPDFObjectHandle value) { if (!valid()) { QTC::TC("qpdf", "NNTree insertAfter inserts first"); impl.insertFirst(key, value); deepen(impl.oh, true, false); return; } auto items = this->node.getKey(impl.details.itemsKey()); if (!items.isArray()) { error(impl.qpdf, node, "node contains no items array"); } if (items.getArrayNItems() < this->item_number + 2) { error(impl.qpdf, node, "insert: items array is too short"); } items.insertItem(this->item_number + 2, key); items.insertItem(this->item_number + 3, value); resetLimits(this->node, lastPathElement()); split(this->node, lastPathElement()); increment(false); }
pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0xf0, %rsp movq %rdx, %r15 movq %rsi, %r12 movq %rdi, %rbx cmpl $0x0, 0x38(%rdi) js 0x26e60 leaq 0x28(%rbx), %r14 movq 0x8(%rbx), %rax movq (%rax), %rdi movq (%rdi), %rax callq *(%rax) leaq 0x10(%rsp), %r13 movq %r13, %rdi movq %r14, %rsi movq %rax, %rdx callq 0xc2a84 movq %r13, %rdi callq 0x9872e testb %al, %al je 0x26f01 leaq 0x10(%rsp), %rdi callq 0xc0bea movl 0x38(%rbx), %esi addl $0x2, %esi cmpl %esi, %eax jl 0x26f2f leaq 0x10(%rsp), %rdi movq %r12, %rdx callq 0xc150c movl 0x38(%rbx), %esi addl $0x3, %esi leaq 0x10(%rsp), %rdi movq %r15, %rdx callq 0xc150c leaq 0x30(%rsp), %r12 movq %r12, %rdi movq %r14, %rsi callq 0x2905c leaq 0x10(%rbx), %r15 movq %r15, %rdx cmpq %r15, 0x10(%rbx) je 0x26e05 movq 0x18(%rbx), %rdx movq %rbx, %rdi movq %r12, %rsi callq 0x25e1a leaq 0x38(%rsp), %rdi callq 0x1cf2a leaq 0x20(%rsp), %r12 movq %r12, %rdi movq %r14, %rsi callq 0x2905c cmpq %r15, 0x10(%rbx) je 0x26e34 movq 0x18(%rbx), %r15 movq %rbx, %rdi movq %r12, %rsi movq %r15, %rdx callq 0x265f0 leaq 0x28(%rsp), %rdi callq 0x1cf2a movq %rbx, %rdi xorl %esi, %esi callq 0x254bc leaq 0x18(%rsp), %rdi jmp 0x26eeb movq 0x8(%rbx), %r14 leaq 0x80(%rsp), %r13 movq %r13, %rdi movq %r12, %rsi callq 0x2905c leaq 0x70(%rsp), %r12 movq %r12, %rdi movq %r15, %rsi callq 0x2905c leaq 0x90(%rsp), %rdi movq %r14, %rsi movq %r13, %rdx movq %r12, %rcx callq 0x26fc2 leaq 0x90(%rsp), %rdi callq 0x28e86 leaq 0x78(%rsp), %rdi callq 0x1cf2a leaq 0x88(%rsp), %rdi callq 0x1cf2a movq 0x8(%rbx), %rsi addq $0x18, %rsi leaq 0x60(%rsp), %r14 movq %r14, %rdi callq 0x2905c pushq $0x1 popq %rdx movq %rbx, %rdi movq %r14, %rsi xorl %ecx, %ecx callq 0x25842 leaq 0x68(%rsp), %rdi callq 0x1cf2a addq $0xf0, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 retq movq 0x8(%rbx), %rax movq 0x8(%rax), %rbx leaq 0xe6572(%rip), %rsi # 0x10d482 leaq 0x40(%rsp), %rdi leaq 0xf(%rsp), %rdx callq 0x1b660 leaq 0x40(%rsp), %rdx movq %rbx, %rdi movq %r14, %rsi callq 0x25192 movq 0x8(%rbx), %rax movq 0x8(%rax), %rbx leaq 0xe6561(%rip), %rsi # 0x10d49f leaq 0x40(%rsp), %rdi leaq 0xf(%rsp), %rdx callq 0x1b660 leaq 0x40(%rsp), %rdx movq %rbx, %rdi movq %r14, %rsi callq 0x25192 jmp 0x26f61 jmp 0x26fac movq %rax, %rbx leaq 0x40(%rsp), %rdi callq 0x19e78 jmp 0x26faf jmp 0x26fac movq %rax, %rbx leaq 0x68(%rsp), %rdi jmp 0x26fb4 movq %rax, %rbx leaq 0x78(%rsp), %rdi callq 0x1cf2a leaq 0x88(%rsp), %rdi jmp 0x26fb4 movq %rax, %rbx leaq 0x28(%rsp), %rdi jmp 0x26fa5 movq %rax, %rbx leaq 0x38(%rsp), %rdi callq 0x1cf2a jmp 0x26faf movq %rax, %rbx leaq 0x18(%rsp), %rdi callq 0x1cf2a movq %rbx, %rdi callq 0x19750 nop
/qpdf[P]qpdf/libqpdf/NNTree.cc
NNTreeIterator::remove()
bool NNTreeIterator::valid() const { return this->item_number >= 0; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x98, %rsp cmpl $0x0, 0x38(%rdi) js 0x274d8 movq %rdi, %r12 leaq 0x28(%rdi), %r14 movq 0x8(%rdi), %rax movq (%rax), %rdi movq (%rdi), %rax callq *(%rax) leaq 0x48(%rsp), %rbx movq %rbx, %rdi movq %r14, %rsi movq %rax, %rdx callq 0xc2a84 movq %rbx, %rdi callq 0xc0bea movl %eax, %r15d movl 0x38(%r12), %esi leal 0x2(%rsi), %eax cmpl %r15d, %eax jg 0x27508 leaq 0x48(%rsp), %rdi callq 0xc16e0 movl 0x38(%r12), %esi leaq 0x48(%rsp), %rdi callq 0xc16e0 cmpl $0x3, %r15d jl 0x27259 leal -0x2(%r15), %ebp movl 0x38(%r12), %eax testl %eax, %eax sete %cl cmpl %ebp, %eax sete %dl orb %cl, %dl cmpb $0x1, %dl jne 0x27239 leaq 0x88(%rsp), %rbx movq %rbx, %rdi movq %r14, %rsi callq 0x2905c leaq 0x10(%r12), %rdx cmpq %rdx, 0x10(%r12) je 0x2721c movq 0x18(%r12), %rdx movq %r12, %rdi movq %rbx, %rsi callq 0x25e1a leaq 0x90(%rsp), %rdi callq 0x1cf2a movl 0x38(%r12), %eax cmpl %ebp, %eax jne 0x27310 addl $-0x4, %r15d movl %r15d, 0x38(%r12) movq %r12, %rdi xorl %esi, %esi callq 0x254bc jmp 0x274bc leaq 0x10(%r12), %rax movq %rax, 0x40(%rsp) cmpq %rax, 0x10(%r12) je 0x27326 movq %r12, 0x8(%rsp) leaq 0x10(%rsp), %rbx movq 0x40(%rsp), %r12 movq 0x8(%rsp), %rax cmpq %r12, 0x10(%rax) je 0x27291 movq 0x8(%rsp), %rax movq 0x18(%rax), %r12 movq 0x8(%r12), %r14 movq %rbx, %rdi leaq 0xe6394(%rip), %rsi # 0x10d634 leaq 0x7(%rsp), %rdx callq 0x1b660 leaq 0x10(%r12), %r15 leaq 0x30(%rsp), %r13 movq %r13, %rdi movq %r15, %rsi movq %rbx, %rdx callq 0xc2a84 movq %rbx, %rbp movq %rbx, %rdi callq 0x19e78 movl 0x20(%r12), %esi movq %r13, %rdi callq 0xc16e0 movq %r13, %rdi callq 0xc0bea movl %eax, %ebx testl %eax, %eax jg 0x2733f movq 0x40(%rsp), %r12 cmpq %r12, %r14 je 0x27403 movq %r12, %rdi callq 0x28e60 leaq 0x38(%rsp), %rdi callq 0x1cf2a movq %rbp, %rbx jmp 0x2727d jge 0x27537 pushq $0x1 popq %rsi movq %r12, %rdi callq 0x24fe8 jmp 0x274bc movq 0x8(%r12), %rsi addq $0x18, %rsi pushq $-0x1 popq %rdx movq %r12, %rdi callq 0x25df2 jmp 0x274bc movl 0x20(%r12), %edx testl %edx, %edx setne %al cmpl %ebx, %edx setne %cl testb %cl, %al jne 0x27384 leaq 0x78(%rsp), %r13 movq %r13, %rdi movq %r15, %rsi callq 0x2905c movq 0x8(%rsp), %rdi movq %r13, %rsi movq %r14, %rdx callq 0x25e1a leaq 0x80(%rsp), %rdi callq 0x1cf2a movl 0x20(%r12), %edx cmpl %ebx, %edx jne 0x27485 xorps %xmm0, %xmm0 leaq 0x10(%rsp), %rsi movaps %xmm0, (%rsi) pushq $-0x1 popq %rdx movq 0x8(%rsp), %rdi callq 0x25df2 leaq 0x18(%rsp), %rdi callq 0x1cf2a movl 0x20(%r12), %edx decl %edx movl %edx, 0x20(%r12) leaq 0x68(%rsp), %rdi leaq 0x30(%rsp), %rsi callq 0xc0c96 movq 0x8(%rsp), %rbx leaq 0x68(%rsp), %rsi pushq $0x1 popq %rcx movq %rbx, %rdi xorl %edx, %edx callq 0x25842 leaq 0x70(%rsp), %rdi callq 0x1cf2a cmpl $0x0, 0x38(%rbx) js 0x274b2 movq %rbx, %rdi xorl %esi, %esi callq 0x254bc jmp 0x274b2 leaq 0xe622a(%rip), %rsi # 0x10d634 leaq 0x10(%rsp), %rdi leaq 0x7(%rsp), %rdx callq 0x1b660 leaq 0x10(%rsp), %rsi movq %r15, %rdi callq 0xc2fa8 movq 0x8(%rsp), %r14 leaq 0x10(%rsp), %rdi callq 0x19e78 movq 0x8(%r14), %rax movq (%rax), %rdi movq (%rdi), %rax callq *(%rax) movq %rax, %rbx leaq 0x10(%rsp), %rdi callq 0x9b194 leaq 0x10(%rsp), %rdx movq %r15, %rdi movq %rbx, %rsi callq 0xc2da0 leaq 0x18(%rsp), %rdi callq 0x1cf2a movq %r12, %rdi callq 0x28eb4 movq 0x8(%r14), %rsi addq $0x18, %rsi pushq $-0x1 popq %rdx movq %r14, %rdi callq 0x25df2 jmp 0x274b2 leaq 0x58(%rsp), %rdi leaq 0x30(%rsp), %rsi callq 0xc0c96 movq 0x8(%rsp), %rdi leaq 0x58(%rsp), %rsi pushq $0x1 popq %rcx movl %ecx, %edx callq 0x25842 leaq 0x60(%rsp), %rdi callq 0x1cf2a leaq 0x38(%rsp), %rdi callq 0x1cf2a leaq 0x50(%rsp), %rdi callq 0x1cf2a addq $0x98, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq pushq $0x10 popq %rdi callq 0x19400 movq %rax, %r14 leaq 0xe5fd6(%rip), %rsi # 0x10d4c0 movq %rax, %rdi callq 0x199a0 movq 0x18aaef(%rip), %rsi # 0x1b1fe8 movq 0x18aac0(%rip), %rdx # 0x1b1fc0 movq %r14, %rdi callq 0x19720 movq 0x8(%r12), %rax movq 0x8(%rax), %rbx leaq 0xe5fd3(%rip), %rsi # 0x10d4eb leaq 0x10(%rsp), %rdi leaq 0x30(%rsp), %rdx callq 0x1b660 leaq 0x10(%rsp), %rdx movq %rbx, %rdi movq %r14, %rsi callq 0x25192 pushq $0x10 popq %rdi callq 0x19400 movq %rax, %r14 leaq 0xe5fd1(%rip), %rsi # 0x10d51a movq %rax, %rdi callq 0x199a0 movq 0x18aa90(%rip), %rsi # 0x1b1fe8 movq 0x18aa61(%rip), %rdx # 0x1b1fc0 movq %r14, %rdi callq 0x19720 movq %rax, %rbx leaq 0x70(%rsp), %rdi jmp 0x2759f movq %rax, %rbx leaq 0x60(%rsp), %rdi jmp 0x2759f jmp 0x27597 movq %rax, %rbx leaq 0x80(%rsp), %rdi jmp 0x2759f movq %rax, %rbx movq %r14, %rdi callq 0x19a90 jmp 0x275fe movq %rax, %rbx leaq 0x18(%rsp), %rdi callq 0x1cf2a jmp 0x275e5 jmp 0x275e2 movq %rax, %rbx leaq 0x10(%rsp), %rdi callq 0x19e78 jmp 0x275e5 jmp 0x275e2 movq %rax, %rbx leaq 0x90(%rsp), %rdi jmp 0x275ea jmp 0x275f1 jmp 0x275dd movq %rax, %rbx movq %r14, %rdi callq 0x19a90 jmp 0x27608 jmp 0x275e2 jmp 0x275dd jmp 0x275e2 movq %rax, %rbx jmp 0x275fe movq %rax, %rbx leaq 0x38(%rsp), %rdi callq 0x1cf2a jmp 0x275fe movq %rax, %rbx leaq 0x10(%rsp), %rdi callq 0x19e78 leaq 0x50(%rsp), %rdi callq 0x1cf2a movq %rbx, %rdi callq 0x19750
/qpdf[P]qpdf/libqpdf/NNTree.cc
NNTreeImpl::NNTreeImpl(NNTreeDetails const&, QPDF&, QPDFObjectHandle&, bool)
NNTreeImpl::NNTreeImpl( NNTreeDetails const& details, QPDF& qpdf, QPDFObjectHandle& oh, bool auto_repair) : details(details), qpdf(qpdf), split_threshold(32), oh(oh), auto_repair(auto_repair) { }
pushq %r14 pushq %rbx pushq %rax movl %r8d, %ebx movq %rdi, %r14 movq %rsi, (%rdi) movq %rdx, 0x8(%rdi) movl $0x20, 0x10(%rdi) addq $0x18, %rdi movq %rcx, %rsi callq 0x2905c movb %bl, 0x28(%r14) addq $0x8, %rsp popq %rbx popq %r14 retq
/qpdf[P]qpdf/libqpdf/NNTree.cc
NNTreeImpl::withinLimits(QPDFObjectHandle, QPDFObjectHandle)
int NNTreeImpl::withinLimits(QPDFObjectHandle key, QPDFObjectHandle node) { int result = 0; auto limits = node.getKey("/Limits"); if (limits.isArray() && (limits.getArrayNItems() >= 2) && details.keyValid(limits.getArrayItem(0)) && details.keyValid(limits.getArrayItem(1))) { if (details.compareKeys(key, limits.getArrayItem(0)) < 0) { result = -1; } else if (details.compareKeys(key, limits.getArrayItem(1)) > 0) { result = 1; } } else { QTC::TC("qpdf", "NNTree missing limits"); error(qpdf, node, "node is missing /Limits"); } return result; }
pushq %rbp pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0xa0, %rsp movq %rdx, %r15 movq %rsi, %r14 movq %rdi, %rbx leaq 0xe5de9(%rip), %rsi # 0x10d64a leaq 0x80(%rsp), %rdi leaq 0xf(%rsp), %rdx callq 0x1b660 leaq 0x10(%rsp), %rdi leaq 0x80(%rsp), %rdx movq %r15, %rsi callq 0xc2a84 leaq 0x80(%rsp), %rdi callq 0x19e78 leaq 0x10(%rsp), %rdi callq 0x9872e testb %al, %al je 0x279f1 leaq 0x10(%rsp), %rdi callq 0xc0bea cmpl $0x2, %eax jl 0x279f1 movq (%rbx), %r12 leaq 0x20(%rsp), %rdi leaq 0x10(%rsp), %rsi xorl %edx, %edx callq 0xc0c96 movq (%r12), %rax leaq 0x20(%rsp), %rsi movq %r12, %rdi callq *0x8(%rax) testb %al, %al je 0x279e7 movq (%rbx), %r12 leaq 0x70(%rsp), %rdi leaq 0x10(%rsp), %rsi pushq $0x1 popq %rdx callq 0xc0c96 movq (%r12), %rax leaq 0x70(%rsp), %rsi movq %r12, %rdi callq *0x8(%rax) movl %eax, %ebp leaq 0x78(%rsp), %rdi callq 0x1cf2a leaq 0x28(%rsp), %rdi callq 0x1cf2a testb %bpl, %bpl je 0x279f1 movq (%rbx), %r15 leaq 0x60(%rsp), %rdi movq %r14, %rsi callq 0x2905c leaq 0x50(%rsp), %rdi leaq 0x10(%rsp), %rsi xorl %edx, %edx callq 0xc0c96 movq (%r15), %rax leaq 0x60(%rsp), %rsi leaq 0x50(%rsp), %rdx movq %r15, %rdi callq *0x10(%rax) movl %eax, %ebp leaq 0x58(%rsp), %rdi callq 0x1cf2a leaq 0x68(%rsp), %rdi callq 0x1cf2a testl %ebp, %ebp js 0x279c8 movq (%rbx), %rbx leaq 0x40(%rsp), %rdi movq %r14, %rsi callq 0x2905c leaq 0x30(%rsp), %rdi leaq 0x10(%rsp), %rsi pushq $0x1 popq %rdx callq 0xc0c96 movq (%rbx), %rax leaq 0x40(%rsp), %rsi leaq 0x30(%rsp), %rdx movq %rbx, %rdi callq *0x10(%rax) xorl %ebx, %ebx testl %eax, %eax setg %bl leaq 0x38(%rsp), %rdi callq 0x1cf2a leaq 0x48(%rsp), %rdi callq 0x1cf2a jmp 0x279cb pushq $-0x1 popq %rbx leaq 0x18(%rsp), %rdi callq 0x1cf2a movl %ebx, %eax addq $0xa0, %rsp popq %rbx popq %r12 popq %r14 popq %r15 popq %rbp retq leaq 0x28(%rsp), %rdi callq 0x1cf2a movq 0x8(%rbx), %rbx leaq 0xe5c3e(%rip), %rsi # 0x10d63a leaq 0x80(%rsp), %rdi leaq 0xf(%rsp), %rdx callq 0x1b660 leaq 0x80(%rsp), %rdx movq %rbx, %rdi movq %r15, %rsi callq 0x25192 movq %rax, %rbx leaq 0x38(%rsp), %rdi callq 0x1cf2a jmp 0x27a33 movq %rax, %rbx leaq 0x48(%rsp), %rdi jmp 0x27a81 movq %rax, %rbx leaq 0x58(%rsp), %rdi callq 0x1cf2a jmp 0x27a4c movq %rax, %rbx leaq 0x68(%rsp), %rdi jmp 0x27a81 movq %rax, %rbx leaq 0x78(%rsp), %rdi callq 0x1cf2a jmp 0x27a7c movq %rax, %rbx leaq 0x80(%rsp), %rdi callq 0x19e78 jmp 0x27aa9 movq %rax, %rbx jmp 0x27aa9 movq %rax, %rbx leaq 0x28(%rsp), %rdi callq 0x1cf2a jmp 0x27a9f movq %rax, %rbx leaq 0x80(%rsp), %rdi callq 0x19e78 jmp 0x27a9f jmp 0x27a9c movq %rax, %rbx leaq 0x18(%rsp), %rdi callq 0x1cf2a movq %rbx, %rdi callq 0x19750 nop
/qpdf[P]qpdf/libqpdf/NNTree.cc
NNTreeImpl::repair()
void NNTreeImpl::repair() { auto new_node = QPDFObjectHandle::newDictionary(); new_node.replaceKey(details.itemsKey(), QPDFObjectHandle::newArray()); NNTreeImpl repl(details, qpdf, new_node, false); for (auto const& i: *this) { repl.insert(i.first, i.second); } this->oh.replaceKey("/Kids", new_node.getKey("/Kids")); this->oh.replaceKey(details.itemsKey(), new_node.getKey(details.itemsKey())); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x1a8, %rsp # imm = 0x1A8 movq %rdi, %rbx leaq 0x10(%rsp), %rdi callq 0x9c81e movq %rbx, 0x20(%rsp) movq (%rbx), %rdi movq (%rdi), %rax callq *(%rax) movq %rax, %rbx leaq 0x58(%rsp), %rdi callq 0x9b194 leaq 0x10(%rsp), %rdi leaq 0x58(%rsp), %rdx movq %rbx, %rsi callq 0xc2da0 leaq 0x60(%rsp), %rdi callq 0x1cf2a movq 0x20(%rsp), %rbx movq (%rbx), %rsi movq 0x8(%rbx), %rdx leaq 0x118(%rsp), %rdi leaq 0x10(%rsp), %rcx xorl %r8d, %r8d callq 0x276b8 leaq 0x58(%rsp), %rdi movq %rbx, %rsi callq 0x276ec leaq 0x1841ad(%rip), %rax # 0x1ac098 leaq 0xc8(%rsp), %rcx movq %rax, -0x10(%rcx) movq %rbx, -0x8(%rcx) movq %rcx, 0x8(%rcx) movq %rcx, (%rcx) xorps %xmm0, %xmm0 andq $0x0, 0x20(%rcx) movups %xmm0, 0x10(%rcx) orl $-0x1, 0x28(%rcx) movups %xmm0, 0x30(%rcx) movups %xmm0, 0x40(%rcx) leaq 0x58(%rsp), %r12 leaq 0x48(%rsp), %rbp leaq 0x38(%rsp), %rbx leaq 0x148(%rsp), %r14 leaq 0x118(%rsp), %r15 movq %r12, %rdi leaq 0xb8(%rsp), %rsi callq 0x28f76 testb %al, %al je 0x27fa9 movq %r12, %rdi callq 0x27632 movq %rax, %r13 movq %rbp, %rdi movq %rax, %rsi callq 0x2905c addq $0x10, %r13 movq %rbx, %rdi movq %r13, %rsi callq 0x2905c movq %r14, %rdi movq %r15, %rsi movq %rbp, %rdx movq %rbx, %rcx callq 0x2815c movq %r14, %rdi callq 0x28e86 leaq 0x40(%rsp), %rdi callq 0x1cf2a leaq 0x50(%rsp), %rdi callq 0x1cf2a movq %r12, %rdi callq 0x27610 jmp 0x27f39 leaq 0xb8(%rsp), %rdi callq 0x28e86 leaq 0x58(%rsp), %rdi callq 0x28e86 leaq 0xe566d(%rip), %rsi # 0x10d634 leaq 0x58(%rsp), %rdi leaq 0xf(%rsp), %rdx callq 0x1b660 leaq 0xe5657(%rip), %rsi # 0x10d634 leaq 0xb8(%rsp), %rdi leaq 0xe(%rsp), %rdx callq 0x1b660 leaq 0x28(%rsp), %rdi leaq 0x10(%rsp), %rsi leaq 0xb8(%rsp), %rdx callq 0xc2a84 movq 0x20(%rsp), %r15 leaq 0x18(%r15), %r14 leaq 0x58(%rsp), %rsi leaq 0x28(%rsp), %rdx movq %r14, %rdi callq 0xc2da0 leaq 0x30(%rsp), %rdi callq 0x1cf2a leaq 0xb8(%rsp), %rdi callq 0x19e78 leaq 0x58(%rsp), %rdi callq 0x19e78 movq (%r15), %rdi movq (%rdi), %rax callq *(%rax) movq %rax, %rbx movq (%r15), %rdi movq (%rdi), %rax callq *(%rax) leaq 0x58(%rsp), %rdi leaq 0x10(%rsp), %rsi movq %rax, %rdx callq 0xc2a84 leaq 0x58(%rsp), %rdx movq %r14, %rdi movq %rbx, %rsi callq 0xc2da0 leaq 0x60(%rsp), %rdi callq 0x1cf2a leaq 0x138(%rsp), %rdi callq 0x1cf2a leaq 0x18(%rsp), %rdi callq 0x1cf2a addq $0x1a8, %rsp # imm = 0x1A8 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq %rax, %rbx leaq 0x60(%rsp), %rdi callq 0x1cf2a jmp 0x2813d jmp 0x28103 movq %rax, %rbx leaq 0x30(%rsp), %rdi callq 0x1cf2a jmp 0x280d0 movq %rax, %rbx leaq 0xb8(%rsp), %rdi callq 0x19e78 jmp 0x280e2 movq %rax, %rbx leaq 0x58(%rsp), %rdi callq 0x19e78 jmp 0x2813d jmp 0x28103 jmp 0x28103 movq %rax, %rbx leaq 0x60(%rsp), %rdi jmp 0x28145 jmp 0x280fe movq %rax, %rbx jmp 0x2814a movq %rax, %rbx jmp 0x2813d jmp 0x28123 movq %rax, %rbx leaq 0x40(%rsp), %rdi callq 0x1cf2a leaq 0x50(%rsp), %rdi callq 0x1cf2a jmp 0x28126 movq %rax, %rbx leaq 0xb8(%rsp), %rdi callq 0x28e86 leaq 0x58(%rsp), %rdi callq 0x28e86 leaq 0x138(%rsp), %rdi callq 0x1cf2a leaq 0x18(%rsp), %rdi callq 0x1cf2a movq %rbx, %rdi callq 0x19750
/qpdf[P]qpdf/libqpdf/NNTree.cc
QPDF::writeHGeneric(BitWriter&, QPDF::HGeneric&)
void QPDF::writeHGeneric(BitWriter& w, HGeneric& t) { w.writeBitsInt(t.first_object, 32); // 1 w.writeBits(toULL(t.first_object_offset), 32); // 2 w.writeBitsInt(t.nobjects, 32); // 3 w.writeBitsInt(t.group_length, 32); // 4 }
pushq %r15 pushq %r14 pushq %rbx movq %rdx, %rbx movq %rsi, %r14 movl (%rdx), %esi pushq $0x20 popq %r15 movq %r14, %rdi movq %r15, %rdx callq 0x1bfa6 leaq 0x8(%rbx), %rdi callq 0xbf9c2 movq %r14, %rdi movq %rax, %rsi movq %r15, %rdx callq 0x1be94 movl 0x10(%rbx), %esi movq %r14, %rdi movq %r15, %rdx callq 0x1bfa6 movl 0x14(%rbx), %esi movq %r14, %rdi movq %r15, %rdx popq %rbx popq %r14 popq %r15 jmp 0x1bfa6
/qpdf[P]qpdf/libqpdf/QPDF_linearization.cc
ObjTable<QPDFWriter::NewObject>::element(unsigned long) const
inline T const& element(size_t idx) const { static const size_t max_size = std::vector<T>::max_size(); if (idx < std::vector<T>::size()) { return std::vector<T>::operator[](idx); } if (idx < max_size) { return sparse_elements.at(idx); } throw std::runtime_error("Impossibly large object id encountered accessing ObjTable"); return element(0); // doesn't return }
pushq %r14 pushq %rbx pushq %rax movq %rdi, %rbx movq %rsi, (%rsp) movb 0xd4d65(%rip), %al # 0x1b3428 testb %al, %al je 0xde707 movq (%rsp), %rcx movq (%rbx), %rax movq 0x8(%rbx), %rdx subq %rax, %rdx sarq $0x5, %rdx cmpq %rdx, %rcx jae 0xde6e7 shlq $0x5, %rcx addq %rcx, %rax jmp 0xde6ff cmpq 0xd4d32(%rip), %rcx # 0x1b3420 jae 0xde736 addq $0x18, %rbx movq %rsp, %rsi movq %rbx, %rdi callq 0xde77a addq $0x8, %rsp popq %rbx popq %r14 retq leaq 0xd4d1a(%rip), %rdi # 0x1b3428 callq 0x193c0 testl %eax, %eax je 0xde6c7 movabsq $0x3ffffffffffffff, %rax # imm = 0x3FFFFFFFFFFFFFF movq %rax, 0xd4cf8(%rip) # 0x1b3420 leaq 0xd4cf9(%rip), %rdi # 0x1b3428 callq 0x19690 jmp 0xde6c7 pushq $0x10 popq %rdi callq 0x19400 movq %rax, %rbx leaq 0x4ba64(%rip), %rsi # 0x12a1ac movq %rax, %rdi callq 0x192c0 movq 0xd3851(%rip), %rsi # 0x1b1fa8 movq 0xd381a(%rip), %rdx # 0x1b1f78 movq %rbx, %rdi callq 0x19720 movq %rax, %r14 movq %rbx, %rdi callq 0x19a90 movq %r14, %rdi callq 0x19750 nop
/qpdf[P]qpdf/libqpdf/qpdf/ObjTable.hh
QPDF::parse(char const*)
void QPDF::parse(char const* password) { if (password) { m->encp->provided_password = password; } // Find the header anywhere in the first 1024 bytes of the file. PatternFinder hf(*this, &QPDF::findHeader); if (!m->file->findFirst("%PDF-", 0, 1024, hf)) { QTC::TC("qpdf", "QPDF not a pdf file"); warn(damagedPDF("", -1, "can't find PDF header")); // QPDFWriter writes files that usually require at least version 1.2 for /FlateDecode m->pdf_version = "1.2"; } // PDF spec says %%EOF must be found within the last 1024 bytes of/ the file. We add an extra // 30 characters to leave room for the startxref stuff. m->file->seek(0, SEEK_END); qpdf_offset_t end_offset = m->file->tell(); m->xref_table_max_offset = end_offset; // Sanity check on object ids. All objects must appear in xref table / stream. In all realistic // scenarios at least 3 bytes are required. if (m->xref_table_max_id > m->xref_table_max_offset / 3) { m->xref_table_max_id = static_cast<int>(m->xref_table_max_offset / 3); } qpdf_offset_t start_offset = (end_offset > 1054 ? end_offset - 1054 : 0); PatternFinder sf(*this, &QPDF::findStartxref); qpdf_offset_t xref_offset = 0; if (m->file->findLast("startxref", start_offset, 0, sf)) { xref_offset = QUtil::string_to_ll(readToken(*m->file).getValue().c_str()); } try { if (xref_offset == 0) { QTC::TC("qpdf", "QPDF can't find startxref"); throw damagedPDF("", -1, "can't find startxref"); } try { read_xref(xref_offset); } catch (QPDFExc&) { throw; } catch (std::exception& e) { throw damagedPDF("", -1, std::string("error reading xref: ") + e.what()); } } catch (QPDFExc& e) { if (m->attempt_recovery) { reconstruct_xref(e, xref_offset > 0); QTC::TC("qpdf", "QPDF reconstructed xref table"); } else { throw; } } initializeEncryption(); m->parsed = true; if (m->xref_table.size() > 0 && !getRoot().getKey("/Pages").isDictionary()) { // QPDFs created from JSON have an empty xref table and no root object yet. throw damagedPDF("", -1, "unable to find page tree"); } }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x108, %rsp # imm = 0x108 movq %rdi, %rbx testq %rsi, %rsi je 0xdeae4 movq (%rbx), %rax movq 0x108(%rax), %rdi addq $0x50, %rdi callq 0x19df0 leaq 0xd203d(%rip), %r14 # 0x1b0b28 leaq 0xe8(%rsp), %r8 movq %r14, (%r8) movq %rbx, 0x8(%r8) leaq -0xad39b(%rip), %rax # 0x31766 movq %rax, 0x10(%r8) andq $0x0, 0x18(%r8) movq (%rbx), %rax movq 0xb0(%rax), %rdi leaq 0x2ff0b(%rip), %rsi # 0x10ea26 movl $0x400, %ecx # imm = 0x400 xorl %edx, %edx callq 0x1de92 testb %al, %al jne 0xdebbd leaq 0x4b392(%rip), %rsi # 0x129ec8 leaq 0xc8(%rsp), %rdi leaq 0x28(%rsp), %rdx callq 0x1b660 leaq 0x4eaf9(%rip), %rsi # 0x12d648 leaq 0x8(%rsp), %rdi leaq 0x6(%rsp), %rdx callq 0x1b660 leaq 0x48(%rsp), %rdi leaq 0xc8(%rsp), %rdx pushq $-0x1 popq %rcx leaq 0x8(%rsp), %r8 movq %rbx, %rsi callq 0x32b44 leaq 0x48(%rsp), %rsi movq %rbx, %rdi callq 0x31918 leaq 0x48(%rsp), %rdi callq 0x1dc50 leaq 0x8(%rsp), %rdi callq 0x19e78 leaq 0xc8(%rsp), %rdi callq 0x19e78 movl $0x118, %edi # imm = 0x118 addq (%rbx), %rdi leaq 0x4a8e3(%rip), %rsi # 0x12949b callq 0x19df0 movq (%rbx), %rax movq 0xb0(%rax), %rdi movq (%rdi), %rax pushq $0x2 popq %rdx xorl %esi, %esi callq *0x28(%rax) movq (%rbx), %rax movq 0xb0(%rax), %rdi movq (%rdi), %rax callq *0x20(%rax) movq %rax, %rcx movq (%rbx), %rsi movq %rax, 0x170(%rsi) movslq 0x168(%rsi), %rdi pushq $0x3 popq %r8 cqto idivq %r8 cmpq %rdi, %rax jge 0xdec0a movl %eax, 0x168(%rsi) leaq -0x41e(%rcx), %rdx xorl %eax, %eax cmpq $0x41f, %rcx # imm = 0x41F cmovlq %rax, %rdx leaq 0xc8(%rsp), %r8 movq %r14, (%r8) movq %rbx, 0x8(%r8) leaq -0x28c(%rip), %rax # 0xde9a8 movq %rax, 0x10(%r8) andq $0x0, 0x18(%r8) movq 0xb0(%rsi), %rdi leaq 0x4ea1e(%rip), %rsi # 0x12d669 xorl %ecx, %ecx callq 0x1e08c testb %al, %al je 0xded36 movq (%rbx), %rax movq 0xb0(%rax), %rdx leaq 0x48(%rsp), %rdi movq %rbx, %rsi xorl %ecx, %ecx callq 0xdea94 movq 0x50(%rsp), %rdi callq 0xf2879 movq %rax, %r15 leaq 0x48(%rsp), %rdi callq 0x2f12a testq %r15, %r15 je 0xded36 movq %rbx, %rdi movq %r15, %rsi callq 0xdf098 movq %rbx, %rdi callq 0xca13c movq (%rbx), %rax movb $0x1, 0x2d5(%rax) cmpq $0x0, 0x160(%rax) je 0xded24 leaq 0x28(%rsp), %rdi movq %rbx, %rsi callq 0x33752 leaq 0x37683(%rip), %rsi # 0x116351 leaq 0x48(%rsp), %rdi leaq 0x6(%rsp), %rdx callq 0x1b660 leaq 0x8(%rsp), %rdi leaq 0x28(%rsp), %rsi leaq 0x48(%rsp), %rdx callq 0xc2a84 leaq 0x8(%rsp), %rdi callq 0x9873c movl %eax, %ebp leaq 0x10(%rsp), %rdi callq 0x1cf2a leaq 0x48(%rsp), %rdi callq 0x19e78 leaq 0x30(%rsp), %rdi callq 0x1cf2a testb %bpl, %bpl je 0xdeda7 addq $0x108, %rsp # imm = 0x108 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movl $0x80, %edi callq 0x19400 movq %rax, %r15 leaq 0x4b17e(%rip), %rsi # 0x129ec8 leaq 0x48(%rsp), %rdi leaq 0x28(%rsp), %rdx callq 0x1b660 leaq 0x4e8fe(%rip), %rsi # 0x12d65e leaq 0x8(%rsp), %rdi leaq 0x6(%rsp), %rdx callq 0x1b660 movb $0x1, %bpl leaq 0x48(%rsp), %rdx pushq $-0x1 popq %rcx leaq 0x8(%rsp), %r8 movq %r15, %rdi movq %rbx, %rsi callq 0x32b44 xorl %ebp, %ebp leaq 0xccfdd(%rip), %rsi # 0x1abd70 leaq -0xc114a(%rip), %rdx # 0x1dc50 movq %r15, %rdi callq 0x19720 jmp 0xdf073 movl $0x80, %edi callq 0x19400 movq %rax, %r15 leaq 0x4b10d(%rip), %rsi # 0x129ec8 leaq 0x48(%rsp), %rdi leaq 0x28(%rsp), %rdx callq 0x1b660 leaq 0x4e8b7(%rip), %rsi # 0x12d688 leaq 0x8(%rsp), %rdi leaq 0x6(%rsp), %rdx callq 0x1b660 movb $0x1, %bpl leaq 0x48(%rsp), %rdx pushq $-0x1 popq %rcx leaq 0x8(%rsp), %r8 movq %r15, %rdi movq %rbx, %rsi callq 0x32b44 xorl %ebp, %ebp leaq 0xccf6c(%rip), %rsi # 0x1abd70 leaq -0xc11bb(%rip), %rdx # 0x1dc50 movq %r15, %rdi callq 0x19720 jmp 0xdf073 movq %rax, %r14 leaq 0x8(%rsp), %rdi callq 0x19e78 jmp 0xdee2d movq %rax, %r14 movb $0x1, %bpl leaq 0x48(%rsp), %rdi callq 0x19e78 testb %bpl, %bpl jne 0xdee44 jmp 0xdf090 movq %rax, %r14 movq %r15, %rdi callq 0x19a90 jmp 0xdf090 movq %rdx, %r12 movq %rax, %r14 leaq 0x8(%rsp), %rdi callq 0x19e78 jmp 0xdee6c movq %rdx, %r12 movq %rax, %r14 movb $0x1, %bpl leaq 0x48(%rsp), %rdi callq 0x19e78 testb %bpl, %bpl jne 0xdf02c jmp 0xdf034 movq %rax, %r14 leaq 0x48(%rsp), %rdi callq 0x1dc50 jmp 0xdee96 movq %rax, %r14 leaq 0x8(%rsp), %rdi callq 0x19e78 jmp 0xdeea5 movq %rax, %r14 leaq 0xc8(%rsp), %rdi callq 0x19e78 jmp 0xdf090 jmp 0xdf08d movq %rax, %r14 leaq 0x10(%rsp), %rdi callq 0x1cf2a jmp 0xdeece movq %rax, %r14 leaq 0x48(%rsp), %rdi callq 0x19e78 jmp 0xdeedd movq %rax, %r14 leaq 0x30(%rsp), %rdi callq 0x1cf2a jmp 0xdf090 jmp 0xdf08d movq %rdx, %r12 movq %rax, %r14 cmpl $0x2, %r12d je 0xdefa2 cmpl $0x1, %r12d jne 0xdf037 movq %r14, %rdi callq 0x19070 movq %rax, %r14 movl $0x80, %edi callq 0x19400 movq %rax, %r13 leaq 0x4af9e(%rip), %rsi # 0x129ec8 leaq 0x48(%rsp), %rdi leaq 0x6(%rsp), %rdx callq 0x1b660 leaq 0x4e733(%rip), %rsi # 0x12d673 leaq 0x28(%rsp), %rdi leaq 0x7(%rsp), %rdx callq 0x1b660 movq (%r14), %rax movq %r14, %rdi callq *0x10(%rax) leaq 0x8(%rsp), %rdi leaq 0x28(%rsp), %rsi movq %rax, %rdx callq 0x1baf2 movb $0x1, %bpl leaq 0x48(%rsp), %rdx pushq $-0x1 popq %rcx leaq 0x8(%rsp), %r8 movq %r13, %rdi movq %rbx, %rsi callq 0x32b44 xorl %ebp, %ebp leaq 0xccde2(%rip), %rsi # 0x1abd70 leaq -0xc1345(%rip), %rdx # 0x1dc50 movq %r13, %rdi callq 0x19720 jmp 0xdf073 movq %r14, %rdi callq 0x19070 callq 0x19940 jmp 0xdf073 movq %rdx, %r12 movq %rax, %r14 leaq 0x8(%rsp), %rdi callq 0x19e78 jmp 0xdefcf movq %rdx, %r12 movq %rax, %r14 movb $0x1, %bpl leaq 0x28(%rsp), %rdi callq 0x19e78 jmp 0xdefe4 movq %rdx, %r12 movq %rax, %r14 movb $0x1, %bpl leaq 0x48(%rsp), %rdi callq 0x19e78 testb %bpl, %bpl jne 0xdeffb jmp 0xdf003 movq %rdx, %r12 movq %rax, %r14 movq %r13, %rdi callq 0x19a90 callq 0x198b0 jmp 0xdf037 movq %rdx, %r12 movq %rax, %r14 callq 0x198b0 jmp 0xdf037 movq %rax, %r14 leaq 0x48(%rsp), %rdi callq 0x2f12a jmp 0xdf090 movq %rdx, %r12 movq %rax, %r14 movq %r15, %rdi callq 0x19a90 xorl %r15d, %r15d cmpl $0x2, %r12d jne 0xdf090 movq %r14, %rdi callq 0x19070 movq (%rbx), %rcx cmpb $0x1, 0x100(%rcx) jne 0xdf06e xorl %edx, %edx testq %r15, %r15 setg %dl movq %rbx, %rdi movq %rax, %rsi callq 0xdf740 callq 0x198b0 jmp 0xdec9e callq 0x19940 jmp 0xdf08d movq %rax, %r14 callq 0x198b0 jmp 0xdf090 movq %rax, %rdi callq 0x22a35 jmp 0xdf08d jmp 0xdf08d jmp 0xdf08d movq %rax, %r14 movq %r14, %rdi callq 0x19750
/qpdf[P]qpdf/libqpdf/QPDF_objects.cc
QPDF::reconstruct_xref(QPDFExc&, bool)
void QPDF::reconstruct_xref(QPDFExc& e, bool found_startxref) { if (m->reconstructed_xref) { // Avoid xref reconstruction infinite loops. This is getting very hard to reproduce because // qpdf is throwing many fewer exceptions while parsing. Most situations are warnings now. throw e; } // If recovery generates more than 1000 warnings, the file is so severely damaged that there // probably is no point trying to continue. const auto max_warnings = m->warnings.size() + 1000U; auto check_warnings = [this, max_warnings]() { if (m->warnings.size() > max_warnings) { throw damagedPDF("", -1, "too many errors while reconstructing cross-reference table"); } }; m->reconstructed_xref = true; m->in_xref_reconstruction = true; // We may find more objects, which may contain dangling references. m->fixed_dangling_refs = false; warn(damagedPDF("", -1, "file is damaged")); warn(e); warn(damagedPDF("", -1, "Attempting to reconstruct cross-reference table")); // Delete all references to type 1 (uncompressed) objects std::vector<QPDFObjGen> to_delete; for (auto const& iter: m->xref_table) { if (iter.second.getType() == 1) { to_delete.emplace_back(iter.first); } } for (auto const& iter: to_delete) { m->xref_table.erase(iter); } std::vector<std::tuple<int, int, qpdf_offset_t>> found_objects; std::vector<qpdf_offset_t> trailers; std::vector<qpdf_offset_t> startxrefs; m->file->seek(0, SEEK_END); qpdf_offset_t eof = m->file->tell(); m->file->seek(0, SEEK_SET); // Don't allow very long tokens here during recovery. All the interesting tokens are covered. static size_t const MAX_LEN = 10; while (m->file->tell() < eof) { QPDFTokenizer::Token t1 = readToken(*m->file, MAX_LEN); qpdf_offset_t token_start = m->file->tell() - toO(t1.getValue().length()); if (t1.isInteger()) { auto pos = m->file->tell(); auto t2 = readToken(*m->file, MAX_LEN); if (t2.isInteger() && readToken(*m->file, MAX_LEN).isWord("obj")) { int obj = QUtil::string_to_int(t1.getValue().c_str()); int gen = QUtil::string_to_int(t2.getValue().c_str()); if (obj <= m->xref_table_max_id) { found_objects.emplace_back(obj, gen, token_start); } else { warn(damagedPDF( "", -1, "ignoring object with impossibly large id " + std::to_string(obj))); } } m->file->seek(pos, SEEK_SET); } else if (!m->trailer && t1.isWord("trailer")) { trailers.emplace_back(m->file->tell()); } else if (!found_startxref && t1.isWord("startxref")) { startxrefs.emplace_back(m->file->tell()); } check_warnings(); m->file->findAndSkipNextEOL(); } if (!found_startxref && !startxrefs.empty() && !found_objects.empty() && startxrefs.back() > std::get<2>(found_objects.back())) { try { m->file->seek(startxrefs.back(), SEEK_SET); if (auto offset = QUtil::string_to_ll(readToken(*m->file).getValue().data())) { read_xref(offset); if (getRoot().getKey("/Pages").isDictionary()) { QTC::TC("qpdf", "QPDF startxref more than 1024 before end"); warn(damagedPDF( "", -1, "startxref was more than 1024 bytes before end of file")); initializeEncryption(); m->parsed = true; m->reconstructed_xref = false; return; } } } catch (...) { // ok, bad luck. Do recovery. } } auto rend = found_objects.rend(); for (auto it = found_objects.rbegin(); it != rend; it++) { auto [obj, gen, token_start] = *it; insertXrefEntry(obj, 1, token_start, gen); check_warnings(); } m->deleted_objects.clear(); for (auto it = trailers.rbegin(); it != trailers.rend(); it++) { m->file->seek(*it, SEEK_SET); auto t = readTrailer(); if (!t.isDictionary()) { // Oh well. It was worth a try. } else { if (t.hasKey("/Root")) { m->trailer = t; break; } warn(damagedPDF("trailer", *it, "recovered trailer has no /Root entry")); } check_warnings(); } if (!m->trailer) { qpdf_offset_t max_offset{0}; size_t max_size{0}; // If there are any xref streams, take the last one to appear. for (auto const& iter: m->xref_table) { auto entry = iter.second; if (entry.getType() != 1) { continue; } auto oh = getObject(iter.first); try { if (!oh.isStreamOfType("/XRef")) { continue; } } catch (std::exception&) { continue; } auto offset = entry.getOffset(); auto size = oh.getDict().getKey("/Size").getUIntValueAsUInt(); if (size > max_size || (size == max_size && offset > max_offset)) { max_offset = offset; setTrailer(oh.getDict()); } check_warnings(); } if (max_offset > 0) { try { read_xref(max_offset); } catch (std::exception&) { warn(damagedPDF( "", -1, "error decoding candidate xref stream while recovering damaged file")); } QTC::TC("qpdf", "QPDF recover xref stream"); } } if (!m->trailer || (!m->parsed && !m->trailer.getKey("/Root").isDictionary())) { // Try to find a Root dictionary. As a quick fix try the one with the highest object id. QPDFObjectHandle root; for (auto const& iter: m->obj_cache) { try { if (QPDFObjectHandle(iter.second.object).isDictionaryOfType("/Catalog")) { root = iter.second.object; } } catch (std::exception&) { continue; } } if (root) { if (!m->trailer) { warn(damagedPDF( "", -1, "unable to find trailer dictionary while recovering damaged file")); m->trailer = QPDFObjectHandle::newDictionary(); } m->trailer.replaceKey("/Root", root); } } if (!m->trailer) { // We could check the last encountered object to see if it was an xref stream. If so, we // could try to get the trailer from there. This may make it possible to recover files with // bad startxref pointers even when they have object streams. throw damagedPDF("", -1, "unable to find trailer dictionary while recovering damaged file"); } if (m->xref_table.empty()) { // We cannot check for an empty xref table in parse because empty tables are valid when // creating QPDF objects from JSON. throw damagedPDF("", -1, "unable to find objects while recovering damaged file"); } check_warnings(); if (!m->parsed) { m->parsed = true; getAllPages(); check_warnings(); if (m->all_pages.empty()) { m->parsed = false; throw damagedPDF("", -1, "unable to find any pages while recovering damaged file"); } } m->in_xref_reconstruction = false; // We could iterate through the objects looking for streams and try to find objects inside of // them, but it's probably not worth the trouble. Acrobat can't recover files with any errors // in an xref stream, and this would be a real long shot anyway. If we wanted to do anything // that involved looking at stream contents, we'd also have to call initializeEncryption() here. // It's safe to call it more than once. }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x288, %rsp # imm = 0x288 movl %edx, 0x3c(%rsp) movq %rsi, %r14 movq (%rdi), %rax cmpb $0x1, 0x2d0(%rax) je 0xdfe86 movq %rdi, %rbx movq 0x278(%rax), %rcx subq 0x270(%rax), %rcx sarq $0x7, %rcx addq $0x3e8, %rcx # imm = 0x3E8 movq %rdi, 0xe0(%rsp) movq %rcx, 0xe8(%rsp) movw $0x101, 0x2d0(%rax) # imm = 0x101 movb $0x0, 0x2d2(%rax) leaq 0x4a71d(%rip), %rsi # 0x129ec8 leaq 0xf8(%rsp), %rdi movq %rsp, %rdx callq 0x1b660 leaq 0x4df4c(%rip), %rsi # 0x12d70e leaq 0x160(%rsp), %rdi leaq 0xc0(%rsp), %rdx callq 0x1b660 leaq 0x40(%rsp), %rdi leaq 0xf8(%rsp), %rdx pushq $-0x1 popq %rcx leaq 0x160(%rsp), %r8 movq %rbx, %rsi callq 0x32b44 leaq 0x40(%rsp), %rsi movq %rbx, %rdi callq 0x31918 leaq 0x40(%rsp), %rdi callq 0x1dc50 leaq 0x160(%rsp), %rdi callq 0x19e78 leaq 0xf8(%rsp), %rdi callq 0x19e78 movq %rbx, %rdi movq %r14, %rsi callq 0x31918 leaq 0x4a68e(%rip), %rsi # 0x129ec8 leaq 0xf8(%rsp), %rdi movq %rsp, %rdx callq 0x1b660 leaq 0x4decd(%rip), %rsi # 0x12d71e leaq 0x160(%rsp), %rdi leaq 0xc0(%rsp), %rdx callq 0x1b660 leaq 0x40(%rsp), %rdi leaq 0xf8(%rsp), %rdx pushq $-0x1 popq %rcx leaq 0x160(%rsp), %r8 movq %rbx, %rsi callq 0x32b44 leaq 0x40(%rsp), %rsi movq %rbx, %rdi callq 0x31918 leaq 0x40(%rsp), %rdi callq 0x1dc50 leaq 0x160(%rsp), %rdi callq 0x19e78 leaq 0xf8(%rsp), %rdi callq 0x19e78 xorps %xmm0, %xmm0 leaq 0x260(%rsp), %r14 andq $0x0, 0x10(%r14) movaps %xmm0, (%r14) movq (%rbx), %r12 movq 0x150(%r12), %r15 addq $0x140, %r12 # imm = 0x140 cmpq %r12, %r15 je 0xdf909 leaq 0x28(%r15), %rdi callq 0xbffd2 cmpl $0x1, %eax jne 0xdf8fc leaq 0x20(%r15), %rsi movq %r14, %rdi callq 0xe796e movq %r15, %rdi callq 0x19bb0 movq %rax, %r15 jmp 0xdf8dd movq 0x260(%rsp), %r14 movq 0x268(%rsp), %r15 movl $0x138, %r12d # imm = 0x138 cmpq %r15, %r14 je 0xdf938 movq (%rbx), %rdi addq %r12, %rdi movq %r14, %rsi callq 0xea3e0 addq $0x8, %r14 jmp 0xdf91f xorps %xmm0, %xmm0 andq $0x0, 0x1e0(%rsp) movaps %xmm0, 0x1d0(%rsp) andq $0x0, 0x220(%rsp) movaps %xmm0, 0x210(%rsp) andq $0x0, 0x200(%rsp) movaps %xmm0, 0x1f0(%rsp) movq (%rbx), %rax movq 0xb0(%rax), %rdi movq (%rdi), %rax pushq $0x2 popq %rdx xorl %esi, %esi callq *0x28(%rax) movq (%rbx), %rax movq 0xb0(%rax), %rdi movq (%rdi), %rax callq *0x20(%rax) movq %rax, 0x20(%rsp) movq (%rbx), %rax movq 0xb0(%rax), %rdi movq (%rdi), %rax xorl %esi, %esi xorl %edx, %edx callq *0x28(%rax) leaq 0xf8(%rsp), %r15 pushq $0xa popq %r12 leaq 0x40(%rsp), %r13 movq (%rbx), %rax movq 0xb0(%rax), %rdi movq (%rdi), %rax callq *0x20(%rax) cmpq 0x20(%rsp), %rax jge 0xdfccf movq (%rbx), %rax movq 0xb0(%rax), %rdx movq %r15, %rdi movq %rbx, %rsi movq %r12, %rcx callq 0xdea94 movq (%rbx), %rax movq 0xb0(%rax), %rdi movq (%rdi), %rax callq *0x20(%rax) movq %rax, %rbp movq 0x108(%rsp), %rax movq %rax, 0x40(%rsp) movq %r13, %rdi callq 0x1c7ea subq %rax, %rbp movq %rbp, 0x258(%rsp) cmpl $0x7, 0xf8(%rsp) movq (%rbx), %rax jne 0xdfb94 movq 0xb0(%rax), %rdi movq (%rdi), %rax callq *0x20(%rax) movq %rax, 0x230(%rsp) movq (%rbx), %rax movq 0xb0(%rax), %rdx leaq 0x160(%rsp), %rdi movq %rbx, %rsi movq %r12, %rcx callq 0xdea94 movq %rsp, %rbp cmpl $0x7, 0x160(%rsp) jne 0xdfc7e movq (%rbx), %rax movq 0xb0(%rax), %rdx movq %r13, %rdi movq %rbx, %rsi movq %r12, %rcx callq 0xdea94 movq %rbp, %rdi leaq 0x4e631(%rip), %rsi # 0x12e0ca leaq 0xc0(%rsp), %rdx callq 0x1b660 movq %r13, %rdi movq %rbp, %rsi callq 0x2f118 movl %eax, %ebp movq %rsp, %rdi callq 0x19e78 movq %r13, %rdi callq 0x2f12a testb %bpl, %bpl je 0xdfc7e movq 0x100(%rsp), %rdi callq 0xf2966 movl %eax, 0x28(%rsp) movq 0x168(%rsp), %rdi callq 0xf2966 movl %eax, 0xf4(%rsp) movl 0x28(%rsp), %eax movq (%rbx), %rcx cmpl 0x168(%rcx), %eax jle 0xdfc5c movq %rsp, %rdi leaq 0x4a3ba(%rip), %rsi # 0x129ec8 leaq 0x2f(%rsp), %rdx callq 0x1b660 movl 0x28(%rsp), %esi leaq 0x238(%rsp), %r14 movq %r14, %rdi callq 0x1dbf7 leaq 0xc0(%rsp), %rbp movq %rbp, %rdi leaq 0x4dc10(%rip), %rsi # 0x12d74e movq %r14, %rdx callq 0x1bb11 movq %r13, %rdi movq %rbx, %rsi movq %rsp, %rdx pushq $-0x1 popq %rcx movq %rbp, %r8 callq 0x32b44 movq %rbx, %rdi movq %r13, %rsi callq 0x31918 movq %r13, %rdi callq 0x1dc50 leaq 0xc0(%rsp), %rdi callq 0x19e78 leaq 0x238(%rsp), %rdi callq 0x19e78 movq %rsp, %rdi callq 0x19e78 jmp 0xdfc7e cmpq $0x0, 0x208(%rax) jne 0xdfbf9 movq %r13, %rdi leaq 0x4e366(%rip), %rsi # 0x12df0e leaq 0x160(%rsp), %rdx callq 0x1b660 movq %r15, %rdi movq %r13, %rsi callq 0x2f118 movl %eax, %ebp movq %r13, %rdi callq 0x19e78 testb %bpl, %bpl je 0xdfbf9 movq (%rbx), %rax movq 0xb0(%rax), %rdi movq (%rdi), %rax callq *0x20(%rax) movq %rax, 0x40(%rsp) leaq 0x210(%rsp), %rdi movq %r13, %rsi callq 0xbeb4a jmp 0xdfca5 cmpb $0x0, 0x3c(%rsp) jne 0xdfca5 movq %r13, %rdi leaq 0x4da5b(%rip), %rsi # 0x12d669 leaq 0x160(%rsp), %rdx callq 0x1b660 movq %r15, %rdi movq %r13, %rsi callq 0x2f118 movl %eax, %ebp movq %r13, %rdi callq 0x19e78 testb %bpl, %bpl je 0xdfca5 movq (%rbx), %rax movq 0xb0(%rax), %rdi movq (%rdi), %rax callq *0x20(%rax) movq %rax, 0x40(%rsp) leaq 0x1f0(%rsp), %rdi movq %r13, %rsi callq 0xbeb4a jmp 0xdfca5 leaq 0x1d0(%rsp), %rdi leaq 0x28(%rsp), %rsi leaq 0xf4(%rsp), %rdx leaq 0x258(%rsp), %rcx callq 0xe79a6 movq (%rbx), %rax movq 0xb0(%rax), %rdi movq (%rdi), %rax movq 0x230(%rsp), %rsi xorl %edx, %edx callq *0x28(%rax) leaq 0x160(%rsp), %rdi callq 0x2f12a leaq 0xe0(%rsp), %rdi callq 0xe0c24 movq (%rbx), %rax movq 0xb0(%rax), %rdi movq (%rdi), %rax callq *0x10(%rax) movq %r15, %rdi callq 0x2f12a jmp 0xdf9bd cmpb $0x0, 0x3c(%rsp) jne 0xdff41 movq 0x1f8(%rsp), %rax cmpq %rax, 0x1f0(%rsp) je 0xdff41 movq 0x1d8(%rsp), %rcx cmpq %rcx, 0x1d0(%rsp) je 0xdff41 movq -0x8(%rax), %rsi cmpq -0x10(%rcx), %rsi jle 0xdff41 movq (%rbx), %rax movq 0xb0(%rax), %rdi movq (%rdi), %rax xorl %edx, %edx callq *0x28(%rax) movq (%rbx), %rax movq 0xb0(%rax), %rdx leaq 0x40(%rsp), %rdi movq %rbx, %rsi xorl %ecx, %ecx callq 0xdea94 movq 0x48(%rsp), %rdi callq 0xf2879 movq %rax, %r14 leaq 0x40(%rsp), %rdi callq 0x2f12a testq %r14, %r14 je 0xdff41 movq %rbx, %rdi movq %r14, %rsi callq 0xdf098 leaq 0x160(%rsp), %rdi movq %rbx, %rsi callq 0x33752 leaq 0x365d0(%rip), %rsi # 0x116351 leaq 0x40(%rsp), %rdi movq %rsp, %rdx callq 0x1b660 leaq 0xf8(%rsp), %rdi leaq 0x160(%rsp), %rsi leaq 0x40(%rsp), %rdx callq 0xc2a84 leaq 0xf8(%rsp), %rdi callq 0x9873c movl %eax, %ebp leaq 0x100(%rsp), %rdi callq 0x1cf2a leaq 0x40(%rsp), %rdi callq 0x19e78 leaq 0x168(%rsp), %rdi callq 0x1cf2a testb %bpl, %bpl je 0xdff41 leaq 0x4a0dd(%rip), %rsi # 0x129ec8 leaq 0xf8(%rsp), %rdi movq %rsp, %rdx callq 0x1b660 leaq 0x4d976(%rip), %rsi # 0x12d778 leaq 0x160(%rsp), %rdi leaq 0xc0(%rsp), %rdx callq 0x1b660 leaq 0x40(%rsp), %rdi leaq 0xf8(%rsp), %rdx pushq $-0x1 popq %rcx leaq 0x160(%rsp), %r8 movq %rbx, %rsi callq 0x32b44 leaq 0x40(%rsp), %rsi movq %rbx, %rdi callq 0x31918 leaq 0x40(%rsp), %rdi callq 0x1dc50 leaq 0x160(%rsp), %rdi callq 0x19e78 leaq 0xf8(%rsp), %rdi callq 0x19e78 movq %rbx, %rdi callq 0xca13c movq (%rbx), %rax movb $0x1, 0x2d5(%rax) movb $0x0, 0x2d0(%rax) jmp 0xe0648 movl $0x80, %edi callq 0x19400 movq %rax, %rbx movq %rax, %rdi movq %r14, %rsi callq 0x36d70 leaq 0xcbecb(%rip), %rsi # 0x1abd70 leaq -0xc225c(%rip), %rdx # 0x1dc50 movq %rbx, %rdi callq 0x19720 movq %rax, %r14 leaq 0x40(%rsp), %rdi callq 0x1dc50 jmp 0xdfec6 movq %rax, %r14 leaq 0x160(%rsp), %rdi callq 0x19e78 jmp 0xdfed8 movq %rax, %r14 leaq 0xf8(%rsp), %rdi callq 0x19e78 jmp 0xdff34 jmp 0xdff31 movq %rax, %r14 leaq 0x100(%rsp), %rdi callq 0x1cf2a jmp 0xdfefe movq %rax, %r14 leaq 0x40(%rsp), %rdi callq 0x19e78 jmp 0xdff0d movq %rax, %r14 leaq 0x168(%rsp), %rdi callq 0x1cf2a jmp 0xdff34 jmp 0xdff31 jmp 0xdff31 movq %rax, %r14 leaq 0x40(%rsp), %rdi callq 0x2f12a jmp 0xdff34 jmp 0xdff31 movq %rax, %r14 movq %r14, %rdi callq 0x19070 callq 0x198b0 movq 0x1d0(%rsp), %r15 movq 0x1d8(%rsp), %r12 pushq $0x1 popq %rbp leaq 0xe0(%rsp), %r14 cmpq %r15, %r12 je 0xdff88 movq -0x10(%r12), %rcx movl -0x8(%r12), %r8d movl -0x4(%r12), %esi movq %rbx, %rdi movl %ebp, %edx callq 0xe0cf8 addq $-0x10, %r12 movq %r14, %rdi callq 0xe0c24 jmp 0xdff5c movl $0x178, %edi # imm = 0x178 addq (%rbx), %rdi callq 0xbda50 movq 0x218(%rsp), %r12 leaq 0x40(%rsp), %r13 leaq 0xf8(%rsp), %rbp cmpq 0x210(%rsp), %r12 je 0xe00d4 movq (%rbx), %rax movq 0xb0(%rax), %rdi movq -0x8(%r12), %rsi movq (%rdi), %rax xorl %edx, %edx callq *0x28(%rax) movq %rsp, %r14 movq %r14, %rdi movq %rbx, %rsi callq 0xe0f76 movq %r14, %rdi callq 0x9873c addq $-0x8, %r12 testb %al, %al je 0xe009e movq %r13, %rdi leaq 0x2ecd0(%rip), %rsi # 0x10eccb movq %rbp, %rdx callq 0x1b660 movq %rsp, %rdi movq %r13, %rsi callq 0xc29da movl %eax, %r14d movq %r13, %rdi callq 0x19e78 testb %r14b, %r14b jne 0xe00ba movq %rbp, %r15 movq %rbp, %rdi leaq 0x4dedf(%rip), %rsi # 0x12df0e leaq 0xc0(%rsp), %rdx callq 0x1b660 movq (%r12), %r14 leaq 0x160(%rsp), %rbp movq %rbp, %rdi leaq 0x4d75c(%rip), %rsi # 0x12d7ae leaq 0x238(%rsp), %rdx callq 0x1b660 movq %r13, %rdi movq %rbx, %rsi movq %r15, %rdx movq %r14, %rcx movq %rbp, %r8 callq 0x32b44 movq %rbx, %rdi movq %r13, %rsi callq 0x31918 movq %r13, %rdi callq 0x1dc50 leaq 0x160(%rsp), %rdi callq 0x19e78 movq %r15, %rbp movq %r15, %rdi callq 0x19e78 leaq 0xe0(%rsp), %rdi callq 0xe0c24 leaq 0x8(%rsp), %rdi callq 0x1cf2a jmp 0xdffaa movl $0x208, %edi # imm = 0x208 addq (%rbx), %rdi movq %rsp, %rsi callq 0x29070 leaq 0x8(%rsp), %rdi callq 0x1cf2a movq (%rbx), %r13 cmpq $0x0, 0x208(%r13) jne 0xe02f8 movq 0x150(%r13), %rbp addq $0x140, %r13 # imm = 0x140 movq $0x0, 0x20(%rsp) leaq 0x40(%rsp), %r15 cmpq %r13, %rbp je 0xe02e6 movq 0x38(%rbp), %rax movq %rax, 0x170(%rsp) movups 0x28(%rbp), %xmm0 movaps %xmm0, 0x160(%rsp) leaq 0x160(%rsp), %rdi callq 0xbffd2 cmpl $0x1, %eax jne 0xe0284 movq 0x20(%rbp), %rdx movq %rsp, %rdi movq %rbx, %rsi callq 0xe11f6 movq %r15, %rdi leaq 0x49de6(%rip), %rsi # 0x129f37 leaq 0xc0(%rsp), %rdx callq 0x1b660 leaq 0xf8(%rsp), %r12 movq %r12, %rdi leaq 0x49d58(%rip), %rsi # 0x129ec8 leaq 0x238(%rsp), %rdx callq 0x1b660 movq %rsp, %rdi movq %r15, %rsi movq %r12, %rdx callq 0x989d0 movl %eax, %r14d movq %r12, %rdi callq 0x19e78 movq %r15, %rdi callq 0x19e78 testb %r14b, %r14b je 0xe027a leaq 0x160(%rsp), %rdi callq 0xbffd6 movq %rax, %r14 leaq 0xc0(%rsp), %rdi movq %rsp, %rsi callq 0xc52e6 movq %r15, %rdi leaq 0x30f84(%rip), %rsi # 0x111155 leaq 0x238(%rsp), %rdx callq 0x1b660 leaq 0xf8(%rsp), %r12 movq %r12, %rdi leaq 0xc0(%rsp), %rsi movq %r15, %rdx callq 0xc2a84 movq %r12, %rdi callq 0x98d90 movl %eax, %r12d leaq 0x100(%rsp), %rdi callq 0x1cf2a movq %r15, %rdi callq 0x19e78 leaq 0xc8(%rsp), %rdi callq 0x1cf2a testl %r12d, %r12d setne %al cmpq 0x20(%rsp), %r14 setg %cl orb %al, %cl cmpb $0x1, %cl jne 0xe026d leaq 0x278(%rsp), %rdi movq %rsp, %rsi callq 0xc52e6 movq %rbx, %rdi leaq 0x278(%rsp), %rsi callq 0xe0c0a leaq 0x280(%rsp), %rdi callq 0x1cf2a movq %r14, 0x20(%rsp) leaq 0xe0(%rsp), %rdi callq 0xe0c24 leaq 0x8(%rsp), %rdi callq 0x1cf2a movq %rbp, %rdi callq 0x19bb0 movq %rax, %rbp jmp 0xe0101 movq %rbx, 0x30(%rsp) movq %rdx, %rbx movq %rax, %r14 movq %r12, %rdi callq 0x19e78 jmp 0xe02b4 movq %rbx, 0x30(%rsp) movq %rdx, %rbx movq %rax, %r14 movq %r15, %rdi callq 0x19e78 jmp 0xe02c9 movq %rbx, 0x30(%rsp) movq %rdx, %rbx movq %rax, %r14 cmpl $0x2, %ebx jne 0xe0aa0 movq %r14, %rdi callq 0x19070 callq 0x198b0 movq 0x30(%rsp), %rbx jmp 0xe027a movq 0x20(%rsp), %rsi testq %rsi, %rsi jle 0xe02f8 movq %rbx, %rdi callq 0xdf098 movq (%rbx), %r14 cmpq $0x0, 0x208(%r14) je 0xe037a cmpb $0x0, 0x2d5(%r14) jne 0xe05d9 leaq 0x2e9b1(%rip), %rsi # 0x10eccb leaq 0x40(%rsp), %rdi leaq 0x160(%rsp), %rdx callq 0x1b660 addq $0x208, %r14 # imm = 0x208 leaq 0xf8(%rsp), %rdi leaq 0x40(%rsp), %rdx movq %r14, %rsi callq 0xc2a84 leaq 0xf8(%rsp), %rdi callq 0x9873c movl %eax, %ebp leaq 0x100(%rsp), %rdi callq 0x1cf2a leaq 0x40(%rsp), %rdi callq 0x19e78 movq (%rbx), %r14 testb %bpl, %bpl jne 0xe05d9 movq %rbx, 0x30(%rsp) xorps %xmm0, %xmm0 movq %rsp, %rax movaps %xmm0, (%rax) movq 0x1c0(%r14), %r13 addq $0x1b0, %r14 # imm = 0x1B0 leaq 0x40(%rsp), %rbx leaq 0xf8(%rsp), %r15 movq %r14, 0x20(%rsp) cmpq %r14, %r13 je 0xe04bf leaq 0x28(%r13), %rbp leaq 0x160(%rsp), %rdi movq %rbp, %rsi callq 0x2905c movq %rbx, %rdi leaq 0x2e928(%rip), %rsi # 0x10ecf7 leaq 0xc0(%rsp), %rdx callq 0x1b660 movq %r15, %r12 movq %r15, %rdi leaq 0x49adf(%rip), %rsi # 0x129ec8 leaq 0x238(%rsp), %rdx callq 0x1b660 leaq 0x160(%rsp), %rdi leaq 0x40(%rsp), %rbx movq %rbx, %rsi movq %r12, %rdx callq 0x98890 movl %eax, %r14d movq %r12, %rdi callq 0x19e78 movq %rbx, %rdi callq 0x19e78 leaq 0x168(%rsp), %rdi callq 0x1cf2a testb %r14b, %r14b je 0xe0458 leaq 0x40(%rsp), %rbx movq %rbx, %rdi movq %rbp, %rsi callq 0x2905c movq %rsp, %rdi movq %rbx, %rsi callq 0x2902e leaq 0x48(%rsp), %rdi callq 0x1cf2a movq %r13, %rdi callq 0x19bb0 movq %rax, %r13 movq 0x20(%rsp), %r14 leaq 0x40(%rsp), %rbx jmp 0xe03a8 movq %rdx, %rbp movq %rax, %r14 movq %r12, %rdi callq 0x19e78 jmp 0xe0488 movq %rdx, %rbp movq %rax, %r14 leaq 0x40(%rsp), %rdi callq 0x19e78 jmp 0xe049a movq %rdx, %rbp movq %rax, %r14 leaq 0x168(%rsp), %rdi callq 0x1cf2a cmpl $0x2, %ebp jne 0xe0aa0 movq %r14, %rdi callq 0x19070 callq 0x198b0 jmp 0xe0458 cmpq $0x0, (%rsp) movq 0x30(%rsp), %rbx je 0xe05cc movq (%rbx), %r14 cmpq $0x0, 0x208(%r14) jne 0xe0592 leaq 0x499e1(%rip), %rsi # 0x129ec8 leaq 0xf8(%rsp), %rdi leaq 0xc0(%rsp), %rdx callq 0x1b660 leaq 0x4d313(%rip), %rsi # 0x12d816 leaq 0x160(%rsp), %rdi leaq 0x238(%rsp), %rdx callq 0x1b660 leaq 0x40(%rsp), %rdi leaq 0xf8(%rsp), %rdx pushq $-0x1 popq %rcx leaq 0x160(%rsp), %r8 movq %rbx, %rsi callq 0x32b44 leaq 0x40(%rsp), %rsi movq %rbx, %rdi callq 0x31918 leaq 0x40(%rsp), %rdi callq 0x1dc50 leaq 0x160(%rsp), %rdi callq 0x19e78 leaq 0xf8(%rsp), %rdi callq 0x19e78 leaq 0x40(%rsp), %rdi callq 0x9c81e movl $0x208, %edi # imm = 0x208 addq (%rbx), %rdi leaq 0x40(%rsp), %rsi callq 0x2902e leaq 0x48(%rsp), %rdi callq 0x1cf2a movq (%rbx), %r14 leaq 0x2e732(%rip), %rsi # 0x10eccb leaq 0x40(%rsp), %rdi leaq 0xf8(%rsp), %rdx callq 0x1b660 addq $0x208, %r14 # imm = 0x208 leaq 0x40(%rsp), %rsi movq %rsp, %rdx movq %r14, %rdi callq 0xc2da0 leaq 0x40(%rsp), %rdi callq 0x19e78 leaq 0x8(%rsp), %rdi callq 0x1cf2a movq (%rbx), %r14 cmpq $0x0, 0x208(%r14) je 0xe068e cmpq $0x0, 0x160(%r14) je 0xe0706 leaq 0xe0(%rsp), %rdi callq 0xe0c24 movq (%rbx), %rax cmpb $0x0, 0x2d5(%rax) jne 0xe0641 movb $0x1, 0x2d5(%rax) movq %rbx, %rdi callq 0xef790 leaq 0xe0(%rsp), %rdi callq 0xe0c24 movq (%rbx), %rax movq 0x218(%rax), %rcx cmpq 0x220(%rax), %rcx je 0xe077b movb $0x0, 0x2d1(%rax) leaq 0x1f0(%rsp), %rdi callq 0x30416 leaq 0x210(%rsp), %rdi callq 0x30416 leaq 0x1d0(%rsp), %rdi callq 0xea57c leaq 0x260(%rsp), %rdi callq 0xbd52a addq $0x288, %rsp # imm = 0x288 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movl $0x80, %edi callq 0x19400 movq %rax, %r14 leaq 0x49826(%rip), %rsi # 0x129ec8 leaq 0x40(%rsp), %rdi leaq 0x160(%rsp), %rdx callq 0x1b660 leaq 0x4d15b(%rip), %rsi # 0x12d816 leaq 0xf8(%rsp), %rdi movq %rsp, %rdx callq 0x1b660 movb $0x1, %bpl leaq 0x40(%rsp), %rdx pushq $-0x1 popq %rcx leaq 0xf8(%rsp), %r8 movq %r14, %rdi movq %rbx, %rsi callq 0x32b44 xorl %ebp, %ebp leaq 0xcb67e(%rip), %rsi # 0x1abd70 leaq -0xc2aa9(%rip), %rdx # 0x1dc50 movq %r14, %rdi callq 0x19720 jmp 0xe07f5 movl $0x80, %edi callq 0x19400 movq %rax, %r14 leaq 0x497ae(%rip), %rsi # 0x129ec8 leaq 0x40(%rsp), %rdi leaq 0x160(%rsp), %rdx callq 0x1b660 leaq 0x4d123(%rip), %rsi # 0x12d856 leaq 0xf8(%rsp), %rdi movq %rsp, %rdx callq 0x1b660 movb $0x1, %bpl leaq 0x40(%rsp), %rdx pushq $-0x1 popq %rcx leaq 0xf8(%rsp), %r8 movq %r14, %rdi movq %rbx, %rsi callq 0x32b44 xorl %ebp, %ebp leaq 0xcb606(%rip), %rsi # 0x1abd70 leaq -0xc2b21(%rip), %rdx # 0x1dc50 movq %r14, %rdi callq 0x19720 jmp 0xe07f5 movb $0x0, 0x2d5(%rax) movl $0x80, %edi callq 0x19400 movq %rax, %r14 leaq 0x49732(%rip), %rsi # 0x129ec8 leaq 0x40(%rsp), %rdi leaq 0x160(%rsp), %rdx callq 0x1b660 leaq 0x4d0dc(%rip), %rsi # 0x12d88b leaq 0xf8(%rsp), %rdi movq %rsp, %rdx callq 0x1b660 movb $0x1, %bpl leaq 0x40(%rsp), %rdx pushq $-0x1 popq %rcx leaq 0xf8(%rsp), %r8 movq %r14, %rdi movq %rbx, %rsi callq 0x32b44 xorl %ebp, %ebp leaq 0xcb58a(%rip), %rsi # 0x1abd70 leaq -0xc2b9d(%rip), %rdx # 0x1dc50 movq %r14, %rdi callq 0x19720 jmp 0xe0a9d jmp 0xe0a9d jmp 0xe0a9d movq %rax, %r14 leaq 0x40(%rsp), %rdi callq 0x1dc50 jmp 0xe0816 movq %rax, %r14 leaq 0x160(%rsp), %rdi callq 0x19e78 jmp 0xe0828 movq %rax, %r14 leaq 0xf8(%rsp), %rdi jmp 0xe0993 jmp 0xe0a9d jmp 0xe0936 jmp 0xe0948 cmpl $0x2, %edx jne 0xe0b57 movq %rax, %rdi callq 0x19070 leaq 0x4966c(%rip), %rsi # 0x129ec8 leaq 0xf8(%rsp), %rdi movq %rsp, %rdx callq 0x1b660 leaq 0x4cf60(%rip), %rsi # 0x12d7d3 leaq 0x160(%rsp), %rdi leaq 0xc0(%rsp), %rdx callq 0x1b660 leaq 0x40(%rsp), %rdi leaq 0xf8(%rsp), %rdx pushq $-0x1 popq %rcx leaq 0x160(%rsp), %r8 movq %rbx, %rsi callq 0x32b44 leaq 0x40(%rsp), %rsi movq %rbx, %rdi callq 0x31918 leaq 0x40(%rsp), %rdi callq 0x1dc50 leaq 0x160(%rsp), %rdi callq 0x19e78 leaq 0xf8(%rsp), %rdi callq 0x19e78 callq 0x198b0 jmp 0xe02f8 jmp 0xe0b57 movq %rax, %r15 leaq 0x40(%rsp), %rdi callq 0x1dc50 jmp 0xe08fa movq %rax, %r15 leaq 0x160(%rsp), %rdi callq 0x19e78 jmp 0xe090c movq %rax, %r15 leaq 0xf8(%rsp), %rdi callq 0x19e78 jmp 0xe091e movq %rax, %r15 callq 0x198b0 jmp 0xe0b6c movq %rax, %rdi callq 0x22a35 jmp 0xe09a4 jmp 0xe0936 jmp 0xe0948 movq %rax, %r15 leaq 0xf8(%rsp), %rdi callq 0x19e78 jmp 0xe094e movq %rax, %r15 movb $0x1, %bpl leaq 0x40(%rsp), %rdi callq 0x19e78 testb %bpl, %bpl jne 0xe09a7 jmp 0xe0b6c movq %rax, %r15 leaq 0x100(%rsp), %rdi callq 0x1cf2a jmp 0xe0977 movq %rax, %r15 leaq 0x40(%rsp), %rdi callq 0x19e78 jmp 0xe0b6c jmp 0xe0b57 movq %rax, %r14 leaq 0x40(%rsp), %rdi callq 0x19e78 jmp 0xe0aa0 jmp 0xe0a9d jmp 0xe09a4 movq %rax, %r15 movq %r14, %rdi callq 0x19a90 jmp 0xe0b6c movq %rax, %r15 movq %rbx, %rdi callq 0x19a90 jmp 0xe0ba0 jmp 0xe0b57 jmp 0xe09d1 jmp 0xe09e0 jmp 0xe09f2 jmp 0xe0a07 movq %rax, %r15 leaq 0x40(%rsp), %rdi callq 0x1dc50 jmp 0xe09e3 movq %rax, %r15 leaq 0x160(%rsp), %rdi callq 0x19e78 jmp 0xe09f5 movq %rax, %r15 leaq 0xf8(%rsp), %rdi callq 0x19e78 jmp 0xe0ba0 movq %rax, %r15 jmp 0xe0ba0 movq %rax, %r15 jmp 0xe0a21 movq %rax, %r15 leaq 0x40(%rsp), %rdi callq 0x1dc50 leaq 0xc0(%rsp), %rdi callq 0x19e78 jmp 0xe0a33 movq %rax, %r15 leaq 0x238(%rsp), %rdi callq 0x19e78 jmp 0xe0a4a jmp 0xe0b23 movq %rax, %r15 movq %rsp, %rdi callq 0x19e78 jmp 0xe0b26 jmp 0xe0b57 jmp 0xe0b57 movq %rax, %r14 jmp 0xe0a89 jmp 0xe0a9d jmp 0xe0a9d movq %rax, %r14 leaq 0x100(%rsp), %rdi callq 0x1cf2a jmp 0xe0a7f movq %rax, %r14 leaq 0x40(%rsp), %rdi callq 0x19e78 leaq 0xc8(%rsp), %rdi callq 0x1cf2a jmp 0xe0aa0 jmp 0xe0b23 movq %rax, %r14 leaq 0x8(%rsp), %rdi callq 0x1cf2a movq %r14, %r15 jmp 0xe0b6c jmp 0xe0b57 jmp 0xe0b5c jmp 0xe0b23 jmp 0xe0b5c jmp 0xe0b5c jmp 0xe0b5c movq %rax, %r15 leaq 0x40(%rsp), %rdi callq 0x2f12a jmp 0xe0b26 jmp 0xe0b23 movq %rax, %r15 leaq 0x40(%rsp), %rdi callq 0x1dc50 jmp 0xe0af0 movq %rax, %r15 leaq 0x160(%rsp), %rdi callq 0x19e78 jmp 0xe0b02 movq %rax, %r15 leaq 0xf8(%rsp), %rdi jmp 0xe0b18 jmp 0xe0b43 jmp 0xe0b43 movq %rax, %r15 leaq 0x40(%rsp), %rdi callq 0x19e78 jmp 0xe0b46 jmp 0xe0b57 jmp 0xe0b5c movq %rax, %r15 leaq 0x160(%rsp), %rdi callq 0x2f12a jmp 0xe0b5f jmp 0xe0b5c jmp 0xe0b57 jmp 0xe0b57 jmp 0xe0b5c jmp 0xe0b57 jmp 0xe0b52 jmp 0xe0b57 movq %rax, %r15 leaq 0x8(%rsp), %rdi callq 0x1cf2a jmp 0xe0b6c movq %rax, %r15 jmp 0xe0b93 movq %rax, %r15 jmp 0xe0b6c movq %rax, %r15 leaq 0xf8(%rsp), %rdi callq 0x2f12a leaq 0x1f0(%rsp), %rdi callq 0x30416 leaq 0x210(%rsp), %rdi callq 0x30416 leaq 0x1d0(%rsp), %rdi callq 0xea57c leaq 0x260(%rsp), %rdi callq 0xbd52a movq %r15, %rdi callq 0x19750
/qpdf[P]qpdf/libqpdf/QPDF_objects.cc
QPDF::removeObject(QPDFObjGen)
void QPDF::removeObject(QPDFObjGen og) { m->xref_table.erase(og); if (auto cached = m->obj_cache.find(og); cached != m->obj_cache.end()) { // Take care of any object handles that may be floating around. cached->second.object->assign_null(); cached->second.object->setObjGen(nullptr, QPDFObjGen()); m->obj_cache.erase(cached); } }
pushq %r15 pushq %r14 pushq %rbx subq $0x10, %rsp movq %rdi, %rbx leaq 0x8(%rsp), %r15 movq %rsi, (%r15) movl $0x138, %edi # imm = 0x138 addq (%rbx), %rdi movq %r15, %rsi callq 0xea3e0 movl $0x1a8, %r14d # imm = 0x1A8 movq (%rbx), %rdi addq %r14, %rdi movq %r15, %rsi callq 0xeaee6 movq %rax, %r15 movl $0x1b0, %eax # imm = 0x1B0 addq (%rbx), %rax cmpq %rax, %r15 je 0xe1f76 movq 0x28(%r15), %rdi callq 0xe7e78 movq 0x28(%r15), %rax xorps %xmm0, %xmm0 movups %xmm0, 0x48(%rax) addq (%rbx), %r14 movq %r14, %rdi movq %r15, %rsi callq 0xeb342 addq $0x10, %rsp popq %rbx popq %r14 popq %r15 retq
/qpdf[P]qpdf/libqpdf/QPDF_objects.cc
QPDF::resolveXRefTable()
bool QPDF::resolveXRefTable() { bool may_change = !m->reconstructed_xref; for (auto& iter: m->xref_table) { if (isUnresolved(iter.first)) { resolve(iter.first); if (may_change && m->reconstructed_xref) { return false; } } } return true; }
pushq %rbp pushq %r15 pushq %r14 pushq %rbx pushq %rax movq %rdi, %rbx movq (%rdi), %r15 movb 0x2d0(%r15), %bpl movq 0x150(%r15), %r14 addq $0x140, %r15 # imm = 0x140 cmpq %r15, %r14 je 0xe44b7 movq 0x20(%r14), %rsi movq %rbx, %rdi callq 0xe44c8 testb %al, %al je 0xe44aa movq 0x20(%r14), %rsi movq %rbx, %rdi callq 0xe4504 testb %bpl, %bpl jne 0xe44aa movq (%rbx), %rax cmpb $0x0, 0x2d0(%rax) jne 0xe44b7 movq %r14, %rdi callq 0x19bb0 movq %rax, %r14 jmp 0xe4478 cmpq %r15, %r14 sete %al addq $0x8, %rsp popq %rbx popq %r14 popq %r15 popq %rbp retq
/qpdf[P]qpdf/libqpdf/QPDF_objects.cc
QPDF::getAllObjects()
std::vector<QPDFObjectHandle> QPDF::getAllObjects() { // After fixDanglingReferences is called, all objects are in the object cache. fixDanglingReferences(); std::vector<QPDFObjectHandle> result; for (auto const& iter: m->obj_cache) { result.push_back(newIndirect(iter.first, iter.second.object)); } return result; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x18, %rsp movq %rsi, %r14 movq %rdi, %rbx movq %rsi, %rdi xorl %esi, %esi callq 0xe4b24 xorps %xmm0, %xmm0 movups %xmm0, (%rbx) andq $0x0, 0x10(%rbx) movq (%r14), %rbp movq 0x1c0(%rbp), %r12 addq $0x1b0, %rbp # imm = 0x1B0 leaq 0x10(%rsp), %r15 leaq 0x8(%rsp), %r13 cmpq %rbp, %r12 je 0xe4c0e movq 0x20(%r12), %rdx leaq 0x28(%r12), %rcx movq %r13, %rdi movq %r14, %rsi callq 0xe4c3c movq %rbx, %rdi movq %r13, %rsi callq 0x4967c movq %r15, %rdi callq 0x1cf2a movq %r12, %rdi callq 0x19bb0 movq %rax, %r12 jmp 0xe4bd4 movq %rbx, %rax addq $0x18, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq %rax, %r14 movq %r15, %rdi callq 0x1cf2a movq %rbx, %rdi callq 0x34e9c movq %r14, %rdi callq 0x19750 nop
/qpdf[P]qpdf/libqpdf/QPDF_objects.cc
QPDF::readObjectInStream(qpdf::is::OffsetBuffer&, int, int)
QPDFObjectHandle QPDF::readObjectInStream(is::OffsetBuffer& input, int stream_id, int obj_id) { auto [object, empty] = QPDFParser::parse(input, stream_id, obj_id, m->tokenizer, *this); if (empty) { // Nothing in the PDF spec appears to allow empty objects, but they have been encountered in // actual PDF files and Adobe Reader appears to ignore them. warn(QPDFExc( qpdf_e_damaged_pdf, m->file->getName() + " object stream " + std::to_string(stream_id), +"object " + std::to_string(obj_id) + " 0, offset " + std::to_string(input.getLastOffset()), 0, "empty object treated as null")); } return object; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x1c8, %rsp # imm = 0x1C8 movl %r8d, %ebp movl %ecx, %r12d movq %rdx, %r15 movq %rsi, %r14 movq %rdi, %rbx movq (%rsi), %r8 addq $0x18, %r8 leaq 0x10(%rsp), %r13 movq %r13, %rdi movq %rdx, %rsi movl %ecx, %edx movl %ebp, %ecx movq %r14, %r9 callq 0xacfda cmpb $0x1, 0x10(%r13) jne 0xe5b80 movq (%r14), %rax movq 0xb0(%rax), %rdi movq (%rdi), %rax callq *0x18(%rax) leaq 0x48781(%rip), %rdx # 0x12e18d leaq 0x108(%rsp), %rdi movq %rax, %rsi callq 0x1c7b2 leaq 0xe8(%rsp), %rdi movl %r12d, %esi callq 0x1dbf7 leaq 0x128(%rsp), %rdi leaq 0x108(%rsp), %rsi leaq 0xe8(%rsp), %rdx callq 0x1ba8b leaq 0x68(%rsp), %rdi movl %ebp, %esi callq 0x1dbf7 leaq 0x41b56(%rip), %rsi # 0x1275b2 leaq 0x88(%rsp), %rdi leaq 0x68(%rsp), %rdx callq 0x1bb11 leaq 0x485b2(%rip), %rdx # 0x12e027 leaq 0xa8(%rsp), %rdi leaq 0x88(%rsp), %rsi callq 0x1baf2 movq %r15, %rdi callq 0x1ddd6 leaq 0x48(%rsp), %rdi movq %rax, %rsi callq 0x1db97 leaq 0xc8(%rsp), %rdi leaq 0xa8(%rsp), %rsi leaq 0x48(%rsp), %rdx callq 0x1ba8b leaq 0x48419(%rip), %rsi # 0x12ded9 leaq 0x28(%rsp), %rdi leaq 0xf(%rsp), %rdx callq 0x1b660 leaq 0x148(%rsp), %rdi pushq $0x5 popq %rsi leaq 0x128(%rsp), %rdx leaq 0xc8(%rsp), %rcx leaq 0x28(%rsp), %r9 xorl %r8d, %r8d callq 0x56b28 leaq 0x148(%rsp), %rsi movq %r14, %rdi callq 0x31918 leaq 0x148(%rsp), %rdi callq 0x1dc50 leaq 0x28(%rsp), %rdi callq 0x19e78 leaq 0xc8(%rsp), %rdi callq 0x19e78 leaq 0x48(%rsp), %rdi callq 0x19e78 leaq 0xa8(%rsp), %rdi callq 0x19e78 leaq 0x88(%rsp), %rdi callq 0x19e78 leaq 0x68(%rsp), %rdi callq 0x19e78 leaq 0x128(%rsp), %rdi callq 0x19e78 leaq 0xe8(%rsp), %rdi callq 0x19e78 leaq 0x108(%rsp), %rdi callq 0x19e78 leaq 0x10(%rsp), %rsi movq %rbx, %rdi callq 0x2905c leaq 0x18(%rsp), %rdi callq 0x1cf2a movq %rbx, %rax addq $0x1c8, %rsp # imm = 0x1C8 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq %rax, %rbx leaq 0x148(%rsp), %rdi callq 0x1dc50 jmp 0xe5bc1 movq %rax, %rbx leaq 0x28(%rsp), %rdi callq 0x19e78 jmp 0xe5bd0 movq %rax, %rbx leaq 0xc8(%rsp), %rdi callq 0x19e78 jmp 0xe5be2 movq %rax, %rbx leaq 0x48(%rsp), %rdi callq 0x19e78 jmp 0xe5c0a movq %rax, %rbx jmp 0xe5c17 movq %rax, %rbx jmp 0xe5c24 movq %rax, %rbx jmp 0xe5c2e movq %rax, %rbx jmp 0xe5c3b movq %rax, %rbx jmp 0xe5c48 movq %rax, %rbx leaq 0xa8(%rsp), %rdi callq 0x19e78 leaq 0x88(%rsp), %rdi callq 0x19e78 leaq 0x68(%rsp), %rdi callq 0x19e78 leaq 0x128(%rsp), %rdi callq 0x19e78 leaq 0xe8(%rsp), %rdi callq 0x19e78 leaq 0x108(%rsp), %rdi callq 0x19e78 leaq 0x18(%rsp), %rdi callq 0x1cf2a movq %rbx, %rdi callq 0x19750 movq %rax, %rbx jmp 0xe5c55
/qpdf[P]qpdf/libqpdf/QPDF_objects.cc
QPDF::resolveObjectsInStream(int)
void QPDF::resolveObjectsInStream(int obj_stream_number) { auto damaged = [this, obj_stream_number](int id, qpdf_offset_t offset, std::string const& msg) -> QPDFExc { return { qpdf_e_damaged_pdf, m->file->getName() + " object stream " + std::to_string(obj_stream_number), +"object " + std::to_string(id) + " 0", offset, msg, true}; }; if (m->resolved_object_streams.count(obj_stream_number)) { return; } m->resolved_object_streams.insert(obj_stream_number); // Force resolution of object stream auto obj_stream = getObject(obj_stream_number, 0).as_stream(); if (!obj_stream) { throw damagedPDF( "object " + std::to_string(obj_stream_number) + " 0", "supposed object stream " + std::to_string(obj_stream_number) + " is not a stream"); } // For linearization data in the object, use the data from the object stream for the objects in // the stream. QPDFObjGen stream_og(obj_stream_number, 0); qpdf_offset_t end_before_space = m->obj_cache[stream_og].end_before_space; qpdf_offset_t end_after_space = m->obj_cache[stream_og].end_after_space; QPDFObjectHandle dict = obj_stream.getDict(); if (!dict.isDictionaryOfType("/ObjStm")) { QTC::TC("qpdf", "QPDF ERR object stream with wrong type"); warn(damagedPDF( "object " + std::to_string(obj_stream_number) + " 0", "supposed object stream " + std::to_string(obj_stream_number) + " has wrong type")); } unsigned int n{0}; int first{0}; if (!(dict.getKey("/N").getValueAsUInt(n) && dict.getKey("/First").getValueAsInt(first))) { throw damagedPDF( "object " + std::to_string(obj_stream_number) + " 0", "object stream " + std::to_string(obj_stream_number) + " has incorrect keys"); } // id, offset, size std::vector<std::tuple<int, qpdf_offset_t, size_t>> offsets; auto bp = obj_stream.getStreamData(qpdf_dl_specialized); BufferInputSource input("", bp.get()); const auto b_size = bp->getSize(); const auto end_offset = static_cast<qpdf_offset_t>(b_size); auto b_start = bp->getBuffer(); if (first >= end_offset) { throw damagedPDF( "object " + std::to_string(obj_stream_number) + " 0", "object stream " + std::to_string(obj_stream_number) + " has invalid /First entry"); } int id = 0; long long last_offset = -1; bool is_first = true; for (unsigned int i = 0; i < n; ++i) { auto tnum = readToken(input); auto id_offset = input.getLastOffset(); auto toffset = readToken(input); if (!(tnum.isInteger() && toffset.isInteger())) { throw damaged(0, input.getLastOffset(), "expected integer in object stream header"); } int num = QUtil::string_to_int(tnum.getValue().c_str()); long long offset = QUtil::string_to_int(toffset.getValue().c_str()); if (num == obj_stream_number) { QTC::TC("qpdf", "QPDF ignore self-referential object stream"); warn(damaged(num, id_offset, "object stream claims to contain itself")); continue; } if (num < 1) { QTC::TC("qpdf", "QPDF object stream contains id < 1"); warn(damaged(num, id_offset, "object id is invalid"s)); continue; } if (offset <= last_offset) { QTC::TC("qpdf", "QPDF object stream offsets not increasing"); warn(damaged( num, input.getLastOffset(), "offset " + std::to_string(offset) + " is invalid (must be larger than previous offset " + std::to_string(last_offset) + ")")); continue; } if (num > m->xref_table_max_id) { continue; } if (first + offset >= end_offset) { warn(damaged( num, input.getLastOffset(), "offset " + std::to_string(offset) + " is too large")); continue; } if (is_first) { is_first = false; } else { offsets.emplace_back( id, last_offset + first, static_cast<size_t>(offset - last_offset)); } last_offset = offset; id = num; } if (!is_first) { // We found at least one valid entry. offsets.emplace_back( id, last_offset + first, b_size - static_cast<size_t>(last_offset + first)); } // To avoid having to read the object stream multiple times, store all objects that would be // found here in the cache. Remember that some objects stored here might have been overridden // by new objects appended to the file, so it is necessary to recheck the xref table and only // cache what would actually be resolved here. for (auto const& [obj_id, obj_offset, obj_size]: offsets) { QPDFObjGen og(obj_id, 0); auto entry = m->xref_table.find(og); if (entry != m->xref_table.end() && entry->second.getType() == 2 && entry->second.getObjStreamNumber() == obj_stream_number) { Buffer obj_buffer{b_start + obj_offset, obj_size}; is::OffsetBuffer in("", &obj_buffer, obj_offset); auto oh = readObjectInStream(in, obj_stream_number, obj_id); updateCache(og, oh.getObj(), end_before_space, end_after_space); } else { QTC::TC("qpdf", "QPDF not caching overridden objstm object"); } } }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x4d8, %rsp # imm = 0x4D8 movq %rdi, %rbx leaq 0xc(%rsp), %rax movl %esi, (%rax) movq %rdi, 0xa0(%rsp) movl %esi, 0xa8(%rsp) movl $0x2d8, %r14d # imm = 0x2D8 movq (%rdi), %rdi addq %r14, %rdi movq %rax, %rsi callq 0x6ff20 testq %rax, %rax jne 0xe6818 addq (%rbx), %r14 leaq 0xc(%rsp), %r15 movq %r14, %rdi movq %r15, %rsi callq 0x748ce movl (%r15), %edx leaq 0x1f8(%rsp), %r14 movq %r14, %rdi movq %rbx, %rsi xorl %ecx, %ecx callq 0x31e04 leaq 0xd0(%rsp), %rdi movq %r14, %rsi xorl %edx, %edx callq 0x34a6a leaq 0x200(%rsp), %rdi callq 0x1cf2a cmpq $0x0, 0xd0(%rsp) movq %rbx, 0x18(%rsp) je 0xe689d movl 0xc(%rsp), %eax leaq 0x1f0(%rsp), %rsi movl %eax, (%rsi) andl $0x0, 0x4(%rsi) movl $0x1a8, %r14d # imm = 0x1A8 movq (%rbx), %rdi addq %r14, %rdi callq 0xd8b6c movq 0x10(%rax), %rax movq %rax, 0x1d8(%rsp) addq (%rbx), %r14 leaq 0x1f0(%rsp), %rsi movq %r14, %rdi callq 0xd8b6c movq 0x18(%rax), %rax movq %rax, 0x1d0(%rsp) leaq 0xc0(%rsp), %rdi leaq 0xd0(%rsp), %rsi callq 0xc65fc leaq 0x43e0e(%rip), %rsi # 0x129d6f leaq 0x1f8(%rsp), %rdi leaq 0xf8(%rsp), %rdx callq 0x1b660 leaq 0x43f4b(%rip), %rsi # 0x129ec8 leaq 0x390(%rsp), %rdi leaq 0x160(%rsp), %rdx callq 0x1b660 leaq 0xc0(%rsp), %rdi leaq 0x1f8(%rsp), %rsi leaq 0x390(%rsp), %rdx callq 0x98890 movl %eax, %ebp leaq 0x390(%rsp), %rdi callq 0x19e78 leaq 0x1f8(%rsp), %rdi callq 0x19e78 testb %bpl, %bpl jne 0xe60df movl 0xc(%rsp), %esi leaq 0x160(%rsp), %rdi callq 0x1dbf7 leaq 0x415c6(%rip), %rsi # 0x1275b2 leaq 0xf8(%rsp), %rdi leaq 0x160(%rsp), %rdx callq 0x1bb11 leaq 0x46060(%rip), %rdx # 0x12c068 leaq 0x390(%rsp), %rdi leaq 0xf8(%rsp), %rsi callq 0x1baf2 movl 0xc(%rsp), %esi leaq 0x80(%rsp), %rdi callq 0x1dbf7 leaq 0x48150(%rip), %rsi # 0x12e185 leaq 0x50(%rsp), %rdi leaq 0x80(%rsp), %rdx callq 0x1bb11 leaq 0x4814f(%rip), %rdx # 0x12e19d leaq 0x30(%rsp), %rdi leaq 0x50(%rsp), %rsi callq 0x1baf2 leaq 0x1f8(%rsp), %rdi leaq 0x390(%rsp), %rdx leaq 0x30(%rsp), %rcx movq %rbx, %rsi callq 0x34176 leaq 0x1f8(%rsp), %rsi movq %rbx, %rdi callq 0x31918 leaq 0x1f8(%rsp), %rdi callq 0x1dc50 leaq 0x30(%rsp), %rdi callq 0x19e78 leaq 0x50(%rsp), %rdi callq 0x19e78 leaq 0x80(%rsp), %rdi callq 0x19e78 leaq 0x390(%rsp), %rdi callq 0x19e78 leaq 0xf8(%rsp), %rdi callq 0x19e78 leaq 0x160(%rsp), %rdi callq 0x19e78 andl $0x0, 0x74(%rsp) andl $0x0, 0x24(%rsp) leaq 0x2a577(%rip), %rsi # 0x110667 leaq 0x1f8(%rsp), %rdi leaq 0x30(%rsp), %rdx callq 0x1b660 leaq 0xf8(%rsp), %rdi leaq 0xc0(%rsp), %rsi leaq 0x1f8(%rsp), %rdx callq 0xc2a84 leaq 0xf8(%rsp), %rdi leaq 0x74(%rsp), %rsi callq 0x98e30 testb %al, %al je 0xe696d leaq 0x422d5(%rip), %rsi # 0x128415 leaq 0x390(%rsp), %rdi leaq 0x50(%rsp), %rdx callq 0x1b660 leaq 0x160(%rsp), %rdi leaq 0xc0(%rsp), %rsi leaq 0x390(%rsp), %rdx callq 0xc2a84 leaq 0x160(%rsp), %rdi leaq 0x24(%rsp), %rsi callq 0x98ce0 movl %eax, %ebp leaq 0x168(%rsp), %rdi callq 0x1cf2a leaq 0x390(%rsp), %rdi callq 0x19e78 leaq 0x100(%rsp), %rdi callq 0x1cf2a leaq 0x1f8(%rsp), %rdi callq 0x19e78 testb %bpl, %bpl je 0xe6987 xorps %xmm0, %xmm0 movaps %xmm0, 0xe0(%rsp) andq $0x0, 0xf0(%rsp) leaq 0xb0(%rsp), %rdi leaq 0xd0(%rsp), %rsi pushq $0x2 popq %rdx callq 0xc4632 leaq 0x43cd5(%rip), %rsi # 0x129ec8 leaq 0x1f8(%rsp), %rdi leaq 0xf8(%rsp), %rdx callq 0x1b660 movq 0xb0(%rsp), %rdx leaq 0x390(%rsp), %rdi leaq 0x1f8(%rsp), %rsi xorl %ecx, %ecx callq 0x1c2d4 leaq 0x1f8(%rsp), %rdi callq 0x19e78 movq 0xb0(%rsp), %rdi callq 0x1c232 movq %rax, 0x78(%rsp) movq 0xb0(%rsp), %rdi callq 0x1c242 movq %rax, 0x1c8(%rsp) movslq 0x24(%rsp), %rax cmpq %rax, 0x78(%rsp) jle 0xe6a57 leaq 0x2c(%rsp), %rax andl $0x0, (%rax) xorl %ecx, %ecx movb $0x1, %al movl %eax, 0x28(%rsp) pushq $-0x1 popq %rax movq %rax, 0x10(%rsp) leaq 0x390(%rsp), %rbx leaq 0x30(%rsp), %r13 leaq 0x1f8(%rsp), %r14 movq %rcx, 0x1e8(%rsp) cmpl 0x74(%rsp), %ecx jae 0xe660c leaq 0xf8(%rsp), %rdi movq 0x18(%rsp), %rsi movq %rbx, %rdx xorl %ecx, %ecx callq 0xdea94 movq %rbx, %rdi callq 0x1ddd6 movq %rbx, %rdx movq %rax, %rbp leaq 0x160(%rsp), %rdi movq 0x18(%rsp), %rsi movq %rdx, %rbx xorl %ecx, %ecx callq 0xdea94 cmpl $0x7, 0xf8(%rsp) jne 0xe682a cmpl $0x7, 0x160(%rsp) jne 0xe682a movq 0x100(%rsp), %rdi callq 0xf2966 movl %eax, %r15d movq 0x168(%rsp), %rdi callq 0xf2966 cmpl 0xc(%rsp), %r15d jne 0xe6365 movq %r13, %rdi leaq 0x47ed4(%rip), %rsi # 0x12e204 leaq 0x50(%rsp), %rdx callq 0x1b660 movq %r14, %rdi leaq 0xa0(%rsp), %rsi movl %r15d, %edx movq %rbp, %rcx movq %r13, %r8 callq 0xe6ff4 movq 0x18(%rsp), %rdi movq %r14, %rsi callq 0x31918 jmp 0xe63f0 testl %r15d, %r15d jle 0xe63b8 movslq %eax, %rbp movq %rbp, %rax subq 0x10(%rsp), %rax jle 0xe6433 movq 0x18(%rsp), %rcx movq (%rcx), %rcx cmpl 0x168(%rcx), %r15d jg 0xe6400 movslq 0x24(%rsp), %rcx leaq (%rcx,%rbp), %rdx cmpq 0x78(%rsp), %rdx jge 0xe653f testb $0x1, 0x28(%rsp) je 0xe65d5 movl $0x0, 0x28(%rsp) jmp 0xe6602 movq %r13, %rdi leaq 0x47e69(%rip), %rsi # 0x12e22b pushq $0x14 popq %rdx callq 0x2ac66 movq %r14, %rdi leaq 0xa0(%rsp), %rsi movl %r15d, %edx movq %rbp, %rcx movq %r13, %r8 callq 0xe6ff4 movq 0x18(%rsp), %rdi movq %r14, %rsi callq 0x31918 movq %r14, %rdi callq 0x1dc50 movq %r13, %rdi callq 0x19e78 movq 0x10(%rsp), %rbp leaq 0x160(%rsp), %rdi callq 0x2f12a leaq 0xf8(%rsp), %rdi callq 0x2f12a movq 0x1e8(%rsp), %rcx incl %ecx movq %rbp, 0x10(%rsp) jmp 0xe6298 movq %rbx, %rdi callq 0x1ddd6 movq %rax, 0x1e0(%rsp) leaq 0x498(%rsp), %r12 movq %r12, %rdi movq %rbp, %rsi callq 0x1db97 leaq 0x4b8(%rsp), %rbp movq %rbp, %rdi leaq 0x47bc3(%rip), %rsi # 0x12e02b movq %r12, %rdx callq 0x1bb11 leaq 0x80(%rsp), %rdi movq %rbp, %rsi leaq 0x47dbe(%rip), %rdx # 0x12e240 callq 0x1baf2 leaq 0x478(%rsp), %r12 movq %r12, %rdi movq 0x10(%rsp), %rsi callq 0x1db97 leaq 0x50(%rsp), %rbp movq %rbp, %rdi leaq 0x80(%rsp), %rsi movq %r12, %rdx callq 0x1ba8b movq %r13, %rdi movq %rbp, %rsi leaq 0x42fac(%rip), %rdx # 0x12946d callq 0x1baf2 movq %r14, %rdi leaq 0xa0(%rsp), %rsi movl %r15d, %edx movq 0x1e0(%rsp), %rcx movq %r13, %r8 callq 0xe6ff4 movq 0x18(%rsp), %rdi movq %r14, %rsi callq 0x31918 movq %r14, %rdi callq 0x1dc50 movq %r13, %rdi callq 0x19e78 leaq 0x50(%rsp), %rdi callq 0x19e78 leaq 0x478(%rsp), %rdi callq 0x19e78 leaq 0x80(%rsp), %rdi callq 0x19e78 leaq 0x4b8(%rsp), %rdi callq 0x19e78 leaq 0x498(%rsp), %rdi jmp 0xe63fb movq %rbx, %rdi callq 0x1ddd6 movq %rax, %r12 leaq 0x80(%rsp), %rdi movq %rbp, %rsi callq 0x1db97 leaq 0x50(%rsp), %rbp movq %rbp, %rdi leaq 0x47ac2(%rip), %rsi # 0x12e02b leaq 0x80(%rsp), %rdx callq 0x1bb11 movq %r13, %rdi movq %rbp, %rsi leaq 0x47cef(%rip), %rdx # 0x12e272 callq 0x1baf2 movq %r14, %rdi leaq 0xa0(%rsp), %rsi movl %r15d, %edx movq %r12, %rcx movq %r13, %r8 callq 0xe6ff4 movq 0x18(%rsp), %rdi movq %r14, %rsi callq 0x31918 movq %r14, %rdi callq 0x1dc50 movq %r13, %rdi callq 0x19e78 leaq 0x50(%rsp), %rdi callq 0x19e78 leaq 0x80(%rsp), %rdi jmp 0xe63fb movq 0x10(%rsp), %rdx addq %rcx, %rdx movq %rdx, 0x1f8(%rsp) movq %rax, 0x30(%rsp) leaq 0xe0(%rsp), %rdi leaq 0x2c(%rsp), %rsi movq %r14, %rdx movq %r13, %rcx callq 0xe7b36 movl %r15d, 0x2c(%rsp) jmp 0xe6405 testb $0x1, 0x28(%rsp) jne 0xe6650 movslq 0x24(%rsp), %rax movq 0x10(%rsp), %rcx addq %rax, %rcx leaq 0x1f8(%rsp), %rdx movq %rcx, (%rdx) movq 0x78(%rsp), %rax subq %rcx, %rax leaq 0xf8(%rsp), %rcx movq %rax, (%rcx) leaq 0xe0(%rsp), %rdi leaq 0x2c(%rsp), %rsi callq 0xe7b36 movq 0xe0(%rsp), %rbp movq 0xe8(%rsp), %r12 leaq 0x30(%rsp), %r15 leaq 0xf8(%rsp), %rbx movq %r12, 0x10(%rsp) cmpq %r12, %rbp je 0xe67d7 movq %rbx, %r13 movl 0x10(%rbp), %eax movl %eax, 0x30(%rsp) andl $0x0, 0x34(%rsp) movq 0x18(%rsp), %rbx movq (%rbx), %rdi movl $0x138, %eax # imm = 0x138 addq %rax, %rdi movq %r15, %rsi callq 0xeaea8 movq %rax, %r14 movq (%rbx), %rax movl $0x140, %ecx # imm = 0x140 addq %rcx, %rax cmpq %rax, %r14 movq %r13, %rbx je 0xe67ce addq $0x28, %r14 movq %r14, %rdi callq 0xbffd2 cmpl $0x2, %eax jne 0xe67ce movq %r14, %rdi callq 0xc002e cmpl 0xc(%rsp), %eax jne 0xe67ce movq 0x8(%rbp), %rsi addq 0x1c8(%rsp), %rsi movq (%rbp), %rdx leaq 0x50(%rsp), %rdi callq 0x1c106 movq %rbx, %rdi leaq 0x437c1(%rip), %rsi # 0x129ec8 leaq 0x160(%rsp), %rdx callq 0x1b660 movq 0x8(%rbp), %rcx leaq 0x1f8(%rsp), %r14 movq %r14, %rdi movq %rbx, %rsi leaq 0x50(%rsp), %rdx callq 0xe7b7e movq %rbx, %rdi callq 0x19e78 movl 0xc(%rsp), %ecx movl 0x10(%rbp), %r8d movq %rbx, %rdi movq %rbx, %r15 movq 0x18(%rsp), %rbx movq %rbx, %rsi movq %r14, %rdx callq 0xe59ac movq 0x30(%rsp), %r14 leaq 0x160(%rsp), %r12 movq %r12, %rdi movq %r15, %rsi callq 0x2905c movq %rbx, %rdi movq %r14, %rsi movq %r12, %rdx movq 0x1d8(%rsp), %rcx movq 0x1d0(%rsp), %r8 pushq $0x1 popq %r9 callq 0xe5d60 leaq 0x168(%rsp), %rdi callq 0x1cf2a leaq 0x100(%rsp), %rdi callq 0x1cf2a leaq 0x2a0(%rsp), %rdi callq 0x1c43c leaq 0x50(%rsp), %rdi callq 0x1c1a0 movq %r13, %rbx leaq 0x30(%rsp), %r15 movq 0x10(%rsp), %r12 addq $0x18, %rbp jmp 0xe6672 leaq 0x390(%rsp), %rdi callq 0x1c43c leaq 0xb8(%rsp), %rdi callq 0x1cf2a leaq 0xe0(%rsp), %rdi callq 0xeacda leaq 0xc8(%rsp), %rdi callq 0x1cf2a leaq 0xd8(%rsp), %rdi callq 0x1cf2a addq $0x4d8, %rsp # imm = 0x4D8 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movl $0x80, %edi callq 0x19400 movq %rax, %r14 leaq 0x390(%rsp), %rdi callq 0x1ddd6 movq %rax, %rbx leaq 0x4798d(%rip), %rsi # 0x12e1db leaq 0x1f8(%rsp), %rdi leaq 0x30(%rsp), %rdx callq 0x1b660 movb $0x1, %bpl leaq 0xa0(%rsp), %rsi leaq 0x1f8(%rsp), %r8 movq %r14, %rdi xorl %edx, %edx movq %rbx, %rcx callq 0xe6ff4 xorl %ebp, %ebp leaq 0xc54e7(%rip), %rsi # 0x1abd70 leaq -0xc8c40(%rip), %rdx # 0x1dc50 movq %r14, %rdi callq 0x19720 jmp 0xe6b22 movl $0x80, %edi callq 0x19400 movq %rax, %r14 movl 0xc(%rsp), %esi leaq 0xf8(%rsp), %rdi callq 0x1dbf7 leaq 0x40cf0(%rip), %rsi # 0x1275b2 leaq 0x390(%rsp), %rdi leaq 0xf8(%rsp), %rdx callq 0x1bb11 leaq 0x4578a(%rip), %rdx # 0x12c068 leaq 0x1f8(%rsp), %rdi leaq 0x390(%rsp), %rsi callq 0x1baf2 movl 0xc(%rsp), %esi leaq 0x50(%rsp), %rdi callq 0x1dbf7 leaq 0x4787d(%rip), %rsi # 0x12e185 leaq 0x30(%rsp), %rdi leaq 0x50(%rsp), %rdx callq 0x1bb11 leaq 0x45d05(%rip), %rdx # 0x12c623 leaq 0x160(%rsp), %rdi leaq 0x30(%rsp), %rsi callq 0x1baf2 movb $0x1, %bpl leaq 0x1f8(%rsp), %rdx leaq 0x160(%rsp), %rcx movq %r14, %rdi movq 0x18(%rsp), %rsi callq 0x34176 xorl %ebp, %ebp leaq 0xc5417(%rip), %rsi # 0x1abd70 leaq -0xc8d10(%rip), %rdx # 0x1dc50 movq %r14, %rdi callq 0x19720 jmp 0xe6b22 leaq 0x100(%rsp), %rdi callq 0x1cf2a leaq 0x1f8(%rsp), %rdi callq 0x19e78 movl $0x80, %edi callq 0x19400 movq %rax, %r14 movl 0xc(%rsp), %esi leaq 0xf8(%rsp), %rdi callq 0x1dbf7 leaq 0x40c06(%rip), %rsi # 0x1275b2 leaq 0x390(%rsp), %rdi leaq 0xf8(%rsp), %rdx callq 0x1bb11 leaq 0x456a0(%rip), %rdx # 0x12c068 leaq 0x1f8(%rsp), %rdi leaq 0x390(%rsp), %rsi callq 0x1baf2 movl 0xc(%rsp), %esi leaq 0x50(%rsp), %rdi callq 0x1dbf7 leaq 0x4779c(%rip), %rsi # 0x12e18e leaq 0x30(%rsp), %rdi leaq 0x50(%rsp), %rdx callq 0x1bb11 leaq 0x477a5(%rip), %rdx # 0x12e1ad leaq 0x160(%rsp), %rdi leaq 0x30(%rsp), %rsi callq 0x1baf2 movb $0x1, %bpl leaq 0x1f8(%rsp), %rdx leaq 0x160(%rsp), %rcx movq %r14, %rdi movq 0x18(%rsp), %rsi callq 0x34176 xorl %ebp, %ebp leaq 0xc532d(%rip), %rsi # 0x1abd70 leaq -0xc8dfa(%rip), %rdx # 0x1dc50 movq %r14, %rdi callq 0x19720 jmp 0xe6b22 movl $0x80, %edi callq 0x19400 movq %rax, %r14 movl 0xc(%rsp), %esi leaq 0x160(%rsp), %rdi callq 0x1dbf7 leaq 0x40b36(%rip), %rsi # 0x1275b2 leaq 0xf8(%rsp), %rdi leaq 0x160(%rsp), %rdx callq 0x1bb11 leaq 0x455d0(%rip), %rdx # 0x12c068 leaq 0x1f8(%rsp), %rdi leaq 0xf8(%rsp), %rsi callq 0x1baf2 movl 0xc(%rsp), %esi leaq 0x80(%rsp), %rdi callq 0x1dbf7 leaq 0x476c9(%rip), %rsi # 0x12e18e leaq 0x50(%rsp), %rdi leaq 0x80(%rsp), %rdx callq 0x1bb11 leaq 0x476e3(%rip), %rdx # 0x12e1c1 leaq 0x30(%rsp), %rdi leaq 0x50(%rsp), %rsi callq 0x1baf2 movb $0x1, %bpl leaq 0x1f8(%rsp), %rdx leaq 0x30(%rsp), %rcx movq %r14, %rdi movq 0x18(%rsp), %rsi callq 0x34176 xorl %ebp, %ebp leaq 0xc525d(%rip), %rsi # 0x1abd70 leaq -0xc8eca(%rip), %rdx # 0x1dc50 movq %r14, %rdi callq 0x19720 movq %rax, %rbx leaq 0x30(%rsp), %rdi callq 0x19e78 jmp 0xe6b37 movq %rax, %rbx movb $0x1, %bpl leaq 0x50(%rsp), %rdi callq 0x19e78 jmp 0xe6b6d movq %rax, %rbx leaq 0x160(%rsp), %rdi callq 0x19e78 jmp 0xe6b5b movq %rax, %rbx movb $0x1, %bpl leaq 0x30(%rsp), %rdi callq 0x19e78 jmp 0xe6ba6 movq %rax, %rbx movb $0x1, %bpl leaq 0x80(%rsp), %rdi callq 0x19e78 jmp 0xe6bb8 movq %rax, %rbx leaq 0x160(%rsp), %rdi callq 0x19e78 jmp 0xe6b94 movq %rax, %rbx movb $0x1, %bpl leaq 0x30(%rsp), %rdi callq 0x19e78 jmp 0xe6bcd movq %rax, %rbx movb $0x1, %bpl leaq 0x50(%rsp), %rdi callq 0x19e78 jmp 0xe6bdf movq %rax, %rbx movb $0x1, %bpl leaq 0x1f8(%rsp), %rdi callq 0x19e78 jmp 0xe6bf4 movq %rax, %rbx movb $0x1, %bpl leaq 0x50(%rsp), %rdi callq 0x19e78 jmp 0xe6c09 movq %rax, %rbx movb $0x1, %bpl leaq 0x1f8(%rsp), %rdi callq 0x19e78 jmp 0xe6c1e movq %rax, %rbx movb $0x1, %bpl leaq 0xf8(%rsp), %rdi callq 0x19e78 jmp 0xe6c33 movq %rax, %rbx movb $0x1, %bpl leaq 0x1f8(%rsp), %rdi callq 0x19e78 jmp 0xe6c50 movq %rax, %rbx movb $0x1, %bpl leaq 0x390(%rsp), %rdi callq 0x19e78 jmp 0xe6c65 movq %rax, %rbx movb $0x1, %bpl leaq 0x160(%rsp), %rdi callq 0x19e78 testb %bpl, %bpl jne 0xe6c88 jmp 0xe6fab movq %rax, %rbx movb $0x1, %bpl leaq 0x390(%rsp), %rdi callq 0x19e78 jmp 0xe6c9b movq %rax, %rbx movb $0x1, %bpl leaq 0xf8(%rsp), %rdi callq 0x19e78 testb %bpl, %bpl jne 0xe6d34 jmp 0xe6fdf jmp 0xe6f89 movq %rax, %rbx movq %r14, %rdi callq 0x19a90 jmp 0xe6fab movq %rax, %rbx movb $0x1, %bpl leaq 0xf8(%rsp), %rdi callq 0x19e78 testb %bpl, %bpl jne 0xe6d8a jmp 0xe6fd2 movq %rax, %rbx leaq 0x1f8(%rsp), %rdi callq 0x1dc50 jmp 0xe6ccb movq %rax, %rbx leaq 0x30(%rsp), %rdi callq 0x19e78 jmp 0xe6cda movq %rax, %rbx leaq 0x50(%rsp), %rdi callq 0x19e78 jmp 0xe6ce9 movq %rax, %rbx leaq 0x80(%rsp), %rdi callq 0x19e78 jmp 0xe6cfb movq %rax, %rbx leaq 0x390(%rsp), %rdi callq 0x19e78 leaq 0xf8(%rsp), %rdi callq 0x19e78 leaq 0x160(%rsp), %rdi jmp 0xe6dde movq %rax, %rbx jmp 0xe6d08 movq %rax, %rbx jmp 0xe6d15 jmp 0xe6de8 movq %rax, %rbx movq %r14, %rdi callq 0x19a90 jmp 0xe6fdf jmp 0xe6f8e jmp 0xe6f89 jmp 0xe6f89 movq %rax, %rbx leaq 0x1f8(%rsp), %rdi callq 0x19e78 jmp 0xe6fb8 movq %rax, %rbx jmp 0xe6fb8 movq %rax, %rbx jmp 0xe6fc5 movq %rax, %rbx leaq 0x168(%rsp), %rdi callq 0x1cf2a jmp 0xe6d9a movq %rax, %rbx movq %r14, %rdi callq 0x19a90 jmp 0xe6fd2 movq %rax, %rbx leaq 0x390(%rsp), %rdi callq 0x19e78 jmp 0xe6dae jmp 0xe6dab movq %rax, %rbx leaq 0x100(%rsp), %rdi callq 0x1cf2a jmp 0xe6dd6 jmp 0xe6dd3 jmp 0xe6de8 movq %rax, %rbx leaq 0x390(%rsp), %rdi callq 0x19e78 jmp 0xe6dd6 movq %rax, %rbx leaq 0x1f8(%rsp), %rdi callq 0x19e78 jmp 0xe6fd2 movq %rax, %rbx jmp 0xe6fd2 jmp 0xe6df4 jmp 0xe6df4 movq %rax, %rbx jmp 0xe6fdf movq %rax, %rbx leaq 0x200(%rsp), %rdi jmp 0xe6fe7 movq %rax, %rbx jmp 0xe6e26 jmp 0xe6f8e movq %rax, %rbx leaq 0x1f8(%rsp), %rdi callq 0x1dc50 leaq 0x30(%rsp), %rdi callq 0x19e78 jmp 0xe6e35 movq %rax, %rbx leaq 0x50(%rsp), %rdi callq 0x19e78 jmp 0xe6e44 movq %rax, %rbx leaq 0x80(%rsp), %rdi jmp 0xe6f73 jmp 0xe6f8e movq %rax, %rbx leaq 0x168(%rsp), %rdi callq 0x1cf2a leaq 0x100(%rsp), %rdi callq 0x1cf2a jmp 0xe6e78 movq %rax, %rbx leaq 0x2a0(%rsp), %rdi callq 0x1c43c jmp 0xe6e9c movq %rax, %rbx leaq 0xf8(%rsp), %rdi callq 0x19e78 jmp 0xe6e9c movq %rax, %rbx leaq 0x50(%rsp), %rdi callq 0x1c1a0 jmp 0xe6fab jmp 0xe6f89 movq %rax, %rbx jmp 0xe6ed4 movq %rax, %rbx jmp 0xe6f16 movq %rax, %rbx jmp 0xe6f23 jmp 0xe6f8e movq %rax, %rbx leaq 0x1f8(%rsp), %rdi callq 0x1dc50 leaq 0x30(%rsp), %rdi callq 0x19e78 jmp 0xe6ee3 movq %rax, %rbx leaq 0x50(%rsp), %rdi callq 0x19e78 jmp 0xe6efc jmp 0xe6f8e movq %rax, %rbx jmp 0xe6f09 movq %rax, %rbx leaq 0x478(%rsp), %rdi callq 0x19e78 leaq 0x80(%rsp), %rdi callq 0x19e78 leaq 0x4b8(%rsp), %rdi callq 0x19e78 leaq 0x498(%rsp), %rdi jmp 0xe6f73 jmp 0xe6f59 jmp 0xe6f8e jmp 0xe6f6b movq %rax, %rbx leaq 0x1f8(%rsp), %rdi callq 0x19e78 testb %bpl, %bpl jne 0xe6f4f jmp 0xe6f91 jmp 0xe6f4c movq %rax, %rbx movq %r14, %rdi callq 0x19a90 jmp 0xe6f91 movq %rax, %rbx leaq 0x1f8(%rsp), %rdi callq 0x1dc50 jmp 0xe6f6e movq %rax, %rbx leaq 0x30(%rsp), %rdi callq 0x19e78 jmp 0xe6f91 jmp 0xe6f8e jmp 0xe6f89 jmp 0xe6f89 jmp 0xe6f82 movq %rax, %rbx jmp 0xe6f9e jmp 0xe6f8e movq %rax, %rbx jmp 0xe6fab movq %rax, %rbx leaq 0x160(%rsp), %rdi callq 0x2f12a leaq 0xf8(%rsp), %rdi callq 0x2f12a leaq 0x390(%rsp), %rdi callq 0x1c43c leaq 0xb8(%rsp), %rdi callq 0x1cf2a leaq 0xe0(%rsp), %rdi callq 0xeacda leaq 0xc8(%rsp), %rdi callq 0x1cf2a leaq 0xd8(%rsp), %rdi callq 0x1cf2a movq %rbx, %rdi callq 0x19750
/qpdf[P]qpdf/libqpdf/QPDF_objects.cc
QPDF::replaceObject(QPDFObjGen, QPDFObjectHandle)
QPDFObjectHandle QPDF::readObjectInStream(is::OffsetBuffer& input, int stream_id, int obj_id) { auto [object, empty] = QPDFParser::parse(input, stream_id, obj_id, m->tokenizer, *this); if (empty) { // Nothing in the PDF spec appears to allow empty objects, but they have been encountered in // actual PDF files and Adobe Reader appears to ignore them. warn(QPDFExc( qpdf_e_damaged_pdf, m->file->getName() + " object stream " + std::to_string(stream_id), +"object " + std::to_string(obj_id) + " 0, offset " + std::to_string(input.getLastOffset()), 0, "empty object treated as null")); } return object; }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x18, %rsp cmpq $0x0, (%rdx) je 0xe7666 movq %rdx, %r15 movq %rsi, %rbx movq %rdi, %r14 movq %rdx, %rdi callq 0x99458 testb %al, %al je 0xe7629 movq %r15, %rdi callq 0x9874a testb %al, %al je 0xe7666 movq %r15, %rdi callq 0x99ecc cmpq %rbx, %rax jne 0xe7666 leaq 0x8(%rsp), %r12 movq %r12, %rdi movq %r15, %rsi callq 0x2905c pushq $-0x1 popq %rcx movq %r14, %rdi movq %rbx, %rsi movq %r12, %rdx movq %rcx, %r8 xorl %r9d, %r9d callq 0xe5d60 leaq 0x10(%rsp), %rdi callq 0x1cf2a addq $0x18, %rsp popq %rbx popq %r12 popq %r14 popq %r15 retq pushq $0x10 popq %rdi callq 0x19400 movq %rax, %rbx leaq 0x46c75(%rip), %rsi # 0x12e2ed movq %rax, %rdi callq 0x199a0 movq 0xca961(%rip), %rsi # 0x1b1fe8 movq 0xca932(%rip), %rdx # 0x1b1fc0 movq %rbx, %rdi callq 0x19720 movq %rax, %r14 leaq 0x10(%rsp), %rdi callq 0x1cf2a jmp 0xe76b0 movq %rax, %r14 movq %rbx, %rdi callq 0x19a90 movq %r14, %rdi callq 0x19750
/qpdf[P]qpdf/libqpdf/QPDF_objects.cc
QPDF::tableSize()
size_t QPDF::tableSize() { // If obj_cache is dense, accommodate all object in tables,else accommodate only original // objects. auto max_xref = m->xref_table.size() ? m->xref_table.crbegin()->first.getObj() : 0; auto max_obj = m->obj_cache.size() ? m->obj_cache.crbegin()->first.getObj() : 0; auto max_id = std::numeric_limits<int>::max() - 1; if (max_obj >= max_id || max_xref >= max_id) { // Temporary fix. Long-term solution is // - QPDFObjGen to enforce objgens are valid and sensible // - xref table and obj cache to protect against insertion of impossibly large obj ids stopOnError("Impossibly large object id encountered."); } if (max_obj < 1.1 * std::max(toI(m->obj_cache.size()), max_xref)) { return toS(++max_obj); } return toS(++max_xref); }
pushq %rbp pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x40, %rsp movq %rdi, %rbx movq (%rdi), %r14 xorl %ebp, %ebp cmpq $0x0, 0x160(%r14) movl $0x0, %r15d je 0xe7840 leaq 0x140(%r14), %rdi callq 0x19c70 movl 0x20(%rax), %r15d movq 0x1d0(%r14), %r12 testq %r12, %r12 je 0xe785e addq $0x1b0, %r14 # imm = 0x1B0 movq %r14, %rdi callq 0x19c70 movl 0x20(%rax), %ebp cmpl $0x7ffffffd, %ebp # imm = 0x7FFFFFFD jg 0xe786f cmpl $0x7ffffffe, %r15d # imm = 0x7FFFFFFE jl 0xe78a7 leaq 0x46ade(%rip), %rsi # 0x12e354 leaq 0x20(%rsp), %r14 leaq 0xf(%rsp), %rdx movq %r14, %rdi callq 0x1b660 movq %rbx, %rdi movq %r14, %rsi callq 0x31a12 leaq 0x20(%rsp), %rdi callq 0x19e78 movq (%rbx), %rax movq 0x1d0(%rax), %r12 cvtsi2sd %ebp, %xmm0 movsd %xmm0, 0x10(%rsp) leaq 0x20(%rsp), %rdi movq %r12, (%rdi) callq 0x5311c cmpl %r15d, %eax cmovlel %r15d, %eax cvtsi2sd %eax, %xmm0 mulsd 0x45d6f(%rip), %xmm0 # 0x12d640 ucomisd 0x10(%rsp), %xmm0 jbe 0xe78e4 incl %ebp leaq 0x18(%rsp), %rdi movl %ebp, (%rdi) jmp 0xe78ef incl %r15d leaq 0x1c(%rsp), %rdi movl %r15d, (%rdi) callq 0x2b1b0 addq $0x40, %rsp popq %rbx popq %r12 popq %r14 popq %r15 popq %rbp retq movq %rax, %rbx leaq 0x20(%rsp), %rdi callq 0x19e78 movq %rbx, %rdi callq 0x19750
/qpdf[P]qpdf/libqpdf/QPDF_objects.cc
std::vector<bool, std::allocator<bool>> QPDF::getCompressibleObjGens<bool>()
std::vector<T> QPDF::getCompressibleObjGens() { // Return a list of objects that are allowed to be in object streams. Walk through the objects // by traversing the document from the root, including a traversal of the pages tree. This // makes that objects that are on the same page are more likely to be in the same object stream, // which is slightly more efficient, particularly with linearized files. This is better than // iterating through the xref table since it avoids preserving orphaned items. // Exclude encryption dictionary, if any QPDFObjectHandle encryption_dict = m->trailer.getKey("/Encrypt"); QPDFObjGen encryption_dict_og = encryption_dict.getObjGen(); const size_t max_obj = getObjectCount(); std::vector<bool> visited(max_obj, false); std::vector<QPDFObjectHandle> queue; queue.reserve(512); queue.push_back(m->trailer); std::vector<T> result; if constexpr (std::is_same_v<T, QPDFObjGen>) { result.reserve(m->obj_cache.size()); } else if constexpr (std::is_same_v<T, bool>) { result.resize(max_obj + 1U, false); } else { throw std::logic_error("Unsupported type in QPDF::getCompressibleObjGens"); } while (!queue.empty()) { auto obj = queue.back(); queue.pop_back(); if (obj.getObjectID() > 0) { QPDFObjGen og = obj.getObjGen(); const size_t id = toS(og.getObj() - 1); if (id >= max_obj) { throw std::logic_error( "unexpected object id encountered in getCompressibleObjGens"); } if (visited[id]) { QTC::TC("qpdf", "QPDF loop detected traversing objects"); continue; } // Check whether this is the current object. If not, remove it (which changes it into a // direct null and therefore stops us from revisiting it) and move on to the next object // in the queue. auto upper = m->obj_cache.upper_bound(og); if (upper != m->obj_cache.end() && upper->first.getObj() == og.getObj()) { removeObject(og); continue; } visited[id] = true; if (og == encryption_dict_og) { QTC::TC("qpdf", "QPDF exclude encryption dictionary"); } else if (!(obj.isStream() || (obj.isDictionaryOfType("/Sig") && obj.hasKey("/ByteRange") && obj.hasKey("/Contents")))) { if constexpr (std::is_same_v<T, QPDFObjGen>) { result.push_back(og); } else if constexpr (std::is_same_v<T, bool>) { result[id + 1U] = true; } } } if (obj.isStream()) { auto dict = obj.getDict().as_dictionary(); auto end = dict.crend(); for (auto iter = dict.crbegin(); iter != end; ++iter) { std::string const& key = iter->first; QPDFObjectHandle const& value = iter->second; if (!value.null()) { if (key == "/Length") { // omit stream lengths if (value.isIndirect()) { QTC::TC("qpdf", "QPDF exclude indirect length"); } } else { queue.emplace_back(value); } } } } else if (obj.isDictionary()) { auto dict = obj.as_dictionary(); auto end = dict.crend(); for (auto iter = dict.crbegin(); iter != end; ++iter) { if (!iter->second.null()) { queue.emplace_back(iter->second); } } } else if (auto items = obj.as_array()) { queue.insert(queue.end(), items.crbegin(), items.crend()); } } return result; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x128, %rsp # imm = 0x128 movq %rsi, %r14 movq %rdi, 0x28(%rsp) movq (%rsi), %rbx leaq 0x410df(%rip), %rsi # 0x1296d2 leaq 0xe0(%rsp), %rdi leaq 0x30(%rsp), %rdx callq 0x1b660 addq $0x208, %rbx # imm = 0x208 leaq 0xd0(%rsp), %rdi leaq 0xe0(%rsp), %rdx movq %rbx, %rsi callq 0xc2a84 leaq 0xe0(%rsp), %rdi callq 0x19e78 leaq 0xd0(%rsp), %rdi callq 0x99ecc movq %rax, 0x88(%rsp) movq %r14, %rdi callq 0xe4b52 movq %rax, %rbx leaq 0x30(%rsp), %rdx movb $0x0, (%rdx) leaq 0xe0(%rsp), %rdi leaq 0x98(%rsp), %rcx movq %rax, %rsi callq 0xeb390 xorps %xmm0, %xmm0 leaq 0x50(%rsp), %rdi movaps %xmm0, (%rdi) andq $0x0, 0x10(%rdi) movl $0x200, %esi # imm = 0x200 callq 0x9e2aa movl $0x208, %esi # imm = 0x208 addq (%r14), %rsi leaq 0x50(%rsp), %rdi callq 0x349e0 movq %r14, 0x90(%rsp) movq 0x28(%rsp), %rdi andq $0x0, (%rdi) andl $0x0, 0x8(%rdi) andq $0x0, 0x10(%rdi) andl $0x0, 0x18(%rdi) andq $0x0, 0x20(%rdi) leaq 0x1(%rbx), %rsi xorl %edx, %edx callq 0xeb9f2 movq 0x88(%rsp), %rax shrq $0x20, %rax movq %rax, 0xb8(%rsp) leaq 0x108(%rsp), %rbp leaq 0x2c338(%rip), %r12 # 0x114a26 leaq 0x50(%rsp), %r14 movq 0x58(%rsp), %rsi cmpq %rsi, 0x50(%rsp) je 0xe8aed addq $-0x10, %rsi leaq 0x10(%rsp), %r15 movq %r15, %rdi callq 0x2905c movq 0x58(%rsp), %rdi leaq -0x10(%rdi), %rax movq %rax, 0x58(%rsp) addq $-0x8, %rdi callq 0x1cf2a movq %r15, %rdi callq 0x9dd08 testl %eax, %eax jle 0xe8921 leaq 0x10(%rsp), %rdi callq 0x99ecc movq %rax, 0x20(%rsp) decl %eax movl %eax, 0x30(%rsp) leaq 0x30(%rsp), %rdi callq 0x2b1b0 movq %rax, %r15 cmpq %rbx, %rax jae 0xe8b28 leaq 0xe0(%rsp), %rdi movq %r15, %rsi callq 0xbcf32 testq %rdx, (%rax) jne 0xe8ade movq %rbx, %r13 movq 0x90(%rsp), %rbx movq (%rbx), %rdi movl $0x1a8, %eax # imm = 0x1A8 addq %rax, %rdi leaq 0x20(%rsp), %rsi callq 0xeb610 movq (%rbx), %rcx movl $0x1b0, %edx # imm = 0x1B0 addq %rdx, %rcx cmpq %rcx, %rax je 0xe87d2 movl 0x20(%rax), %eax cmpl 0x20(%rsp), %eax jne 0xe87d2 movq 0x20(%rsp), %rsi movq 0x90(%rsp), %rdi callq 0xe1f0c movq %r13, %rbx jmp 0xe8ade leaq 0xe0(%rsp), %rdi movq %r15, %rsi callq 0xbcf32 orq %rdx, (%rax) movq 0x88(%rsp), %rax cmpl %eax, 0x20(%rsp) jne 0xe8808 movq %r13, %rbx movq 0xb8(%rsp), %rax cmpl %eax, 0x24(%rsp) je 0xe8921 leaq 0x10(%rsp), %rdi callq 0x9874a testb %al, %al movq %r13, %rbx jne 0xe8921 leaq 0x30(%rsp), %rdi leaq 0x27a92(%rip), %rsi # 0x1102bb leaq 0xf(%rsp), %rdx callq 0x1b660 leaq 0x98(%rsp), %r13 movq %r13, %rdi leaq 0x41683(%rip), %rsi # 0x129ec8 leaq 0xe(%rsp), %rdx callq 0x1b660 leaq 0x10(%rsp), %rdi leaq 0x30(%rsp), %rsi movq %r13, %rdx callq 0x98890 testb %al, %al je 0xe88f7 leaq 0x68(%rsp), %r13 movq %r13, %rdi leaq 0x40846(%rip), %rsi # 0x1290be leaq 0xd(%rsp), %rdx callq 0x1b660 leaq 0x10(%rsp), %rdi movq %r13, %rsi callq 0xc29da testb %al, %al je 0xe88ed movq %rbp, %r13 movq %rbp, %rdi leaq 0x2db3e(%rip), %rsi # 0x1163de leaq 0xc(%rsp), %rdx callq 0x1b660 leaq 0x10(%rsp), %rdi movq %r13, %rsi callq 0xc29da movb %al, 0xb(%rsp) movq %r13, %rdi callq 0x19e78 leaq 0x68(%rsp), %rdi callq 0x19e78 leaq 0x98(%rsp), %rdi callq 0x19e78 leaq 0x30(%rsp), %rdi callq 0x19e78 cmpb $0x0, 0xb(%rsp) je 0xe890e jmp 0xe8921 leaq 0x68(%rsp), %rdi callq 0x19e78 leaq 0x98(%rsp), %rdi callq 0x19e78 leaq 0x30(%rsp), %rdi callq 0x19e78 incq %r15 movq 0x28(%rsp), %rdi movq %r15, %rsi callq 0xbcf32 orq %rdx, (%rax) leaq 0x10(%rsp), %rdi callq 0x9874a testb %al, %al je 0xe89e4 leaq 0x98(%rsp), %r13 movq %r13, %rdi leaq 0x10(%rsp), %rsi callq 0xc52e6 leaq 0x30(%rsp), %r15 movq %r15, %rdi movq %r13, %rsi callq 0x2905c leaq 0xa0(%rsp), %rdi callq 0x1cf2a movq %r13, %rdi movq %r15, %rsi callq 0xeb4cc leaq 0x68(%rsp), %rdi movq %r15, %rsi callq 0xeb4ee movq 0x68(%rsp), %rdi cmpq 0x98(%rsp), %rdi je 0xe8a70 callq 0x19c70 movq %rax, %r13 leaq 0x40(%rax), %r15 movq %r15, %rdi callq 0x34a50 testb %al, %al jne 0xe89d0 addq $0x20, %r13 movq %r13, %rdi movq %r12, %rsi callq 0x22e09 testb %al, %al je 0xe89c5 movq %r15, %rdi callq 0x99458 jmp 0xe89d0 movq %r14, %rdi movq %r15, %rsi callq 0x9efc8 movq 0x68(%rsp), %rdi callq 0x19c70 movq %rax, %rdi movq %rax, 0x68(%rsp) jmp 0xe8982 leaq 0x10(%rsp), %rdi callq 0x9873c testb %al, %al je 0xe8a7c leaq 0x30(%rsp), %r15 movq %r15, %rdi leaq 0x10(%rsp), %rsi callq 0x2905c leaq 0x98(%rsp), %rdi movq %r15, %rsi callq 0xeb4cc leaq 0x68(%rsp), %rdi movq %r15, %rsi callq 0xeb4ee movq 0x68(%rsp), %rdi cmpq 0x98(%rsp), %rdi je 0xe8a70 callq 0x19c70 leaq 0x40(%rax), %rdi callq 0x34a50 testb %al, %al jne 0xe8a5c movq 0x68(%rsp), %rdi callq 0x19c70 leaq 0x40(%rax), %rsi movq %r14, %rdi callq 0x9efc8 movq 0x68(%rsp), %rdi callq 0x19c70 movq %rax, %rdi movq %rax, 0x68(%rsp) jmp 0xe8a2a leaq 0x38(%rsp), %rdi callq 0x1cf2a jmp 0xe8ade leaq 0x30(%rsp), %r13 movq %r13, %rdi leaq 0x10(%rsp), %rsi callq 0x353d4 cmpq $0x0, 0x30(%rsp) je 0xe8ad6 movq 0x58(%rsp), %r15 leaq 0xc8(%rsp), %rdi movq %r13, %rsi callq 0xc0538 leaq 0xc0(%rsp), %rdi movq %r13, %rsi callq 0xc05e0 movq %r14, %rdi movq %r15, %rsi leaq 0xc8(%rsp), %rdx leaq 0xc0(%rsp), %rcx callq 0xeb50e movq %r13, %rdi callq 0x34a0c leaq 0x18(%rsp), %rdi callq 0x1cf2a jmp 0xe86f3 leaq 0x50(%rsp), %rdi callq 0x34e9c leaq 0xe0(%rsp), %rdi callq 0xbcf50 leaq 0xd8(%rsp), %rdi callq 0x1cf2a movq 0x28(%rsp), %rax addq $0x128, %rsp # imm = 0x128 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq pushq $0x10 popq %rdi callq 0x19400 movq %rax, %r14 leaq 0x458af(%rip), %rsi # 0x12e3e9 movq %rax, %rdi callq 0x199a0 movq 0xc949f(%rip), %rsi # 0x1b1fe8 movq 0xc9470(%rip), %rdx # 0x1b1fc0 movq %r14, %rdi callq 0x19720 movq %rax, %rbx leaq 0x108(%rsp), %rdi callq 0x19e78 jmp 0xe8b6f jmp 0xe8b6c movq %rax, %rbx leaq 0x68(%rsp), %rdi callq 0x19e78 jmp 0xe8bb3 jmp 0xe8bb0 movq %rax, %rbx jmp 0xe8c28 jmp 0xe8b89 jmp 0xe8b89 movq %rax, %rbx jmp 0xe8c49 movq %rax, %rbx leaq 0xe0(%rsp), %rdi callq 0x19e78 jmp 0xe8c56 movq %rax, %rbx jmp 0xe8c56 jmp 0xe8c0a movq %rax, %rbx leaq 0x98(%rsp), %rdi callq 0x19e78 jmp 0xe8bc5 movq %rax, %rbx leaq 0x30(%rsp), %rdi callq 0x19e78 jmp 0xe8c1e jmp 0xe8c0a movq %rax, %rbx jmp 0xe8c32 jmp 0xe8c11 jmp 0xe8c11 jmp 0xe8c0a movq %rax, %rbx leaq 0x30(%rsp), %rdi callq 0x34a0c jmp 0xe8c1e jmp 0xe8c11 jmp 0xe8c0a jmp 0xe8c11 jmp 0xe8c0a movq %rax, %rbx movq %r14, %rdi callq 0x19a90 jmp 0xe8c1e jmp 0xe8c0a jmp 0xe8c0a jmp 0xe8c0a jmp 0xe8c0a movq %rax, %rbx jmp 0xe8c1e jmp 0xe8c11 movq %rax, %rbx leaq 0x38(%rsp), %rdi callq 0x1cf2a leaq 0x18(%rsp), %rdi callq 0x1cf2a movq 0x28(%rsp), %rdi callq 0xbcf50 leaq 0x50(%rsp), %rdi callq 0x34e9c leaq 0xe0(%rsp), %rdi callq 0xbcf50 leaq 0xd8(%rsp), %rdi callq 0x1cf2a movq %rbx, %rdi callq 0x19750
/qpdf[P]qpdf/libqpdf/QPDF_objects.cc
QPDF::pushInheritedAttributesToPageInternal(QPDFObjectHandle, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::vector<QPDFObjectHandle, std::allocator<QPDFObjectHandle>>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, std::vector<QPDFObjectHandle, std::allocator<QPDFObjectHandle>>>>>&, bool, bool)
void QPDF::pushInheritedAttributesToPageInternal( QPDFObjectHandle cur_pages, std::map<std::string, std::vector<QPDFObjectHandle>>& key_ancestors, bool allow_changes, bool warn_skipped_keys) { // Make a list of inheritable keys. Only the keys /MediaBox, /CropBox, /Resources, and /Rotate // are inheritable attributes. Push this object onto the stack of pages nodes that have values // for this attribute. std::set<std::string> inheritable_keys; for (auto const& key: cur_pages.getKeys()) { if ((key == "/MediaBox") || (key == "/CropBox") || (key == "/Resources") || (key == "/Rotate")) { if (!allow_changes) { throw QPDFExc( qpdf_e_internal, m->file->getName(), m->last_object_description, m->file->getLastOffset(), "optimize detected an inheritable attribute when called in no-change mode"); } // This is an inheritable resource inheritable_keys.insert(key); QPDFObjectHandle oh = cur_pages.getKey(key); QTC::TC("qpdf", "QPDF opt direct pages resource", oh.isIndirect() ? 0 : 1); if (!oh.isIndirect()) { if (!oh.isScalar()) { // Replace shared direct object non-scalar resources with indirect objects to // avoid copying large structures around. cur_pages.replaceKey(key, makeIndirectObject(oh)); oh = cur_pages.getKey(key); } else { // It's okay to copy scalars. QTC::TC("qpdf", "QPDF opt inherited scalar"); } } key_ancestors[key].push_back(oh); if (key_ancestors[key].size() > 1) { QTC::TC("qpdf", "QPDF opt key ancestors depth > 1"); } // Remove this resource from this node. It will be reattached at the page level. cur_pages.removeKey(key); } else if (!((key == "/Type") || (key == "/Parent") || (key == "/Kids") || (key == "/Count"))) { // Warn when flattening, but not if the key is at the top level (i.e. "/Parent" not // set), as we don't change these; but flattening removes intermediate /Pages nodes. if ((warn_skipped_keys) && (cur_pages.hasKey("/Parent"))) { QTC::TC("qpdf", "QPDF unknown key not inherited"); setLastObjectDescription("Pages object", cur_pages.getObjGen()); warn( qpdf_e_pages, m->last_object_description, 0, ("Unknown key " + key + " in /Pages object is being discarded as a result of flattening the /Pages " "tree")); } } } // Process descendant nodes. This method does not perform loop detection because all code paths // that lead here follow a call to getAllPages, which already throws an exception in the event // of a loop in the pages tree. for (auto& kid: cur_pages.getKey("/Kids").aitems()) { if (kid.isDictionaryOfType("/Pages")) { pushInheritedAttributesToPageInternal( kid, key_ancestors, allow_changes, warn_skipped_keys); } else { // Add all available inheritable attributes not present in this object to this object. for (auto const& iter: key_ancestors) { std::string const& key = iter.first; if (!kid.hasKey(key)) { QTC::TC("qpdf", "QPDF opt resource inherited"); kid.replaceKey(key, iter.second.back()); } else { QTC::TC("qpdf", "QPDF opt page resource hides ancestor"); } } } } // For each inheritable key, pop the stack. If the stack becomes empty, remove it from the map. // That way, the invariant that the list of keys in key_ancestors is exactly those keys for // which inheritable attributes are available. if (!inheritable_keys.empty()) { QTC::TC("qpdf", "QPDF opt inheritable keys"); for (auto const& key: inheritable_keys) { key_ancestors[key].pop_back(); if (key_ancestors[key].empty()) { QTC::TC("qpdf", "QPDF opt erase empty key ancestor"); key_ancestors.erase(key); } } } else { QTC::TC("qpdf", "QPDF opt no inheritable keys"); } }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x128, %rsp # imm = 0x128 movl %r8d, %ebx movl %ecx, 0x4(%rsp) movq %rdx, 0x8(%rsp) movq %rsi, %r15 movq %rdi, 0x18(%rsp) leaq 0xe0(%rsp), %rax andl $0x0, (%rax) andq $0x0, 0x8(%rax) movq %rax, 0x10(%rax) movq %rax, 0x18(%rax) andq $0x0, 0x20(%rax) leaq 0x68(%rsp), %rdi callq 0xc2bfc leaq 0x70(%rsp), %rax movq 0x10(%rax), %rbp movl %ebx, 0x2c(%rsp) movl %ebx, %eax xorb $0x1, %al movb %al, 0x3(%rsp) leaq 0x30(%rsp), %r14 leaq 0x98(%rsp), %r12 movq %r15, 0x20(%rsp) leaq 0x70(%rsp), %rax cmpq %rax, %rbp je 0xec605 leaq 0x20(%rbp), %r13 movq %r13, %rdi leaq 0x3c349(%rip), %rsi # 0x1286e0 callq 0x22e09 testb %al, %al jne 0xec3dd movq %r13, %rdi leaq 0x3c340(%rip), %rsi # 0x1286ea callq 0x22e09 testb %al, %al jne 0xec3dd movq %r13, %rdi leaq 0x23f67(%rip), %rsi # 0x110324 callq 0x22e09 testb %al, %al jne 0xec3dd movq %r13, %rdi leaq 0x3b9fe(%rip), %rsi # 0x127dce callq 0x22e09 testb %al, %al je 0xec4f2 cmpb $0x0, 0x4(%rsp) je 0xec84b leaq 0xd8(%rsp), %rdi movq %r13, %rsi callq 0x52c74 movq %r14, %rdi movq %r15, %rsi movq %r13, %rdx callq 0xc2a84 movq %r14, %rdi callq 0x99458 movq %r14, %rdi callq 0x99458 testb %al, %al jne 0xec4a8 movq %r14, %rdi callq 0x98766 testb %al, %al jne 0xec4a8 leaq 0xc8(%rsp), %rbx movq %rbx, %rdi movq %r14, %rsi callq 0x2905c movq %r12, %r15 movq %r12, %rdi movq 0x18(%rsp), %rsi movq %rbx, %rdx callq 0xe72ea movq 0x20(%rsp), %rbx movq %rbx, %rdi movq %r13, %rsi movq %r15, %rdx callq 0xc2da0 leaq 0xa0(%rsp), %rdi callq 0x1cf2a leaq 0xd0(%rsp), %rdi callq 0x1cf2a movq %r15, %rdi movq %rbx, %rsi movq %r13, %rdx callq 0xc2a84 movq %r14, %rdi movq %r15, %rsi callq 0x2902e leaq 0xa0(%rsp), %rdi callq 0x1cf2a movq 0x20(%rsp), %r15 movq 0x8(%rsp), %rdi movq %r13, %rsi callq 0xedf10 movq %rax, %rdi movq %r14, %rsi callq 0x349e0 movq 0x8(%rsp), %rdi movq %r13, %rsi callq 0xedf10 movq %r15, %rdi movq %r13, %rsi callq 0xc2fa8 leaq 0x38(%rsp), %rdi callq 0x1cf2a movq %rbp, %rdi callq 0x19b10 movq %rax, %rbp jmp 0xec37b movq %r13, %rdi leaq 0x227f5(%rip), %rsi # 0x10ecf1 callq 0x22e09 testb %al, %al jne 0xec4e2 movq %r13, %rdi leaq 0x23b73(%rip), %rsi # 0x110082 callq 0x22e09 testb %al, %al jne 0xec4e2 movq %r13, %rdi leaq 0x21112(%rip), %rsi # 0x10d634 callq 0x22e09 testb %al, %al jne 0xec4e2 movq %r13, %rdi leaq 0x29e23(%rip), %rsi # 0x116358 callq 0x22e09 orb 0x3(%rsp), %al jne 0xec4e2 movq %r14, %rdi leaq 0x23b38(%rip), %rsi # 0x110082 movq %r12, %rdx callq 0x1b660 movq %r15, %rdi movq %r14, %rsi callq 0xc29da movl %eax, %ebx movq %r14, %rdi callq 0x19e78 testb %bl, %bl je 0xec4e2 movq %r14, %rdi leaq 0x420da(%rip), %rsi # 0x12e653 movq %r12, %rdx callq 0x1b660 movq %r15, %rdi callq 0x99ecc movq 0x18(%rsp), %rbx movq %rbx, %rdi movq %r14, %rsi movq %rax, %rdx callq 0xe4c58 movq %r14, %rdi callq 0x19e78 movq (%rbx), %rbx movl $0xc0, %eax addq %rax, %rbx movq %r12, %r15 movq %r12, %rdi leaq 0x420a4(%rip), %rsi # 0x12e660 movq %r13, %rdx callq 0x2282d movq %r14, %rdi movq %r15, %rsi leaq 0x4209c(%rip), %rdx # 0x12e66d callq 0x1baf2 movq 0x18(%rsp), %rdi pushq $0x6 popq %rsi movq %rbx, %rdx xorl %ecx, %ecx movq %r14, %r8 callq 0x31a9a movq %r14, %rdi callq 0x19e78 movq %r15, %rdi callq 0x19e78 movq 0x20(%rsp), %r15 jmp 0xec4e2 leaq 0x68(%rsp), %rdi callq 0x4a5d6 leaq 0x2101e(%rip), %rsi # 0x10d634 leaq 0x68(%rsp), %rdi leaq 0x98(%rsp), %rdx callq 0x1b660 leaq 0x30(%rsp), %rdi leaq 0x68(%rsp), %rdx movq %r15, %rsi callq 0xc2a84 leaq 0x58(%rsp), %rdi leaq 0x30(%rsp), %rsi callq 0x99258 leaq 0x38(%rsp), %rdi callq 0x1cf2a leaq 0x68(%rsp), %rdi callq 0x19e78 leaq 0x68(%rsp), %rdi leaq 0x58(%rsp), %rsi callq 0x99ffc leaq 0x30(%rsp), %rdi leaq 0x58(%rsp), %rsi callq 0x9a00e movq 0x8(%rsp), %rax leaq 0x8(%rax), %r12 leaq 0x68(%rsp), %rbx leaq 0x98(%rsp), %r14 leaq 0x108(%rsp), %r15 movzbl 0x4(%rsp), %eax movl %eax, 0x4(%rsp) movzbl 0x2c(%rsp), %eax movl %eax, 0x20(%rsp) movq %rbx, %rdi leaq 0x30(%rsp), %rsi callq 0x48f42 testb %al, %al je 0xec7a5 movq %rbx, %rdi callq 0x9a01e movq %rax, %rbp movq %r14, %rdi leaq 0x29c7c(%rip), %rsi # 0x116351 leaq 0x17(%rsp), %rdx callq 0x1b660 movq %r15, %rdi leaq 0x3d7df(%rip), %rsi # 0x129ec8 leaq 0x16(%rsp), %rdx callq 0x1b660 movq %rbp, %rdi movq %r14, %rsi movq %r15, %rdx callq 0x98890 movl %eax, %ebx movq %r15, %rdi callq 0x19e78 movq %r14, %rdi callq 0x19e78 testb %bl, %bl je 0xec764 leaq 0xb8(%rsp), %rbx movq %rbx, %rdi movq %rbp, %rsi callq 0x2905c movq 0x18(%rsp), %rdi movq %rbx, %rsi movq 0x8(%rsp), %rdx movl 0x4(%rsp), %ecx movl 0x20(%rsp), %r8d callq 0xec308 leaq 0xc0(%rsp), %rdi callq 0x1cf2a leaq 0x68(%rsp), %rbx movq %rbx, %rdi callq 0x9a030 jmp 0xec6ab movq 0x8(%rsp), %rax movq 0x18(%rax), %r13 cmpq %r12, %r13 je 0xec752 leaq 0x20(%r13), %rbx movq %rbp, %rdi movq %rbx, %rsi callq 0xc29da testb %al, %al jne 0xec798 movq 0x48(%r13), %rdx addq $-0x10, %rdx movq %rbp, %rdi movq %rbx, %rsi callq 0xc2da0 movq %r13, %rdi callq 0x19bb0 movq %rax, %r13 jmp 0xec76d leaq 0x30(%rsp), %rdi callq 0x48f58 leaq 0x68(%rsp), %rdi callq 0x48f58 leaq 0x60(%rsp), %rdi callq 0x1cf2a cmpq $0x0, 0x100(%rsp) je 0xec82c movq 0xf0(%rsp), %r14 leaq 0xe0(%rsp), %rax cmpq %rax, %r14 je 0xec82c leaq 0x20(%r14), %r15 movq 0x8(%rsp), %rdi movq %r15, %rsi callq 0xedf10 movq %rax, %rdi callq 0xedf76 movq 0x8(%rsp), %rdi movq %r15, %rsi callq 0xedf10 movq (%rax), %rcx cmpq 0x8(%rax), %rcx jne 0xec81f movq 0x8(%rsp), %rdi movq %r15, %rsi callq 0xeee48 movq %r14, %rdi callq 0x19b10 movq %rax, %r14 jmp 0xec7d6 leaq 0xd8(%rsp), %rdi callq 0x4a5d6 addq $0x128, %rsp # imm = 0x128 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movl $0x80, %edi callq 0x19400 movq %rax, %r14 movq 0x18(%rsp), %rax movq (%rax), %rax movq 0xb0(%rax), %rdi movq (%rdi), %rax callq *0x18(%rax) movq %rax, %rbx movq 0x18(%rsp), %rax movq (%rax), %r15 movq 0xb0(%r15), %rdi callq 0x1ddd6 movq %rax, %r12 leaq 0x41d7c(%rip), %rsi # 0x12e60a leaq 0x30(%rsp), %rdi leaq 0x98(%rsp), %rdx callq 0x1b660 addq $0xc0, %r15 movb $0x1, %bpl pushq $0x1 popq %rsi leaq 0x30(%rsp), %r9 movq %r14, %rdi movq %rbx, %rdx movq %r15, %rcx movq %r12, %r8 callq 0x56b28 xorl %ebp, %ebp leaq 0xbf4a4(%rip), %rsi # 0x1abd70 leaq -0xcec83(%rip), %rdx # 0x1dc50 movq %r14, %rdi callq 0x19720 movq %rax, %rbx leaq 0x30(%rsp), %rdi callq 0x19e78 jmp 0xec8ed movq %rax, %rbx leaq 0x98(%rsp), %rdi jmp 0xec90b jmp 0xec9b5 jmp 0xec9b5 jmp 0xec903 movq %rax, %rbx leaq 0x30(%rsp), %rdi callq 0x19e78 jmp 0xec9f6 jmp 0xec9b5 movq %rax, %rbx jmp 0xeca0f movq %rax, %rbx jmp 0xeca19 movq %rax, %rbx leaq 0x38(%rsp), %rdi callq 0x1cf2a jmp 0xec93c movq %rax, %rbx leaq 0x68(%rsp), %rdi callq 0x19e78 jmp 0xeca23 jmp 0xec9e2 jmp 0xec9e2 movq %rax, %rbx leaq 0x30(%rsp), %rdi callq 0x19e78 testb %bpl, %bpl jne 0xec9a9 jmp 0xec9f6 jmp 0xec9a6 jmp 0xec9e9 movq %rax, %rbx leaq 0xa0(%rsp), %rdi callq 0x1cf2a jmp 0xec985 movq %rax, %rbx leaq 0xd0(%rsp), %rdi callq 0x1cf2a jmp 0xec9ec movq %rax, %rbx leaq 0xc0(%rsp), %rdi callq 0x1cf2a jmp 0xeca05 movq %rax, %rbx movq %r14, %rdi callq 0x19a90 jmp 0xec9f6 jmp 0xec9b5 movq %rax, %rbx jmp 0xec9f6 movq %rax, %rbx leaq 0x108(%rsp), %rdi callq 0x19e78 jmp 0xec9cf movq %rax, %rbx leaq 0x98(%rsp), %rdi callq 0x19e78 jmp 0xeca05 jmp 0xeca02 jmp 0xeca02 movq %rax, %rbx jmp 0xeca23 jmp 0xeca02 movq %rax, %rbx leaq 0x38(%rsp), %rdi callq 0x1cf2a leaq 0x68(%rsp), %rdi callq 0x4a5d6 jmp 0xeca23 movq %rax, %rbx leaq 0x30(%rsp), %rdi callq 0x48f58 leaq 0x68(%rsp), %rdi callq 0x48f58 leaq 0x60(%rsp), %rdi callq 0x1cf2a leaq 0xd8(%rsp), %rdi callq 0x4a5d6 movq %rbx, %rdi callq 0x19750
/qpdf[P]qpdf/libqpdf/QPDF_optimization.cc
QPDF::updateAllPagesCache()
void QPDF::updateAllPagesCache() { // Force regeneration of the pages cache. We force immediate recalculation of all_pages since // users may have references to it that they got from calls to getAllPages(). We can defer // recalculation of pageobj_to_pages_pos until needed. QTC::TC("qpdf", "QPDF updateAllPagesCache"); m->all_pages.clear(); m->pageobj_to_pages_pos.clear(); m->pushed_inherited_attributes_to_pages = false; getAllPages(); }
pushq %rbx movq %rdi, %rbx movl $0x218, %edi # imm = 0x218 addq (%rbx), %rdi callq 0x34894 movl $0x238, %edi # imm = 0x238 addq (%rbx), %rdi callq 0xf154e movq (%rbx), %rax movb $0x0, 0x268(%rax) movq %rbx, %rdi popq %rbx jmp 0xef790 nop
/qpdf[P]qpdf/libqpdf/QPDF_pages.cc
QPDF::addPageAt(QPDFObjectHandle, bool, QPDFObjectHandle)
void QPDF::addPageAt(QPDFObjectHandle newpage, bool before, QPDFObjectHandle refpage) { int refpos = findPage(refpage); if (!before) { ++refpos; } insertPage(newpage, refpos); }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x18, %rsp movl %edx, %ebx movq %rsi, %r14 movq %rdi, %r15 movq %rcx, %rsi callq 0xf118e xorb $0x1, %bl movzbl %bl, %ebx addl %eax, %ebx leaq 0x8(%rsp), %r12 movq %r12, %rdi movq %r14, %rsi callq 0x2905c movq %r15, %rdi movq %r12, %rsi movl %ebx, %edx callq 0xf0ae0 leaq 0x10(%rsp), %rdi callq 0x1cf2a addq $0x18, %rsp popq %rbx popq %r12 popq %r14 popq %r15 retq movq %rax, %rbx leaq 0x10(%rsp), %rdi callq 0x1cf2a movq %rbx, %rdi callq 0x19750 nop
/qpdf[P]qpdf/libqpdf/QPDF_pages.cc
QPDF::findPage(QPDFObjGen)
int QPDF::findPage(QPDFObjGen og) { flattenPagesTree(); auto it = m->pageobj_to_pages_pos.find(og); if (it == m->pageobj_to_pages_pos.end()) { QTC::TC("qpdf", "QPDF_pages findPage not found"); setLastObjectDescription("page object", og); throw QPDFExc( qpdf_e_pages, m->file->getName(), m->last_object_description, 0, "page object not referenced in /Pages tree"); } return (*it).second; }
pushq %rbp pushq %r15 pushq %r14 pushq %rbx subq $0x38, %rsp movq %rdi, %r14 leaq 0x10(%rsp), %rbx movq %rsi, (%rbx) callq 0xf05fa movl $0x238, %edi # imm = 0x238 addq (%r14), %rdi movq %rbx, %rsi callq 0xf17b2 movl $0x240, %ecx # imm = 0x240 addq (%r14), %rcx cmpq %rcx, %rax je 0xf13cf movl 0x28(%rax), %eax addq $0x38, %rsp popq %rbx popq %r14 popq %r15 popq %rbp retq leaq 0x3d5c6(%rip), %rsi # 0x12e99c leaq 0x18(%rsp), %rdi leaq 0xf(%rsp), %rdx callq 0x1b660 movq 0x10(%rsp), %rdx leaq 0x18(%rsp), %rsi movq %r14, %rdi callq 0xe4c58 leaq 0x18(%rsp), %rdi callq 0x19e78 movl $0x80, %edi callq 0x19400 movq %rax, %rbx movq (%r14), %rax movq 0xb0(%rax), %rdi movq (%rdi), %rax callq *0x18(%rax) movq %rax, %r15 movq (%r14), %r14 leaq 0x3d57d(%rip), %rsi # 0x12e9a8 leaq 0x18(%rsp), %rdi leaq 0xf(%rsp), %rdx callq 0x1b660 addq $0xc0, %r14 movb $0x1, %bpl pushq $0x6 popq %rsi leaq 0x18(%rsp), %r9 movq %rbx, %rdi movq %r15, %rdx movq %r14, %rcx xorl %r8d, %r8d callq 0x56b28 xorl %ebp, %ebp leaq 0xba90a(%rip), %rsi # 0x1abd70 leaq -0xd381d(%rip), %rdx # 0x1dc50 movq %rbx, %rdi callq 0x19720 movq %rax, %r14 leaq 0x18(%rsp), %rdi callq 0x19e78 testb %bpl, %bpl jne 0xf148e jmp 0xf14aa jmp 0xf148b movq %rax, %r14 movq %rbx, %rdi callq 0x19a90 jmp 0xf14aa movq %rax, %r14 leaq 0x18(%rsp), %rdi callq 0x19e78 jmp 0xf14aa movq %rax, %r14 movq %r14, %rdi callq 0x19750
/qpdf[P]qpdf/libqpdf/QPDF_pages.cc
QTC::TC_real(char const*, char const*, int)
void QTC::TC_real(char const* const scope, char const* const ccase, int n) { static std::map<std::string, bool> active; auto is_active = active.find(scope); if (is_active == active.end()) { active[scope] = tc_active(scope); is_active = active.find(scope); } if (!is_active->second) { return; } static std::set<std::pair<std::string, int>> cache; std::string filename; #ifdef _WIN32 # define TC_ENV "TC_WIN_FILENAME" #else # define TC_ENV "TC_FILENAME" #endif if (!QUtil::get_env(TC_ENV, &filename)) { return; } #undef TC_ENV if (cache.count(std::make_pair(ccase, n))) { return; } cache.insert(std::make_pair(ccase, n)); FILE* tc = QUtil::safe_fopen(filename.c_str(), "ab"); fprintf(tc, "%s %d\n", ccase, n); fclose(tc); }
pushq %rbp pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x60, %rsp movl %edx, %ebx movq %rsi, %r14 movq %rdi, %r15 movb 0xc1c5e(%rip), %al # 0x1b3468 testb %al, %al je 0xf1a29 leaq 0x8(%rsp), %rdi leaq 0x30(%rsp), %rdx movq %r15, %rsi callq 0x1b660 leaq 0xc1c0d(%rip), %rdi # 0x1b3438 leaq 0x8(%rsp), %rsi callq 0xf1cd0 movq %rax, %r12 leaq 0x8(%rsp), %rdi callq 0x19e78 leaq 0xc1bf7(%rip), %rax # 0x1b3440 cmpq %rax, %r12 jne 0xf1913 leaq 0x18(%rsp), %rax movq %rax, -0x10(%rax) andq $0x0, -0x8(%rax) movb $0x0, (%rax) leaq 0x3d17b(%rip), %rsi # 0x12e9e5 leaq 0x30(%rsp), %rdi leaq 0x50(%rsp), %rdx callq 0x1b660 leaq 0x30(%rsp), %rdi leaq 0x8(%rsp), %rsi callq 0xf333f testb %al, %al je 0xf189d leaq 0x8(%rsp), %rdi movq %r15, %rsi callq 0x22e09 movl %eax, %ebp jmp 0xf189f xorl %ebp, %ebp leaq 0x30(%rsp), %rdi callq 0x19e78 leaq 0x8(%rsp), %rdi callq 0x19e78 leaq 0x8(%rsp), %rdi leaq 0x30(%rsp), %rdx movq %r15, %rsi callq 0x1b660 leaq 0xc1b6c(%rip), %rdi # 0x1b3438 leaq 0x8(%rsp), %rsi callq 0xf1b5c movb %bpl, (%rax) leaq 0x8(%rsp), %rdi callq 0x19e78 leaq 0x8(%rsp), %rdi leaq 0x30(%rsp), %rdx movq %r15, %rsi callq 0x1b660 leaq 0xc1b3c(%rip), %rdi # 0x1b3438 leaq 0x8(%rsp), %rsi callq 0xf1cd0 movq %rax, %r12 leaq 0x8(%rsp), %rdi callq 0x19e78 cmpb $0x1, 0x40(%r12) jne 0xf1a1c movb 0xc1b7b(%rip), %al # 0x1b34a0 testb %al, %al je 0xf1a94 leaq 0x40(%rsp), %rax movq %rax, -0x10(%rax) andq $0x0, -0x8(%rax) movb $0x0, (%rax) leaq 0x3d08d(%rip), %rsi # 0x12e9d2 leaq 0x8(%rsp), %rdi leaq 0x50(%rsp), %rdx callq 0x1b660 leaq 0x8(%rsp), %rdi leaq 0x30(%rsp), %rsi callq 0xf333f movl %eax, %ebp leaq 0x8(%rsp), %rdi callq 0x19e78 testb %bpl, %bpl je 0xf1a12 leaq 0x50(%rsp), %rsi movq %r14, (%rsi) movl %ebx, 0x8(%rsi) leaq 0x8(%rsp), %rdi callq 0xf1be2 leaq 0xc1adc(%rip), %rdi # 0x1b3470 leaq 0x8(%rsp), %rsi callq 0xf1bc8 movq %rax, %r15 leaq 0x8(%rsp), %rdi callq 0x19e78 testq %r15, %r15 jne 0xf1a12 leaq 0x50(%rsp), %rsi movq %r14, (%rsi) movl %ebx, 0x8(%rsi) leaq 0x8(%rsp), %rdi callq 0xf1be2 leaq 0xc1aa4(%rip), %rdi # 0x1b3470 leaq 0x8(%rsp), %rsi callq 0xf2164 leaq 0x8(%rsp), %rdi callq 0x19e78 movq 0x30(%rsp), %rdi leaq 0x1db48(%rip), %rsi # 0x10f534 callq 0xf2bd3 movq %rax, %r15 leaq 0x3cfe3(%rip), %rsi # 0x12e9de movq %rax, %rdi movq %r14, %rdx movl %ebx, %ecx xorl %eax, %eax callq 0x19240 movq %r15, %rdi callq 0x19490 leaq 0x30(%rsp), %rdi callq 0x19e78 addq $0x60, %rsp popq %rbx popq %r12 popq %r14 popq %r15 popq %rbp retq leaq 0xc1a38(%rip), %rdi # 0x1b3468 callq 0x193c0 testl %eax, %eax je 0xf1812 andl $0x0, 0xc19fc(%rip) # 0x1b3440 leaq 0xc19ed(%rip), %rsi # 0x1b3438 leaq 0xc19ee(%rip), %rax # 0x1b3440 andq $0x0, 0xc19ee(%rip) # 0x1b3448 movq %rax, 0xc19ef(%rip) # 0x1b3450 movq %rax, 0xc19f0(%rip) # 0x1b3458 andq $0x0, 0xc19f0(%rip) # 0x1b3460 leaq 0xdf(%rip), %rdi # 0xf1b56 leaq 0xc0cba(%rip), %rdx # 0x1b2738 callq 0x19a80 leaq 0xc19de(%rip), %rdi # 0x1b3468 callq 0x19690 jmp 0xf1812 leaq 0xc1a05(%rip), %rdi # 0x1b34a0 callq 0x193c0 testl %eax, %eax je 0xf192d andl $0x0, 0xc19c9(%rip) # 0x1b3478 leaq 0xc19ba(%rip), %rsi # 0x1b3470 leaq 0xc19bb(%rip), %rax # 0x1b3478 andq $0x0, 0xc19bb(%rip) # 0x1b3480 movq %rax, 0xc19bc(%rip) # 0x1b3488 movq %rax, 0xc19bd(%rip) # 0x1b3490 andq $0x0, 0xc19bd(%rip) # 0x1b3498 leaq 0xe0(%rip), %rdi # 0xf1bc2 leaq 0xc0c4f(%rip), %rdx # 0x1b2738 callq 0x19a80 leaq 0xc19ab(%rip), %rdi # 0x1b34a0 callq 0x19690 jmp 0xf192d jmp 0xf1b31 jmp 0xf1b22 jmp 0xf1b31 jmp 0xf1b22 jmp 0xf1b31 jmp 0xf1b3b jmp 0xf1b4a jmp 0xf1b3b jmp 0xf1b4a movq %rax, %rbx leaq 0x30(%rsp), %rdi callq 0x19e78 jmp 0xf1b3e jmp 0xf1b3b movq %rax, %rbx leaq 0x8(%rsp), %rdi callq 0x19e78 jmp 0xf1b34 movq %rax, %rbx leaq 0x30(%rsp), %rdi jmp 0xf1b43 movq %rax, %rbx leaq 0x8(%rsp), %rdi callq 0x19e78 jmp 0xf1b4d movq %rax, %rbx movq %rbx, %rdi callq 0x19750 nop
/qpdf[P]qpdf/libqpdf/QTC.cc
call_init_write_memory(_qpdf_data*)
static void call_init_write_memory(qpdf_data qpdf) { qpdf->qpdf_writer = std::make_shared<QPDFWriter>(*(qpdf->qpdf)); qpdf->qpdf_writer->setOutputMemory(); }
pushq %r14 pushq %rbx subq $0x18, %rsp movq %rdi, %rbx movq (%rdi), %rsi leaq 0x8(%rsp), %r14 movq %r14, %rdi callq 0x1080bf leaq 0x10(%rbx), %rdi movq %r14, %rsi callq 0x107ef6 leaq 0x10(%rsp), %rdi callq 0x1cf2a movq 0x10(%rbx), %rdi callq 0xb1c78 addq $0x18, %rsp popq %rbx popq %r14 retq
/qpdf[P]qpdf/libqpdf/qpdf-c.cc
qpdf_set_r6_encryption_parameters2
void qpdf_set_r6_encryption_parameters2( qpdf_data qpdf, char const* user_password, char const* owner_password, QPDF_BOOL allow_accessibility, QPDF_BOOL allow_extract, QPDF_BOOL allow_assemble, QPDF_BOOL allow_annotate_and_form, QPDF_BOOL allow_form_filling, QPDF_BOOL allow_modify_other, enum qpdf_r3_print_e print, QPDF_BOOL encrypt_metadata) { QTC::TC("qpdf", "qpdf-c called qpdf_set_r6_encryption_parameters"); qpdf->qpdf_writer->setR6EncryptionParameters( user_password, owner_password, allow_accessibility != QPDF_FALSE, allow_extract != QPDF_FALSE, allow_assemble != QPDF_FALSE, allow_annotate_and_form != QPDF_FALSE, allow_form_filling != QPDF_FALSE, allow_modify_other != QPDF_FALSE, print, encrypt_metadata != QPDF_FALSE); }
pushq %r14 pushq %rbx pushq %rax movl %r9d, %eax movl %r8d, %r9d movl %ecx, %r8d movl 0x38(%rsp), %r10d movq 0x10(%rdi), %rdi xorl %ecx, %ecx testl %r8d, %r8d setne %cl xorl %r8d, %r8d testl %r9d, %r9d setne %r8b xorl %r9d, %r9d testl %eax, %eax setne %r9b xorl %eax, %eax cmpl $0x0, 0x20(%rsp) setne %al xorl %r11d, %r11d cmpl $0x0, 0x28(%rsp) setne %r11b xorl %ebx, %ebx cmpl $0x0, 0x30(%rsp) setne %bl xorl %r14d, %r14d cmpl $0x0, 0x40(%rsp) setne %r14b subq $0x8, %rsp pushq %r14 pushq %r10 pushq %rbx pushq %r11 pushq %rax callq 0xb28e6 addq $0x38, %rsp popq %rbx popq %r14 retq
/qpdf[P]qpdf/libqpdf/qpdf-c.cc
qpdf_register_progress_reporter
void qpdf_register_progress_reporter( qpdf_data qpdf, void (*report_progress)(int percent, void* data), void* data) { QTC::TC("qpdf", "qpdf-c registered progress reporter"); qpdf->qpdf_writer->registerProgressReporter( std::shared_ptr<QPDFWriter::ProgressReporter>(new QPDFWriter::FunctionProgressReporter( std::bind(report_progress, std::placeholders::_1, data)))); }
pushq %rbp pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x40, %rsp movq %rdx, %r15 movq %rsi, %r12 movq 0x10(%rdi), %r14 pushq $0x28 popq %rdi callq 0x191a0 movq %rax, %rbx leaq 0x30(%rsp), %rsi movq %r12, (%rsi) movq %r15, 0x8(%rsi) leaq 0x10(%rsp), %rdi callq 0x107a92 movb $0x1, %bpl leaq 0x10(%rsp), %rsi movq %rbx, %rdi callq 0xb1438 xorl %ebp, %ebp movq %rsp, %rdi movq %rbx, %rsi callq 0x74a20 movq %rsp, %rsi movq %r14, %rdi callq 0xbc7b8 leaq 0x8(%rsp), %rdi callq 0x1cf2a leaq 0x10(%rsp), %rdi callq 0x22ec0 addq $0x40, %rsp popq %rbx popq %r12 popq %r14 popq %r15 popq %rbp retq movq %rax, %r14 leaq 0x8(%rsp), %rdi callq 0x1cf2a xorl %ebp, %ebp jmp 0xfe03a movq %rax, %r14 jmp 0xfe049 movq %rax, %r14 leaq 0x10(%rsp), %rdi callq 0x22ec0 testb %bpl, %bpl je 0xfe054 pushq $0x28 popq %rsi movq %rbx, %rdi callq 0x19100 movq %r14, %rdi callq 0x19750
/qpdf[P]qpdf/libqpdf/qpdf-c.cc
qpdf_oh_get_key
qpdf_oh qpdf_oh_get_key(qpdf_data qpdf, qpdf_oh oh, char const* key) { return do_with_oh<qpdf_oh>(qpdf, oh, return_null(qpdf), [qpdf, key](QPDFObjectHandle& o) { QTC::TC("qpdf", "qpdf-c called qpdf_oh_get_key"); return new_object(qpdf, o.getKey(key)); }); }
pushq %rbx subq $0x40, %rsp leaq 0x20(%rsp), %rax andq $0x0, 0x8(%rax) movq %rdi, (%rax) leaq 0x2086(%rip), %rcx # 0x103b4c movq %rcx, 0x18(%rax) leaq 0x2083(%rip), %rcx # 0x103b54 movq %rcx, 0x10(%rax) movq %rsp, %rcx movq %rdi, (%rcx) movq %rdx, 0x8(%rcx) leaq 0x4ac2(%rip), %rdx # 0x1065a8 movq %rdx, 0x18(%rcx) leaq 0x4b3f(%rip), %rdx # 0x106630 movq %rdx, 0x10(%rcx) movq %rax, %rdx callq 0xffcdd movl %eax, %ebx movq %rsp, %rdi callq 0x22ec0 leaq 0x20(%rsp), %rdi callq 0x22ec0 movl %ebx, %eax addq $0x40, %rsp popq %rbx retq movq %rax, %rbx movq %rsp, %rdi callq 0x22ec0 leaq 0x20(%rsp), %rdi callq 0x22ec0 movq %rbx, %rdi callq 0x19750
/qpdf[P]qpdf/libqpdf/qpdf-c.cc
qpdf_oh_new_unicode_string
qpdf_oh qpdf_oh_new_unicode_string(qpdf_data qpdf, char const* utf8_str) { QTC::TC("qpdf", "qpdf-c called qpdf_oh_new_unicode_string"); return new_object(qpdf, QPDFObjectHandle::newUnicodeString(utf8_str)); }
pushq %r14 pushq %rbx subq $0x38, %rsp movq %rdi, %rbx leaq 0x18(%rsp), %r14 leaq 0x7(%rsp), %rdx movq %r14, %rdi callq 0x1b660 leaq 0x8(%rsp), %rdi movq %r14, %rsi callq 0x9c3bc leaq 0x8(%rsp), %rsi movq %rbx, %rdi callq 0xfe0f3 movl %eax, %ebx leaq 0x10(%rsp), %rdi callq 0x1cf2a leaq 0x18(%rsp), %rdi callq 0x19e78 movl %ebx, %eax addq $0x38, %rsp popq %rbx popq %r14 retq movq %rax, %rbx leaq 0x10(%rsp), %rdi callq 0x1cf2a jmp 0x101fa2 movq %rax, %rbx leaq 0x18(%rsp), %rdi callq 0x19e78 movq %rbx, %rdi callq 0x19750
/qpdf[P]qpdf/libqpdf/qpdf-c.cc
tnt_object
struct tnt_stream * tnt_object(struct tnt_stream *s) { if ((s = tnt_buf(s)) == NULL) goto error; struct tnt_stream_buf *sb = TNT_SBUF_CAST(s); sb->resize = tnt_sbuf_object_resize; struct tnt_sbuf_object *sbo = tnt_mem_alloc(sizeof(struct tnt_sbuf_object)); if (sbo == NULL) goto error; sb->free = tnt_sbuf_object_free; sb->subdata = sbo; sbo->stack_size = 0; sbo->stack_alloc = 8; sbo->stack = tnt_mem_alloc(sbo->stack_alloc * sizeof(struct tnt_sbo_stack)); if (sbo->stack == NULL) goto error; tnt_object_type(s, TNT_SBO_SIMPLE); return s; error: tnt_stream_free(s); return NULL; }
pushq %rbp movq %rsp, %rbp subq $0x20, %rsp movq %rdi, -0x10(%rbp) movq -0x10(%rbp), %rdi callq 0x12e30 movq %rax, -0x10(%rbp) cmpq $0x0, %rax jne 0xb7c4 jmp 0xb85f movq -0x10(%rbp), %rax movq 0x38(%rax), %rax movq %rax, -0x18(%rbp) movq -0x18(%rbp), %rax leaq 0xa5(%rip), %rcx # 0xb880 movq %rcx, 0x20(%rax) movl $0x10, %edi callq 0x12cb0 movq %rax, -0x20(%rbp) cmpq $0x0, -0x20(%rbp) jne 0xb7f6 jmp 0xb85f movq -0x18(%rbp), %rax leaq 0x14f(%rip), %rcx # 0xb950 movq %rcx, 0x28(%rax) movq -0x20(%rbp), %rcx movq -0x18(%rbp), %rax movq %rcx, 0x30(%rax) movq -0x20(%rbp), %rax movb $0x0, 0x8(%rax) movq -0x20(%rbp), %rax movb $0x8, 0x9(%rax) movq -0x20(%rbp), %rax movzbl 0x9(%rax), %eax movl %eax, %edi shlq $0x4, %rdi callq 0x12cb0 movq %rax, %rcx movq -0x20(%rbp), %rax movq %rcx, (%rax) movq -0x20(%rbp), %rax cmpq $0x0, (%rax) jne 0xb84a jmp 0xb85f movq -0x10(%rbp), %rdi xorl %esi, %esi callq 0xb760 movq -0x10(%rbp), %rax movq %rax, -0x8(%rbp) jmp 0xb870 movq -0x10(%rbp), %rdi callq 0xb710 movq $0x0, -0x8(%rbp) movq -0x8(%rbp), %rax addq $0x20, %rsp popq %rbp retq nopw (%rax,%rax)
/tarantool[P]tarantool-c/tnt/tnt_object.c
tnt_sbuf_object_resize
static char * tnt_sbuf_object_resize(struct tnt_stream *s, size_t size) { struct tnt_stream_buf *sb = TNT_SBUF_CAST(s); if (sb->size + size > sb->alloc) { size_t newsize = 2 * (sb->alloc); if (newsize < sb->size + size) newsize = sb->size + size; char *nd = tnt_mem_realloc(sb->data, newsize); if (nd == NULL) { tnt_mem_free(sb->data); return NULL; } sb->data = nd; sb->alloc = newsize; } return sb->data + sb->size; }
pushq %rbp movq %rsp, %rbp subq $0x30, %rsp movq %rdi, -0x10(%rbp) movq %rsi, -0x18(%rbp) movq -0x10(%rbp), %rax movq 0x38(%rax), %rax movq %rax, -0x20(%rbp) movq -0x20(%rbp), %rax movq 0x8(%rax), %rax addq -0x18(%rbp), %rax movq -0x20(%rbp), %rcx cmpq 0x10(%rcx), %rax jbe 0xb92e movq -0x20(%rbp), %rax movq 0x10(%rax), %rax shlq %rax movq %rax, -0x28(%rbp) movq -0x28(%rbp), %rax movq -0x20(%rbp), %rcx movq 0x8(%rcx), %rcx addq -0x18(%rbp), %rcx cmpq %rcx, %rax jae 0xb8e6 movq -0x20(%rbp), %rax movq 0x8(%rax), %rax addq -0x18(%rbp), %rax movq %rax, -0x28(%rbp) movq -0x20(%rbp), %rax movq (%rax), %rdi movq -0x28(%rbp), %rsi callq 0x12ce0 movq %rax, -0x30(%rbp) cmpq $0x0, -0x30(%rbp) jne 0xb917 movq -0x20(%rbp), %rax movq (%rax), %rdi callq 0x12d80 movq $0x0, -0x8(%rbp) jmp 0xb941 movq -0x30(%rbp), %rcx movq -0x20(%rbp), %rax movq %rcx, (%rax) movq -0x28(%rbp), %rcx movq -0x20(%rbp), %rax movq %rcx, 0x10(%rax) movq -0x20(%rbp), %rax movq (%rax), %rax movq -0x20(%rbp), %rcx addq 0x8(%rcx), %rax movq %rax, -0x8(%rbp) movq -0x8(%rbp), %rax addq $0x30, %rsp popq %rbp retq nopl (%rax,%rax)
/tarantool[P]tarantool-c/tnt/tnt_object.c
tnt_object_add_int
ssize_t tnt_object_add_int (struct tnt_stream *s, int64_t value) { struct tnt_sbuf_object *sbo = TNT_SOBJ_CAST(s); if (sbo->stack_size > 0) sbo->stack[sbo->stack_size - 1].size += 1; char data[10], *end; if (value < 0) end = mp_encode_int(data, value); else end = mp_encode_uint(data, value); return s->write(s, data, end - data); }
pushq %rbp movq %rsp, %rbp subq $0x30, %rsp movq %rdi, -0x8(%rbp) movq %rsi, -0x10(%rbp) movq -0x8(%rbp), %rax movq 0x38(%rax), %rax movq 0x30(%rax), %rax movq %rax, -0x18(%rbp) movq -0x18(%rbp), %rax movzbl 0x8(%rax), %eax cmpl $0x0, %eax jle 0xbb02 movq -0x18(%rbp), %rax movq (%rax), %rax movq -0x18(%rbp), %rcx movzbl 0x8(%rcx), %ecx subl $0x1, %ecx movslq %ecx, %rcx shlq $0x4, %rcx addq %rcx, %rax movl 0x8(%rax), %ecx addl $0x1, %ecx movl %ecx, 0x8(%rax) cmpq $0x0, -0x10(%rbp) jge 0xbb1c leaq -0x22(%rbp), %rdi movq -0x10(%rbp), %rsi callq 0x26db0 movq %rax, -0x30(%rbp) jmp 0xbb2d leaq -0x22(%rbp), %rdi movq -0x10(%rbp), %rsi callq 0x26cb0 movq %rax, -0x30(%rbp) movq -0x8(%rbp), %rax movq 0x8(%rax), %rax movq -0x8(%rbp), %rdi leaq -0x22(%rbp), %rsi movq -0x30(%rbp), %rdx leaq -0x22(%rbp), %rcx subq %rcx, %rdx callq *%rax addq $0x30, %rsp popq %rbp retq
/tarantool[P]tarantool-c/tnt/tnt_object.c
tnt_object_add_str
ssize_t tnt_object_add_str (struct tnt_stream *s, const char *str, uint32_t len) { struct tnt_sbuf_object *sbo = TNT_SOBJ_CAST(s); if (sbo->stack_size > 0) sbo->stack[sbo->stack_size - 1].size += 1; struct iovec v[2]; int v_sz = 2; char data[6], *end; end = mp_encode_strl(data, len); v[0].iov_base = data; v[0].iov_len = end - data; v[1].iov_base = (void *)str; v[1].iov_len = len; return s->writev(s, v, v_sz); }
pushq %rbp movq %rsp, %rbp subq $0x60, %rsp movq %rdi, -0x8(%rbp) movq %rsi, -0x10(%rbp) movl %edx, -0x14(%rbp) movq -0x8(%rbp), %rax movq 0x38(%rax), %rax movq 0x30(%rax), %rax movq %rax, -0x20(%rbp) movq -0x20(%rbp), %rax movzbl 0x8(%rax), %eax cmpl $0x0, %eax jle 0xbba5 movq -0x20(%rbp), %rax movq (%rax), %rax movq -0x20(%rbp), %rcx movzbl 0x8(%rcx), %ecx subl $0x1, %ecx movslq %ecx, %rcx shlq $0x4, %rcx addq %rcx, %rax movl 0x8(%rax), %ecx addl $0x1, %ecx movl %ecx, 0x8(%rax) movl $0x2, -0x44(%rbp) leaq -0x4a(%rbp), %rdi movl -0x14(%rbp), %esi callq 0x27580 movq %rax, -0x58(%rbp) leaq -0x4a(%rbp), %rax movq %rax, -0x40(%rbp) movq -0x58(%rbp), %rax leaq -0x4a(%rbp), %rcx subq %rcx, %rax movq %rax, -0x38(%rbp) movq -0x10(%rbp), %rax movq %rax, -0x30(%rbp) movl -0x14(%rbp), %eax movq %rax, -0x28(%rbp) movq -0x8(%rbp), %rax movq 0x10(%rax), %rax movq -0x8(%rbp), %rdi leaq -0x40(%rbp), %rsi movl -0x44(%rbp), %edx callq *%rax addq $0x60, %rsp popq %rbp retq nopl (%rax)
/tarantool[P]tarantool-c/tnt/tnt_object.c
icetStrategySupportsOrdering
IceTBoolean icetStrategySupportsOrdering(IceTEnum strategy) { switch (strategy) { case ICET_STRATEGY_DIRECT: return ICET_TRUE; case ICET_STRATEGY_SEQUENTIAL: return ICET_TRUE; case ICET_STRATEGY_SPLIT: return ICET_FALSE; case ICET_STRATEGY_REDUCE: return ICET_TRUE; case ICET_STRATEGY_VTREE: return ICET_FALSE; case ICET_STRATEGY_UNDEFINED: icetRaiseError("Strategy not defined. " "Use icetStrategy to set the strategy.", ICET_INVALID_ENUM); return ICET_FALSE; default: icetRaiseError("Invalid strategy.", ICET_INVALID_ENUM); return ICET_FALSE; } }
pushq %rax leal -0x6001(%rdi), %ecx cmpl $0x4, %ecx ja 0x134a7 movb $0x1, %al leaq 0x89a6(%rip), %rdx # 0x1be44 movslq (%rdx,%rcx,4), %rcx addq %rdx, %rcx jmpq *%rcx cmpl $-0x1, %edi jne 0x134c4 leaq 0x8a05(%rip), %rdi # 0x1beb8 leaq 0x8a3a(%rip), %rcx # 0x1bef4 pushq $-0x2 popq %rsi pushq $0x1 popq %rdx pushq $0x60 jmp 0x134da leaq 0x7ae5(%rip), %rdi # 0x1afb0 leaq 0x8a22(%rip), %rcx # 0x1bef4 pushq $-0x2 popq %rsi pushq $0x1 popq %rdx pushq $0x63 popq %r8 callq 0xa5c0 xorl %eax, %eax popq %rcx retq
/kmorel[P]IceT/src/strategies/select.c
icetDirectCompose
IceTImage icetDirectCompose(void) { IceTImage image; IceTVoid *inSparseImageBuffer; IceTSparseImage outSparseImage; IceTSizeType sparseImageSize; const IceTInt *contrib_counts; const IceTInt *display_nodes; IceTInt max_width, max_height; IceTInt num_tiles; IceTInt num_contributors; IceTInt display_tile; IceTInt tile; IceTInt *tile_image_dest; icetRaiseDebug("In Direct Compose"); icetGetIntegerv(ICET_TILE_MAX_WIDTH, &max_width); icetGetIntegerv(ICET_TILE_MAX_HEIGHT, &max_height); icetGetIntegerv(ICET_NUM_TILES, &num_tiles); sparseImageSize = icetSparseImageBufferSize(max_width, max_height); image = icetGetStateBufferImage(DIRECT_IMAGE_BUFFER, max_width, max_height); inSparseImageBuffer = icetGetStateBuffer(DIRECT_IN_SPARSE_IMAGE_BUFFER, sparseImageSize); outSparseImage = icetGetStateBufferSparseImage( DIRECT_OUT_SPARSE_IMAGE_BUFFER, max_width, max_height); tile_image_dest = icetGetStateBuffer(DIRECT_TILE_IMAGE_DEST_BUFFER, num_tiles*sizeof(IceTInt)); icetGetIntegerv(ICET_TILE_DISPLAYED, &display_tile); if (display_tile >= 0) { contrib_counts = icetUnsafeStateGetInteger(ICET_TILE_CONTRIB_COUNTS); num_contributors = contrib_counts[display_tile]; } else { num_contributors = 0; } display_nodes = icetUnsafeStateGetInteger(ICET_DISPLAY_NODES); for (tile = 0; tile < num_tiles; tile++) { tile_image_dest[tile] = display_nodes[tile]; } icetRaiseDebug("Rendering and transferring images."); icetRenderTransferFullImages(image, inSparseImageBuffer, outSparseImage, tile_image_dest); if ((display_tile >= 0) && (num_contributors < 1)) { /* Must be displaying a blank tile. */ const IceTInt *tile_viewports = icetUnsafeStateGetInteger(ICET_TILE_VIEWPORTS); const IceTInt *display_tile_viewport = tile_viewports + 4*display_tile; IceTInt display_tile_width = display_tile_viewport[2]; IceTInt display_tile_height = display_tile_viewport[3]; icetRaiseDebug("Returning blank tile."); icetImageSetDimensions(image, display_tile_width, display_tile_height); icetClearImage(image); } return image; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x18, %rsp pushq $0x13 popq %rdi leaq 0x14(%rsp), %r15 movq %r15, %rsi callq 0x9efa pushq $0x14 popq %rdi leaq 0x10(%rsp), %r13 movq %r13, %rsi callq 0x9efa pushq $0x10 popq %rdi leaq 0xc(%rsp), %r12 movq %r12, %rsi callq 0x9efa movl (%r15), %edi movl (%r13), %esi callq 0xd291 movl %eax, %ebp movl (%r15), %esi movl (%r13), %edx movl $0x1a0, %edi # imm = 0x1A0 callq 0xd32f movq %rax, %rbx movl $0x1a1, %edi # imm = 0x1A1 movl %ebp, %esi callq 0xa48f movq %rax, %r14 movl (%r15), %esi movl (%r13), %edx movl $0x1a2, %edi # imm = 0x1A2 callq 0xd469 movq %rax, %r15 movl (%r12), %esi shll $0x2, %esi movl $0x1a3, %edi # imm = 0x1A3 callq 0xa48f movq %rax, %r12 pushq $0x1b popq %rdi leaq 0x8(%rsp), %r13 movq %r13, %rsi callq 0x9efa cmpl $0x0, (%r13) js 0x1371f movl $0x8a, %edi callq 0xa3e6 movslq 0x8(%rsp), %rcx cmpl $0x0, (%rax,%rcx,4) setle %bpl jmp 0x13722 movb $0x1, %bpl pushq $0x1a popq %rdi callq 0xa3e6 xorl %ecx, %ecx movslq 0xc(%rsp), %rdx cmpq %rdx, %rcx jge 0x13742 movl (%rax,%rcx,4), %edx movl %edx, (%r12,%rcx,4) incq %rcx jmp 0x1372c movq %rbx, %rdi movq %r14, %rsi movq %r15, %rdx movq %r12, %rcx callq 0x172ec cmpl $0x0, 0x8(%rsp) setns %al andb %bpl, %al cmpb $0x1, %al jne 0x1378b pushq $0x11 popq %rdi callq 0xa3e6 movslq 0x8(%rsp), %rcx shlq $0x4, %rcx movl 0x8(%rax,%rcx), %esi movl 0xc(%rax,%rcx), %edx movq %rbx, %rdi callq 0xd5fc movq %rbx, %rdi callq 0xf0a0 movq %rbx, %rax addq $0x18, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq nopl (%rax)
/kmorel[P]IceT/src/strategies/direct.c
icetSequentialCompose
IceTImage icetSequentialCompose(void) { IceTInt num_tiles; IceTInt rank; IceTInt num_proc; const IceTInt *display_nodes; const IceTInt *tile_viewports; IceTBoolean ordered_composite; IceTBoolean image_collect; IceTImage my_image; IceTInt *compose_group; int i; icetGetIntegerv(ICET_NUM_TILES, &num_tiles); icetGetIntegerv(ICET_RANK, &rank); icetGetIntegerv(ICET_NUM_PROCESSES, &num_proc); display_nodes = icetUnsafeStateGetInteger(ICET_DISPLAY_NODES); tile_viewports = icetUnsafeStateGetInteger(ICET_TILE_VIEWPORTS); ordered_composite = icetIsEnabled(ICET_ORDERED_COMPOSITE); image_collect = icetIsEnabled(ICET_COLLECT_IMAGES); if (!image_collect && (num_tiles > 1)) { icetRaiseWarning("Sequential strategy must collect images with more" " than one tile.", ICET_INVALID_OPERATION); image_collect = ICET_TRUE; } compose_group = icetGetStateBuffer(SEQUENTIAL_COMPOSE_GROUP_BUFFER, sizeof(IceTInt)*num_proc); my_image = icetImageNull(); if (ordered_composite) { icetGetIntegerv(ICET_COMPOSITE_ORDER, compose_group); } else { for (i = 0; i < num_proc; i++) { compose_group[i] = i; } } /* Render and compose every tile. */ for (i = 0; i < num_tiles; i++) { int d_node = display_nodes[i]; int image_dest; IceTSparseImage rendered_image; IceTSparseImage composited_image; IceTSizeType piece_offset; IceTSizeType tile_width; IceTSizeType tile_height; tile_width = tile_viewports[4*i + 2]; tile_height = tile_viewports[4*i + 3]; /* Make the image go to the display node. */ if (ordered_composite) { for (image_dest = 0; compose_group[image_dest] != d_node; image_dest++); } else { /* Technically, the above computation will work, but this is faster. */ image_dest = d_node; } rendered_image = icetGetStateBufferSparseImage(SEQUENTIAL_IMAGE_BUFFER, tile_width, tile_height); icetGetCompressedTileImage(i, rendered_image); icetSingleImageCompose(compose_group, num_proc, image_dest, rendered_image, &composited_image, &piece_offset); if (image_collect) { IceTImage tile_image; /* If this processor is display node, make sure image goes to myColorBuffer. */ if (d_node == rank) { tile_image = icetGetStateBufferImage( SEQUENTIAL_FINAL_IMAGE_BUFFER, tile_width, tile_height); } else { tile_image = icetGetStateBufferImage( SEQUENTIAL_INTERMEDIATE_IMAGE_BUFFER, tile_width, tile_height); } icetSingleImageCollect(composited_image, d_node, piece_offset, tile_image); if (d_node == rank) { my_image = tile_image; } } else { /* !image_collect */ IceTSizeType piece_size = icetSparseImageGetNumPixels(composited_image); if (piece_size > 0) { my_image = icetGetStateBufferImage( SEQUENTIAL_FINAL_IMAGE_BUFFER, tile_width, tile_height); icetDecompressSubImage(composited_image, piece_offset, my_image); icetStateSetInteger(ICET_VALID_PIXELS_TILE, i); icetStateSetInteger(ICET_VALID_PIXELS_OFFSET, piece_offset); icetStateSetInteger(ICET_VALID_PIXELS_NUM, piece_size); } else { my_image = icetImageNull(); icetStateSetInteger(ICET_VALID_PIXELS_TILE, -1); icetStateSetInteger(ICET_VALID_PIXELS_OFFSET, 0); icetStateSetInteger(ICET_VALID_PIXELS_NUM, 0); } } } return my_image; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x48, %rsp pushq $0x10 popq %rdi leaq 0x1c(%rsp), %rsi callq 0x9efa pushq $0x2 popq %rdi leaq 0x18(%rsp), %rsi callq 0x9efa pushq $0x3 popq %rdi leaq 0x14(%rsp), %rsi callq 0x9efa pushq $0x1a popq %rdi callq 0xa3e6 movq %rax, 0x38(%rsp) pushq $0x11 popq %rdi callq 0xa3e6 movq %rax, 0x30(%rsp) movl $0x142, %edi # imm = 0x142 callq 0xa341 movb %al, 0xf(%rsp) movl $0x146, %edi # imm = 0x146 callq 0xa341 movb %al, 0xe(%rsp) testb %al, %al jne 0x13838 cmpl $0x2, 0x1c(%rsp) jl 0x13838 leaq 0x8774(%rip), %rdi # 0x1bf91 leaq 0x87ae(%rip), %rcx # 0x1bfd2 pushq $-0x5 popq %rsi pushq $0x3 popq %rdx pushq $0x2e popq %r8 callq 0xa5c0 movb $0x1, 0xe(%rsp) movl 0x14(%rsp), %esi shll $0x2, %esi movl $0x1a3, %edi # imm = 0x1A3 callq 0xa48f movq %rax, %rbx callq 0xd45f movq %rax, %r14 cmpb $0x0, 0xf(%rsp) je 0x139eb pushq $0x29 popq %rdi movq %rbx, %rsi callq 0x9efa movq %rbx, 0x28(%rsp) xorl %ebx, %ebx movslq 0x1c(%rsp), %rax cmpq %rax, %rbx jge 0x139d9 movq %r14, 0x40(%rsp) movq 0x38(%rsp), %rax movl (%rax,%rbx,4), %r12d movl %r12d, %ebp cmpb $0x0, 0xf(%rsp) je 0x138ad movq 0x28(%rsp), %rax pushq $-0x1 popq %rbp incl %ebp leaq 0x4(%rax), %rcx cmpl %r12d, (%rax) movq %rcx, %rax jne 0x1389f movq %rbx, %rax shlq $0x4, %rax movq 0x30(%rsp), %rcx movl 0x8(%rcx,%rax), %r14d movl 0xc(%rcx,%rax), %r15d movl $0x1a0, %edi # imm = 0x1A0 movl %r14d, %esi movl %r15d, %edx callq 0xd469 movq %rax, %r13 movl %ebx, %edi movq %rax, %rsi callq 0xf735 movl 0x14(%rsp), %esi movq 0x28(%rsp), %rdi movl %ebp, %edx movq %r13, %rcx leaq 0x20(%rsp), %r8 leaq 0x10(%rsp), %r9 callq 0x17c08 cmpb $0x0, 0xe(%rsp) je 0x1394d xorl %edi, %edi cmpl 0x18(%rsp), %r12d setne %dil addl $0x1a1, %edi # imm = 0x1A1 movl %r14d, %esi movl %r15d, %edx callq 0xd32f movq %rax, %r14 movl 0x10(%rsp), %edx movq 0x20(%rsp), %rdi movl %r12d, %esi movq %rax, %rcx callq 0x17c64 cmpl 0x18(%rsp), %r12d movq 0x40(%rsp), %rax cmoveq %r14, %rax movq %rax, %r14 jmp 0x139d1 movq 0x20(%rsp), %rdi callq 0xd727 testl %eax, %eax jle 0x139a4 movl %eax, %ebp movl $0x1a1, %edi # imm = 0x1A1 movl %r14d, %esi movl %r15d, %edx callq 0xd32f movq %rax, %r14 movl 0x10(%rsp), %esi movq 0x20(%rsp), %rdi movq %rax, %rdx callq 0x10aa5 movl $0x8c, %edi movl %ebx, %esi callq 0x99db movl 0x10(%rsp), %esi movl $0x8d, %edi callq 0x99db movl $0x8e, %edi movl %ebp, %esi jmp 0x139cc callq 0xd45f movq %rax, %r14 movl $0x8c, %edi pushq $-0x1 popq %rsi callq 0x99db movl $0x8d, %edi xorl %esi, %esi callq 0x99db movl $0x8e, %edi xorl %esi, %esi callq 0x99db incq %rbx jmp 0x13871 movq %r14, %rax addq $0x48, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq xorl %eax, %eax movslq 0x14(%rsp), %rcx cmpq %rcx, %rax jge 0x1386a movl %eax, (%rbx,%rax,4) incq %rax jmp 0x139ed nop
/kmorel[P]IceT/src/strategies/sequential.c
icetSplitCompose
IceTImage icetSplitCompose(void) { IceTInt *tile_groups; IceTInt my_tile; IceTInt group_size; IceTSizeType my_fragment_size; IceTInt rank; IceTInt num_proc; IceTInt num_tiles; IceTInt max_width, max_height; const IceTInt *tile_contribs; IceTInt total_image_count; IceTInt tile_displayed; const IceTInt *tile_viewports; IceTInt my_width, my_height; IceTInt num_contained_tiles; const IceTInt *contained_tiles_list; const IceTBoolean *all_contained_tiles_masks; int tile, image, node; int num_allocated; IceTSparseImage incoming; IceTVoid **incomingBuffers; IceTByte *nextInBuf; /* Use IceTByte for byte-based pointer arithmetic. */ IceTSparseImage outgoing; IceTImage imageFragment; IceTImage fullImage; IceTSizeType fragmentSparseImageSize; int num_requests; IceTCommRequest *requests; int first_incoming; icetRaiseDebug("In splitStrategy"); icetGetIntegerv(ICET_RANK, &rank); icetGetIntegerv(ICET_NUM_PROCESSES, &num_proc); icetGetIntegerv(ICET_NUM_TILES, &num_tiles); icetGetIntegerv(ICET_TILE_MAX_WIDTH, &max_width); icetGetIntegerv(ICET_TILE_MAX_HEIGHT, &max_height); tile_contribs = icetUnsafeStateGetInteger(ICET_TILE_CONTRIB_COUNTS); icetGetIntegerv(ICET_TOTAL_IMAGE_COUNT, &total_image_count); icetGetIntegerv(ICET_TILE_DISPLAYED, &tile_displayed); tile_viewports = icetUnsafeStateGetInteger(ICET_TILE_VIEWPORTS); icetGetIntegerv(ICET_NUM_CONTAINED_TILES, &num_contained_tiles); contained_tiles_list = icetUnsafeStateGetInteger(ICET_CONTAINED_TILES_LIST); all_contained_tiles_masks = icetUnsafeStateGetBoolean(ICET_ALL_CONTAINED_TILES_MASKS); fullImage = icetImageNull(); /* Special case: no images rendered whatsoever. */ if (total_image_count < 1) { icetRaiseDebug("Not rendering any images. Quit early."); if (tile_displayed >= 0) { my_width = tile_viewports[4*tile_displayed + 2]; my_height = tile_viewports[4*tile_displayed + 3]; fullImage = icetGetStateBufferImage(SPLIT_FULL_IMAGE_BUFFER, my_width, my_height); icetClearImage(fullImage); } return fullImage; } tile_groups = icetGetStateBuffer(SPLIT_TILE_GROUPS_BUFFER, sizeof(int)*(num_tiles+1)); num_allocated = 0; tile_groups[0] = 0; /* Set entry of tile_groups[i+1] to the number of processes to help compose the image in tile i. */ /* TODO: Consider tile sizes when allocating processes. */ for (tile = 0; tile < num_tiles; tile++) { int allocate = (tile_contribs[tile]*num_proc)/total_image_count; if ((allocate < 1) && (tile_contribs[tile] > 0)) { allocate = 1; } tile_groups[tile+1] = allocate; num_allocated += allocate; } /* Make the number of processes allocated equal exactly the number of processes available. */ while (num_allocated < num_proc) { /* Add processes to the tile with the lowest process:image ratio. */ int min_id = -1; float min_ratio = (float)num_proc; for (tile = 0; tile < num_tiles; tile++) { float ratio; /* Don't even consider tiles with no contributors. */ if (tile_contribs[tile] == 0) continue; ratio = (float)tile_groups[tile+1]/tile_contribs[tile]; if (ratio < min_ratio) { min_ratio = ratio; min_id = tile; } } #ifdef DEBUG if (min_id < 0) { icetRaiseError("Could not find candidate to add tile.", ICET_SANITY_CHECK_FAIL); } #endif tile_groups[min_id+1]++; num_allocated++; } while (num_allocated > num_proc) { /* Remove processes from the tile with the highest process:image ratio. */ int max_id = -1; float max_ratio = 0; for (tile = 0; tile < num_tiles; tile++) { float ratio; /* Don't even consider tiles with a minimum allocation. */ if (tile_groups[tile+1] <= 1) continue; ratio = (float)tile_groups[tile+1]/tile_contribs[tile]; if (ratio > max_ratio) { max_ratio = ratio; max_id = tile; } } #ifdef DEBUG if (max_id < 0) { icetRaiseError("Could not find candidate to remove tile.", ICET_SANITY_CHECK_FAIL); } #endif tile_groups[max_id+1]--; num_allocated--; } /* Processes are assigned sequentially from 0 to N to each tile as needed. Change each tile_groups[i] entry to be the lowest rank of the processes assigned to tile i. Thus the processes assigned to tile i are tile_groups[i] through tile_groups[i+1]-1. */ for (tile = 1; tile < num_tiles; tile++) { tile_groups[tile] += tile_groups[tile-1]; } tile_groups[num_tiles] = num_proc; /* Figure out which tile I am assigned to. */ for (my_tile = 0; rank >= tile_groups[my_tile+1]; my_tile++); icetRaiseDebug1("My tile is %d", my_tile); group_size = tile_groups[my_tile+1] - tile_groups[my_tile]; my_width = tile_viewports[4*my_tile + 2]; my_height = tile_viewports[4*my_tile + 3]; my_fragment_size = FRAG_SIZE(max_width*max_height, group_size); num_requests = tile_contribs[my_tile]; fragmentSparseImageSize = icetSparseImageBufferSize(my_fragment_size, 1); incomingBuffers = icetGetStateBuffer(SPLIT_INCOMING_ARRAY_BUFFER, sizeof(IceTVoid*)*tile_contribs[my_tile]); outgoing = icetGetStateBufferSparseImage(SPLIT_OUTGOING_BUFFER, max_width, max_height); imageFragment = icetGetStateBufferImage(SPLIT_IMAGE_FRAGMENT_BUFFER, my_fragment_size, 1); fullImage = icetGetStateBufferImage(SPLIT_FULL_IMAGE_BUFFER, max_width, max_height); requests = icetGetStateBuffer(SPLIT_REQUEST_BUFFER, sizeof(IceTCommRequest)*num_requests); /* Set up asynchronous receives for all incoming image fragments. */ nextInBuf = icetGetStateBuffer(SPLIT_INCOMING_BUFFERS, fragmentSparseImageSize*tile_contribs[my_tile]); for (image = 0, node = 0; image < tile_contribs[my_tile]; node++) { if (all_contained_tiles_masks[node*num_tiles + my_tile]) { icetRaiseDebug1("Setting up receive from node %d", node); incomingBuffers[image] = nextInBuf; requests[image] = icetCommIrecv(incomingBuffers[image], fragmentSparseImageSize, ICET_BYTE, node, IMAGE_DATA); image++; nextInBuf += fragmentSparseImageSize; } } /* Render and send all tile images I am rendering. */ for (image = 0; image < num_contained_tiles; image++) { IceTSizeType sending_frag_size; IceTSizeType offset; tile = contained_tiles_list[image]; icetGetTileImage(tile, fullImage); icetRaiseDebug1("Rendered image for tile %d", tile); offset = 0; sending_frag_size = FRAG_SIZE(icetImageGetNumPixels(fullImage), tile_groups[tile+1]-tile_groups[tile]); for (node = tile_groups[tile]; node < tile_groups[tile+1]; node++) { IceTVoid *package_buffer; IceTSizeType package_size; IceTSizeType truncated_size; truncated_size = MIN(sending_frag_size, icetImageGetNumPixels(fullImage) - offset); icetRaiseDebug2("Sending tile %d to node %d", tile, node); icetRaiseDebug2("Pixels %d to %d", (int)offset, (int)truncated_size-1); icetCompressSubImage(fullImage, offset, truncated_size, outgoing); icetSparseImagePackageForSend(outgoing, &package_buffer, &package_size); icetCommSend(package_buffer, package_size, ICET_BYTE, node, IMAGE_DATA); offset += truncated_size; } } /* Wait for images to come in and Z compare them. */ first_incoming = 1; for (image = 0; image < tile_contribs[my_tile]; image++) { int idx; idx = icetCommWaitany(tile_contribs[my_tile], requests); incoming = icetSparseImageUnpackageFromReceive(incomingBuffers[idx]); if (first_incoming) { icetRaiseDebug1("Got first image (%d).", idx); icetDecompressImage(incoming, imageFragment); first_incoming = 0; } else { icetRaiseDebug1("Got subsequent image (%d).", idx); icetCompressedComposite(imageFragment, incoming, 1); } } if (icetIsEnabled(ICET_COLLECT_IMAGES)) { icetCollectImage(imageFragment, my_tile, tile_groups, fullImage); } else { IceTSizeType offset; offset = (rank - tile_groups[my_tile])*my_fragment_size; /* Fragment might be truncated. Adjust my_fragment_size appropriately. */ my_fragment_size = icetImageGetNumPixels(imageFragment); icetImageCopyPixels(imageFragment, 0, fullImage, offset, my_fragment_size); icetStateSetInteger(ICET_VALID_PIXELS_TILE, my_tile); icetStateSetInteger(ICET_VALID_PIXELS_OFFSET, offset); icetStateSetInteger(ICET_VALID_PIXELS_NUM, my_fragment_size); } return fullImage; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0xa8, %rsp pushq $0x2 popq %rdi leaq 0x3c(%rsp), %rsi callq 0x9efa pushq $0x3 popq %rdi leaq 0x14(%rsp), %rsi callq 0x9efa pushq $0x10 popq %rdi leaq 0x10(%rsp), %rsi callq 0x9efa pushq $0x13 popq %rdi leaq 0x24(%rsp), %rsi callq 0x9efa pushq $0x14 popq %rdi leaq 0x20(%rsp), %rsi callq 0x9efa movl $0x8a, %edi callq 0xa3e6 movq %rax, 0x58(%rsp) leaq 0x6c(%rsp), %rbx movl $0x8b, %edi movq %rbx, %rsi callq 0x9efa pushq $0x1b popq %rdi leaq 0x68(%rsp), %rsi callq 0x9efa pushq $0x11 popq %rdi callq 0xa3e6 movq %rax, %r15 leaq 0x64(%rsp), %rsi movl $0x86, %edi callq 0x9efa movl $0x87, %edi callq 0xa3e6 movq %rax, 0xa0(%rsp) movl $0x89, %edi callq 0xa3ed movq %rax, %r13 callq 0xd45f cmpl $0x0, (%rbx) jle 0x1405c movl 0x10(%rsp), %eax leal 0x4(,%rax,4), %esi movl $0x1a6, %edi # imm = 0x1A6 callq 0xa48f movq %rax, %r10 andl $0x0, (%rax) xorl %esi, %esi pushq $0x1 popq %rdi xorl %ecx, %ecx movq 0x58(%rsp), %r15 movslq 0x10(%rsp), %rax cmpq %rax, %rsi jge 0x13b27 movl (%r15,%rsi,4), %r8d movl 0x14(%rsp), %eax imull %r8d, %eax cltd idivl 0x6c(%rsp) cmpl $0x2, %eax movl %edi, %edx cmovgel %eax, %edx testl %r8d, %r8d cmovlel %eax, %edx movl %edx, 0x4(%r10,%rsi,4) incq %rsi addl %edx, %ecx jmp 0x13af2 xorl %eax, %eax pushq $-0x1 popq %rdx movl 0x14(%rsp), %esi cmpl %esi, %ecx jge 0x13b83 cvtsi2ss %esi, %xmm0 movl 0x10(%rsp), %esi testl %esi, %esi cmovlel %eax, %esi xorl %r8d, %r8d movl %edx, %edi cmpq %r8, %rsi je 0x13b77 movl (%r15,%r8,4), %r9d testl %r9d, %r9d je 0x13b72 cvtsi2ssl 0x4(%r10,%r8,4), %xmm1 cvtsi2ss %r9d, %xmm2 divss %xmm2, %xmm1 ucomiss %xmm1, %xmm0 cmoval %r8d, %edi minss %xmm0, %xmm1 movaps %xmm1, %xmm0 incq %r8 jmp 0x13b46 movslq %edi, %rsi incl 0x4(%r10,%rsi,4) incl %ecx jmp 0x13b2c xorl %eax, %eax pushq $-0x1 popq %rdx cmpl %esi, %ecx jle 0x13be4 movl 0x10(%rsp), %esi testl %esi, %esi cmovlel %eax, %esi xorps %xmm0, %xmm0 xorl %r8d, %r8d movl %edx, %edi cmpq %r8, %rsi je 0x13bd4 movl 0x4(%r10,%r8,4), %r9d incq %r8 cmpl $0x2, %r9d jl 0x13b9d cvtsi2ss %r9d, %xmm1 cvtsi2ssl -0x4(%r15,%r8,4), %xmm2 divss %xmm2, %xmm1 ucomiss %xmm0, %xmm1 leal -0x1(%r8), %r9d cmoval %r9d, %edi maxss %xmm0, %xmm1 movaps %xmm1, %xmm0 jmp 0x13b9d movslq %edi, %rsi decl 0x4(%r10,%rsi,4) decl %ecx movl 0x14(%rsp), %esi jmp 0x13b88 pushq $0x1 popq %rax movslq 0x10(%rsp), %rcx cmpq %rcx, %rax jge 0x13bff movl -0x4(%r10,%rax,4), %ecx addl %ecx, (%r10,%rax,4) incq %rax jmp 0x13be7 movl 0x14(%rsp), %eax movl %eax, (%r10,%rcx,4) pushq $-0x1 popq %rdx movl 0x3c(%rsp), %eax movl 0x8(%r10,%rdx,4), %ecx incq %rdx cmpl %ecx, %eax jge 0x13c0e movq %rdx, 0x90(%rsp) movl %edx, %r12d movq %r10, 0x18(%rsp) subl (%r10,%r12,4), %ecx movl 0x20(%rsp), %eax imull 0x24(%rsp), %eax addl %ecx, %eax decl %eax cltd idivl %ecx movl %eax, %r14d movl (%r15,%r12,4), %ebx pushq $0x1 popq %rsi movl %eax, %edi callq 0xd291 movl %eax, %ebp movl (%r15,%r12,4), %esi shll $0x3, %esi movl $0x1a1, %edi # imm = 0x1A1 callq 0xa48f movq %rax, 0x88(%rsp) movl 0x24(%rsp), %esi movl 0x20(%rsp), %edx movl $0x1a2, %edi # imm = 0x1A2 callq 0xd469 movq %rax, 0x48(%rsp) movl $0x1a3, %edi # imm = 0x1A3 movl %r14d, 0x60(%rsp) movl %r14d, %esi pushq $0x1 popq %rdx callq 0xd32f movq %rax, 0x28(%rsp) movl 0x24(%rsp), %esi movl 0x20(%rsp), %edx movl $0x1a4, %edi # imm = 0x1A4 callq 0xd32f movq %rax, 0x50(%rsp) shll $0x3, %ebx movl $0x1a5, %edi # imm = 0x1A5 movl %ebx, %esi callq 0xa48f movq %rax, 0x98(%rsp) movq %r12, 0x30(%rsp) movl (%r15,%r12,4), %esi imull %ebp, %esi movl $0x1a0, %edi # imm = 0x1A0 callq 0xa48f movq %rax, %rbx movslq %ebp, %r15 xorl %ebp, %ebp xorl %r14d, %r14d movq 0x58(%rsp), %rax movq 0x30(%rsp), %rcx cmpl (%rax,%rcx,4), %r14d jge 0x13d4d movl 0x10(%rsp), %eax imull %ebp, %eax addl 0x90(%rsp), %eax cltq cmpb $0x0, (%r13,%rax) je 0x13d49 movslq %r14d, %r12 movq 0x88(%rsp), %rax movq %rbx, (%rax,%r12,8) movq %rbx, %rdi movl %r15d, %esi movl $0x8001, %edx # imm = 0x8001 movl %ebp, %ecx pushq $0x32 popq %r8 callq 0xac0e movq 0x98(%rsp), %rcx movq %rax, (%rcx,%r12,8) incl %r14d addq %r15, %rbx incl %ebp jmp 0x13cea xorl %ecx, %ecx movq 0x18(%rsp), %rbp movslq 0x64(%rsp), %rax cmpq %rax, %rcx movq 0x50(%rsp), %r14 jge 0x13e2e movq 0xa0(%rsp), %rax movq %rcx, 0x40(%rsp) movl (%rax,%rcx,4), %ebx movl %ebx, %edi movq %r14, %rsi callq 0xf1a8 movq %r14, %rdi callq 0xd6e1 movslq %ebx, %r14 movl (%rbp,%r14,4), %ebx movl 0x4(%rbp,%r14,4), %ecx movl %ecx, %esi subl %ebx, %esi addl %esi, %eax decl %eax cltd idivl %esi movl %eax, %r15d xorl %r12d, %r12d cmpl %ecx, %ebx jge 0x13e21 movq 0x50(%rsp), %r13 movq %r13, %rdi callq 0xd6e1 subl %r12d, %eax movl %r15d, %ebp cmpl %eax, %r15d jle 0x13dd0 movq %r13, %rdi callq 0xd6e1 movl %eax, %ebp subl %r12d, %ebp movq %r13, %rdi movl %r12d, %esi movl %ebp, %edx movq 0x48(%rsp), %r13 movq %r13, %rcx callq 0x104d0 movq %r13, %rdi leaq 0x70(%rsp), %rsi leaq 0x8(%rsp), %rdx callq 0xe619 movq 0x70(%rsp), %rdi movl 0x8(%rsp), %esi movl $0x8001, %edx # imm = 0x8001 movl %ebx, %ecx pushq $0x32 popq %r8 callq 0xa795 addl %ebp, %r12d incl %ebx movq 0x18(%rsp), %rbp movl 0x4(%rbp,%r14,4), %ecx jmp 0x13da7 movq 0x40(%rsp), %rcx incq %rcx jmp 0x13d54 xorl %r14d, %r14d pushq $0x1 popq %rbx xorl %ebp, %ebp movq 0x58(%rsp), %r15 movq 0x88(%rsp), %r12 movq 0x30(%rsp), %rax movl (%r15,%rax,4), %edi cmpl %edi, %ebp jge 0x13e93 movq 0x98(%rsp), %rsi callq 0xac97 cltq movq (%r12,%rax,8), %rdi callq 0xe65e testb $0x1, %r14b je 0x13e7f movq 0x28(%rsp), %rdi movq %rax, %rsi movl %ebx, %edx callq 0x116d4 jmp 0x13e8c movq %rax, %rdi movq 0x28(%rsp), %rsi callq 0x10a6c incl %ebp movb $0x1, %r14b jmp 0x13e43 movl $0x146, %edi # imm = 0x146 callq 0xa341 testb %al, %al je 0x14092 pushq $0x1b popq %rdi leaq 0x8(%rsp), %rsi callq 0x9efa pushq $0x11 popq %rdi callq 0xa3e6 movq %rax, %r12 pushq $0x1a popq %rdi callq 0xa3e6 movq %rax, %rbx movq 0x28(%rsp), %r14 movq %r14, %rdi callq 0xd6e1 movl %eax, %r13d movq %r14, %rdi callq 0xd5b5 movq %r14, %rdi callq 0xd5ed movl %eax, %ebp movq %r14, %rdi callq 0xd6d2 movl %eax, %r15d callq 0xb64e movl %ebp, 0x40(%rsp) cmpl $0xc000, %ebp # imm = 0xC000 movq 0x50(%rsp), %r14 je 0x13f42 leaq 0xc(%rsp), %rbp movq 0x28(%rsp), %rdi movq %rbp, %rsi callq 0xd7da movl (%rbp), %esi imull %r13d, %esi movq 0x30(%rsp), %rcx movl (%rbx,%rcx,4), %ecx pushq $0x33 popq %r8 movq %rax, %rdi movl $0x8001, %edx # imm = 0x8001 callq 0xab73 movq %rax, 0x70(%rsp) movl %r15d, 0x48(%rsp) cmpl $0xd000, %r15d # imm = 0xD000 je 0x13f88 leaq 0xc(%rsp), %rbp movq 0x28(%rsp), %rdi movq %rbp, %rsi callq 0xd8cc imull (%rbp), %r13d movq 0x30(%rsp), %rcx movl (%rbx,%rcx,4), %ecx pushq $0x34 popq %r8 movq %rax, %rdi movl %r13d, %esi movl $0x8001, %edx # imm = 0x8001 callq 0xab73 movq %rax, 0x78(%rsp) movl 0x8(%rsp), %eax testl %eax, %eax js 0x14102 shll $0x2, %eax movl 0x8(%r12,%rax,4), %ebp movl 0xc(%r12,%rax,4), %ebx movq %r14, %rdi callq 0xd5b5 movq %r14, %rdi movl %ebp, %esi movl %ebx, %edx callq 0xd5fc movslq 0x8(%rsp), %rax movq 0x18(%rsp), %rdx movl 0x4(%rdx,%rax,4), %ecx subl (%rdx,%rax,4), %ecx jle 0x140fa imull %ebp, %ebx leal (%rbx,%rcx), %eax decl %eax cltd idivl %ecx movl %eax, %r12d movslq %eax, %r15 cmpl $0xc000, 0x40(%rsp) # imm = 0xC000 jne 0x14144 cmpl $0xd000, 0x48(%rsp) # imm = 0xD000 je 0x14102 leaq 0xc(%rsp), %rsi movq %r14, %rdi callq 0xd8cc movq %rax, %rbx movslq 0x8(%rsp), %rax movq 0x18(%rsp), %rcx movl (%rcx,%rax,4), %r13d pushq $0x34 popq %rbp cltq movq 0x18(%rsp), %rcx cmpl 0x4(%rcx,%rax,4), %r13d jge 0x14102 movl 0xc(%rsp), %esi imull %r12d, %esi movq %rbx, %rdi movl $0x8003, %edx # imm = 0x8003 movl %r13d, %ecx movl %ebp, %r8d callq 0xa82e movslq 0xc(%rsp), %rax imulq %r15, %rax addq %rax, %rbx incl %r13d movl 0x8(%rsp), %eax jmp 0x1401a movq %rax, %r14 movl 0x68(%rsp), %eax testl %eax, %eax js 0x1412f shll $0x2, %eax movl 0x8(%r15,%rax,4), %esi movl 0xc(%r15,%rax,4), %edx movl $0x1a4, %edi # imm = 0x1A4 callq 0xd32f movq %rax, %r14 movq %rax, %rdi callq 0xf0a0 jmp 0x1412f movl 0x3c(%rsp), %ebx movq 0x18(%rsp), %rax movq 0x30(%rsp), %rcx subl (%rax,%rcx,4), %ebx imull 0x60(%rsp), %ebx movq 0x28(%rsp), %r14 movq %r14, %rdi callq 0xd6e1 movl %eax, %ebp movq %r14, %rdi xorl %esi, %esi movq 0x50(%rsp), %r14 movq %r14, %rdx movl %ebx, %ecx movl %eax, %r8d callq 0xdbfa movl $0x8c, %edi movq 0x90(%rsp), %rsi callq 0x99db movl $0x8d, %edi movl %ebx, %esi callq 0x99db movl $0x8e, %edi movl %ebp, %esi callq 0x99db jmp 0x1412f movq %r14, %rdi callq 0xf0a0 cmpl $0xc000, 0x40(%rsp) # imm = 0xC000 je 0x14116 leaq 0x70(%rsp), %rdi callq 0xac7f cmpl $0xd000, 0x48(%rsp) # imm = 0xD000 je 0x1412a leaq 0x78(%rsp), %rdi callq 0xac7f callq 0xb662 movq %r14, %rax addq $0xa8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq leaq 0xc(%rsp), %rsi movq %r14, %rdi callq 0xd7da movq %rax, %rbx movslq 0x8(%rsp), %rax movq 0x18(%rsp), %rcx movl (%rcx,%rax,4), %r13d pushq $0x33 popq %rbp cltq movq 0x18(%rsp), %rcx cmpl 0x4(%rcx,%rax,4), %r13d jge 0x13feb movl 0xc(%rsp), %esi imull %r12d, %esi movq %rbx, %rdi movl $0x8001, %edx # imm = 0x8001 movl %r13d, %ecx movl %ebp, %r8d callq 0xa82e movslq 0xc(%rsp), %rax imulq %r15, %rax addq %rax, %rbx incl %r13d movl 0x8(%rsp), %eax jmp 0x14165 nop
/kmorel[P]IceT/src/strategies/split.c
std::function<void (std::vector<double, std::allocator<double>> const&, std::vector<double, std::allocator<double>>&)> TasDREAM::posterior<(TasDREAM::TypeSamplingForm)1>(std::function<void (std::vector<double, std::allocator<double>> const&, std::vector<double, std::allocator<double>>&)>, std::function<void (TasDREAM::TypeSamplingForm, std::vector<double, std::allocator<double>> const&, std::vector<double, std::allocator<double>>&)>)
DreamPDF posterior(DreamMergedLikelyModel likelihood_model, DreamPrior prior){ return [=](const std::vector<double> &candidates, std::vector<double> &values)->void{ likelihood_model(candidates, values); std::vector<double> prior_vals(values.size()); prior(form, candidates, prior_vals); auto iv = values.begin(); if (form == regform){ for(auto p : prior_vals) *iv++ *= p; }else{ for(auto p : prior_vals) *iv++ += p; } }; }
pushq %r15 pushq %r14 pushq %rbx subq $0x40, %rsp movq %rdx, %r15 movq %rdi, %rbx movq %rsp, %rdi callq 0x9e56 leaq 0x20(%rsp), %r14 movq %r14, %rdi movq %r15, %rsi callq 0xd15e movq %rsp, %rsi movq %rbx, %rdi callq 0xd524 movq 0x30(%rsp), %rax testq %rax, %rax je 0xc801 movq %r14, %rdi movq %r14, %rsi movl $0x3, %edx callq *%rax movq 0x10(%rsp), %rax testq %rax, %rax je 0xc818 movq %rsp, %rdi movq %rdi, %rsi movl $0x3, %edx callq *%rax movq %rbx, %rax addq $0x40, %rsp popq %rbx popq %r14 popq %r15 retq jmp 0xc858 jmp 0xc858 movq %rax, %rbx movq %rsp, %rdi callq 0xd582 jmp 0xc850 movq %rax, %rbx movq 0x10(%rsp), %rax testq %rax, %rax je 0xc850 movq %rsp, %rdi movq %rdi, %rsi movl $0x3, %edx callq *%rax movq %rbx, %rdi callq 0x7370 movq %rax, %rdi callq 0x941d
/mkstoyanov[P]TASMANIAN/DREAM/tsgDreamSample.hpp
czh::error::location_to_str[abi:cxx11](std::source_location const&)
std::string location_to_str(const std::source_location &l) { return std::string(l.file_name()) + ":" + std::to_string(l.line()) + ":" + l.function_name() + "()"; }
pushq %r15 pushq %r14 pushq %rbx subq $0xd0, %rsp movq %rsi, %r14 movq %rdi, %rbx movq (%rsi), %rax testq %rax, %rax je 0xe78f movq (%rax), %rsi jmp 0xe796 leaq 0x55efe(%rip), %rsi # 0x64694 leaq 0xb0(%rsp), %r15 leaq 0xf(%rsp), %rdx movq %r15, %rdi callq 0x10b0c leaq 0x551c5(%rip), %rdx # 0x63977 leaq 0x30(%rsp), %rdi movq %r15, %rsi callq 0x10a85 movq (%r14), %rax testq %rax, %rax je 0xe7cc movl 0x10(%rax), %esi jmp 0xe7ce xorl %esi, %esi leaq 0x10(%rsp), %rdi callq 0x10b47 leaq 0x50(%rsp), %rdi leaq 0x30(%rsp), %rsi leaq 0x10(%rsp), %rdx callq 0x10aa4 leaq 0x55184(%rip), %rdx # 0x63977 leaq 0x70(%rsp), %rdi leaq 0x50(%rsp), %rsi callq 0x10a85 movq (%r14), %rax testq %rax, %rax je 0xe810 movq 0x8(%rax), %rdx jmp 0xe817 leaq 0x55e7d(%rip), %rdx # 0x64694 leaq 0x90(%rsp), %rdi leaq 0x70(%rsp), %rsi callq 0x10a85 leaq 0x4f3d8(%rip), %rdx # 0x5dc08 leaq 0x90(%rsp), %rsi movq %rbx, %rdi callq 0x10a85 leaq 0x90(%rsp), %rdi callq 0x10b86 leaq 0x70(%rsp), %rdi callq 0x10b86 leaq 0x50(%rsp), %rdi callq 0x10b86 leaq 0x10(%rsp), %rdi callq 0x10b86 leaq 0x30(%rsp), %rdi callq 0x10b86 leaq 0xb0(%rsp), %rdi callq 0x10b86 movq %rbx, %rax addq $0xd0, %rsp popq %rbx popq %r14 popq %r15 retq movq %rax, %rbx leaq 0x90(%rsp), %rdi callq 0x10b86 jmp 0xe8a7 movq %rax, %rbx leaq 0x70(%rsp), %rdi callq 0x10b86 jmp 0xe8b6 movq %rax, %rbx leaq 0x50(%rsp), %rdi callq 0x10b86 jmp 0xe8c5 movq %rax, %rbx leaq 0x10(%rsp), %rdi callq 0x10b86 jmp 0xe8d4 movq %rax, %rbx leaq 0x30(%rsp), %rdi callq 0x10b86 leaq 0xb0(%rsp), %rdi callq 0x10b86 movq %rbx, %rdi callq 0xd750 movq %rax, %rbx jmp 0xe8de
/caozhanhao[P]wxserver/thirdparty/libczh/include/libczh/error.hpp
czh::utils::grisu_round(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, unsigned long, unsigned long, unsigned long, unsigned long)
void grisu_round(std::string &buffer, uint64_t delta, uint64_t rest, uint64_t ten_kappa, uint64_t wp_w) { while (rest < wp_w && delta - rest >= ten_kappa && (rest + ten_kappa < wp_w || /// closer wp_w - rest > rest + ten_kappa - wp_w)) { --buffer.back(); rest += ten_kappa; } }
subq %rdx, %rsi movq %rcx, %rax subq %r8, %rax movq %r8, %r9 subq %rdx, %r9 cmpq %r8, %rdx jae 0xea18 subq %rcx, %rsi jb 0xea18 leaq (%rdx,%rcx), %r10 cmpq %r8, %r10 jb 0xea04 addq %rax, %rdx cmpq %rdx, %r9 jbe 0xea18 movq (%rdi), %rdx movq 0x8(%rdi), %r11 decb -0x1(%rdx,%r11) subq %rcx, %r9 movq %r10, %rdx jmp 0xe9e9 retq
/caozhanhao[P]wxserver/thirdparty/libczh/include/libczh/dtoa.hpp
czh::utils::grisu2(double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, int&)
void grisu2(double v, std::string &buffer, int &K) { int q = 64, alpha = -59; auto[w_m, w_p] = DiyFp(v).normalized_boundaries(); DiyFp w = DiyFp(v).normalize(); int mk = k_comp(w_p.e + q, alpha); DiyFp c_mk = cached_power(mk); DiyFp W = w * c_mk; DiyFp Wp = w_p * c_mk; DiyFp Wm = w_m * c_mk; Wm.f++; Wp.f--; DiyFp delta = Wp - Wm; K = -mk; digit_gen(W, Wp, delta, buffer, K); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x78, %rsp movq %rsi, 0x10(%rsp) movq %xmm0, %rax movq %rax, %rcx shrq $0x34, %rcx andl $0x7ff, %ecx # imm = 0x7FF movabsq $0xfffffffffffff, %rdx # imm = 0xFFFFFFFFFFFFF andq %rdx, %rax testl %ecx, %ecx leaq 0x1(%rax,%rdx), %rbx cmoveq %rax, %rbx leal -0x433(%rcx), %eax movl $0xfffffbce, %ebp # imm = 0xFFFFFBCE cmovnel %eax, %ebp movq %rdi, 0x8(%rsp) leaq 0x28(%rsp), %r14 movq %rbx, (%r14) movl %ebp, 0x8(%r14) leaq 0x38(%rsp), %r12 movq %r12, %rdi movq %r14, %rsi callq 0x11308 leaq 0x48(%rsp), %r15 leaq 0x18(%rsp), %r13 movq %rbx, (%r13) movl %ebp, 0x8(%r13) movq %r13, %rdi callq 0x1139c movq %rax, (%r14) movl %edx, 0x8(%r14) pushq $-0x3c popq %rax subl -0x8(%r15), %eax cvtsi2sd %eax, %xmm0 mulsd 0x4d5bf(%rip), %xmm0 # 0x5c1f8 callq 0xdc50 cvttsd2si %xmm0, %ebp movl %ebp, %edi callq 0xe99c movq %rax, (%r13) movl %edx, 0x8(%r13) leaq 0x28(%rsp), %rdi leaq 0x18(%rsp), %r15 movq %r15, %rsi callq 0x113b8 movq %rax, %r13 movl %edx, %r14d movq %r12, %rdi movq %r15, %rsi callq 0x113b8 movq %rax, %r12 leaq 0x68(%rsp), %rbx movl %edx, 0x8(%rbx) leaq 0x48(%rsp), %rdi movq %r15, %rsi callq 0x113b8 leaq 0x58(%rsp), %rsi movl %edx, 0x8(%rsi) incq %rax movq %rax, (%rsi) decq %r12 movq %r12, (%rbx) movq %rbx, %rdi callq 0x1127a negl %ebp movq 0x10(%rsp), %r9 movl %ebp, (%r9) movq (%rbx), %rdx movl 0x8(%rbx), %ecx movq %r13, %rdi movl %r14d, %esi movq %rax, %r8 pushq %r9 pushq 0x10(%rsp) callq 0xea19 addq $0x88, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/caozhanhao[P]wxserver/thirdparty/libczh/include/libczh/dtoa.hpp
czh::utils::fill_exponent(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
void fill_exponent(int K, std::string &buffer) { if (K < 0) { buffer += '-'; K = -K; } if (K >= 100) { buffer += static_cast<char>(static_cast<int>('0') + K / 100); K %= 100; buffer += static_cast<char>(static_cast<int>('0') + K / 10); K %= 10; buffer += static_cast<char>(static_cast<int>('0') + K); } else if (K >= 10) { buffer += static_cast<char>(static_cast<int>('0') + K / 10); K %= 10; buffer += static_cast<char>(static_cast<int>('0') + K); } else buffer += static_cast<char>(static_cast<int>('0') + K); }
pushq %rbp pushq %rbx pushq %rax movq %rsi, %rbx movl %edi, %ebp testl %edi, %edi jns 0xecf7 pushq $0x2d popq %rsi movq %rbx, %rdi callq 0x34dc0 negl %ebp cmpl $0x64, %ebp jb 0xed16 pushq $0x64 popq %rcx movl %ebp, %eax xorl %edx, %edx divl %ecx addb $0x30, %al movsbl %al, %esi movl %edx, %ebp movq %rbx, %rdi callq 0x34dc0 jmp 0xed1b cmpl $0xa, %ebp jb 0xed33 movzbl %bpl, %eax movb $0xa, %cl divb %cl movzbl %ah, %ebp orb $0x30, %al movsbl %al, %esi movq %rbx, %rdi callq 0x34dc0 orb $0x30, %bpl movsbl %bpl, %esi movq %rbx, %rdi addq $0x8, %rsp popq %rbx popq %rbp jmp 0x34dc0
/caozhanhao[P]wxserver/thirdparty/libczh/include/libczh/dtoa.hpp
czh::utils::fill_double[abi:cxx11](double)
std::string fill_double(double v) { int K; std::string buffer; grisu2(v, buffer, K); return std::move(prettify_string(buffer, K)); }
pushq %rbx subq $0x50, %rsp movq %rdi, %rbx leaq 0x20(%rsp), %rax movq %rax, -0x10(%rax) andq $0x0, -0x8(%rax) movb $0x0, (%rax) leaq 0x10(%rsp), %rdi leaq 0xc(%rsp), %rsi callq 0xeb99 movl 0xc(%rsp), %edx leaq 0x30(%rsp), %rdi leaq 0x10(%rsp), %rsi callq 0xed49 leaq 0x10(%rbx), %rcx movq %rcx, (%rbx) leaq 0x40(%rsp), %rax movq -0x10(%rax), %rdx cmpq %rax, %rdx je 0xefc2 movq %rdx, (%rbx) movq 0x40(%rsp), %rcx movq %rcx, 0x10(%rbx) jmp 0xefc8 movups (%rax), %xmm0 movups %xmm0, (%rcx) leaq 0x30(%rsp), %rdi movq 0x8(%rdi), %rcx movq %rcx, 0x8(%rbx) movq %rax, (%rdi) andq $0x0, 0x8(%rdi) movb $0x0, 0x10(%rdi) callq 0x10b86 leaq 0x10(%rsp), %rdi callq 0x10b86 movq %rbx, %rax addq $0x50, %rsp popq %rbx retq jmp 0xeffb movq %rax, %rbx leaq 0x10(%rsp), %rdi callq 0x10b86 movq %rbx, %rdi callq 0xd750
/caozhanhao[P]wxserver/thirdparty/libczh/include/libczh/dtoa.hpp
czh::utils::dtoa[abi:cxx11](double const&)
std::string dtoa(const double &value) { if (value == 0 && ((double_to_uint64(value) & SIGN_MASK) != 0)) { return "-0.0"; } std::string buffer; if (value == 0) { buffer = "0.0"; } else { buffer = fill_double(std::abs(value)); } if (value < 0) { return "-" + buffer; } return std::move(buffer); }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x48, %rsp movq %rsi, %r14 movq %rdi, %rbx movsd (%rsi), %xmm0 xorpd %xmm1, %xmm1 ucomisd %xmm1, %xmm0 jne 0xf067 jp 0xf067 movq %xmm0, %rax testq %rax, %rax js 0xf0e8 leaq 0x18(%rsp), %r12 movq %r12, -0x10(%r12) andq $0x0, -0x8(%r12) movb $0x0, (%r12) leaq 0x4de63(%rip), %rsi # 0x5cebe leaq 0x8(%rsp), %rdi callq 0x5513a jmp 0xf0a8 leaq 0x18(%rsp), %r12 movq %r12, -0x10(%r12) andq $0x0, -0x8(%r12) movb $0x0, (%r12) andpd 0x4d18c(%rip), %xmm0 # 0x5c210 leaq 0x28(%rsp), %rdi callq 0xef64 leaq 0x8(%rsp), %rdi leaq 0x28(%rsp), %r15 movq %r15, %rsi callq 0x114a0 movq %r15, %rdi callq 0x10b86 xorpd %xmm0, %xmm0 ucomisd (%r14), %xmm0 jbe 0xf0c9 leaq 0x51753(%rip), %rsi # 0x6080d leaq 0x8(%rsp), %rdx movq %rbx, %rdi callq 0x11592 jmp 0xf121 leaq 0x10(%rbx), %rax movq %rax, (%rbx) movq 0x8(%rsp), %rcx cmpq %r12, %rcx je 0xf0fe movq %rcx, (%rbx) movq 0x18(%rsp), %rax movq %rax, 0x10(%rbx) jmp 0xf108 leaq 0x4ddce(%rip), %rsi # 0x5cebd leaq 0x8(%rsp), %rdx movq %rbx, %rdi callq 0x10b0c jmp 0xf12b movupd (%r12), %xmm0 movupd %xmm0, (%rax) movq 0x10(%rsp), %rax movq %rax, 0x8(%rbx) movq %r12, 0x8(%rsp) andq $0x0, 0x10(%rsp) movb $0x0, 0x18(%rsp) leaq 0x8(%rsp), %rdi callq 0x10b86 movq %rbx, %rax addq $0x48, %rsp popq %rbx popq %r12 popq %r14 popq %r15 retq jmp 0xf13c movq %rax, %rbx leaq 0x8(%rsp), %rdi callq 0x10b86 movq %rbx, %rdi callq 0xd750
/caozhanhao[P]wxserver/thirdparty/libczh/include/libczh/dtoa.hpp
czh::value::details::get_typename[abi:cxx11](unsigned long)
std::string get_typename(size_t sz) { static std::vector<std::string> names{"Null", "int", "long long", "double", "bool", "std::string", "czh::value::Reference", "czh::value::Array"}; return names[sz]; }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x118, %rsp # imm = 0x118 movq %rsi, %r12 movq %rdi, %r15 movb 0x889ed(%rip), %al # 0x97b58 testb %al, %al je 0xf197 shlq $0x5, %r12 addq 0x889c6(%rip), %r12 # 0x97b40 movq %r15, %rdi movq %r12, %rsi callq 0x11642 movq %r15, %rax addq $0x118, %rsp # imm = 0x118 popq %rbx popq %r12 popq %r14 popq %r15 retq leaq 0x889ba(%rip), %rdi # 0x97b58 callq 0xd410 testl %eax, %eax je 0xf16f leaq 0x4dd14(%rip), %rsi # 0x5cec2 leaq 0x18(%rsp), %rbx leaq 0x17(%rsp), %rdx movq %rbx, %rdi callq 0x10b0c leaq 0x38(%rsp), %r14 leaq 0x514cf(%rip), %rsi # 0x6069b leaq 0x16(%rsp), %rdx movq %r14, %rdi callq 0x10b0c leaq 0x58(%rsp), %r14 leaq 0x4dce2(%rip), %rsi # 0x5cec7 leaq 0x15(%rsp), %rdx movq %r14, %rdi callq 0x10b0c leaq 0x78(%rsp), %r14 leaq 0x4dcd3(%rip), %rsi # 0x5ced1 leaq 0x14(%rsp), %rdx movq %r14, %rdi callq 0x10b0c leaq 0x98(%rsp), %r14 leaq 0x4dcbe(%rip), %rsi # 0x5ced8 leaq 0x13(%rsp), %rdx movq %r14, %rdi callq 0x10b0c leaq 0xb8(%rsp), %r14 leaq 0x4e456(%rip), %rsi # 0x5d68c leaq 0x12(%rsp), %rdx movq %r14, %rdi callq 0x10b0c leaq 0xd8(%rsp), %r14 leaq 0x4dc8b(%rip), %rsi # 0x5cedd leaq 0x11(%rsp), %rdx movq %r14, %rdi callq 0x10b0c leaq 0xf8(%rsp), %r14 leaq 0x4dc85(%rip), %rsi # 0x5cef3 leaq 0x10(%rsp), %rdx movq %r14, %rdi callq 0x10b0c leaq 0x888be(%rip), %rdi # 0x97b40 leaq 0x18(%rsp), %rsi pushq $0x8 popq %rdx leaq 0xf(%rsp), %rcx callq 0x11608 movl $0xe0, %ebx leaq (%rsp,%rbx), %rdi addq $0x18, %rdi callq 0x10b86 addq $-0x20, %rbx cmpq $-0x20, %rbx jne 0xf299 leaq 0x19c1(%rip), %rdi # 0x10c78 leaq 0x88882(%rip), %rsi # 0x97b40 leaq 0x88413(%rip), %rdx # 0x976d8 callq 0xd9a0 leaq 0x88887(%rip), %rdi # 0x97b58 callq 0xd680 jmp 0xf16f movq %rax, %r15 movl $0xe0, %r12d leaq (%rsp,%r12), %rdi addq $0x18, %rdi callq 0x10b86 addq $-0x20, %r12 cmpq $-0x20, %r12 jne 0xf2e4 movb $0x1, %al jmp 0xf310 jmp 0xf30b jmp 0xf30b jmp 0xf30b jmp 0xf30b jmp 0xf30b jmp 0xf30b movq %rax, %r15 xorl %eax, %eax cmpq %r14, %rbx je 0xf32f testb %al, %al jne 0xf32f addq $-0x20, %r14 movq %r14, %rdi callq 0x10b86 cmpq %rbx, %r14 jne 0xf319 jmp 0xf32f movq %rax, %r15 leaq 0x88822(%rip), %rdi # 0x97b58 callq 0xd4f0 movq %r15, %rdi callq 0xd750
/caozhanhao[P]wxserver/thirdparty/libczh/include/libczh/value.hpp
czh::utils::colorify(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, czh::utils::Color, czh::utils::ColorType)
std::string colorify(const std::string &str, Color with_color, ColorType type) { if (with_color == Color::no_color) return str; switch (get_color(type)) { case CzhColor::PURPLE: return "\033[35m" + str + "\033[0m"; case CzhColor::LIGHT_BLUE: return "\033[36m" + str + "\033[0m"; case CzhColor::BLUE: return "\033[34m" + str + "\033[0m"; case CzhColor::GREEN: return "\033[32m" + str + "\033[0m"; case CzhColor::YELLOW: return "\033[33m" + str + "\033[0m"; case CzhColor::WHITE: return "\033[37m" + str + "\033[0m"; case CzhColor::RED: return "\033[31m" + str + "\033[0m"; default: error::czh_unreachable(); } error::czh_unreachable(); return ""; }
pushq %r15 pushq %r14 pushq %rbx subq $0x60, %rsp movq %rsi, %r14 movq %rdi, %rbx cmpl $0x1, %edx jne 0xf367 movq %rbx, %rdi movq %r14, %rsi callq 0x11642 jmp 0xf4e4 movl %ecx, 0x58(%rsp) movb 0x8881f(%rip), %al # 0x97b90 testb %al, %al je 0xf4f1 leaq 0x887e0(%rip), %rdi # 0x97b60 leaq 0x58(%rsp), %rsi callq 0x14692 movl (%rax), %eax cmpq $0x6, %rax ja 0xf579 leaq 0x4ac97(%rip), %rcx # 0x5a034 movslq (%rcx,%rax,4), %rax addq %rcx, %rax jmpq *%rax leaq 0x4db69(%rip), %rsi # 0x5cf16 leaq 0x10(%rsp), %r15 movq %r15, %rdi movq %r14, %rdx callq 0x11592 leaq 0x4db47(%rip), %rdx # 0x5cf0b movq %rbx, %rdi movq %r15, %rsi callq 0x10a85 jmp 0xf4da leaq 0x4db47(%rip), %rsi # 0x5cf22 leaq 0x10(%rsp), %r15 movq %r15, %rdi movq %r14, %rdx callq 0x11592 leaq 0x4db19(%rip), %rdx # 0x5cf0b movq %rbx, %rdi movq %r15, %rsi callq 0x10a85 jmp 0xf4da leaq 0x4db13(%rip), %rsi # 0x5cf1c leaq 0x10(%rsp), %r15 movq %r15, %rdi movq %r14, %rdx callq 0x11592 leaq 0x4daeb(%rip), %rdx # 0x5cf0b movq %rbx, %rdi movq %r15, %rsi callq 0x10a85 jmp 0xf4da leaq 0x4dace(%rip), %rsi # 0x5cf05 leaq 0x10(%rsp), %r15 movq %r15, %rdi movq %r14, %rdx callq 0x11592 leaq 0x4dabd(%rip), %rdx # 0x5cf0b movq %rbx, %rdi movq %r15, %rsi callq 0x10a85 jmp 0xf4da leaq 0x4daae(%rip), %rsi # 0x5cf10 leaq 0x10(%rsp), %r15 movq %r15, %rdi movq %r14, %rdx callq 0x11592 leaq 0x4da92(%rip), %rdx # 0x5cf0b movq %rbx, %rdi movq %r15, %rsi callq 0x10a85 jmp 0xf4da leaq 0x4da9b(%rip), %rsi # 0x5cf28 leaq 0x10(%rsp), %r15 movq %r15, %rdi movq %r14, %rdx callq 0x11592 leaq 0x4da67(%rip), %rdx # 0x5cf0b movq %rbx, %rdi movq %r15, %rsi callq 0x10a85 jmp 0xf4da leaq 0x4da76(%rip), %rsi # 0x5cf2e leaq 0x10(%rsp), %r15 movq %r15, %rdi movq %r14, %rdx callq 0x11592 leaq 0x4da3c(%rip), %rdx # 0x5cf0b movq %rbx, %rdi movq %r15, %rsi callq 0x10a85 leaq 0x10(%rsp), %rdi callq 0x10b86 movq %rbx, %rax addq $0x60, %rsp popq %rbx popq %r14 popq %r15 retq leaq 0x88698(%rip), %rdi # 0x97b90 callq 0xd410 testl %eax, %eax je 0xf379 movups 0x4cbc0(%rip), %xmm0 # 0x5c0cc leaq 0x10(%rsp), %rsi movaps %xmm0, 0x30(%rsi) movups 0x4cba0(%rip), %xmm0 # 0x5c0bc movaps %xmm0, 0x20(%rsi) movups 0x4cb85(%rip), %xmm0 # 0x5c0ac movaps %xmm0, 0x10(%rsi) movups 0x4cb6a(%rip), %xmm0 # 0x5c09c movaps %xmm0, (%rsi) leaq 0x88624(%rip), %rdi # 0x97b60 pushq $0x8 popq %rdx leaq 0xe(%rsp), %rcx leaq 0xf(%rsp), %r8 callq 0x14646 leaq 0x5137(%rip), %rdi # 0x1468c leaq 0x88604(%rip), %rsi # 0x97b60 leaq 0x88175(%rip), %rdx # 0x976d8 callq 0xd9a0 leaq 0x88621(%rip), %rdi # 0x97b90 callq 0xd680 jmp 0xf379 leaq 0x4d9b4(%rip), %rsi # 0x5cf34 leaq 0x10(%rsp), %rdi leaq 0xe(%rsp), %rdx callq 0x10b0c leaq 0x85be2(%rip), %rax # 0x95178 leaq 0x58(%rsp), %rsi movq %rax, (%rsi) leaq 0x10(%rsp), %rdi callq 0xe8f8 movq %rax, %rbx leaq 0x885de(%rip), %rdi # 0x97b90 callq 0xd4f0 jmp 0xf5d9 jmp 0xf5cc movq %rax, %rbx jmp 0xf5d9 jmp 0xf5cc jmp 0xf5cc jmp 0xf5cc jmp 0xf5cc jmp 0xf5cc jmp 0xf5cc movq %rax, %rbx leaq 0x10(%rsp), %rdi callq 0x10b86 movq %rbx, %rdi callq 0xd750
/caozhanhao[P]wxserver/thirdparty/libczh/include/libczh/utils.hpp
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> czh::utils::to_czhstr<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, czh::utils::Color)
std::string to_czhstr(const std::string &val, Color color) { std::string ret; for (auto &r: val) { switch (r) { case '\"': ret += '\\'; ret += '\"'; break; case '\\': ret += '\\'; ret += '\\'; break; case '\b': ret += '\\'; ret += 'b'; break; case '\f': ret += '\\'; ret += 'f'; break; case '\n': ret += '\\'; ret += 'n'; break; case '\r': ret += '\\'; ret += 'r'; break; case '\t': ret += '\\'; ret += 't'; break; default: ret += r; break; } } return colorify(("\"" + ret + "\""), color, ColorType::STR); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x78, %rsp movl %edx, 0xc(%rsp) leaq 0x28(%rsp), %rax movq %rax, -0x10(%rax) andq $0x0, -0x8(%rax) movq %rdi, 0x10(%rsp) movb $0x0, (%rax) movq (%rsi), %r12 movq 0x8(%rsi), %r13 xorl %ebp, %ebp leaq 0x18(%rsp), %r14 leaq 0x4a914(%rip), %rbx # 0x5a050 cmpq %rbp, %r13 je 0xf7ea movb (%r12,%rbp), %r15b movzbl %r15b, %eax leal -0x8(%rax), %ecx cmpl $0x5, %ecx ja 0xf76e movslq (%rbx,%rcx,4), %rax addq %rbx, %rax jmpq *%rax movb $0x62, %r15b movq %r14, %rdi pushq $0x5c popq %rsi callq 0x34dc0 jmp 0xf7d6 cmpl $0x5c, %eax je 0xf7c8 cmpl $0x22, %eax jne 0xf7d6 movb $0x22, %r15b movq %r14, %rdi pushq $0x5c popq %rsi callq 0x34dc0 jmp 0xf7d6 movb $0x74, %r15b movq %r14, %rdi pushq $0x5c popq %rsi callq 0x34dc0 jmp 0xf7d6 movb $0x6e, %r15b movq %r14, %rdi pushq $0x5c popq %rsi callq 0x34dc0 jmp 0xf7d6 movb $0x66, %r15b movq %r14, %rdi pushq $0x5c popq %rsi callq 0x34dc0 jmp 0xf7d6 movb $0x72, %r15b movq %r14, %rdi pushq $0x5c popq %rsi callq 0x34dc0 jmp 0xf7d6 movb $0x5c, %r15b movq %r14, %rdi pushq $0x5c popq %rsi callq 0x34dc0 movsbl %r15b, %esi movq %r14, %rdi callq 0x34dc0 incq %rbp jmp 0xf73c leaq 0x50f04(%rip), %rsi # 0x606f5 leaq 0x38(%rsp), %rdi leaq 0x18(%rsp), %rdx callq 0x11592 leaq 0x50eee(%rip), %rdx # 0x606f5 leaq 0x58(%rsp), %rdi leaq 0x38(%rsp), %rsi callq 0x10a85 movq 0x10(%rsp), %rbx leaq 0x58(%rsp), %rsi pushq $0x3 popq %rcx movq %rbx, %rdi movl 0xc(%rsp), %edx callq 0xf343 leaq 0x58(%rsp), %rdi callq 0x10b86 leaq 0x38(%rsp), %rdi callq 0x10b86 leaq 0x18(%rsp), %rdi callq 0x10b86 movq %rbx, %rax addq $0x78, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq %rax, %rbx leaq 0x58(%rsp), %rdi callq 0x10b86 jmp 0xf871 movq %rax, %rbx leaq 0x38(%rsp), %rdi callq 0x10b86 jmp 0xf882 jmp 0xf87f movq %rax, %rbx leaq 0x18(%rsp), %rdi callq 0x10b86 movq %rbx, %rdi callq 0xd750
/caozhanhao[P]wxserver/thirdparty/libczh/include/libczh/utils.hpp
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> czh::utils::to_czhstr<std::vector<std::variant<czh::value::Null, int, long long, double, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::variant<czh::value::Null, int, long long, double, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>>(std::vector<std::variant<czh::value::Null, int, long long, double, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::variant<czh::value::Null, int, long long, double, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>> const&, czh::utils::Color)
std::string to_czhstr(const value::Array &v, Color color) { auto visitor = [&color](auto &&v) -> std::string { return to_czhstr(v, color); }; std::string result = "{"; for (auto it = v.cbegin(); it != std::prev(v.cend()); ++it) { result += std::visit(visitor, *it); result += ","; } result += std::visit(visitor, *std::prev(v.cend())); result += "}"; return result; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x38, %rsp movq %rsi, %r14 movq %rdi, %rbx leaq 0x14(%rsp), %rax movl %edx, (%rax) leaq 0x8(%rsp), %rcx movq %rax, (%rcx) leaq 0x4d6fe(%rip), %rsi # 0x5d016 leaq 0x18(%rsp), %r12 movq %r12, %rdx callq 0x10b0c movq (%r14), %r13 leaq 0x85999(%rip), %r15 # 0x952c8 leaq 0x4d6e2(%rip), %rbp # 0x5d018 movq 0x8(%r14), %rax leaq -0x28(%rax), %rdx cmpq %rdx, %r13 je 0xf97b movzbl 0x20(%r13), %eax movq %r12, %rdi leaq 0x8(%rsp), %rsi movq %r13, %rdx callq *(%r15,%rax,8) movq %rbx, %rdi movq %r12, %rsi callq 0x10c68 movq %r12, %rdi callq 0x10b86 movq %rbx, %rdi movq %rbp, %rsi callq 0x10bce addq $0x28, %r13 jmp 0xf936 movzbl -0x8(%rax), %eax leaq 0x18(%rsp), %rdi leaq 0x8(%rsp), %rsi callq *(%r15,%rax,8) leaq 0x18(%rsp), %rsi movq %rbx, %rdi callq 0x10c68 leaq 0x18(%rsp), %rdi callq 0x10b86 leaq 0x53fd2(%rip), %rsi # 0x6397d movq %rbx, %rdi callq 0x10bce movq %rbx, %rax addq $0x38, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq jmp 0xf9dc jmp 0xf9cd jmp 0xf9dc jmp 0xf9dc movq %rax, %r14 leaq 0x18(%rsp), %rdi callq 0x10b86 jmp 0xf9df movq %rax, %r14 movq %rbx, %rdi callq 0x10b86 movq %r14, %rdi callq 0xd750
/caozhanhao[P]wxserver/thirdparty/libczh/include/libczh/utils.hpp
czh::utils::get_string_edit_distance(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
int get_string_edit_distance(const std::string &s1, const std::string &s2) { std::size_t n = s1.size(); std::size_t m = s2.size(); if (n * m == 0) return static_cast<int>(n + m); std::vector<std::vector<int>> D(n + 1, std::vector<int>(m + 1)); for (int i = 0; i < n + 1; i++) { D[i][0] = i; } for (int j = 0; j < m + 1; j++) D[0][j] = j; for (int i = 1; i < n + 1; i++) { for (int j = 1; j < m + 1; j++) { int left = D[i - 1][j] + 1; int down = D[i][j - 1] + 1; int left_down = D[i - 1][j - 1]; if (s1[i - 1] != s2[j - 1]) left_down += 1; D[i][j] = (std::min)(left, (std::min)(down, left_down)); } } return D[n][m]; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x58, %rsp movq %rdi, 0x18(%rsp) movq 0x8(%rdi), %rcx movq %rsi, 0x20(%rsp) movq 0x8(%rsi), %rbx movq %rbx, %rax imulq %rcx, %rax testq %rax, %rax je 0xfb36 movq %rcx, 0x8(%rsp) leaq 0x1(%rcx), %r12 movq %rbx, 0x10(%rsp) leaq 0x1(%rbx), %r13 leaq 0x40(%rsp), %rbp leaq 0x7(%rsp), %rdx movq %rbp, %rdi movq %r13, %rsi callq 0x1165c leaq 0x28(%rsp), %rdi leaq 0x6(%rsp), %rcx movq %r12, %rsi movq %rbp, %rdx callq 0x116ae leaq 0x40(%rsp), %rdi callq 0x5535c xorl %eax, %eax movq 0x28(%rsp), %rcx cmpq %rax, %r12 je 0xfa7f movq (%rcx), %rdx movl %eax, (%rdx) incq %rax addq $0x18, %rcx jmp 0xfa6c movq 0x28(%rsp), %rax xorl %ecx, %ecx cmpq %rcx, %r13 je 0xfa96 movq (%rax), %rdx movl %ecx, (%rdx,%rcx,4) incq %rcx jmp 0xfa86 pushq $0x1 popq %rcx cmpq %rcx, %r12 jbe 0xfb15 leaq -0x1(%rcx), %rdx movq 0x28(%rsp), %rsi imulq $0x18, %rcx, %r8 leaq (%rsi,%r8), %rdi addq $-0x18, %rdi addq %r8, %rsi movq 0x18(%rsp), %rax movq (%rax), %r8 movq 0x20(%rsp), %rax movq (%rax), %r9 pushq $0x1 popq %r10 cmpq %r10, %r13 jbe 0xfb10 movq (%rdi), %r11 movl (%r11,%r10,4), %ebp incl %ebp movq (%rsi), %rbx movl -0x4(%rbx,%r10,4), %eax movb (%r8,%rdx), %r14b xorl %r15d, %r15d cmpb -0x1(%r9,%r10), %r14b leal 0x1(%rax), %r14d setne %r15b addl -0x4(%r11,%r10,4), %r15d cmpl %eax, %r15d cmovgl %r14d, %r15d cmpl %ebp, %r15d cmovgel %ebp, %r15d movl %r15d, (%rbx,%r10,4) incq %r10 jmp 0xfaca incq %rcx jmp 0xfa99 leaq 0x28(%rsp), %rdi movq (%rdi), %rax imulq $0x18, 0x8(%rsp), %rcx movq (%rax,%rcx), %rax movq 0x10(%rsp), %rbx movl (%rax,%rbx,4), %ebx callq 0x11704 jmp 0xfb38 addl %ecx, %ebx movl %ebx, %eax addq $0x58, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq %rax, %rbx leaq 0x40(%rsp), %rdi callq 0x5535c movq %rbx, %rdi callq 0xd750
/caozhanhao[P]wxserver/thirdparty/libczh/include/libczh/utils.hpp
ws::details::xml_parse(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
std::string xml_parse(const std::string &xml, const std::string &tag) { auto a = xml.find("<" + tag + ">"); auto b = xml.find("</" + tag + ">"); std::string ret; auto i = a + tag.size() + 2; ret = xml.substr(i, b - i); if (ret.substr(0, 9) == "<![CDATA[") { auto tmp = ret.substr(9); return tmp.substr(0, tmp.size() - 3); } return ret; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x48, %rsp movq %rdx, %r15 movq %rsi, %r14 movq %rdi, %rbx leaq 0x4d445(%rip), %rsi # 0x5d0dc leaq 0x28(%rsp), %r12 movq %r12, %rdi callq 0x11592 leaq 0x531ab(%rip), %rdx # 0x62e56 leaq 0x8(%rsp), %rdi movq %r12, %rsi callq 0x10a85 leaq 0x8(%rsp), %r13 movq %r14, %rdi movq %r13, %rsi xorl %edx, %edx callq 0x11998 movq %rax, %r12 movq %r13, %rdi callq 0x10b86 leaq 0x28(%rsp), %rdi callq 0x10b86 leaq 0x4d3f8(%rip), %rsi # 0x5d0de leaq 0x28(%rsp), %r13 movq %r13, %rdi movq %r15, %rdx callq 0x11592 leaq 0x53159(%rip), %rdx # 0x62e56 leaq 0x8(%rsp), %rdi movq %r13, %rsi callq 0x10a85 leaq 0x8(%rsp), %r13 movq %r14, %rdi movq %r13, %rsi xorl %edx, %edx callq 0x11998 movq %rax, %rbp movq %r13, %rdi callq 0x10b86 leaq 0x28(%rsp), %rdi callq 0x10b86 leaq 0x18(%rsp), %r13 movq %r13, -0x10(%r13) andq $0x0, -0x8(%r13) movb $0x0, (%r13) movq 0x8(%r15), %rax leaq (%r12,%rax), %rdx addq $0x2, %rdx subq %rdx, %rbp leaq 0x28(%rsp), %rdi movq %r14, %rsi movq %rbp, %rcx callq 0x119a8 leaq 0x8(%rsp), %r14 leaq 0x28(%rsp), %r15 movq %r14, %rdi movq %r15, %rsi callq 0x114a0 movq %r15, %rdi callq 0x10b86 leaq 0x28(%rsp), %rdi pushq $0x9 popq %rcx movq %r14, %rsi xorl %edx, %edx callq 0x119a8 leaq 0x4d348(%rip), %rsi # 0x5d0e1 leaq 0x28(%rsp), %r14 movq %r14, %rdi callq 0x119e5 movl %eax, %ebp movq %r14, %rdi callq 0x10b86 testb %bpl, %bpl je 0xfded leaq 0x28(%rsp), %rdi leaq 0x8(%rsp), %rsi pushq $0x9 popq %rdx pushq $-0x1 popq %rcx callq 0x119a8 leaq 0x28(%rsp), %rsi movq 0x8(%rsi), %rcx addq $-0x3, %rcx movq %rbx, %rdi xorl %edx, %edx callq 0x119a8 leaq 0x28(%rsp), %rdi callq 0x10b86 jmp 0xfe2d leaq 0x10(%rbx), %rax movq %rax, (%rbx) movq 0x8(%rsp), %rcx cmpq %r13, %rcx je 0xfe0c movq %rcx, (%rbx) movq 0x18(%rsp), %rax movq %rax, 0x10(%rbx) jmp 0xfe14 movups (%r13), %xmm0 movups %xmm0, (%rax) movq 0x10(%rsp), %rax movq %rax, 0x8(%rbx) movq %r13, 0x8(%rsp) andq $0x0, 0x10(%rsp) movb $0x0, 0x18(%rsp) leaq 0x8(%rsp), %rdi callq 0x10b86 movq %rbx, %rax addq $0x48, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq %rax, %rbx leaq 0x28(%rsp), %rdi callq 0x10b86 jmp 0xfe5f jmp 0xfe5c jmp 0xfe5c movq %rax, %rbx leaq 0x8(%rsp), %rdi jmp 0xfe70 jmp 0xfe68 movq %rax, %rbx leaq 0x28(%rsp), %rdi callq 0x10b86 movq %rbx, %rdi callq 0xd750
/caozhanhao[P]wxserver/include/wxserver/server.hpp
czh::node::Node::Node()
Node() : name(""), last_node(nullptr) { data.emplace<NodeData>(); }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx pushq %rax movq %rdi, %rbx leaq 0x52b80(%rip), %rsi # 0x64694 leaq 0x7(%rsp), %rdx callq 0x10b0c andq $0x0, 0x20(%rbx) leaq 0x28(%rbx), %r14 movq %r14, %rdi callq 0x16334 leaq 0x78(%rbx), %r15 movl $0xc, 0x78(%rbx) movb $0x0, 0xa0(%rbx) xorps %xmm0, %xmm0 movups %xmm0, 0xa8(%rbx) movups %xmm0, 0xb8(%rbx) movq %r14, %rdi callq 0x1639c addq $0x8, %rsp popq %rbx popq %r12 popq %r14 popq %r15 retq movq %rax, %r12 movq %r15, %rdi callq 0x1630a movq %r14, %rdi callq 0x16324 movq %rbx, %rdi callq 0x10b86 movq %r12, %rdi callq 0xd750 nop
/caozhanhao[P]wxserver/thirdparty/libczh/include/libczh/node.hpp
czh::node::Node::operator=(czh::node::Node const&)
Node &operator=(const Node &v) { name = v.name; last_node = v.last_node; czh_token = token::Token(v.czh_token); if (v.is_node()) { data.emplace<NodeData>(NodeData(std::get<NodeData>(v.data))); auto &nd = std::get<NodeData>(data); for (auto &r: nd.nodes) { r.last_node = this; } } else { data = Value(std::get<Value>(v.data)); } return *this; }
pushq %r15 pushq %r14 pushq %rbx subq $0x50, %rsp movq %rsi, %r14 movq %rdi, %rbx callq 0x55098 movq 0x20(%r14), %rax movq %rax, 0x20(%rbx) leaq 0x78(%r14), %rsi movq %rsp, %r15 movq %r15, %rdi callq 0x19d3e leaq 0x78(%rbx), %rdi movq %r15, %rsi callq 0x1672e movq %r15, %rdi callq 0x1630a cmpb $0x0, 0x70(%r14) je 0x11c5f addq $0x28, %r14 movq %r14, %rdi callq 0x1c23c movq %rsp, %r14 movq %r14, %rdi movq %rax, %rsi callq 0x196d4 leaq 0x28(%rbx), %rdi movq %r14, %rsi callq 0x1bfc8 movq %r14, %rdi callq 0x151d6 movq %rbx, %rax addq $0x50, %rsp popq %rbx popq %r14 popq %r15 retq leaq 0x28(%rbx), %r15 addq $0x28, %r14 movq %r14, %rdi callq 0x1a73b movq %rsp, %r14 movq %r14, %rdi movq %rax, %rsi callq 0x1bed2 movq %r15, %rdi movq %r14, %rsi callq 0x1c00c movq %rsp, %rdi callq 0x16438 movq %r15, %rdi callq 0x1640b addq $0x30, %rax movq %rax, %rcx movq (%rcx), %rcx cmpq %rax, %rcx je 0x11c52 movq %rbx, 0x30(%rcx) jmp 0x11c9f movq %rax, %rbx movq %rsp, %rdi callq 0x16438 movq %rbx, %rdi callq 0xd750
/caozhanhao[P]wxserver/thirdparty/libczh/include/libczh/node.hpp
czh::error::CzhError::get_content[abi:cxx11]() const
[[nodiscard]] std::string get_content() const { return {"\033[1;37m" + location + ": " + "\033[0;32;31mError: \033[m" + detail}; }
pushq %r15 pushq %r14 pushq %rbx subq $0x60, %rsp movq %rsi, %r14 movq %rdi, %rbx leaq 0x10(%rsi), %rdx leaq 0x4b6c4(%rip), %rsi # 0x5d3ce leaq 0x40(%rsp), %r15 movq %r15, %rdi callq 0x11592 leaq 0x51c40(%rip), %rdx # 0x6395e movq %rsp, %rdi movq %r15, %rsi callq 0x10a85 leaq 0x4be79(%rip), %rdx # 0x5dba9 leaq 0x20(%rsp), %rdi movq %rsp, %rsi callq 0x10a85 addq $0x30, %r14 leaq 0x20(%rsp), %rsi movq %rbx, %rdi movq %r14, %rdx callq 0x141a5 leaq 0x20(%rsp), %rdi callq 0x10b86 movq %rsp, %rdi callq 0x10b86 leaq 0x40(%rsp), %rdi callq 0x10b86 movq %rbx, %rax addq $0x60, %rsp popq %rbx popq %r14 popq %r15 retq movq %rax, %rbx leaq 0x20(%rsp), %rdi callq 0x10b86 jmp 0x11d8c movq %rax, %rbx movq %rsp, %rdi callq 0x10b86 jmp 0x11d99 movq %rax, %rbx leaq 0x40(%rsp), %rdi callq 0x10b86 movq %rbx, %rdi callq 0xd750 nop
/caozhanhao[P]wxserver/thirdparty/libczh/include/libczh/error.hpp
czh::node::Node::Node(czh::node::Node&&)
Node(Node &&node) : name(std::move(node.name)), last_node(std::move(node.last_node)), czh_token(std::move(node.czh_token)), data(std::move(node.data)) { if (is_node()) { auto &nd = std::get<NodeData>(data); for (auto &r: nd.nodes) { r.last_node = this; } } }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx pushq %rax movq %rsi, %r12 movq %rdi, %rbx callq 0x11558 movq 0x20(%r12), %rax movq %rax, 0x20(%rbx) leaq 0x28(%rbx), %r14 leaq 0x28(%r12), %rsi movq %r14, %rdi callq 0x1c2ae leaq 0x78(%rbx), %r15 addq $0x78, %r12 movq %r15, %rdi movq %r12, %rsi callq 0x16e4a cmpb $0x0, 0x70(%rbx) je 0x11e28 addq $0x8, %rsp popq %rbx popq %r12 popq %r14 popq %r15 retq movq %r14, %rdi callq 0x1640b addq $0x30, %rax movq %rax, %rcx movq (%rcx), %rcx cmpq %rax, %rcx je 0x11e1c movq %rbx, 0x30(%rcx) jmp 0x11e37 movq %rax, %r12 movq %r15, %rdi callq 0x1630a movq %r14, %rdi callq 0x16324 jmp 0x11e5d movq %rax, %r12 movq %rbx, %rdi callq 0x10b86 movq %r12, %rdi callq 0xd750 nop
/caozhanhao[P]wxserver/thirdparty/libczh/include/libczh/node.hpp
ws::Server::Server()
Server() : inited(false), port(-1), new_task_queue([] { return new httplib::ThreadPool(4); }) {}
pushq %rbx movq %rdi, %rbx xorl %eax, %eax movb %al, (%rdi) leaq 0x18(%rdi), %rcx movq %rcx, 0x8(%rdi) andq $0x0, 0x10(%rdi) movb %al, 0x18(%rdi) orl $-0x1, 0x28(%rdi) addq $0x30, %rdi callq 0x1c316 leaq 0x90(%rbx), %rdi callq 0x1c348 leaq 0xf8(%rbx), %rdi callq 0x1c37a xorps %xmm0, %xmm0 movups %xmm0, 0x408(%rbx) movups %xmm0, 0x3f8(%rbx) movups %xmm0, 0x3e8(%rbx) leaq 0xaf10(%rip), %rax # 0x1cdf4 movq %rax, 0x420(%rbx) leaq 0xaf08(%rip), %rax # 0x1cdfa movq %rax, 0x418(%rbx) popq %rbx retq nop
/caozhanhao[P]wxserver/include/wxserver/server.hpp
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> czh::node::Node::get<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>(std::source_location const&) const
T get(const std::source_location &l = std::source_location::current()) const { assert_value(l); auto &value = std::get<Value>(data); if (value.is<value::Reference>() && typeid(T) != typeid(value::Reference)) { auto ptr = get_end_of_list_of_ref(value.get<value::Reference>(), l); assert_true(ptr != nullptr, "Can not get a circular reference.", czh_token, l); return ptr->get<T>(); } if (!value.can_get<T>()) { report_error("The value is not '" + std::string(value::details::nameof<T>()) + "'.[Actual T = '" + value.get_typename() + "'].", czh_token, l); } return value.get<T>(); }
pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0xe0, %rsp movq %rdx, %r14 movq %rsi, %r15 movq %rdi, %rbx movq %rsi, %rdi movq %rdx, %rsi callq 0x1d206 leaq 0x28(%r15), %rdi callq 0x1c23c movq %rax, %r12 movb 0x20(%rax), %al cmpb $0x6, %al jne 0x128d1 leaq 0x842e8(%rip), %rdi # 0x96ba0 leaq 0x83b01(%rip), %rsi # 0x963c0 callq 0x15a14 testb %al, %al je 0x129e6 movb 0x20(%r12), %al cmpb $0x5, %al je 0x129c7 leaq 0xd0(%rsp), %rsi movq $0x4, (%rsi) leaq 0x52b24(%rip), %rax # 0x65413 movq %rax, 0x8(%rsi) leaq 0x70(%rsp), %rdi leaq 0xf(%rsp), %rdx callq 0x1d40a leaq 0x4b4b7(%rip), %rsi # 0x5ddc0 leaq 0x90(%rsp), %rdi leaq 0x70(%rsp), %rdx callq 0x141c4 leaq 0x4b4eb(%rip), %rdx # 0x5de0d leaq 0xb0(%rsp), %rdi leaq 0x90(%rsp), %rsi callq 0x10a85 leaq 0x50(%rsp), %rdi movq %r12, %rsi callq 0x1d424 leaq 0x30(%rsp), %rdi leaq 0xb0(%rsp), %rsi leaq 0x50(%rsp), %rdx callq 0x10aa4 leaq 0x4b4bb(%rip), %rdx # 0x5de1d leaq 0x10(%rsp), %rdi leaq 0x30(%rsp), %rsi callq 0x10a85 addq $0x78, %r15 leaq 0x10(%rsp), %rdi movq %r15, %rsi movq %r14, %rdx callq 0x1aff0 leaq 0x10(%rsp), %rdi callq 0x10b86 leaq 0x30(%rsp), %rdi callq 0x10b86 leaq 0x50(%rsp), %rdi callq 0x10b86 leaq 0xb0(%rsp), %rdi callq 0x10b86 leaq 0x90(%rsp), %rdi callq 0x10b86 leaq 0x70(%rsp), %rdi callq 0x10b86 leaq 0x83002(%rip), %rax # 0x959d0 leaq 0x10(%rsp), %rdx movq %rax, (%rdx) movq %rbx, %rdi movq %r12, %rsi callq 0x1a484 jmp 0x12a76 leaq 0x82fb3(%rip), %rax # 0x959a0 leaq 0x30(%rsp), %rdx movq %rax, (%rdx) leaq 0x10(%rsp), %r13 movq %r13, %rdi movq %r12, %rsi callq 0x1d7e2 movq %r15, %rdi movq %r13, %rsi movq %r14, %rdx callq 0x1d2b8 movq %rax, %r12 leaq 0x10(%rsp), %rdi callq 0x10c78 leaq 0x4b377(%rip), %rsi # 0x5dd9e leaq 0x10(%rsp), %rdi leaq 0x30(%rsp), %rdx callq 0x10b0c testq %r12, %r12 jne 0x12a4f addq $0x78, %r15 leaq 0x10(%rsp), %rdi movq %r15, %rsi movq %r14, %rdx callq 0x1aff0 leaq 0x10(%rsp), %r14 movq %r14, %rdi callq 0x10b86 leaq 0x82f55(%rip), %rax # 0x959b8 movq %rax, (%r14) leaq 0x10(%rsp), %rdx movq %rbx, %rdi movq %r12, %rsi callq 0x1287a movq %rbx, %rax addq $0xe0, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 retq movq %rax, %rbx leaq 0x10(%rsp), %rdi jmp 0x12af9 jmp 0x12b05 movq %rax, %rbx leaq 0x10(%rsp), %rdi callq 0x10c78 jmp 0x12b08 movq %rax, %rbx leaq 0x10(%rsp), %rdi callq 0x10b86 jmp 0x12ab7 movq %rax, %rbx leaq 0x30(%rsp), %rdi callq 0x10b86 jmp 0x12ac6 movq %rax, %rbx leaq 0x50(%rsp), %rdi callq 0x10b86 jmp 0x12ad5 movq %rax, %rbx leaq 0xb0(%rsp), %rdi callq 0x10b86 jmp 0x12ae7 movq %rax, %rbx leaq 0x90(%rsp), %rdi callq 0x10b86 leaq 0x70(%rsp), %rdi callq 0x10b86 jmp 0x12b08 movq %rax, %rbx jmp 0x12af4 movq %rax, %rbx movq %rbx, %rdi callq 0xd750
/caozhanhao[P]wxserver/thirdparty/libczh/include/libczh/node.hpp
int czh::node::Node::get<int>(std::source_location const&) const
T get(const std::source_location &l = std::source_location::current()) const { assert_value(l); auto &value = std::get<Value>(data); if (value.is<value::Reference>() && typeid(T) != typeid(value::Reference)) { auto ptr = get_end_of_list_of_ref(value.get<value::Reference>(), l); assert_true(ptr != nullptr, "Can not get a circular reference.", czh_token, l); return ptr->get<T>(); } if (!value.can_get<T>()) { report_error("The value is not '" + std::string(value::details::nameof<T>()) + "'.[Actual T = '" + value.get_typename() + "'].", czh_token, l); } return value.get<T>(); }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0xd8, %rsp movq %rsi, %rbx movq %rdi, %r14 callq 0x1d206 leaq 0x28(%r14), %rdi callq 0x1c23c movq %rax, %r15 movb 0x20(%rax), %al cmpb $0x6, %al jne 0x12bbb movq 0x843c5(%rip), %rdi # 0x96f68 leaq 0x83816(%rip), %rsi # 0x963c0 callq 0x15a14 testb %al, %al je 0x12ccd movb 0x20(%r15), %al cmpb $0x1, %al je 0x12cb1 leaq 0xc8(%rsp), %rsi movq $0x38, (%rsi) leaq 0x5270c(%rip), %rax # 0x652e5 movq %rax, 0x8(%rsi) leaq 0x68(%rsp), %rdi leaq 0x7(%rsp), %rdx callq 0x1d40a leaq 0x4b1cd(%rip), %rsi # 0x5ddc0 leaq 0x88(%rsp), %rdi leaq 0x68(%rsp), %rdx callq 0x141c4 leaq 0x4b201(%rip), %rdx # 0x5de0d leaq 0xa8(%rsp), %rdi leaq 0x88(%rsp), %rsi callq 0x10a85 leaq 0x48(%rsp), %rdi movq %r15, %rsi callq 0x1d424 leaq 0x28(%rsp), %rdi leaq 0xa8(%rsp), %rsi leaq 0x48(%rsp), %rdx callq 0x10aa4 leaq 0x4b1d1(%rip), %rdx # 0x5de1d leaq 0x8(%rsp), %rdi leaq 0x28(%rsp), %rsi callq 0x10a85 addq $0x78, %r14 leaq 0x8(%rsp), %rdi movq %r14, %rsi movq %rbx, %rdx callq 0x1aff0 leaq 0x8(%rsp), %rdi callq 0x10b86 leaq 0x28(%rsp), %rdi callq 0x10b86 leaq 0x48(%rsp), %rdi callq 0x10b86 leaq 0xa8(%rsp), %rdi callq 0x10b86 leaq 0x88(%rsp), %rdi callq 0x10b86 leaq 0x68(%rsp), %rdi callq 0x10b86 leaq 0x82cb8(%rip), %rax # 0x95970 leaq 0x8(%rsp), %rsi movq %rax, (%rsi) movq %r15, %rdi callq 0x5628e jmp 0x12d5a leaq 0x82c6c(%rip), %rax # 0x95940 leaq 0x28(%rsp), %rdx movq %rax, (%rdx) leaq 0x8(%rsp), %r12 movq %r12, %rdi movq %r15, %rsi callq 0x1d7e2 movq %r14, %rdi movq %r12, %rsi movq %rbx, %rdx callq 0x1d2b8 movq %rax, %r15 leaq 0x8(%rsp), %rdi callq 0x10c78 leaq 0x4b090(%rip), %rsi # 0x5dd9e leaq 0x8(%rsp), %rdi leaq 0x28(%rsp), %rdx callq 0x10b0c testq %r15, %r15 jne 0x12d36 addq $0x78, %r14 leaq 0x8(%rsp), %rdi movq %r14, %rsi movq %rbx, %rdx callq 0x1aff0 leaq 0x8(%rsp), %rbx movq %rbx, %rdi callq 0x10b86 leaq 0x82c0e(%rip), %rax # 0x95958 movq %rax, (%rbx) leaq 0x8(%rsp), %rsi movq %r15, %rdi callq 0x12b70 addq $0xd8, %rsp popq %rbx popq %r12 popq %r14 popq %r15 retq movq %rax, %rbx leaq 0x8(%rsp), %rdi jmp 0x12dd8 jmp 0x12de4 movq %rax, %rbx leaq 0x8(%rsp), %rdi callq 0x10c78 jmp 0x12de7 movq %rax, %rbx leaq 0x8(%rsp), %rdi callq 0x10b86 jmp 0x12d96 movq %rax, %rbx leaq 0x28(%rsp), %rdi callq 0x10b86 jmp 0x12da5 movq %rax, %rbx leaq 0x48(%rsp), %rdi callq 0x10b86 jmp 0x12db4 movq %rax, %rbx leaq 0xa8(%rsp), %rdi callq 0x10b86 jmp 0x12dc6 movq %rax, %rbx leaq 0x88(%rsp), %rdi callq 0x10b86 leaq 0x68(%rsp), %rdi callq 0x10b86 jmp 0x12de7 movq %rax, %rbx jmp 0x12dd3 movq %rax, %rbx movq %rbx, %rdi callq 0xd750 nop
/caozhanhao[P]wxserver/thirdparty/libczh/include/libczh/node.hpp
ws::Server::run()
Server &run() { std::unique_ptr<httplib::TaskQueue> task_queue(new_task_queue()); if (!inited) { critical(no_fmt, "Not inited."); } svr.Get("/", [this](const httplib::Request &req, httplib::Response &res) { auto msg_sig = req.get_param_value("msg_signature"); auto timestamp = req.get_param_value("timestamp"); auto nonce = req.get_param_value("nonce"); auto req_echostr = req.get_param_value("echostr"); auto echostr = crypto.verify_url(msg_sig, timestamp, nonce, req_echostr); res.set_content(echostr, "text/plain"); info(no_fmt, "Verify url successfully."); }); svr.Post("/", [this, &task_queue](const httplib::Request &req, httplib::Response &res) { auto a = req.body.find("<xml>"); auto b = req.body.find("</xml>"); auto req_xml = req.body.substr(a, b + 6); auto msg_encrypt = details::xml_parse(req_xml, "Encrypt"); std::string plain_xml; try { plain_xml = crypto.decrypt_msg(req.get_param_value("msg_signature"), req.get_param_value("timestamp"), req.get_param_value("nonce"), details::xml_parse(req_xml, "Encrypt")); } catch (MsgCryptoError &err) { error(FormatWithLoc(no_fmt, err.location), err.what()); return; } Request wxreq; wxreq.content = details::xml_parse(plain_xml, "Content"); wxreq.user_id = details::xml_parse(plain_xml, "FromUserName"); if (auto type = details::xml_parse(plain_xml, "MsgType"); type == "text") { wxreq.msg_type = Request::MsgType::text; } else { wxreq.msg_type = Request::MsgType::unknown; } info(no_fmt, "From: ", wxreq.user_id, " | Content: ", wxreq.content); if (msg_handle) { task_queue->enqueue([this, wxreq]() { Message wxres; msg_handle(wxreq, wxres); if (wxres.to_user.empty()) { wxres.set_user(wxreq.user_id); } send_message(wxres); }); } }); info(no_fmt, "Server started. Host: ", host, ", Port: ", port); svr.listen(host, port); task_queue->shutdown(); return *this; }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x78, %rsp movq %rdi, %rbx addq $0x408, %rdi # imm = 0x408 callq 0x1de26 movq %rax, 0x8(%rsp) cmpb $0x0, (%rbx) jne 0x12e4b leaq 0x84cfd(%rip), %rsi # 0x97b18 leaq 0x10(%rsp), %rdi callq 0x11642 leaq 0x82934(%rip), %rax # 0x95760 leaq 0x10(%rsp), %rdi movq %rax, 0x20(%rdi) leaq 0x4b330(%rip), %rsi # 0x5e16c callq 0x1de36 leaq 0x10(%rsp), %rdi callq 0x10b86 leaq 0x4d670(%rip), %rsi # 0x604c2 leaq 0x10(%rsp), %rdi leaq 0x7(%rsp), %rdx callq 0x10b0c leaq 0xf8(%rbx), %r14 leaq 0x58(%rsp), %rdx andq $0x0, 0x8(%rdx) movq %rbx, (%rdx) leaq 0x14d04(%rip), %rax # 0x27b80 movq %rax, 0x18(%rdx) leaq 0x14cff(%rip), %rax # 0x27b86 movq %rax, 0x10(%rdx) leaq 0x10(%rsp), %rsi movq %r14, %rdi callq 0x1de44 leaq 0x58(%rsp), %rdi callq 0x5528a leaq 0x10(%rsp), %rdi callq 0x10b86 leaq 0x4d60f(%rip), %rsi # 0x604c2 leaq 0x10(%rsp), %rdi leaq 0x7(%rsp), %rdx callq 0x10b0c leaq 0x38(%rsp), %rdx movq %rbx, (%rdx) leaq 0x8(%rsp), %rax movq %rax, 0x8(%rdx) leaq 0x15c7c(%rip), %rax # 0x28b56 movq %rax, 0x18(%rdx) leaq 0x15c77(%rip), %rax # 0x28b5c movq %rax, 0x10(%rdx) leaq 0x10(%rsp), %rsi movq %r14, %rdi callq 0x1deca leaq 0x38(%rsp), %rdi callq 0x5528a leaq 0x10(%rsp), %rdi callq 0x10b86 leaq 0x84c07(%rip), %rsi # 0x97b18 leaq 0x10(%rsp), %rdi callq 0x11642 leaq 0x82856(%rip), %rax # 0x95778 leaq 0x10(%rsp), %rdi movq %rax, 0x20(%rdi) leaq 0x8(%rbx), %r15 leaq 0x28(%rbx), %r12 leaq 0x4b23e(%rip), %rsi # 0x5e178 leaq 0x4b24e(%rip), %rcx # 0x5e18f movq %r15, %rdx movq %r12, %r8 callq 0x1df4f leaq 0x10(%rsp), %rdi callq 0x10b86 movl (%r12), %edx movq %r14, %rdi movq %r15, %rsi xorl %ecx, %ecx callq 0x1df66 movq 0x8(%rsp), %rdi movq (%rdi), %rax callq *0x18(%rax) movq 0x8(%rsp), %rdi testq %rdi, %rdi je 0x12f82 movq (%rdi), %rax callq *0x8(%rax) movq %rbx, %rax addq $0x78, %rsp popq %rbx popq %r12 popq %r14 popq %r15 retq jmp 0x12f95 jmp 0x12fc3 movq %rax, %rbx jmp 0x12fb5 jmp 0x12fc3 movq %rax, %rbx leaq 0x38(%rsp), %rdi jmp 0x12fb0 jmp 0x12fc3 movq %rax, %rbx leaq 0x58(%rsp), %rdi callq 0x5528a leaq 0x10(%rsp), %rdi callq 0x10b86 jmp 0x12fc6 jmp 0x12fc3 movq %rax, %rbx movq 0x8(%rsp), %rdi testq %rdi, %rdi je 0x12fd6 movq (%rdi), %rax callq *0x8(%rax) movq %rbx, %rdi callq 0xd750
/caozhanhao[P]wxserver/include/wxserver/server.hpp
httplib::detail::SocketStream::read(char*, unsigned long)
inline ssize_t SocketStream::read(char *ptr, size_t size) { #ifdef _WIN32 size = (std::min)(size, static_cast<size_t>((std::numeric_limits<int>::max)())); #else size = (std::min)(size, static_cast<size_t>((std::numeric_limits<ssize_t>::max)())); #endif if (read_buff_off_ < read_buff_content_size_) { auto remaining_size = read_buff_content_size_ - read_buff_off_; if (size <= remaining_size) { memcpy(ptr, read_buff_.data() + read_buff_off_, size); read_buff_off_ += size; return static_cast<ssize_t>(size); } else { memcpy(ptr, read_buff_.data() + read_buff_off_, remaining_size); read_buff_off_ += remaining_size; return static_cast<ssize_t>(remaining_size); } } if (!is_readable()) { return -1; } read_buff_off_ = 0; read_buff_content_size_ = 0; if (size < read_buff_size_) { auto n = read_socket(sock_, read_buff_.data(), read_buff_size_, CPPHTTPLIB_RECV_FLAGS); if (n <= 0) { return n; } else if (n <= static_cast<ssize_t>(size)) { memcpy(ptr, read_buff_.data(), static_cast<size_t>(n)); return n; } else { memcpy(ptr, read_buff_.data(), size); read_buff_off_ = size; read_buff_content_size_ = static_cast<size_t>(n); return static_cast<ssize_t>(size); } } else { return read_socket(sock_, ptr, size, CPPHTTPLIB_RECV_FLAGS); } }
pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx movq %rsi, %r14 movabsq $0x7fffffffffffffff, %r15 # imm = 0x7FFFFFFFFFFFFFFF cmpq %r15, %rdx cmovbq %rdx, %r15 movq %rdi, %rbx movq 0x48(%rdi), %rsi movq 0x50(%rdi), %r13 subq %rsi, %r13 jbe 0x130bd addq 0x30(%rbx), %rsi cmpq %r13, %r15 cmovbq %r15, %r13 movq %r14, %rdi movq %r13, %rdx callq 0xd0c0 addq %r13, 0x48(%rbx) jmp 0x13120 movq %rdx, %r12 movq (%rbx), %rax movq %rbx, %rdi callq *0x10(%rax) testb %al, %al je 0x1311c leaq 0x48(%rbx), %rax xorps %xmm0, %xmm0 movups %xmm0, (%rax) movl 0x8(%rbx), %edi cmpq $0xfff, %r12 # imm = 0xFFF ja 0x1312d movq 0x30(%rbx), %rsi movl $0x1000, %edx # imm = 0x1000 xorl %ecx, %ecx callq 0x32342 movq %rax, %r13 testq %rax, %rax jle 0x13120 movq 0x30(%rbx), %rsi movq %r14, %rdi cmpq %r12, %r13 jbe 0x13143 movq %r15, %rdx callq 0xd0c0 movq %r15, 0x48(%rbx) movq %r13, 0x50(%rbx) movq %r12, %r13 jmp 0x13120 pushq $-0x1 popq %r13 movq %r13, %rax popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 retq movq %r14, %rsi movq %r15, %rdx xorl %ecx, %ecx popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 jmp 0x32342 movq %r13, %rdx callq 0xd0c0 jmp 0x13120 nop
/caozhanhao[P]wxserver/thirdparty/cpp-httplib/httplib.h
httplib::detail::SocketStream::write(char const*, unsigned long)
inline ssize_t SocketStream::write(const char *ptr, size_t size) { if (!is_writable()) { return -1; } #if defined(_WIN32) && !defined(_WIN64) size = (std::min)(size, static_cast<size_t>((std::numeric_limits<int>::max)())); #endif return send_socket(sock_, ptr, size, CPPHTTPLIB_SEND_FLAGS); }
pushq %r15 pushq %r14 pushq %rbx movq %rdx, %rbx movq %rsi, %r14 movq %rdi, %r15 movq (%rdi), %rax callq *0x18(%rax) testb %al, %al je 0x1317c movl 0x8(%r15), %edi movq %r14, %rsi movq %rbx, %rdx xorl %ecx, %ecx popq %rbx popq %r14 popq %r15 jmp 0x4b6bc pushq $-0x1 popq %rax popq %rbx popq %r14 popq %r15 retq nop
/caozhanhao[P]wxserver/thirdparty/cpp-httplib/httplib.h
httplib::detail::BufferStream::read(char*, unsigned long)
inline ssize_t BufferStream::read(char *ptr, size_t size) { #if defined(_MSC_VER) && _MSC_VER < 1910 auto len_read = buffer._Copy_s(ptr, size, size, position); #else auto len_read = buffer.copy(ptr, size, position); #endif position += static_cast<size_t>(len_read); return static_cast<ssize_t>(len_read); }
pushq %rbx movq %rdi, %rbx addq $0x8, %rdi movq 0x28(%rbx), %rcx callq 0x4b8ae addq %rax, 0x28(%rbx) popq %rbx retq nop
/caozhanhao[P]wxserver/thirdparty/cpp-httplib/httplib.h
httplib::detail::ssl_delete(std::mutex&, ssl_st*, bool)
inline void ssl_delete(std::mutex &ctx_mutex, SSL *ssl, bool shutdown_gracefully) { // sometimes we may want to skip this to try to avoid SIGPIPE if we know // the remote has closed the network connection // Note that it is not always possible to avoid SIGPIPE, this is merely a // best-efforts. if (shutdown_gracefully) { SSL_shutdown(ssl); } std::lock_guard<std::mutex> guard(ctx_mutex); SSL_free(ssl); }
pushq %r14 pushq %rbx pushq %rax movq %rsi, %r14 movq %rdi, %rbx testl %edx, %edx je 0x14173 movq %r14, %rdi callq 0xd290 movq %rbx, %rdi callq 0x1cae8 movq %r14, %rdi callq 0xd110 movq %rbx, %rdi addq $0x8, %rsp popq %rbx popq %r14 jmp 0xd310 movq %rax, %r14 movq %rbx, %rdi callq 0xd310 movq %r14, %rdi callq 0xd750
/caozhanhao[P]wxserver/thirdparty/cpp-httplib/httplib.h
czh::file::NonStreamFile::get_spec_line[abi:cxx11](unsigned long, unsigned long, unsigned long) const
[[nodiscard]] std::string get_spec_line(std::size_t beg, std::size_t end, std::size_t linenosize) const override { std::size_t lineno = 1; bool first_line_flag = true; bool first_line_no = true; std::string ret; for (std::size_t i = 0; i < code.size() && lineno < end; ++i) { if (code[i] == '\n') { ++lineno; first_line_flag = true; continue; } if (lineno >= beg) { if (first_line_flag) { std::string addition = utils::to_str(lineno); if (addition.size() < linenosize) ret += std::string(linenosize - addition.size(), '0'); if (!first_line_no) ret += '\n'; else first_line_no = false; ret += addition + "| "; first_line_flag = false; } if (code[i] != '\r') ret += code[i]; } } while (ret.back() == '\r' || ret.back() == '\n') { ret.pop_back(); } return ret; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x58, %rsp movq %r8, 0x8(%rsp) movq %rcx, %r15 movq %rdx, 0x10(%rsp) movq %rdi, %rbx leaq 0x10(%rdi), %rax movq %rax, (%rdi) andq $0x0, 0x8(%rdi) movq %rsi, %r13 movb $0x0, 0x10(%rdi) movb $0x1, %al pushq $0x1 popq %rbp xorl %r14d, %r14d movb $0x1, %r12b movq %rcx, (%rsp) cmpq 0x30(%r13), %r14 jae 0x1578f cmpq %r15, %rbp jae 0x1578f movq 0x28(%r13), %rcx movb (%rcx,%r14), %cl cmpb $0xa, %cl jne 0x156b8 incq %rbp movb $0x1, %al jmp 0x1577f cmpq 0x10(%rsp), %rbp jb 0x1577f testb $0x1, %al je 0x1576d leaq 0x38(%rsp), %rdi movq %rbp, %rsi callq 0x1589e movq 0x8(%rsp), %rsi subq 0x40(%rsp), %rsi jbe 0x1571b movl %r12d, %r15d leaq 0x28(%rsp), %rax movq %rax, 0x18(%rsp) leaq 0x18(%rsp), %r12 movq %r12, %rdi pushq $0x30 popq %rdx callq 0x136c8 movq %rbx, %rdi movq %r12, %rsi callq 0x10c68 movq %r12, %rdi callq 0x10b86 movl %r15d, %r12d movq (%rsp), %r15 testb $0x1, %r12b jne 0x1572c movq %rbx, %rdi pushq $0xa popq %rsi callq 0x34dc0 leaq 0x18(%rsp), %r12 movq %r12, %rdi leaq 0x38(%rsp), %rsi leaq 0x47e32(%rip), %rdx # 0x5d572 callq 0x11467 movq %rbx, %rdi movq %r12, %rsi callq 0x10c68 movq %r12, %rdi callq 0x10b86 leaq 0x38(%rsp), %rdi callq 0x10b86 movq 0x28(%r13), %rax movb (%rax,%r14), %cl xorl %r12d, %r12d cmpb $0xd, %cl je 0x1577d movsbl %cl, %esi movq %rbx, %rdi callq 0x34dc0 xorl %eax, %eax incq %r14 jmp 0x1568e movq %rbx, %rdi callq 0x15884 movq (%rbx), %rax movq 0x8(%rbx), %rcx movzbl -0x1(%rax,%rcx), %eax cmpl $0xd, %eax je 0x15787 cmpl $0xa, %eax je 0x15787 movq %rbx, %rax addq $0x58, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq jmp 0x157d3 jmp 0x157d3 jmp 0x157c4 jmp 0x157bf movq %rax, %r14 jmp 0x157e0 movq %rax, %r14 leaq 0x18(%rsp), %rdi callq 0x10b86 jmp 0x157d6 movq %rax, %r14 leaq 0x38(%rsp), %rdi callq 0x10b86 movq %rbx, %rdi callq 0x10b86 movq %r14, %rdi callq 0xd750
/caozhanhao[P]wxserver/thirdparty/libczh/include/libczh/file.hpp
czh::file::NonStreamFile::get_arrowpos(unsigned long) const
[[nodiscard]] std::size_t get_arrowpos(std::size_t pos) const override { int i = static_cast<int>(pos); if (pos != 1) --i; while (code[i] != '\n' && i >= 0) --i; return pos - i; }
leal -0x1(%rsi), %eax cmpq $0x1, %rsi movslq %eax, %rdx movq 0x28(%rdi), %rcx cmoveq %rsi, %rdx leaq -0x1(%rdx), %rax testq %rdx, %rdx js 0x15836 cmpb $0xa, (%rcx,%rdx) movq %rax, %rdx jne 0x15824 notq %rax addq %rsi, %rax retq nop
/caozhanhao[P]wxserver/thirdparty/libczh/include/libczh/file.hpp
czh::file::StreamFile::get_arrowpos(unsigned long) const
[[nodiscard]] std::size_t get_arrowpos(std::size_t pos) const override { std::size_t postmp = 0; std::string tmp; file->clear(); file->seekg(std::ios::beg); while (std::getline(*file, tmp)) { if (postmp + tmp.size() >= pos) return pos - postmp + 1; postmp += tmp.size() + 1; } return 0; }
pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x20, %rsp movq %rsi, %rbx movq %rdi, %r14 leaq 0x10(%rsp), %rax movq %rax, -0x10(%rax) andq $0x0, -0x8(%rax) movb $0x0, (%rax) movq 0x28(%rdi), %rdi movq (%rdi), %rax addq -0x18(%rax), %rdi xorl %esi, %esi callq 0xdca0 movq 0x28(%r14), %rdi xorl %esi, %esi xorl %edx, %edx callq 0xd670 xorl %r15d, %r15d movq %rsp, %r12 xorl %r13d, %r13d movq 0x28(%r14), %rdi movq %r12, %rsi callq 0xd5e0 movq (%rax), %rcx movq -0x18(%rcx), %rcx testb $0x5, 0x20(%rax,%rcx) jne 0x1609d movq 0x8(%rsp), %rax leaq (%rax,%r13), %rcx cmpq %rbx, %rcx jae 0x16094 addq %rax, %r13 incq %r13 jmp 0x16064 subq %r13, %rbx incq %rbx movq %rbx, %r15 movq %rsp, %rdi callq 0x10b86 movq %r15, %rax addq $0x20, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 retq jmp 0x160b8 movq %rax, %rbx movq %rsp, %rdi callq 0x10b86 movq %rbx, %rdi callq 0xd750 nop
/caozhanhao[P]wxserver/thirdparty/libczh/include/libczh/file.hpp
czh::lexer::Lexer::reset()
void reset() { is_eof = false; buffer = token::Token{token::TokenType::UNEXPECTED, 0, codepos}; match.reset(); nmatch.reset(); codepos.reset(); }
pushq %r15 pushq %r14 pushq %rbx subq $0x70, %rsp movq %rdi, %r14 movb $0x0, 0x90(%rdi) leaq 0x20(%rdi), %rbx movq %rsp, %r15 movq %r15, %rdi movq %rbx, %rsi callq 0x150c0 leaq 0x20(%rsp), %rdi pushq $0xc popq %rsi xorl %edx, %edx movq %r15, %rcx callq 0x150d4 leaq 0x40(%r14), %rdi leaq 0x20(%rsp), %r15 movq %r15, %rsi callq 0x1672e movq %r15, %rdi callq 0x1630a leaq 0x18(%rsp), %rdi callq 0x1511c movabsq $0xb00000000, %rax # imm = 0xB00000000 movq %rax, 0x10(%r14) andl $0x0, 0x18(%r14) movb $0x0, 0x1c(%r14) xorps %xmm0, %xmm0 movups %xmm0, (%rbx) addq $0x70, %rsp popq %rbx popq %r14 popq %r15 retq movq %rax, %rbx leaq 0x18(%rsp), %rdi callq 0x1511c movq %rbx, %rdi callq 0xd750 nop
/caozhanhao[P]wxserver/thirdparty/libczh/include/libczh/lexer.hpp
czh::lexer::Lexer::check_token(czh::token::Token const&)
void check_token(const token::Token &token) { if (token.type == token::TokenType::FEND) { if (match.get_state() == State::END || match.get_state() == State::INIT) return; else token.report_error("Unexpected end of file."); } if (match.end() && token.type != token::TokenType::SEND) match.match(token::TokenType::SEND); match.match(token.type); if (!match.good()) { token.report_error("Unexpected token '" + token.to_string() + "'.Do you mean '" + match.error_correct() + "'?"); } }
pushq %r15 pushq %r14 pushq %rbx subq $0xc0, %rsp movq %rsi, %rbx movq %rdi, %r15 movl (%rsi), %eax cmpl $0x8, %eax jne 0x17d5d movl 0x10(%r15), %eax testl %eax, %eax je 0x17e56 cmpl $0xc, %eax je 0x17e56 leaq 0x45aa3(%rip), %rsi # 0x5d7de movq %rsp, %rdi leaq 0x20(%rsp), %rdx callq 0x10b0c movq %rsp, %rsi movq %rbx, %rdi callq 0x182f8 movq %rsp, %rdi callq 0x10b86 movl (%rbx), %eax leaq 0x10(%r15), %r14 cmpl $0xc, 0x10(%r15) jne 0x17d7e cmpl $0x9, %eax je 0x17d7e movq %rsp, %rsi movl $0x9, (%rsi) movq %r14, %rdi callq 0x19214 movq %r14, %rdi movq %rbx, %rsi callq 0x19214 cmpl $0xb, (%r14) jne 0x17e56 leaq 0xa0(%rsp), %r15 movq %r15, %rdi movq %rbx, %rsi callq 0x19444 leaq 0x459af(%rip), %rsi # 0x5d75c leaq 0x60(%rsp), %rdi movq %r15, %rdx callq 0x141c4 leaq 0x45a35(%rip), %rdx # 0x5d7f6 leaq 0x80(%rsp), %rdi leaq 0x60(%rsp), %rsi callq 0x10a85 leaq 0x40(%rsp), %rdi movq %r14, %rsi callq 0x194a2 leaq 0x20(%rsp), %rdi leaq 0x80(%rsp), %rsi leaq 0x40(%rsp), %rdx callq 0x10aa4 leaq 0x45a08(%rip), %rdx # 0x5d806 movq %rsp, %rdi leaq 0x20(%rsp), %rsi callq 0x10a85 movq %rsp, %rsi movq %rbx, %rdi callq 0x182f8 movq %rsp, %rdi callq 0x10b86 leaq 0x20(%rsp), %rdi callq 0x10b86 leaq 0x40(%rsp), %rdi callq 0x10b86 leaq 0x80(%rsp), %rdi callq 0x10b86 leaq 0x60(%rsp), %rdi callq 0x10b86 leaq 0xa0(%rsp), %rdi callq 0x10b86 addq $0xc0, %rsp popq %rbx popq %r14 popq %r15 retq movq %rax, %rbx movq %rsp, %rdi jmp 0x17ec2 movq %rax, %rbx jmp 0x17ec7 movq %rax, %rbx movq %rsp, %rdi callq 0x10b86 jmp 0x17e80 movq %rax, %rbx leaq 0x20(%rsp), %rdi callq 0x10b86 jmp 0x17e8f movq %rax, %rbx leaq 0x40(%rsp), %rdi callq 0x10b86 jmp 0x17e9e movq %rax, %rbx leaq 0x80(%rsp), %rdi callq 0x10b86 jmp 0x17eb0 movq %rax, %rbx leaq 0x60(%rsp), %rdi callq 0x10b86 leaq 0xa0(%rsp), %rdi callq 0x10b86 movq %rbx, %rdi callq 0xd750 movq %rax, %rbx jmp 0x17eba
/caozhanhao[P]wxserver/thirdparty/libczh/include/libczh/lexer.hpp
czh::lexer::Lexer::skip()
void skip() { while (check_char() && get_character_size() == 1 && isspace(ch)) { ch = get_char(); } while (check_char() && ch == '<') { int notes = 0; auto bak = get_pos().set_size(1); ch = get_char(); while (check_char() && !(ch == '>' && notes == 0)) { if (ch == '<') ++notes; if (ch == '>') --notes; ch = get_char(); } if (notes != 0 && !check_char()) { token::Token tmp(token::TokenType::UNEXPECTED, static_cast<int>('<'), bak); tmp.report_error("Expected '>' to match this '<'."); } if (ch == '>') { ch = get_char(); } } }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0xb8, %rsp movq %rdi, %r14 movq (%r14), %rdi movq (%rdi), %rax callq *0x38(%rax) testb %al, %al je 0x1805b movq %r14, %rdi callq 0x17fc8 cmpq $0x1, %rax jne 0x1805b movsbl 0x91(%r14), %edi callq 0xd880 testl %eax, %eax je 0x1805b movq %r14, %rdi callq 0x153d8 movb %al, 0x91(%r14) jmp 0x1801e leaq 0x20(%r14), %r12 leaq 0x68(%rsp), %rbp leaq 0x28(%rsp), %r15 leaq 0x48(%rsp), %r13 movq (%r14), %rdi movq (%rdi), %rax callq *0x38(%rax) testb %al, %al je 0x1819c cmpb $0x3c, 0x91(%r14) jne 0x1819c movq %rbp, %rdi movq %r12, %rsi callq 0x150c0 movq $0x1, 0x70(%rsp) movq %r15, %rdi movq %rbp, %rsi callq 0x150c0 leaq 0x80(%rsp), %rdi callq 0x1511c movq %r14, %rdi callq 0x153d8 xorl %ebx, %ebx movb %al, 0x91(%r14) movq (%r14), %rdi movq (%rdi), %rax callq *0x38(%rax) testb %al, %al je 0x18106 movb 0x91(%r14), %al cmpb $0x3e, %al jne 0x180ea testl %ebx, %ebx je 0x1817e xorl %ecx, %ecx cmpb $0x3c, %al sete %cl addl %ecx, %ebx xorl %ecx, %ecx cmpb $0x3e, %al sete %cl subl %ecx, %ebx movq %r14, %rdi callq 0x153d8 jmp 0x180c3 testl %ebx, %ebx je 0x18174 movq (%r14), %rdi movq (%rdi), %rax callq *0x38(%rax) testb %al, %al jne 0x18174 leaq 0x8(%rsp), %rbx movq %rbx, %rdi movq %r15, %rsi callq 0x150c0 movq %rbp, %rdi pushq $0xc popq %rsi pushq $0x3c popq %rdx movq %rbx, %rcx callq 0x150d4 leaq 0x20(%rsp), %rdi callq 0x1511c movq %r13, %rbx movq %r13, %rdi leaq 0x45658(%rip), %rsi # 0x5d7a7 leaq 0x7(%rsp), %rdx callq 0x10b0c movq %rbp, %rdi movq %rbx, %rsi callq 0x182f8 movq %rbx, %rdi callq 0x10b86 movq %rbp, %rdi callq 0x1630a cmpb $0x3e, 0x91(%r14) jne 0x1818d movq %r14, %rdi callq 0x153d8 movb %al, 0x91(%r14) leaq 0x40(%rsp), %rdi callq 0x1511c jmp 0x1806e addq $0xb8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq %rax, %r14 leaq 0x20(%rsp), %rdi callq 0x1511c jmp 0x181e0 movq %rax, %r14 leaq 0x48(%rsp), %rdi callq 0x10b86 jmp 0x181cf movq %rax, %r14 leaq 0x68(%rsp), %rdi callq 0x1630a jmp 0x181e0 jmp 0x181dd movq %rax, %r14 leaq 0x40(%rsp), %rdi callq 0x1511c movq %r14, %rdi callq 0xd750
/caozhanhao[P]wxserver/thirdparty/libczh/include/libczh/lexer.hpp
czh::token::Token::Token<double>(czh::token::TokenType, double, czh::token::Pos)
Token(TokenType type_, T what_, Pos pos_) :type(type_), what(std::move(what_)), pos(std::move(pos_)) {}
pushq %r14 pushq %rbx pushq %rax movq %rdx, %rbx movq %rdi, %r14 movq %rsp, %rax movsd %xmm0, (%rax) movl %esi, (%rdi) addq $0x8, %rdi movq %rax, %rsi callq 0x189ca movups (%rbx), %xmm0 movups %xmm0, 0x30(%r14) andq $0x0, 0x48(%r14) movups 0x10(%rbx), %xmm0 andq $0x0, 0x18(%rbx) movups %xmm0, 0x40(%r14) andq $0x0, 0x10(%rbx) addq $0x8, %rsp popq %rbx popq %r14 retq nop
/caozhanhao[P]wxserver/thirdparty/libczh/include/libczh/token.hpp
czh::token::Token::Token<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>(czh::token::TokenType, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, czh::token::Pos)
Token(TokenType type_, T what_, Pos pos_) :type(type_), what(std::move(what_)), pos(std::move(pos_)) {}
pushq %r14 pushq %rbx pushq %rax movq %rcx, %rbx movq %rdi, %r14 movl %esi, (%rdi) addq $0x8, %rdi movq %rdx, %rsi callq 0x18ee4 movups (%rbx), %xmm0 movups %xmm0, 0x30(%r14) andq $0x0, 0x48(%r14) movups 0x10(%rbx), %xmm0 andq $0x0, 0x18(%rbx) movups %xmm0, 0x40(%r14) andq $0x0, 0x10(%rbx) addq $0x8, %rsp popq %rbx popq %r14 retq
/caozhanhao[P]wxserver/thirdparty/libczh/include/libczh/token.hpp
czh::lexer::NumberMatch::get_token(int)
Token get_token(int ch = -1) { if (std::isdigit(ch)) return Token::INT; else if (ch == '.') { _is_double = true; return Token::DOT; } else if (ch == 'e' || ch == 'E') return Token::EXP; else if (ch == '+' || ch == '-') return Token::SIGN; else if (ch == -1) return Token::END; return Token::UNEXPECTED; }
leal -0x30(%rsi), %ecx xorl %eax, %eax cmpl $0xa, %ecx jae 0x188b1 retq cmpl $0x2e, %esi jne 0x188be movb $0x1, 0x4(%rdi) pushq $0x1 jmp 0x188ca movl %esi, %eax andl $-0x21, %eax cmpl $0x45, %eax jne 0x188cc pushq $0x3 popq %rax retq pushq $0x2 popq %rax cmpl $0x2d, %esi je 0x188b0 cmpl $0x2b, %esi je 0x188b0 cmpl $-0x1, %esi jne 0x188e2 pushq $0x5 jmp 0x188ca pushq $0x4 jmp 0x188ca
/caozhanhao[P]wxserver/thirdparty/libczh/include/libczh/lexer.hpp
czh::lexer::NumberMatch::next(czh::lexer::NumberMatch::Token const&)
void next(const Token &token) { switch (state) { case State::INIT: switch (token) { case Token::INT: state = State::INT; break; case Token::DOT: state = State::DOT_NO_INT; break; case Token::SIGN: state = State::SIGN; break; default: state = State::UNEXPECTED; break; } break; case State::SIGN: switch (token) { case Token::INT: state = State::INT; break; case Token::DOT: state = State::DOT_NO_INT; break; default: state = State::UNEXPECTED; break; } break; case State::INT: switch (token) { case Token::INT: break; case Token::DOT: state = State::DOT; break; case Token::EXP: state = State::EXP; break; case Token::END: state = State::END; break; default: state = State::UNEXPECTED; break; } break; case State::INT_DOT: switch (token) { case Token::INT: break; case Token::EXP: state = State::EXP; break; case Token::END: state = State::END; break; default: state = State::UNEXPECTED; break; } break; case State::DOT_NO_INT: switch (token) { case Token::INT: state = State::INT_DOT; break; default: state = State::UNEXPECTED; break; } break; case State::DOT: switch (token) { case Token::INT: state = State::INT_DOT; break; case Token::EXP: state = State::EXP; break; case Token::END: state = State::END; break; default: state = State::UNEXPECTED; break; } break; case State::EXP: switch (token) { case Token::INT: state = State::EXP_INT; break; case Token::SIGN: state = State::EXP_SIGN; break; default: state = State::UNEXPECTED; break; } break; case State::EXP_SIGN: switch (token) { case Token::INT: state = State::EXP_INT; break; default: state = State::UNEXPECTED; break; } break; case State::EXP_INT: switch (token) { case Token::INT: break; case Token::END: state = State::END; break; default: state = State::UNEXPECTED; break; } break; default: state = State::UNEXPECTED; break; } }
movl (%rdi), %ecx pushq $0xa popq %rax cmpq $0x8, %rcx ja 0x189c6 leaq 0x439a4(%rip), %rdx # 0x5c2a0 movslq (%rdx,%rcx,4), %rcx addq %rdx, %rcx jmpq *%rcx movl (%rsi), %ecx cmpq $0x3, %rcx jae 0x189c6 leaq 0x43850(%rip), %rax # 0x5c168 jmp 0x1892d movl (%rsi), %ecx cmpq $0x6, %rcx jae 0x189c6 leaq 0x43847(%rip), %rax # 0x5c174 movl (%rax,%rcx,4), %eax jmp 0x189c6 movl (%rsi), %ecx testl %ecx, %ecx je 0x189c8 cmpl $0x3, %ecx jne 0x189ba jmp 0x189c3 movl (%rsi), %eax xorl %ecx, %ecx cmpl $0x1, %eax setne %cl leal (%rcx,%rcx,4), %ecx addl $0x5, %ecx testl %eax, %eax pushq $0x1 jmp 0x189ae xorl %eax, %eax cmpl $0x0, (%rsi) setne %al leal 0x8(,%rax,2), %eax jmp 0x189c6 movl (%rsi), %ecx cmpq $0x5, %rcx ja 0x189c6 leaq 0x43948(%rip), %rdx # 0x5c2c4 movslq (%rdx,%rcx,4), %rcx addq %rdx, %rcx jmpq *%rcx pushq $0x4 jmp 0x189c5 xorl %eax, %eax cmpl $0x0, (%rsi) setne %al leal 0x2(,%rax,8), %eax jmp 0x189c6 movl (%rsi), %eax xorl %ecx, %ecx cmpl $0x2, %eax setne %cl leal (%rcx,%rcx,2), %ecx addl $0x7, %ecx testl %eax, %eax pushq $0x8 popq %rax cmovnel %ecx, %eax jmp 0x189c6 movl (%rsi), %ecx testl %ecx, %ecx je 0x189c8 cmpl $0x5, %ecx jne 0x189c6 pushq $0x9 jmp 0x189c5 pushq $0x6 popq %rax movl %eax, (%rdi) retq nop
/caozhanhao[P]wxserver/thirdparty/libczh/include/libczh/lexer.hpp
czh::token::Pos::get_code[abi:cxx11]() const
[[nodiscard]] std::string get_code() const { std::size_t lineno = code->get_lineno(pos); std::size_t linenosize = utils::to_str(lineno + next).size(); std::size_t actual_last = last; std::size_t actual_next = next; std::size_t total_line = code->get_lineno(code->size() - 1); while (static_cast<int>(lineno) - static_cast<int>(actual_last) <= 0 && actual_last > 0) { --actual_last; } while (lineno + actual_next >= total_line && actual_next > 0) { --actual_next; } std::string temp1, temp2; //lineno - actual_last is impossible to be equal lineno + 1 temp1 = code->get_spec_line(lineno - actual_last, lineno + 1, linenosize);//[beg, end) if (actual_next != 0) {//lineno + 1 might be equal to lineno + actual_next + 1 temp2 = code->get_spec_line(lineno + 1, lineno + actual_next + 1, linenosize); } std::string arrow("\n"); std::size_t arrowpos = code->get_arrowpos(pos) - size + linenosize; arrow += std::string(arrowpos, ' '); arrow += "\033[0;32;32m"; arrow.insert(arrow.end(), size, '^'); arrow += "\033[m\n"; return temp1 + arrow + temp2; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x88, %rsp movq %rsi, %r14 movq %rdi, 0x40(%rsp) movq (%rsi), %rsi movq 0x10(%r14), %rdi movq (%rdi), %rax callq *0x8(%rax) movq %rax, %r12 leaq 0x3(%rax), %r13 leaq 0x48(%rsp), %rbp movq %rbp, %rdi movq %r13, %rsi callq 0x1589e movq 0x8(%rbp), %r15 movq %rbp, %rdi callq 0x10b86 movq 0x10(%r14), %rbp movq (%rbp), %rax movq %rbp, %rdi callq *0x20(%rax) leaq -0x1(%rax), %rsi movq (%rbp), %rax movq %rbp, %rdi callq *0x8(%rax) movslq %r12d, %rdx pushq $0x4 popq %rsi leaq -0x1(%rsi), %rcx cmpq $0x1, %rsi je 0x18c21 movq %rcx, %rsi cmpq %rdx, %rcx jge 0x18c0f xorl %ebx, %ebx movq %rbx, %rdx incq %rbx cmpq $0x3, %rdx je 0x18c3b leaq -0x1(%r13), %rdx cmpq %rax, %r13 movq %rdx, %r13 jae 0x18c23 leaq 0x58(%rsp), %rax movq %rax, -0x10(%rax) andq $0x0, -0x8(%rax) leaq 0x78(%rsp), %rdx movq %rdx, -0x10(%rdx) andq $0x0, -0x8(%rdx) xorl %esi, %esi movb %sil, (%rax) movb %sil, (%rdx) movq 0x10(%r14), %rsi movq %r12, %rdx subq %rcx, %rdx leaq 0x1(%r12), %r13 movq (%rsi), %rax movq %rsp, %rdi movq %r13, %rcx movq %r15, %r8 callq *(%rax) leaq 0x48(%rsp), %rdi movq %rsp, %rbp movq %rbp, %rsi callq 0x114a0 movq %rbp, %rdi callq 0x10b86 cmpq $0x4, %rbx je 0x18cce movq 0x10(%r14), %rsi subq %rbx, %r12 addq $0x5, %r12 movq (%rsi), %rax movq %rsp, %rdi movq %r13, %rdx movq %r12, %rcx movq %r15, %r8 callq *(%rax) leaq 0x68(%rsp), %rdi movq %rsp, %r12 movq %r12, %rsi callq 0x114a0 movq %r12, %rdi callq 0x10b86 leaq 0x4b9be(%rip), %rsi # 0x64693 movq %rsp, %rdi leaq 0x20(%rsp), %rdx callq 0x10b0c movq (%r14), %rsi movq 0x10(%r14), %rdi movq (%rdi), %rax callq *0x10(%rax) addq %r15, %rax subq 0x8(%r14), %rax leaq 0x30(%rsp), %rcx movq %rcx, -0x10(%rcx) leaq 0x20(%rsp), %rdi pushq $0x20 popq %rdx movq %rax, %rsi callq 0x136c8 movq %rsp, %rdi leaq 0x20(%rsp), %rsi callq 0x10c68 leaq 0x20(%rsp), %rdi callq 0x10b86 leaq 0x44aa1(%rip), %rsi # 0x5d7ce movq %rsp, %rdi callq 0x10bce movq %rsp, %rdi movq (%rdi), %rsi addq 0x8(%rdi), %rsi movq 0x8(%r14), %rdx pushq $0x5e popq %rcx callq 0x11414 leaq 0x44a87(%rip), %rsi # 0x5d7d9 movq %rsp, %rdi callq 0x10bce leaq 0x20(%rsp), %rdi leaq 0x48(%rsp), %rsi movq %rsp, %rdx callq 0x18e95 leaq 0x20(%rsp), %rsi leaq 0x68(%rsp), %rdx movq 0x40(%rsp), %rbx movq %rbx, %rdi callq 0x141a5 leaq 0x20(%rsp), %rdi callq 0x10b86 movq %rsp, %rdi callq 0x10b86 leaq 0x68(%rsp), %rdi callq 0x10b86 leaq 0x48(%rsp), %rdi callq 0x10b86 movq %rbx, %rax addq $0x88, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq jmp 0x18dd9 jmp 0x18dc6 jmp 0x18dde jmp 0x18dde movq %rax, %rbx leaq 0x20(%rsp), %rdi callq 0x10b86 jmp 0x18de1 jmp 0x18dde jmp 0x18dd9 movq %rax, %rbx jmp 0x18de9 movq %rax, %rbx movq %rsp, %rdi callq 0x10b86 leaq 0x68(%rsp), %rdi callq 0x10b86 leaq 0x48(%rsp), %rdi callq 0x10b86 movq %rbx, %rdi callq 0xd750 nop
/caozhanhao[P]wxserver/thirdparty/libczh/include/libczh/token.hpp
czh::lexer::Match::match(czh::token::TokenType const&)
void match(const token::TokenType &token) { if (token == token::TokenType::NOTE) return; switch (state) { case State::INIT: switch (token) { case token::TokenType::ID: state = State::ID; break; case token::TokenType::SCEND: state = State::END; break; default: last_state = state; state = State::UNEXPECTED; break; } break; case State::ID: switch (token) { case token::TokenType::EQUAL: state = State::EQUAL; break; case token::TokenType::COLON: state = State::END; break; default: last_state = state; state = State::UNEXPECTED; break; } break; case State::EQUAL: switch (token) { case token::TokenType::VALUE: state = State::END; break; case token::TokenType::ARR_LP: state = State::ARR_LP; break; case token::TokenType::REF: state = State::REF; break; case token::TokenType::ID: state = State::REF_ID; break; default: last_state = state; state = State::UNEXPECTED; break; } break; case State::ARR_LP: switch (token) { case token::TokenType::VALUE: state = State::ARR_VALUE; break; case token::TokenType::ARR_RP: state = State::END; break; default: last_state = state; state = State::UNEXPECTED; break; } break; case State::ARR_VALUE: switch (token) { case token::TokenType::COMMA: state = State::COMMA; break; case token::TokenType::ARR_RP: state = State::END; break; default: last_state = state; state = State::UNEXPECTED; break; } break; case State::COMMA: switch (token) { case token::TokenType::VALUE: state = State::ARR_VALUE; break; default: last_state = state; state = State::UNEXPECTED; break; } break; case State::REF: switch (token) { case token::TokenType::ID: state = State::REF_ID; break; default: last_state = state; state = State::UNEXPECTED; break; } break; case State::REF_ID: switch (token) { case token::TokenType::REF: state = State::REF; break; case token::TokenType::SEND: case token::TokenType::FEND: reset(); break; default: reset(); match(token); break; } break; case State::VALUE: case State::ARR_RP: case State::SC_COLON: case State::UNEXPECTED: error::czh_unreachable(); case State::END: error::czh_assert(token == token::TokenType::SEND || token == token::TokenType::FEND, "Unexpected end of file."); reset(); break; default: error::czh_unreachable(); } }
pushq %r15 pushq %r14 pushq %rbx subq $0x30, %rsp movl (%rsi), %r14d cmpl $0xb, %r14d je 0x193b9 movq %rdi, %rbx movl (%rdi), %edx leaq 0x430a6(%rip), %rax # 0x5c2dc leal -0x8(%r14), %ecx movabsq $0xb00000000, %r15 # imm = 0xB00000000 cmpl $0xc, %edx ja 0x193f2 movl %edx, %edx movslq (%rax,%rdx,4), %rdx addq %rax, %rdx jmpq *%rdx cmpl $0x2, %ecx jb 0x192b5 cmpl $0x7, %r14d je 0x19356 movq %r15, (%rbx) xorl %edx, %edx jmp 0x19244 leaq 0x44569(%rip), %rsi # 0x5d7de leaq 0x10(%rsp), %rdi leaq 0x7(%rsp), %rdx callq 0x10b0c andl $-0x2, %r14d xorl %edi, %edi cmpl $0x8, %r14d sete %dil leaq 0x7c0d7(%rip), %rax # 0x95370 leaq 0x8(%rsp), %rdx movq %rax, (%rdx) leaq 0x10(%rsp), %rsi callq 0xe945 leaq 0x10(%rsp), %rdi callq 0x10b86 movq %r15, (%rbx) jmp 0x193b9 cmpl $0xa, %r14d je 0x1934e testl %r14d, %r14d jne 0x19383 movl $0x1, (%rbx) jmp 0x193b9 cmpl $0x4, %r14d je 0x1934e cmpl $0x1, %r14d je 0x192fc movabsq $0x50000000b, %rax # imm = 0x50000000B jmp 0x193b6 cmpl $0x1, %r14d jne 0x19377 movl $0x3, (%rbx) jmp 0x193b9 cmpl $0x6, %r14d je 0x1934e cmpl $0x2, %r14d jne 0x1938c movl $0x4, (%rbx) jmp 0x193b9 cmpl $0x4, %r14d je 0x1934e cmpl $0x5, %r14d jne 0x19398 movl $0x7, (%rbx) jmp 0x193b9 cmpl $0x7, %r14d ja 0x193ac movl %r14d, %eax leaq 0x42fcb(%rip), %rcx # 0x5c310 movslq (%rcx,%rax,4), %rax addq %rcx, %rax jmpq *%rax movl $0xc, (%rbx) jmp 0x193b9 movl $0x9, (%rbx) jmp 0x193b9 testl %r14d, %r14d je 0x1936f movabsq $0x90000000b, %rax # imm = 0x90000000B jmp 0x193b6 movl $0xa, (%rbx) jmp 0x193b9 movabsq $0x70000000b, %rax # imm = 0x70000000B jmp 0x193b6 movq $0xb, (%rbx) jmp 0x193b9 movabsq $0x10000000b, %rax # imm = 0x10000000B jmp 0x193b6 movabsq $0x30000000b, %rax # imm = 0x30000000B jmp 0x193b6 movl $0x5, (%rbx) jmp 0x193b9 movabsq $0x40000000b, %rax # imm = 0x40000000B movq %rax, (%rbx) addq $0x30, %rsp popq %rbx popq %r14 popq %r15 retq leaq 0x43b6a(%rip), %rsi # 0x5cf34 leaq 0x10(%rsp), %rdi leaq 0x7(%rsp), %rdx callq 0x10b0c leaq 0x7bf78(%rip), %rax # 0x95358 leaq 0x8(%rsp), %rsi movq %rax, (%rsi) leaq 0x10(%rsp), %rdi callq 0xe8f8 leaq 0x43b3b(%rip), %rsi # 0x5cf34 leaq 0x10(%rsp), %rdi leaq 0x7(%rsp), %rdx callq 0x10b0c leaq 0x7bf79(%rip), %rax # 0x95388 leaq 0x8(%rsp), %rsi movq %rax, (%rsi) leaq 0x10(%rsp), %rdi callq 0xe8f8 jmp 0x19429 jmp 0x19438 jmp 0x19429 jmp 0x19438 movq %rax, %rbx leaq 0x10(%rsp), %rdi callq 0x10b86 jmp 0x1943b movq %rax, %rbx movq %rbx, %rdi callq 0xd750 nop
/caozhanhao[P]wxserver/thirdparty/libczh/include/libczh/lexer.hpp
czh::lexer::Match::error_correct[abi:cxx11]()
std::string error_correct() { switch (last_state) { case State::REF: case State::INIT: return "identifier"; case State::ID: return "'=' or ':'"; case State::EQUAL: return "value or '['"; case State::ARR_LP: return "value or ']'"; case State::ARR_VALUE: return "']' or ','"; case State::COMMA: return "value"; case State::REF_ID: return "'::'"; default: error::czh_unreachable("Unexpected token"); } error::czh_unreachable("Unexpected token"); return ""; }
pushq %rbx subq $0x30, %rsp movl 0x4(%rsi), %eax cmpq $0xa, %rax ja 0x19516 movq %rdi, %rbx leaq 0x42e76(%rip), %rcx # 0x5c330 movslq (%rcx,%rax,4), %rax addq %rcx, %rax jmpq *%rax leaq 0x44377(%rip), %rsi # 0x5d841 jmp 0x19500 leaq 0x44384(%rip), %rsi # 0x5d857 jmp 0x19500 leaq 0x44388(%rip), %rsi # 0x5d864 jmp 0x19500 leaq 0x44367(%rip), %rsi # 0x5d84c jmp 0x19500 leaq 0x4438e(%rip), %rsi # 0x5d87c jmp 0x19500 leaq 0x4437a(%rip), %rsi # 0x5d871 jmp 0x19500 leaq 0x49314(%rip), %rsi # 0x62814 leaq 0x8(%rsp), %rdx movq %rbx, %rdi callq 0x10b0c movq %rbx, %rax addq $0x30, %rsp popq %rbx retq leaq 0x4422e(%rip), %rsi # 0x5d74b leaq 0x8(%rsp), %rbx leaq 0x7(%rsp), %rdx movq %rbx, %rdi callq 0x10b0c leaq 0x7be6a(%rip), %rax # 0x953a0 leaq 0x28(%rsp), %rsi movq %rax, (%rsi) movq %rbx, %rdi callq 0xe8f8 movq %rax, %rbx leaq 0x8(%rsp), %rdi callq 0x10b86 movq %rbx, %rdi callq 0xd750
/caozhanhao[P]wxserver/thirdparty/libczh/include/libczh/lexer.hpp
czh::parser::Parser::parse_ref()
value::Reference parse_ref() { std::vector<std::string> path; if (curr_tok.type == token::TokenType::REF) { path = {""}; } bool id = false; while (curr_tok.type == token::TokenType::ID || curr_tok.type == token::TokenType::REF) { if (curr_tok.type == token::TokenType::ID) { if (id) break;// double id path.insert(path.begin(), curr_tok.what.get<std::string>()); id = true; } else { id = false; } curr_tok = get(); } return {path}; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x98, %rsp movq %rsi, %r14 movq %rdi, %rbx andq $0x0, 0x20(%rsp) xorps %xmm0, %xmm0 movaps %xmm0, 0x10(%rsp) cmpl $0x7, 0xd8(%rsi) jne 0x1a010 leaq 0x4a6b1(%rip), %rsi # 0x64694 leaq 0x30(%rsp), %rdi leaq 0x8(%rsp), %rdx callq 0x10b0c leaq 0x50(%rsp), %rdx leaq 0x10(%rsp), %rdi leaq 0x30(%rsp), %rsi callq 0x1b20a leaq 0x30(%rsp), %rdi callq 0x10b86 movq %rbx, 0x28(%rsp) leaq 0xd8(%r14), %r15 leaq 0xe0(%r14), %r12 xorl %eax, %eax leaq 0x30(%rsp), %r13 movl (%r15), %ecx cmpl $0x7, %ecx je 0x1a036 testl %ecx, %ecx jne 0x1a09c testl %ecx, %ecx sete %bl jne 0x1a07a testb $0x1, %al jne 0x1a09c movq 0x10(%rsp), %rbp leaq 0x7b413(%rip), %rax # 0x95460 movq %rax, 0x8(%rsp) movq %r13, %rdi movq %r12, %rsi leaq 0x8(%rsp), %rdx callq 0x1a484 leaq 0x10(%rsp), %rdi movq %rbp, %rsi movq %r13, %rdx callq 0x1b440 movq %r13, %rdi callq 0x10b86 movq %r13, %rdi movq %r14, %rsi callq 0x1671c movq %r15, %rdi movq %r13, %rsi callq 0x1672e movq %r13, %rdi callq 0x1630a movl %ebx, %eax jmp 0x1a02a leaq 0x80(%rsp), %rdi leaq 0x10(%rsp), %rsi callq 0x1976a leaq 0x80(%rsp), %rdi movaps (%rdi), %xmm0 movq 0x28(%rsp), %rbx movups %xmm0, (%rbx) movq 0x10(%rdi), %rax movq %rax, 0x10(%rbx) xorps %xmm0, %xmm0 movaps %xmm0, (%rdi) andq $0x0, 0x10(%rdi) callq 0x10c78 leaq 0x10(%rsp), %rdi callq 0x10c78 movq %rbx, %rax addq $0x98, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq jmp 0x1a0fe jmp 0x1a10f jmp 0x1a10f movq %rax, %rbx leaq 0x30(%rsp), %rdi callq 0x10b86 jmp 0x1a112 jmp 0x1a10f movq %rax, %rbx leaq 0x10(%rsp), %rdi callq 0x10c78 movq %rbx, %rdi callq 0xd750
/caozhanhao[P]wxserver/thirdparty/libczh/include/libczh/parser.hpp
czh::parser::Parser::parse_array[abi:cxx11]()
value::Array parse_array() { value::Array ret; curr_tok = get();//eat [ for (; curr_tok.type != token::TokenType::ARR_RP; curr_tok = get()) { if (curr_tok.type == token::TokenType::COMMA) continue; std::visit(utils::overloaded{ [&ret](auto &&a) { ret.insert(ret.end(), a); }, [](value::Reference) { error::czh_unreachable(); }, [](value::Array) { error::czh_unreachable(); } }, curr_tok.what.get_variant()); } curr_tok = get();//eat ] return ret; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x58, %rsp movq %rsi, %r14 movq %rdi, %rbx xorps %xmm0, %xmm0 movups %xmm0, (%rdi) andq $0x0, 0x10(%rdi) leaq 0x8(%rsp), %rdi callq 0x1671c leaq 0xd8(%r14), %r15 leaq 0x8(%rsp), %r12 movq %r15, %rdi movq %r12, %rsi callq 0x1672e movq %r12, %rdi callq 0x1630a leaq 0xe0(%r14), %r13 movq %rsp, %rbp movl (%r15), %eax cmpl $0x5, %eax je 0x1a2d5 cmpl $0x4, %eax je 0x1a2f5 movq %rbx, (%rsp) movq %r12, %rdi movq %r13, %rsi callq 0x196d4 movq %rbp, %rdi movq %r12, %rsi callq 0x1b679 movq %r12, %rdi callq 0x151d6 movq %r12, %rdi movq %r14, %rsi callq 0x1671c movq %r15, %rdi movq %r12, %rsi callq 0x1672e movq %r12, %rdi callq 0x1630a jmp 0x1a2a6 leaq 0x8(%rsp), %rdi movq %r14, %rsi callq 0x1671c leaq 0x8(%rsp), %r14 movq %r15, %rdi movq %r14, %rsi callq 0x1672e movq %r14, %rdi callq 0x1630a movq %rbx, %rax addq $0x58, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq jmp 0x1a341 jmp 0x1a341 jmp 0x1a341 movq %rax, %r14 leaq 0x8(%rsp), %rdi callq 0x151d6 jmp 0x1a344 movq %rax, %r14 movq %rbx, %rdi callq 0x152ce movq %r14, %rdi callq 0xd750
/caozhanhao[P]wxserver/thirdparty/libczh/include/libczh/parser.hpp
czh::node::Node& czh::node::Node::add<czh::value::Value&, void>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, czh::value::Value&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, czh::token::Token, std::source_location const&)
Node &add(std::string add_name, T &&_value, const std::string &before = "", token::Token token = token::Token(), const std::source_location &l = std::source_location::current()) { assert_node(l); auto &nd = std::get<NodeData>(data); int err = 0; auto ret = nd.add(Node(this, std::move(add_name), Value(std::forward<T>(_value)), std::move(token)), before, err); if (err != 0) report_no_node(before, l); return *ret; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x178, %rsp # imm = 0x178 movq %r8, %r13 movq %rcx, %r14 movq %rdx, %rbp movq %rsi, %rbx movq %rdi, %r15 movq %r9, 0x10(%rsp) movq %r9, %rsi callq 0x1a68a leaq 0x28(%r15), %rdi callq 0x1640b movq %rax, %r12 andl $0x0, 0xc(%rsp) leaq 0x18(%rsp), %rdi movq %rbx, %rsi callq 0x11558 leaq 0x38(%rsp), %rdi movq %rbp, %rsi callq 0x196d4 leaq 0x60(%rsp), %rbx movq %rbx, %rdi movq %r13, %rsi callq 0x16e4a leaq 0xb0(%rsp), %r13 leaq 0x18(%rsp), %rdx leaq 0x38(%rsp), %rcx movq %r13, %rdi movq %r15, %rsi movq %rbx, %r8 callq 0x1b15e leaq 0xc(%rsp), %rcx movq %r12, %rdi movq %r13, %rsi movq %r14, %rdx callq 0x1a7d2 movq %rax, %r12 leaq 0xb0(%rsp), %rdi callq 0x11cc0 leaq 0x60(%rsp), %rdi callq 0x1630a leaq 0x38(%rsp), %rdi callq 0x151d6 leaq 0x18(%rsp), %rdi callq 0x10b86 cmpl $0x0, 0xc(%rsp) je 0x1a434 movq %r15, %rdi movq %r14, %rsi movq 0x10(%rsp), %rdx callq 0x1a8b6 movq %r12, %rax addq $0x178, %rsp # imm = 0x178 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq %rax, %rbx leaq 0xb0(%rsp), %rdi callq 0x11cc0 leaq 0x60(%rsp), %rdi callq 0x1630a leaq 0x38(%rsp), %rdi callq 0x151d6 jmp 0x1a472 movq %rax, %rbx leaq 0x18(%rsp), %rdi callq 0x10b86 movq %rbx, %rdi callq 0xd750
/caozhanhao[P]wxserver/thirdparty/libczh/include/libczh/node.hpp
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> nlohmann::json_abi_v3_11_2::detail::concat<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, char const (&) [52], char const*>(char const (&) [52], char const*&&)
inline OutStringType concat(Args && ... args) { OutStringType str; str.reserve(concat_length(args...)); concat_into(str, std::forward<Args>(args)...); return str; }
pushq %r15 pushq %r14 pushq %rbx movq %rdx, %r14 movq %rsi, %r15 movq %rdi, %rbx leaq 0x10(%rdi), %rax movq %rax, (%rdi) andq $0x0, 0x8(%rdi) movb $0x0, 0x10(%rdi) movq %rsi, %rdi movq %rdx, %rsi callq 0x2d145 movq %rbx, %rdi movq %rax, %rsi callq 0x2c40c movq %rbx, %rdi movq %r15, %rsi movq %r14, %rdx callq 0x2d167 movq %rbx, %rax popq %rbx popq %r14 popq %r15 retq movq %rax, %r14 movq %rbx, %rdi callq 0x10b86 movq %r14, %rdi callq 0xd750 nop
/caozhanhao[P]wxserver/thirdparty/json/single_include/nlohmann/json.hpp
nlohmann::json_abi_v3_11_2::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_2::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char>>, void>::type_name() const
JSON_HEDLEY_RETURNS_NON_NULL const char* type_name() const noexcept { switch (m_data.m_type) { case value_t::null: return "null"; case value_t::object: return "object"; case value_t::array: return "array"; case value_t::string: return "string"; case value_t::boolean: return "boolean"; case value_t::binary: return "binary"; case value_t::discarded: return "discarded"; case value_t::number_integer: case value_t::number_unsigned: case value_t::number_float: default: return "number"; } }
movzbl (%rdi), %eax cmpq $0x9, %rax ja 0x2d0f0 leaq 0x2f0a4(%rip), %rcx # 0x5c18c movslq (%rcx,%rax,4), %rax addq %rcx, %rax retq leaq 0x32c2f(%rip), %rax # 0x5fd26 retq
/caozhanhao[P]wxserver/thirdparty/json/single_include/nlohmann/json.hpp
ws::Cli::get_access_token()
void get_access_token() // see https://open.work.weixin.qq.com/api/doc/90000/90135/91039 { httplib::SSLClient cli("qyapi.weixin.qq.com"); httplib::Params params { {"corpid", corp_id}, {"corpsecret", corp_secret} }; auto res = cli.Get("/cgi-bin/gettoken", params, httplib::Headers{}, httplib::Progress{}); if (res == nullptr || res->status != 200) { critical(no_fmt, "Get access token failed.", "Error: ", httplib::to_string(res.error())); } else { access_token = nlohmann::json::parse(res->body)["access_token"].get<std::string>(); } }
pushq %r14 pushq %rbx subq $0x578, %rsp # imm = 0x578 movq %rdi, %rbx leaq 0x32326(%rip), %rsi # 0x6020e leaq 0x60(%rsp), %rdi leaq 0xe0(%rsp), %rdx callq 0x10b0c leaq 0x158(%rsp), %rdi leaq 0x60(%rsp), %rsi callq 0x2e2b0 leaq 0x60(%rsp), %rdi callq 0x10b86 leaq 0x20(%rbx), %rdx leaq 0x323b0(%rip), %rsi # 0x602d1 leaq 0x60(%rsp), %rdi callq 0x2e838 leaq 0xa0(%rsp), %rdi leaq 0x40(%rbx), %rdx leaq 0x3239a(%rip), %rsi # 0x602d8 callq 0x2e874 leaq 0xe0(%rsp), %rdi leaq 0x60(%rsp), %rsi pushq $0x2 popq %rdx leaq 0x30(%rsp), %rcx leaq 0x10(%rsp), %r8 callq 0x2e8b0 pushq $0x40 popq %r14 leaq (%rsp,%r14), %rdi addq $0x60, %rdi callq 0x140dc addq $-0x40, %r14 cmpq $-0x40, %r14 jne 0x2df66 leaq 0x3235f(%rip), %rsi # 0x602e3 leaq 0x10(%rsp), %rdi leaq 0xf(%rsp), %rdx callq 0x10b0c leaq 0x38(%rsp), %rax xorps %xmm0, %xmm0 movaps %xmm0, -0x8(%rax) andq $0x0, 0x8(%rax) movq %rax, 0x10(%rax) movq %rax, 0x18(%rax) andq $0x0, 0x20(%rax) leaq 0x130(%rsp), %r9 movaps %xmm0, (%r9) movaps %xmm0, 0x10(%r9) leaq 0x60(%rsp), %rdi leaq 0x158(%rsp), %rsi leaq 0x10(%rsp), %rdx leaq 0xe0(%rsp), %rcx leaq 0x30(%rsp), %r8 callq 0x2e8f8 leaq 0x130(%rsp), %rdi callq 0x5528a leaq 0x30(%rsp), %rdi callq 0x14078 leaq 0x10(%rsp), %rdi callq 0x10b86 movq 0x60(%rsp), %rsi testq %rsi, %rsi je 0x2e08f cmpl $0xc8, 0x20(%rsi) jne 0x2e08f addq $0x78, %rsi xorps %xmm0, %xmm0 leaq 0x110(%rsp), %rdx movaps %xmm0, (%rdx) movaps %xmm0, 0x10(%rdx) leaq 0x10(%rsp), %rdi pushq $0x1 popq %rcx xorl %r8d, %r8d callq 0x2e6ba leaq 0x322cf(%rip), %rsi # 0x60316 leaq 0x10(%rsp), %rdi callq 0x2e77a leaq 0x30(%rsp), %rdi movq %rax, %rsi callq 0x483be leaq 0x30(%rsp), %r14 movq %rbx, %rdi movq %r14, %rsi callq 0x114a0 movq %r14, %rdi callq 0x10b86 leaq 0x10(%rsp), %rdi callq 0x2a81e leaq 0x110(%rsp), %rdi callq 0x5528a jmp 0x2e0eb leaq 0x69a82(%rip), %rsi # 0x97b18 leaq 0x30(%rsp), %rdi callq 0x11642 leaq 0x677d9(%rip), %rax # 0x95880 movq %rax, 0x50(%rsp) movl 0x68(%rsp), %esi leaq 0x10(%rsp), %rdi callq 0x2e5a7 leaq 0x321c3(%rip), %rsi # 0x60284 leaq 0x321d5(%rip), %rdx # 0x6029d leaq 0x30(%rsp), %rdi leaq 0x10(%rsp), %rcx callq 0x2e593 leaq 0x10(%rsp), %rdi callq 0x10b86 leaq 0x30(%rsp), %rdi callq 0x10b86 leaq 0x60(%rsp), %rdi callq 0x2e800 leaq 0xe0(%rsp), %rdi callq 0x140f2 leaq 0x158(%rsp), %rdi callq 0x11110 addq $0x578, %rsp # imm = 0x578 popq %rbx popq %r14 retq movq %rax, %rbx jmp 0x2e12c movq %rax, %rbx leaq 0x10(%rsp), %rdi callq 0x2a81e leaq 0x110(%rsp), %rdi callq 0x5528a jmp 0x2e15c movq %rax, %rbx leaq 0x10(%rsp), %rdi callq 0x10b86 jmp 0x2e14d movq %rax, %rbx leaq 0x30(%rsp), %rdi callq 0x10b86 jmp 0x2e15c movq %rax, %rbx leaq 0x60(%rsp), %rdi callq 0x2e800 jmp 0x2e191 movq %rax, %rbx leaq 0x130(%rsp), %rdi callq 0x5528a leaq 0x30(%rsp), %rdi callq 0x14078 leaq 0x10(%rsp), %rdi callq 0x10b86 jmp 0x2e191 movq %rax, %rbx leaq 0xe0(%rsp), %rdi callq 0x140f2 leaq 0x158(%rsp), %rdi callq 0x11110 movq %rbx, %rdi callq 0xd750 movq %rax, %rbx pushq $0x40 popq %r14 leaq (%rsp,%r14), %rdi addq $0x60, %rdi callq 0x140dc addq $-0x40, %r14 cmpq $-0x40, %r14 jne 0x2e1ba jmp 0x2e19e movq %rax, %rbx leaq 0x60(%rsp), %rdi callq 0x140dc jmp 0x2e19e movq %rax, %rbx jmp 0x2e19e movq %rax, %rbx leaq 0x60(%rsp), %rdi callq 0x10b86 jmp 0x2e1ab movq %rax, %rbx jmp 0x2e1ab
/caozhanhao[P]wxserver/include/wxserver/wxcli.hpp
bool httplib::detail::parse_header<httplib::detail::read_headers(httplib::Stream&, std::multimap<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, httplib::detail::ci, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>&)::'lambda'(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&&)>(char const*, char const*, httplib::detail::read_headers(httplib::Stream&, std::multimap<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, httplib::detail::ci, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>&)::'lambda'(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&&))
inline bool parse_header(const char *beg, const char *end, T fn) { // Skip trailing spaces and tabs. while (beg < end && is_space_or_tab(end[-1])) { end--; } auto p = beg; while (p < end && *p != ':') { p++; } if (p == end) { return false; } auto key_end = p; if (*p++ != ':') { return false; } while (p < end && is_space_or_tab(*p)) { p++; } if (p < end) { auto key = std::string(beg, key_end); auto val = compare_case_ignore(key, "Location") ? std::string(p, end) : decode_url(std::string(p, end), false); fn(std::move(key), std::move(val)); return true; } return false; }
pushq %r15 pushq %r14 pushq %rbx subq $0x90, %rsp movq %rdx, %rbx movq %rdi, %rax movq %rsi, %r14 cmpq %rax, %rsi jbe 0x380f3 leaq -0x1(%r14), %rsi movzbl -0x1(%r14), %ecx cmpl $0x9, %ecx je 0x380d8 cmpl $0x20, %ecx je 0x380d8 movq %rax, %rdx cmpq %r14, %rdx jae 0x38105 cmpb $0x3a, (%rdx) je 0x38105 incq %rdx jmp 0x380f6 cmpq %rdx, %r14 je 0x3812b cmpb $0x3a, (%rdx) jne 0x3812b leaq 0x1(%rdx), %r15 cmpq %r14, %r15 jae 0x3812b movzbl (%r15), %ecx cmpl $0x20, %ecx je 0x38126 cmpl $0x9, %ecx jne 0x3813a incq %r15 jmp 0x38113 xorl %eax, %eax addq $0x90, %rsp popq %rbx popq %r14 popq %r15 retq leaq 0x40(%rsp), %rcx movq %rcx, -0x10(%rcx) leaq 0x30(%rsp), %rdi movq %rax, %rsi callq 0x1d9e8 leaq 0x284a4(%rip), %rsi # 0x605fb leaq 0x70(%rsp), %rdi leaq 0xf(%rsp), %rdx callq 0x10b0c leaq 0x30(%rsp), %rdi leaq 0x70(%rsp), %rsi callq 0x3823e testb %al, %al je 0x38194 leaq 0x20(%rsp), %rax movq %rax, -0x10(%rax) leaq 0x10(%rsp), %rdi movq %r15, %rsi movq %r14, %rdx callq 0x1d9e8 jmp 0x381c8 leaq 0x60(%rsp), %rax movq %rax, -0x10(%rax) leaq 0x50(%rsp), %rdi movq %r15, %rsi movq %r14, %rdx callq 0x1d9e8 leaq 0x10(%rsp), %rdi leaq 0x50(%rsp), %rsi xorl %edx, %edx callq 0x38296 leaq 0x50(%rsp), %rdi callq 0x10b86 leaq 0x70(%rsp), %rdi callq 0x10b86 leaq 0x30(%rsp), %rsi leaq 0x10(%rsp), %rdx movq %rbx, %rdi callq 0x3852e leaq 0x10(%rsp), %rdi callq 0x10b86 leaq 0x30(%rsp), %rdi callq 0x10b86 movb $0x1, %al jmp 0x3812d movq %rax, %rbx leaq 0x50(%rsp), %rdi callq 0x10b86 jmp 0x38213 jmp 0x38210 movq %rax, %rbx leaq 0x70(%rsp), %rdi jmp 0x38222 movq %rax, %rbx leaq 0x10(%rsp), %rdi callq 0x10b86 jmp 0x3822c movq %rax, %rbx leaq 0x30(%rsp), %rdi callq 0x10b86 movq %rbx, %rdi callq 0xd750
/caozhanhao[P]wxserver/thirdparty/cpp-httplib/httplib.h
bool httplib::detail::read_content_chunked<httplib::Response>(httplib::Stream&, httplib::Response&, std::function<bool (char const*, unsigned long, unsigned long, unsigned long)>)
inline bool read_content_chunked(Stream &strm, T &x, ContentReceiverWithProgress out) { const auto bufsiz = 16; char buf[bufsiz]; stream_line_reader line_reader(strm, buf, bufsiz); if (!line_reader.getline()) { return false; } unsigned long chunk_len; while (true) { char *end_ptr; chunk_len = std::strtoul(line_reader.ptr(), &end_ptr, 16); if (end_ptr == line_reader.ptr()) { return false; } if (chunk_len == ULONG_MAX) { return false; } if (chunk_len == 0) { break; } if (!read_content_with_length(strm, chunk_len, nullptr, out)) { return false; } if (!line_reader.getline()) { return false; } if (strcmp(line_reader.ptr(), "\r\n")) { return false; } if (!line_reader.getline()) { return false; } } assert(chunk_len == 0); // Trailer if (!line_reader.getline()) { return false; } while (strcmp(line_reader.ptr(), "\r\n")) { if (line_reader.size() > CPPHTTPLIB_HEADER_MAX_LENGTH) { return false; } // Exclude line terminator constexpr auto line_terminator_len = 2; auto end = line_reader.ptr() + line_reader.size() - line_terminator_len; parse_header(line_reader.ptr(), end, [&](std::string &&key, std::string &&val) { x.headers.emplace(std::move(key), std::move(val)); }); if (!line_reader.getline()) { return false; } } return true; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0xa8, %rsp movq %rdi, %r15 leaq 0x20(%rsp), %rcx movq %rdi, -0x20(%rcx) leaq 0x70(%rsp), %rax movq %rax, -0x18(%rcx) movq $0x10, -0x10(%rcx) andq $0x0, -0x8(%rcx) movq %rdx, %r12 movq %rsi, %r14 leaq 0x30(%rsp), %rax movq %rax, -0x10(%rax) andq $0x0, -0x8(%rax) movb $0x0, (%rax) movq %rsp, %rdi callq 0x35f36 testb %al, %al je 0x38d40 movq %r14, 0x40(%rsp) leaq 0x8(%rsp), %r13 leaq 0x88(%rsp), %r14 cmpq $0x0, 0x28(%rsp) leaq 0x20(%rsp), %rax cmoveq %r13, %rax movq (%rax), %rdi leaq 0x48(%rsp), %rsi pushq $0x10 popq %rdx callq 0xd930 movq %rax, %rbp cmpq $0x0, 0x28(%rsp) movq %r13, %rax je 0x38c12 leaq 0x20(%rsp), %rax movq 0x48(%rsp), %rcx cmpq (%rax), %rcx je 0x38d40 cmpq $-0x1, %rbp je 0x38d40 testq %rbp, %rbp je 0x38ccd xorps %xmm0, %xmm0 movaps %xmm0, 0x60(%rsp) movaps %xmm0, 0x50(%rsp) movq %r14, %rdi movq %r12, %rsi callq 0x38da2 movq %r15, %rdi movq %rbp, %rsi leaq 0x50(%rsp), %rbx movq %rbx, %rdx movq %r14, %rcx callq 0x38f04 movl %eax, %ebp movq %r14, %rdi callq 0x5528a movq %rbx, %rdi callq 0x5528a testb %bpl, %bpl je 0x38d40 movq %rsp, %rdi callq 0x35f36 testb %al, %al je 0x38d40 cmpq $0x0, 0x28(%rsp) leaq 0x20(%rsp), %rax cmoveq %r13, %rax movq (%rax), %rax cmpb $0xd, (%rax) jne 0x38d40 cmpb $0xa, 0x1(%rax) jne 0x38d40 cmpb $0x0, 0x2(%rax) jne 0x38d40 movq %rsp, %rdi callq 0x35f36 testb %al, %al jne 0x38be0 jmp 0x38d40 movq %rsp, %rdi callq 0x35f36 testb %al, %al movq 0x40(%rsp), %r13 je 0x38d40 leaq 0x8(%rsp), %r15 leaq 0x20(%rsp), %r12 movq %rsp, %r14 xorl %ebp, %ebp movq 0x28(%rsp), %rax testq %rax, %rax movq %r12, %rcx cmoveq %r15, %rcx movq (%rcx), %rdi cmpb $0xd, (%rdi) jne 0x38d10 cmpb $0xa, 0x1(%rdi) jne 0x38d10 cmpb $0x0, 0x2(%rdi) je 0x38d60 testq %rax, %rax jne 0x38d1a movq 0x18(%rsp), %rax cmpq $0x2000, %rax # imm = 0x2000 ja 0x38d40 leaq (%rdi,%rax), %rsi addq $-0x2, %rsi movq %r13, %rdx callq 0x390df movq %r14, %rdi callq 0x35f36 testb %al, %al jne 0x38ced jmp 0x38d42 xorl %ebp, %ebp leaq 0x20(%rsp), %rdi callq 0x10b86 movl %ebp, %eax addq $0xa8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movb $0x1, %bpl jmp 0x38d42 jmp 0x38d8c jmp 0x38d8c jmp 0x38d8c movq %rax, %r14 leaq 0x88(%rsp), %rdi callq 0x5528a jmp 0x38d80 movq %rax, %r14 leaq 0x50(%rsp), %rdi callq 0x5528a jmp 0x38d8f movq %rax, %r14 leaq 0x20(%rsp), %rdi callq 0x10b86 movq %r14, %rdi callq 0xd750 nop
/caozhanhao[P]wxserver/thirdparty/cpp-httplib/httplib.h
httplib::detail::trim(char const*, char const*, unsigned long, unsigned long)
inline std::pair<size_t, size_t> trim(const char *b, const char *e, size_t left, size_t right) { while (b + left < e && is_space_or_tab(b[left])) { left++; } while (right > 0 && is_space_or_tab(b[right - 1])) { right--; } return std::make_pair(left, right); }
movq %rdx, %rax leaq (%rdi,%rax), %rdx cmpq %rsi, %rdx jae 0x3c009 movzbl (%rdx), %edx cmpl $0x20, %edx je 0x3bff5 cmpl $0x9, %edx jne 0x3c009 incq %rax jmp 0x3bfdf movzbl -0x1(%rdi,%rdx), %esi cmpl $0x20, %esi je 0x3c009 cmpl $0x9, %esi jne 0x3c012 movq %rcx, %rdx subq $0x1, %rcx jae 0x3bffa retq nop
/caozhanhao[P]wxserver/thirdparty/cpp-httplib/httplib.h
httplib::ClientImpl::redirect(httplib::Request&, httplib::Response&, httplib::Error&)
inline bool ClientImpl::redirect(Request &req, Response &res, Error &error) { if (req.redirect_count_ == 0) { error = Error::ExceedRedirectCount; return false; } auto location = res.get_header_value("location"); if (location.empty()) { return false; } const static std::regex re( R"((?:(https?):)?(?://(?:\[([\d:]+)\]|([^:/?#]+))(?::(\d+))?)?([^?#]*)(\?[^#]*)?(?:#.*)?)"); std::smatch m; if (!std::regex_match(location, m, re)) { return false; } auto scheme = is_ssl() ? "https" : "http"; auto next_scheme = m[1].str(); auto next_host = m[2].str(); if (next_host.empty()) { next_host = m[3].str(); } auto port_str = m[4].str(); auto next_path = m[5].str(); auto next_query = m[6].str(); auto next_port = port_; if (!port_str.empty()) { next_port = std::stoi(port_str); } else if (!next_scheme.empty()) { next_port = next_scheme == "https" ? 443 : 80; } if (next_scheme.empty()) { next_scheme = scheme; } if (next_host.empty()) { next_host = host_; } if (next_path.empty()) { next_path = "/"; } auto path = detail::decode_url(next_path, true) + next_query; if (next_scheme == scheme && next_host == host_ && next_port == port_) { return detail::redirect(*this, req, res, path, location, error); } else { if (next_scheme == "https") { #ifdef CPPHTTPLIB_OPENSSL_SUPPORT SSLClient cli(next_host.c_str(), next_port); cli.copy_settings(*this); if (ca_cert_store_) { cli.set_ca_cert_store(ca_cert_store_); } return detail::redirect(cli, req, res, path, location, error); #else return false; #endif } else { ClientImpl cli(next_host.c_str(), next_port); cli.copy_settings(*this); return detail::redirect(cli, req, res, path, location, error); } } }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x558, %rsp # imm = 0x558 movq %rcx, %rbx cmpq $0x0, 0x220(%rsi) je 0x3cd91 movq %rdx, %r14 movq %rsi, %r15 movq %rdi, %r12 leaq 0x23a93(%rip), %rsi # 0x6075d leaq 0x138(%rsp), %rdi leaq 0x10(%rsp), %rdx callq 0x10b0c leaq 0x98(%rsp), %rdi leaq 0x138(%rsp), %rdx movq %r14, %rsi xorl %ecx, %ecx callq 0x33d5c leaq 0x138(%rsp), %rdi callq 0x10b86 cmpq $0x0, 0xa0(%rsp) je 0x3cd9e movb 0x5aff8(%rip), %al # 0x97d10 testb %al, %al je 0x3d1d0 xorps %xmm0, %xmm0 leaq 0x10(%rsp), %rsi movaps %xmm0, 0x10(%rsi) movaps %xmm0, (%rsi) leaq 0x5afba(%rip), %rdx # 0x97cf0 leaq 0x98(%rsp), %rdi xorl %ecx, %ecx callq 0x3e147 testb %al, %al je 0x3cda5 movq (%r12), %rax movq %r12, %rdi callq *0x30(%rax) leaq 0x23a62(%rip), %rcx # 0x607bc leaq 0x23a61(%rip), %r13 # 0x607c2 testb %al, %al cmovneq %rcx, %r13 movq 0x10(%rsp), %rsi movq 0x18(%rsp), %rcx pushq $0x18 popq %rbp subq %rsi, %rcx je 0x3cdac movq %rcx, %rax cqto idivq %rbp addq $-0x5, %rax cmpq $-0x3, %rax ja 0x3cdac addq $0x18, %rsi jmp 0x3cdb3 movl $0x6, (%rbx) xorl %ebx, %ebx jmp 0x3d1bc xorl %ebx, %ebx jmp 0x3d1af xorl %ebx, %ebx jmp 0x3d1a5 addq %rcx, %rsi addq $-0x48, %rsi leaq 0x58(%rsp), %rdi callq 0x3e162 movq 0x10(%rsp), %rsi movq 0x18(%rsp), %rcx subq %rsi, %rcx je 0x3cde4 movq %rcx, %rax cqto idivq %rbp addq $-0x6, %rax cmpq $-0x4, %rax ja 0x3cde4 addq $0x30, %rsi jmp 0x3cdeb addq %rcx, %rsi addq $-0x48, %rsi leaq 0x38(%rsp), %rdi callq 0x3e162 cmpq $0x0, 0x40(%rsp) jne 0x3ce58 movq 0x10(%rsp), %rsi movq 0x18(%rsp), %rcx subq %rsi, %rcx je 0x3ce24 movq %rcx, %rax cqto idivq %rbp addq $-0x7, %rax cmpq $-0x5, %rax ja 0x3ce24 addq $0x48, %rsi jmp 0x3ce2b addq %rcx, %rsi addq $-0x48, %rsi leaq 0x138(%rsp), %rdi callq 0x3e162 leaq 0x38(%rsp), %rdi leaq 0x138(%rsp), %rbp movq %rbp, %rsi callq 0x114a0 movq %rbp, %rdi callq 0x10b86 pushq $0x18 popq %rbp movq 0x10(%rsp), %rsi movq 0x18(%rsp), %rcx subq %rsi, %rcx je 0x3ce7f movq %rcx, %rax cqto idivq %rbp addq $-0x8, %rax cmpq $-0x6, %rax ja 0x3ce7f addq $0x60, %rsi jmp 0x3ce86 addq %rcx, %rsi addq $-0x48, %rsi leaq 0xf8(%rsp), %rdi callq 0x3e162 movq 0x10(%rsp), %rsi movq 0x18(%rsp), %rcx subq %rsi, %rcx je 0x3ceba movq %rcx, %rax cqto idivq %rbp addq $-0x9, %rax cmpq $-0x7, %rax ja 0x3ceba addq $0x78, %rsi jmp 0x3cec1 addq %rcx, %rsi addq $-0x48, %rsi leaq 0xd8(%rsp), %rdi callq 0x3e162 movq 0x10(%rsp), %rsi movq 0x18(%rsp), %rcx subq %rsi, %rcx je 0x3cef8 movq %rcx, %rax cqto idivq %rbp addq $-0xa, %rax cmpq $-0x8, %rax ja 0x3cef8 addq $0x90, %rsi jmp 0x3ceff addq %rcx, %rsi addq $-0x48, %rsi leaq 0x118(%rsp), %rdi callq 0x3e162 cmpq $0x0, 0x100(%rsp) je 0x3cf2d leaq 0xf8(%rsp), %rdi pushq $0xa popq %rdx xorl %esi, %esi callq 0x36015 movl %eax, %ebp jmp 0x3cf5a cmpq $0x0, 0x60(%rsp) je 0x3cf55 leaq 0x23880(%rip), %rsi # 0x607bc leaq 0x58(%rsp), %rdi callq 0x119e5 testb %al, %al movl $0x1bb, %eax # imm = 0x1BB pushq $0x50 popq %rbp cmovnel %eax, %ebp jmp 0x3cf5a movl 0x28(%r12), %ebp cmpq $0x0, 0x60(%rsp) jne 0x3cf6f leaq 0x58(%rsp), %rdi movq %r13, %rsi callq 0x5513a cmpq $0x0, 0x40(%rsp) jne 0x3cf86 leaq 0x8(%r12), %rsi leaq 0x38(%rsp), %rdi callq 0x55098 cmpq $0x0, 0xe0(%rsp) jne 0x3cfa5 leaq 0x2352a(%rip), %rsi # 0x604c2 leaq 0xd8(%rsp), %rdi callq 0x5513a leaq 0x138(%rsp), %rdi leaq 0xd8(%rsp), %rsi pushq $0x1 popq %rdx callq 0x38296 leaq 0xb8(%rsp), %rdi leaq 0x138(%rsp), %rsi leaq 0x118(%rsp), %rdx callq 0x141a5 leaq 0x138(%rsp), %rdi callq 0x10b86 leaq 0x58(%rsp), %rdi movq %r13, %rsi callq 0x119e5 testb %al, %al je 0x3d03a leaq 0x8(%r12), %rsi leaq 0x38(%rsp), %rdi callq 0x1ab1c testb %al, %al je 0x3d03a cmpl 0x28(%r12), %ebp jne 0x3d03a leaq 0xb8(%rsp), %rcx leaq 0x98(%rsp), %r8 movq %r12, %rdi movq %r15, %rsi movq %r14, %rdx movq %rbx, %r9 callq 0x3e19c movl %eax, %ebx jmp 0x3d15d leaq 0x2377b(%rip), %rsi # 0x607bc leaq 0x58(%rsp), %rdi callq 0x119e5 testb %al, %al je 0x3d0e6 movq 0x38(%rsp), %rsi leaq 0x78(%rsp), %rdi leaq 0xf(%rsp), %rdx callq 0x10b0c leaq 0x138(%rsp), %rdi leaq 0x78(%rsp), %rsi movl %ebp, %edx callq 0x3e356 leaq 0x78(%rsp), %rdi callq 0x10b86 leaq 0x138(%rsp), %rdi movq %r12, %rsi callq 0x3e3c0 movq 0x398(%r12), %rsi testq %rsi, %rsi je 0x3d0af leaq 0x138(%rsp), %rdi callq 0x3e5b6 leaq 0x138(%rsp), %rdi leaq 0xb8(%rsp), %rcx leaq 0x98(%rsp), %r8 movq %r15, %rsi movq %r14, %rdx movq %rbx, %r9 callq 0x3e608 movl %eax, %ebx leaq 0x138(%rsp), %rdi callq 0x11110 jmp 0x3d15d movq 0x38(%rsp), %rsi leaq 0x78(%rsp), %rdi leaq 0xf(%rsp), %rdx callq 0x10b0c leaq 0x138(%rsp), %rdi leaq 0x78(%rsp), %rsi movl %ebp, %edx callq 0x3e7c2 leaq 0x78(%rsp), %rdi callq 0x10b86 leaq 0x138(%rsp), %rdi movq %r12, %rsi callq 0x3e3c0 leaq 0x138(%rsp), %rdi leaq 0xb8(%rsp), %rcx leaq 0x98(%rsp), %r8 movq %r15, %rsi movq %r14, %rdx movq %rbx, %r9 callq 0x3e19c movl %eax, %ebx leaq 0x138(%rsp), %rdi callq 0x10f44 leaq 0xb8(%rsp), %rdi callq 0x10b86 leaq 0x118(%rsp), %rdi callq 0x10b86 leaq 0xd8(%rsp), %rdi callq 0x10b86 leaq 0xf8(%rsp), %rdi callq 0x10b86 leaq 0x38(%rsp), %rdi callq 0x10b86 leaq 0x58(%rsp), %rdi callq 0x10b86 leaq 0x10(%rsp), %rdi callq 0x2f714 leaq 0x98(%rsp), %rdi callq 0x10b86 movl %ebx, %eax addq $0x558, %rsp # imm = 0x558 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq leaq 0x5ab39(%rip), %rdi # 0x97d10 callq 0xd410 testl %eax, %eax je 0x3cd20 leaq 0x5ab05(%rip), %rdi # 0x97cf0 leaq 0x23574(%rip), %rsi # 0x60766 pushq $0x10 popq %rdx callq 0x2f0cc leaq -0x1edff(%rip), %rdi # 0x1e402 leaq 0x5aae8(%rip), %rsi # 0x97cf0 leaq 0x5a4c9(%rip), %rdx # 0x976d8 callq 0xd9a0 leaq 0x5aaf5(%rip), %rdi # 0x97d10 callq 0xd680 jmp 0x3cd20 movq %rax, %rbx leaq 0x5aae1(%rip), %rdi # 0x97d10 callq 0xd4f0 jmp 0x3d2fa jmp 0x3d24e jmp 0x3d23d movq %rax, %rbx leaq 0x78(%rsp), %rdi callq 0x10b86 jmp 0x3d277 jmp 0x3d24e movq %rax, %rbx jmp 0x3d277 jmp 0x3d29f movq %rax, %rbx leaq 0x138(%rsp), %rdi callq 0x10f44 jmp 0x3d277 movq %rax, %rbx leaq 0x138(%rsp), %rdi callq 0x11110 leaq 0xb8(%rsp), %rdi jmp 0x3d28c movq %rax, %rbx leaq 0x138(%rsp), %rdi callq 0x10b86 jmp 0x3d2b0 jmp 0x3d2ad movq %rax, %rbx jmp 0x3d2bd movq %rax, %rbx jmp 0x3d2ca movq %rax, %rbx jmp 0x3d2d7 movq %rax, %rbx jmp 0x3d2e1 jmp 0x3d2ed jmp 0x3d2ed movq %rax, %rbx leaq 0x118(%rsp), %rdi callq 0x10b86 leaq 0xd8(%rsp), %rdi callq 0x10b86 leaq 0xf8(%rsp), %rdi callq 0x10b86 leaq 0x38(%rsp), %rdi callq 0x10b86 leaq 0x58(%rsp), %rdi callq 0x10b86 jmp 0x3d2f0 movq %rax, %rbx leaq 0x10(%rsp), %rdi callq 0x2f714 leaq 0x98(%rsp), %rdi callq 0x10b86 movq %rbx, %rdi callq 0xd750 movq %rax, %rbx leaq 0x138(%rsp), %rdi jmp 0x3d302 movq %rax, %rbx jmp 0x3d307 nop
/caozhanhao[P]wxserver/thirdparty/cpp-httplib/httplib.h
nlohmann::json_abi_v3_11_2::detail::json_sax_dom_callback_parser<nlohmann::json_abi_v3_11_2::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_2::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char>>, void>>::start_array(unsigned long)
bool start_array(std::size_t len) { const bool keep = callback(static_cast<int>(ref_stack.size()), parse_event_t::array_start, discarded); keep_stack.push_back(keep); auto val = handle_value(BasicJsonType::value_t::array, true); ref_stack.push_back(val.second); // check array limit if (ref_stack.back() && JSON_HEDLEY_UNLIKELY(len != static_cast<std::size_t>(-1) && len > ref_stack.back()->max_size())) { JSON_THROW(out_of_range::create(408, concat("excessive array size: ", std::to_string(len)), ref_stack.back())); } return true; }
pushq %rbp pushq %r15 pushq %r14 pushq %rbx subq $0x58, %rsp movq %rsi, %r15 movq %rdi, %r14 addq $0x80, %rdi leaq 0x8(%r14), %rbx movq 0x10(%r14), %rsi subq 0x8(%r14), %rsi shrq $0x3, %rsi leaq 0xa8(%r14), %rcx pushq $0x2 popq %rdx callq 0x44720 leaq 0x20(%r14), %rdi movzbl %al, %esi callq 0x439c4 leaq 0x8(%rsp), %rsi movb $0x2, (%rsi) pushq $0x1 popq %rdx movq %r14, %rdi callq 0x44744 leaq 0x50(%rsp), %rsi movb %al, -0x8(%rsi) movq %rdx, (%rsi) movq %rbx, %rdi callq 0x44956 movq 0x10(%r14), %rax movq -0x8(%rax), %rdi testq %rdi, %rdi sete %al cmpq $-0x1, %r15 sete %cl orb %al, %cl jne 0x4433d callq 0x44974 cmpq %r15, %rax jb 0x4434a movb $0x1, %al addq $0x58, %rsp popq %rbx popq %r14 popq %r15 popq %rbp retq pushq $0x20 popq %rdi callq 0xd4a0 movq %rax, %rbx leaq 0x28(%rsp), %rdi movq %r15, %rsi callq 0x1589e leaq 0x1e589(%rip), %rsi # 0x628f2 leaq 0x8(%rsp), %rdi leaq 0x28(%rsp), %rdx callq 0x457c9 movq 0x10(%r14), %rax movq -0x8(%rax), %rcx movb $0x1, %bpl leaq 0x8(%rsp), %rdx movq %rbx, %rdi movl $0x198, %esi # imm = 0x198 callq 0x4499c xorl %ebp, %ebp leaq 0x524aa(%rip), %rsi # 0x96848 leaq -0x1419(%rip), %rdx # 0x42f8c movq %rbx, %rdi callq 0xd710 movq %rax, %r14 leaq 0x8(%rsp), %rdi callq 0x10b86 jmp 0x443c2 movq %rax, %r14 movb $0x1, %bpl leaq 0x28(%rsp), %rdi callq 0x10b86 testb %bpl, %bpl jne 0x443d6 jmp 0x443de movq %rax, %r14 movq %rbx, %rdi callq 0xd9b0 movq %r14, %rdi callq 0xd750
/caozhanhao[P]wxserver/thirdparty/json/single_include/nlohmann/json.hpp
nlohmann::json_abi_v3_11_2::detail::json_sax_dom_callback_parser<nlohmann::json_abi_v3_11_2::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_2::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char>>, void>>::end_array()
bool end_array() { bool keep = true; if (ref_stack.back()) { keep = callback(static_cast<int>(ref_stack.size()) - 1, parse_event_t::array_end, *ref_stack.back()); if (keep) { ref_stack.back()->set_parents(); } else { // discard array *ref_stack.back() = discarded; } } JSON_ASSERT(!ref_stack.empty()); JSON_ASSERT(!keep_stack.empty()); ref_stack.pop_back(); keep_stack.pop_back(); // remove discarded value if (!keep && !ref_stack.empty() && ref_stack.back()->is_array()) { ref_stack.back()->m_data.m_value.array->pop_back(); } return true; }
pushq %rbp pushq %r14 pushq %rbx subq $0x10, %rsp movq %rdi, %rbx movq 0x10(%rdi), %rsi movq -0x8(%rsi), %rcx movb $0x1, %bpl testq %rcx, %rcx je 0x4444a leaq 0x80(%rbx), %rdi subq 0x8(%rbx), %rsi shrq $0x3, %rsi decl %esi pushq $0x3 popq %rdx callq 0x44720 testb %al, %al jne 0x4444a leaq 0xa8(%rbx), %rsi movq %rsp, %r14 movq %r14, %rdi callq 0x2d190 movq 0x10(%rbx), %rax movq -0x8(%rax), %rdi movq %r14, %rsi callq 0x2a7da movq %r14, %rdi callq 0x2a81e xorl %ebp, %ebp movq 0x10(%rbx), %rax cmpq %rax, 0x8(%rbx) je 0x444a1 movq 0x20(%rbx), %rcx cmpq 0x30(%rbx), %rcx jne 0x44464 cmpl $0x0, 0x38(%rbx) je 0x444c0 leaq 0x30(%rbx), %rdi addq $-0x8, %rax movq %rax, 0x10(%rbx) callq 0x43d86 testb %bpl, %bpl jne 0x44496 movq 0x10(%rbx), %rax cmpq %rax, 0x8(%rbx) je 0x44496 movq -0x8(%rax), %rax cmpb $0x2, (%rax) jne 0x44496 movq 0x8(%rax), %rdi callq 0x2b880 movb $0x1, %al addq $0x10, %rsp popq %rbx popq %r14 popq %rbp retq leaq 0x1dfde(%rip), %rdi # 0x62486 leaq 0x1a891(%rip), %rsi # 0x5ed40 leaq 0x1e453(%rip), %rcx # 0x62909 movl $0x1bb3, %edx # imm = 0x1BB3 callq 0xd230 leaq 0x1de61(%rip), %rdi # 0x62328 leaq 0x1a872(%rip), %rsi # 0x5ed40 leaq 0x1e434(%rip), %rcx # 0x62909 movl $0x1bb4, %edx # imm = 0x1BB4 callq 0xd230 nop
/caozhanhao[P]wxserver/thirdparty/json/single_include/nlohmann/json.hpp
nlohmann::json_abi_v3_11_2::detail::iter_impl<nlohmann::json_abi_v3_11_2::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_2::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char>>, void>> nlohmann::json_abi_v3_11_2::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_2::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char>>, void>::erase<nlohmann::json_abi_v3_11_2::detail::iter_impl<nlohmann::json_abi_v3_11_2::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_2::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char>>, void>>, 0>(nlohmann::json_abi_v3_11_2::detail::iter_impl<nlohmann::json_abi_v3_11_2::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_2::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char>>, void>>)
IteratorType erase(IteratorType pos) { // make sure iterator fits the current value if (JSON_HEDLEY_UNLIKELY(this != pos.m_object)) { JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value", this)); } IteratorType result = end(); switch (m_data.m_type) { case value_t::boolean: case value_t::number_float: case value_t::number_integer: case value_t::number_unsigned: case value_t::string: case value_t::binary: { if (JSON_HEDLEY_UNLIKELY(!pos.m_it.primitive_iterator.is_begin())) { JSON_THROW(invalid_iterator::create(205, "iterator out of range", this)); } if (is_string()) { AllocatorType<string_t> alloc; std::allocator_traits<decltype(alloc)>::destroy(alloc, m_data.m_value.string); std::allocator_traits<decltype(alloc)>::deallocate(alloc, m_data.m_value.string, 1); m_data.m_value.string = nullptr; } else if (is_binary()) { AllocatorType<binary_t> alloc; std::allocator_traits<decltype(alloc)>::destroy(alloc, m_data.m_value.binary); std::allocator_traits<decltype(alloc)>::deallocate(alloc, m_data.m_value.binary, 1); m_data.m_value.binary = nullptr; } m_data.m_type = value_t::null; assert_invariant(); break; } case value_t::object: { result.m_it.object_iterator = m_data.m_value.object->erase(pos.m_it.object_iterator); break; } case value_t::array: { result.m_it.array_iterator = m_data.m_value.array->erase(pos.m_it.array_iterator); break; } case value_t::null: case value_t::discarded: default: JSON_THROW(type_error::create(307, detail::concat("cannot use erase() with ", type_name()), this)); } return result; }
pushq %rbp pushq %r15 pushq %r14 pushq %rbx subq $0x28, %rsp movq %rsi, %r14 cmpq %rsi, (%rdx) jne 0x44ed3 movq %rdx, %r15 movq %rdi, %rbx movq %r14, %rsi callq 0x44cb8 movzbl (%r14), %eax leal -0x3(%rax), %ecx cmpl $0x6, %ecx jae 0x44e66 cmpq $0x0, 0x18(%r15) jne 0x44f27 cmpl $0x8, %eax je 0x44e87 cmpl $0x3, %eax jne 0x44ea3 leaq 0x8(%r14), %r15 movq 0x8(%r14), %rdi callq 0x10b86 pushq $0x20 jmp 0x44e96 cmpl $0x1, %eax je 0x44ec0 cmpl $0x2, %eax jne 0x44f78 movq 0x8(%r14), %rdi movq 0x10(%r15), %rsi callq 0x45314 movq %rax, 0x10(%rbx) jmp 0x44eb2 leaq 0x8(%r14), %r15 movq 0x8(%r14), %rdi callq 0x2bbf0 pushq $0x28 popq %rsi movq (%r15), %rdi callq 0xd150 andq $0x0, (%r15) movb $0x0, (%r14) pushq $0x1 popq %rsi movq %r14, %rdi callq 0x2b3e0 movq %rbx, %rax addq $0x28, %rsp popq %rbx popq %r14 popq %r15 popq %rbp retq movq 0x8(%r14), %rdi movq 0x8(%r15), %rsi callq 0x45378 movq %rax, 0x8(%rbx) jmp 0x44eb2 pushq $0x20 popq %rdi callq 0xd4a0 movq %rax, %rbx leaq 0x1d935(%rip), %rsi # 0x6281a leaq 0x8(%rsp), %rdi movq %rsp, %rdx callq 0x10b0c movb $0x1, %bpl leaq 0x8(%rsp), %rdx movq %rbx, %rdi movl $0xca, %esi movq %r14, %rcx callq 0x451a2 xorl %ebp, %ebp leaq 0x51975(%rip), %rsi # 0x96888 leaq -0x1f8e(%rip), %rdx # 0x42f8c movq %rbx, %rdi callq 0xd710 jmp 0x44fd2 pushq $0x20 popq %rdi callq 0xd4a0 movq %rax, %rbx leaq 0x1d905(%rip), %rsi # 0x6283e leaq 0x8(%rsp), %rdi movq %rsp, %rdx callq 0x10b0c movb $0x1, %bpl leaq 0x8(%rsp), %rdx movq %rbx, %rdi movl $0xcd, %esi movq %r14, %rcx callq 0x451a2 xorl %ebp, %ebp leaq 0x51921(%rip), %rsi # 0x96888 leaq -0x1fe2(%rip), %rdx # 0x42f8c movq %rbx, %rdi callq 0xd710 jmp 0x44fd2 pushq $0x20 popq %rdi callq 0xd4a0 movq %rax, %rbx movq %r14, %rdi callq 0x2d0d8 movq %rsp, %rdx movq %rax, (%rdx) leaq 0x1d8bc(%rip), %rsi # 0x62854 leaq 0x8(%rsp), %rdi callq 0x45319 movb $0x1, %bpl leaq 0x8(%rsp), %rdx movq %rbx, %rdi movl $0x133, %esi # imm = 0x133 movq %r14, %rcx callq 0x2db4e xorl %ebp, %ebp leaq 0x5169d(%rip), %rsi # 0x96660 leaq -0x203e(%rip), %rdx # 0x42f8c movq %rbx, %rdi callq 0xd710 jmp 0x44fda jmp 0x44fee jmp 0x44fda jmp 0x44fee movq %rax, %r14 leaq 0x8(%rsp), %rdi callq 0x10b86 testb %bpl, %bpl jne 0x44ff1 jmp 0x44ff9 movq %rax, %r14 movq %rbx, %rdi callq 0xd9b0 movq %r14, %rdi callq 0xd750 nop
/caozhanhao[P]wxserver/thirdparty/json/single_include/nlohmann/json.hpp
nlohmann::json_abi_v3_11_2::detail::iter_impl<nlohmann::json_abi_v3_11_2::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_2::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char>>, void>>::operator++()
iter_impl& operator++() { JSON_ASSERT(m_object != nullptr); switch (m_object->m_data.m_type) { case value_t::object: { std::advance(m_it.object_iterator, 1); break; } case value_t::array: { std::advance(m_it.array_iterator, 1); break; } case value_t::null: case value_t::string: case value_t::boolean: case value_t::number_integer: case value_t::number_unsigned: case value_t::number_float: case value_t::binary: case value_t::discarded: default: { ++m_it.primitive_iterator; break; } } return *this; }
pushq %rbx movq (%rdi), %rax testq %rax, %rax je 0x45039 movq %rdi, %rbx movzbl (%rax), %eax cmpl $0x2, %eax je 0x45029 cmpl $0x1, %eax jne 0x45030 leaq 0x8(%rbx), %rdi pushq $0x1 popq %rsi callq 0x4548c jmp 0x45034 addq $0x10, 0x10(%rbx) jmp 0x45034 incq 0x18(%rbx) movq %rbx, %rax popq %rbx retq leaq 0x1d4dc(%rip), %rdi # 0x6251c leaq 0x19cf9(%rip), %rsi # 0x5ed40 leaq 0x1d81f(%rip), %rcx # 0x6286d movl $0x3371, %edx # imm = 0x3371 callq 0xd230
/caozhanhao[P]wxserver/thirdparty/json/single_include/nlohmann/json.hpp
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> nlohmann::json_abi_v3_11_2::detail::concat<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, char const (&) [23], std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>(char const (&) [23], std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&&)
inline OutStringType concat(Args && ... args) { OutStringType str; str.reserve(concat_length(args...)); concat_into(str, std::forward<Args>(args)...); return str; }
pushq %r15 pushq %r14 pushq %rbx movq %rdx, %r14 movq %rsi, %r15 movq %rdi, %rbx leaq 0x10(%rdi), %rax movq %rax, (%rdi) andq $0x0, 0x8(%rdi) movb $0x0, 0x10(%rdi) movq %rsi, %rdi movq %rdx, %rsi callq 0x44c57 movq %rbx, %rdi movq %rax, %rsi callq 0x2c40c movq %rbx, %rdi movq %r15, %rsi movq %r14, %rdx callq 0x45827 movq %rbx, %rax popq %rbx popq %r14 popq %r15 retq movq %rax, %r14 movq %rbx, %rdi callq 0x10b86 movq %r14, %rdi callq 0xd750
/caozhanhao[P]wxserver/thirdparty/json/single_include/nlohmann/json.hpp
std::pair<bool, nlohmann::json_abi_v3_11_2::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_2::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char>>, void>*> nlohmann::json_abi_v3_11_2::detail::json_sax_dom_callback_parser<nlohmann::json_abi_v3_11_2::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_2::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char>>, void>>::handle_value<double&>(double&, bool)
std::pair<bool, BasicJsonType*> handle_value(Value&& v, const bool skip_callback = false) { JSON_ASSERT(!keep_stack.empty()); // do not handle this value if we know it would be added to a discarded // container if (!keep_stack.back()) { return {false, nullptr}; } // create value auto value = BasicJsonType(std::forward<Value>(v)); // check callback const bool keep = skip_callback || callback(static_cast<int>(ref_stack.size()), parse_event_t::value, value); // do not handle this value if we just learnt it shall be discarded if (!keep) { return {false, nullptr}; } if (ref_stack.empty()) { root = std::move(value); return {true, &root}; } // skip this value if we already decided to skip the parent // (https://github.com/nlohmann/json/issues/971#issuecomment-413678360) if (!ref_stack.back()) { return {false, nullptr}; } // we now only expect arrays and objects JSON_ASSERT(ref_stack.back()->is_array() || ref_stack.back()->is_object()); // array if (ref_stack.back()->is_array()) { ref_stack.back()->m_data.m_value.array->emplace_back(std::move(value)); return {true, &(ref_stack.back()->m_data.m_value.array->back())}; } // object JSON_ASSERT(ref_stack.back()->is_object()); // check if we should store an element for the current key JSON_ASSERT(!key_keep_stack.empty()); const bool store_element = key_keep_stack.back(); key_keep_stack.pop_back(); if (!store_element) { return {false, nullptr}; } JSON_ASSERT(object_element); *object_element = std::move(value); return {true, object_element}; }
pushq %rbp pushq %r15 pushq %r14 pushq %rbx subq $0x38, %rsp movl %edx, %ebp movq %rsi, %r14 movq %rdi, %rbx movq 0x20(%rdi), %rax cmpq 0x30(%rdi), %rax jne 0x45906 cmpl $0x0, 0x38(%rbx) je 0x45a5e leaq 0x20(%rbx), %rdi callq 0x446f2 testq %rdx, (%rax) je 0x459a1 leaq 0x8(%rsp), %rdi movq %r14, %rsi callq 0x45af2 testb %bpl, %bpl jne 0x45952 leaq 0x80(%rbx), %rdi movq 0x10(%rbx), %rsi subq 0x8(%rbx), %rsi shrq $0x3, %rsi pushq $0x5 popq %rdx leaq 0x8(%rsp), %rcx callq 0x44720 testb %al, %al je 0x45a3f movq 0x10(%rbx), %rax cmpq %rax, 0x8(%rbx) je 0x459ab movq -0x8(%rax), %rax testq %rax, %rax je 0x45a3f movzbl (%rax), %ecx cmpl $0x1, %ecx je 0x459d5 cmpl $0x2, %ecx jne 0x45a7d movq 0x8(%rax), %rdi leaq 0x8(%rsp), %rsi callq 0x2b99a movq 0x10(%rbx), %rax movq -0x8(%rax), %rax movq 0x8(%rax), %rax movq 0x8(%rax), %r14 addq $-0x10, %r14 jmp 0x45a3b xorl %ebx, %ebx xorl %r14d, %r14d jmp 0x45a4e leaq 0x28(%rsp), %r14 leaq 0x8(%rsp), %rsi movq %r14, %rdi callq 0x2b84c movq (%rbx), %rdi movq %r14, %rsi callq 0x2a7da movq %r14, %rdi callq 0x2a81e movq (%rbx), %r14 jmp 0x45a3b movq 0x48(%rbx), %rax cmpq 0x58(%rbx), %rax jne 0x459e9 cmpl $0x0, 0x60(%rbx) je 0x45a9c leaq 0x48(%rbx), %rdi callq 0x446f2 movq %rdx, %r14 leaq 0x58(%rbx), %rdi movq (%rax), %r15 callq 0x43d86 testq %r14, %r15 je 0x45a3f cmpq $0x0, 0x70(%rbx) je 0x45abb leaq 0x18(%rsp), %r14 leaq 0x8(%rsp), %rsi movq %r14, %rdi callq 0x2b84c movq 0x70(%rbx), %rdi movq %r14, %rsi callq 0x2a7da movq %r14, %rdi callq 0x2a81e movq 0x70(%rbx), %r14 movb $0x1, %bl jmp 0x45a44 xorl %ebx, %ebx xorl %r14d, %r14d leaq 0x8(%rsp), %rdi callq 0x2a81e movl %ebx, %eax movq %r14, %rdx addq $0x38, %rsp popq %rbx popq %r14 popq %r15 popq %rbp retq leaq 0x1c8c3(%rip), %rdi # 0x62328 leaq 0x192d4(%rip), %rsi # 0x5ed40 leaq 0x1cf18(%rip), %rcx # 0x6298b movl $0x1be6, %edx # imm = 0x1BE6 callq 0xd230 leaq 0x1c990(%rip), %rdi # 0x62414 leaq 0x192b5(%rip), %rsi # 0x5ed40 leaq 0x1cef9(%rip), %rcx # 0x6298b movl $0x1c09, %edx # imm = 0x1C09 callq 0xd230 leaq 0x1c9af(%rip), %rdi # 0x62452 leaq 0x19296(%rip), %rsi # 0x5ed40 leaq 0x1ceda(%rip), %rcx # 0x6298b movl $0x1c15, %edx # imm = 0x1C15 callq 0xd230 leaq 0x1c9a8(%rip), %rdi # 0x6246a leaq 0x19277(%rip), %rsi # 0x5ed40 leaq 0x1cebb(%rip), %rcx # 0x6298b movl $0x1c1e, %edx # imm = 0x1C1E callq 0xd230 jmp 0x45adc movq %rax, %rbx leaq 0x8(%rsp), %rdi callq 0x2a81e movq %rbx, %rdi callq 0xd750 nop
/caozhanhao[P]wxserver/thirdparty/json/single_include/nlohmann/json.hpp
std::pair<bool, nlohmann::json_abi_v3_11_2::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_2::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char>>, void>*> nlohmann::json_abi_v3_11_2::detail::json_sax_dom_callback_parser<nlohmann::json_abi_v3_11_2::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_2::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char>>, void>>::handle_value<long&>(long&, bool)
std::pair<bool, BasicJsonType*> handle_value(Value&& v, const bool skip_callback = false) { JSON_ASSERT(!keep_stack.empty()); // do not handle this value if we know it would be added to a discarded // container if (!keep_stack.back()) { return {false, nullptr}; } // create value auto value = BasicJsonType(std::forward<Value>(v)); // check callback const bool keep = skip_callback || callback(static_cast<int>(ref_stack.size()), parse_event_t::value, value); // do not handle this value if we just learnt it shall be discarded if (!keep) { return {false, nullptr}; } if (ref_stack.empty()) { root = std::move(value); return {true, &root}; } // skip this value if we already decided to skip the parent // (https://github.com/nlohmann/json/issues/971#issuecomment-413678360) if (!ref_stack.back()) { return {false, nullptr}; } // we now only expect arrays and objects JSON_ASSERT(ref_stack.back()->is_array() || ref_stack.back()->is_object()); // array if (ref_stack.back()->is_array()) { ref_stack.back()->m_data.m_value.array->emplace_back(std::move(value)); return {true, &(ref_stack.back()->m_data.m_value.array->back())}; } // object JSON_ASSERT(ref_stack.back()->is_object()); // check if we should store an element for the current key JSON_ASSERT(!key_keep_stack.empty()); const bool store_element = key_keep_stack.back(); key_keep_stack.pop_back(); if (!store_element) { return {false, nullptr}; } JSON_ASSERT(object_element); *object_element = std::move(value); return {true, object_element}; }
pushq %rbp pushq %r15 pushq %r14 pushq %rbx subq $0x38, %rsp movl %edx, %ebp movq %rsi, %r14 movq %rdi, %rbx movq 0x20(%rdi), %rax cmpq 0x30(%rdi), %rax jne 0x45ffa cmpl $0x0, 0x38(%rbx) je 0x46152 leaq 0x20(%rbx), %rdi callq 0x446f2 testq %rdx, (%rax) je 0x46095 leaq 0x8(%rsp), %rdi movq %r14, %rsi callq 0x461e6 testb %bpl, %bpl jne 0x46046 leaq 0x80(%rbx), %rdi movq 0x10(%rbx), %rsi subq 0x8(%rbx), %rsi shrq $0x3, %rsi pushq $0x5 popq %rdx leaq 0x8(%rsp), %rcx callq 0x44720 testb %al, %al je 0x46133 movq 0x10(%rbx), %rax cmpq %rax, 0x8(%rbx) je 0x4609f movq -0x8(%rax), %rax testq %rax, %rax je 0x46133 movzbl (%rax), %ecx cmpl $0x1, %ecx je 0x460c9 cmpl $0x2, %ecx jne 0x46171 movq 0x8(%rax), %rdi leaq 0x8(%rsp), %rsi callq 0x2b99a movq 0x10(%rbx), %rax movq -0x8(%rax), %rax movq 0x8(%rax), %rax movq 0x8(%rax), %r14 addq $-0x10, %r14 jmp 0x4612f xorl %ebx, %ebx xorl %r14d, %r14d jmp 0x46142 leaq 0x28(%rsp), %r14 leaq 0x8(%rsp), %rsi movq %r14, %rdi callq 0x2b84c movq (%rbx), %rdi movq %r14, %rsi callq 0x2a7da movq %r14, %rdi callq 0x2a81e movq (%rbx), %r14 jmp 0x4612f movq 0x48(%rbx), %rax cmpq 0x58(%rbx), %rax jne 0x460dd cmpl $0x0, 0x60(%rbx) je 0x46190 leaq 0x48(%rbx), %rdi callq 0x446f2 movq %rdx, %r14 leaq 0x58(%rbx), %rdi movq (%rax), %r15 callq 0x43d86 testq %r14, %r15 je 0x46133 cmpq $0x0, 0x70(%rbx) je 0x461af leaq 0x18(%rsp), %r14 leaq 0x8(%rsp), %rsi movq %r14, %rdi callq 0x2b84c movq 0x70(%rbx), %rdi movq %r14, %rsi callq 0x2a7da movq %r14, %rdi callq 0x2a81e movq 0x70(%rbx), %r14 movb $0x1, %bl jmp 0x46138 xorl %ebx, %ebx xorl %r14d, %r14d leaq 0x8(%rsp), %rdi callq 0x2a81e movl %ebx, %eax movq %r14, %rdx addq $0x38, %rsp popq %rbx popq %r14 popq %r15 popq %rbp retq leaq 0x1c1cf(%rip), %rdi # 0x62328 leaq 0x18be0(%rip), %rsi # 0x5ed40 leaq 0x1ca7d(%rip), %rcx # 0x62be4 movl $0x1be6, %edx # imm = 0x1BE6 callq 0xd230 leaq 0x1c29c(%rip), %rdi # 0x62414 leaq 0x18bc1(%rip), %rsi # 0x5ed40 leaq 0x1ca5e(%rip), %rcx # 0x62be4 movl $0x1c09, %edx # imm = 0x1C09 callq 0xd230 leaq 0x1c2bb(%rip), %rdi # 0x62452 leaq 0x18ba2(%rip), %rsi # 0x5ed40 leaq 0x1ca3f(%rip), %rcx # 0x62be4 movl $0x1c15, %edx # imm = 0x1C15 callq 0xd230 leaq 0x1c2b4(%rip), %rdi # 0x6246a leaq 0x18b83(%rip), %rsi # 0x5ed40 leaq 0x1ca20(%rip), %rcx # 0x62be4 movl $0x1c1e, %edx # imm = 0x1C1E callq 0xd230 jmp 0x461d0 movq %rax, %rbx leaq 0x8(%rsp), %rdi callq 0x2a81e movq %rbx, %rdi callq 0xd750 nop
/caozhanhao[P]wxserver/thirdparty/json/single_include/nlohmann/json.hpp
nlohmann::json_abi_v3_11_2::detail::serializer<nlohmann::json_abi_v3_11_2::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_2::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char>>, void>>::decode(unsigned char&, unsigned int&, unsigned char)
static std::uint8_t decode(std::uint8_t& state, std::uint32_t& codep, const std::uint8_t byte) noexcept { static const std::array<std::uint8_t, 400> utf8d = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 00..1F 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 20..3F 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 40..5F 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 60..7F 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, // 80..9F 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, // A0..BF 8, 8, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // C0..DF 0xA, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x4, 0x3, 0x3, // E0..EF 0xB, 0x6, 0x6, 0x6, 0x5, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, // F0..FF 0x0, 0x1, 0x2, 0x3, 0x5, 0x8, 0x7, 0x1, 0x1, 0x1, 0x4, 0x6, 0x1, 0x1, 0x1, 0x1, // s0..s0 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, // s1..s2 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, // s3..s4 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 3, 1, 1, 1, 1, 1, 1, // s5..s6 1, 3, 1, 1, 1, 1, 1, 3, 1, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // s7..s8 } }; JSON_ASSERT(byte < utf8d.size()); const std::uint8_t type = utf8d[byte]; codep = (state != UTF8_ACCEPT) ? (byte & 0x3fu) | (codep << 6u) : (0xFFu >> type) & (byte); const std::size_t index = 256u + static_cast<size_t>(state) * 16u + static_cast<size_t>(type); JSON_ASSERT(index < utf8d.size()); state = utf8d[index]; return state; }
movl %edx, %ecx leaq 0x1da30(%rip), %rax # 0x6762d movzbl (%rcx,%rax), %ecx cmpb $0x0, (%rdi) je 0x49c17 andb $0x3f, %dl movzbl %dl, %r8d movl (%rsi), %edx shll $0x6, %edx orl %r8d, %edx jmp 0x49c26 movl $0xff, %r8d shrl %cl, %r8d movzbl %dl, %edx andl %r8d, %edx movl %edx, (%rsi) movzbl (%rdi), %edx shll $0x4, %edx movl %ecx, %ecx addq %rdx, %rcx addq $0x100, %rcx # imm = 0x100 cmpq $0x190, %rcx # imm = 0x190 jae 0x49c49 movb (%rcx,%rax), %al movb %al, (%rdi) retq pushq %rax leaq 0x19ed4(%rip), %rdi # 0x63b25 leaq 0x150e8(%rip), %rsi # 0x5ed40 leaq 0x19e17(%rip), %rcx # 0x63a76 movl $0x49a4, %edx # imm = 0x49A4 callq 0xd230
/caozhanhao[P]wxserver/thirdparty/json/single_include/nlohmann/json.hpp
httplib::Server::bind_internal(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int, int)
inline int Server::bind_internal(const std::string &host, int port, int socket_flags) { if (!is_valid()) { return -1; } svr_sock_ = create_server_socket(host, port, socket_flags, socket_options_); if (svr_sock_ == INVALID_SOCKET) { return -1; } if (port == 0) { struct sockaddr_storage addr; socklen_t addr_len = sizeof(addr); if (getsockname(svr_sock_, reinterpret_cast<struct sockaddr *>(&addr), &addr_len) == -1) { return -1; } if (addr.ss_family == AF_INET) { return ntohs(reinterpret_cast<struct sockaddr_in *>(&addr)->sin_port); } else if (addr.ss_family == AF_INET6) { return ntohs(reinterpret_cast<struct sockaddr_in6 *>(&addr)->sin6_port); } else { return -1; } } else { return port; } }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0xa8, %rsp movl %ecx, %r15d movl %edx, %ebp movq %rsi, %r12 movq %rdi, %r14 movq (%rdi), %rax callq *0x10(%rax) pushq $-0x1 popq %rbx testb %al, %al je 0x4b245 leaq 0x2a0(%r14), %rsi leaq 0x8(%rsp), %r13 movq %r13, %rdi callq 0x3ef84 movq %r14, %rdi movq %r12, %rsi movl %ebp, %edx movl %r15d, %ecx movq %r13, %r8 callq 0x4b2ac xchgl %eax, 0x28(%r14) leaq 0x8(%rsp), %rdi callq 0x5528a movl 0x28(%r14), %eax cmpl $-0x1, %eax je 0x4b245 movl %ebp, %ebx testl %ebp, %ebp je 0x4b259 movl %ebx, %eax addq $0xa8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq leaq 0x4(%rsp), %rdx movl $0x80, (%rdx) movl 0x28(%r14), %edi leaq 0x28(%rsp), %rsi callq 0xd060 pushq $-0x1 popq %rbx cmpl $-0x1, %eax je 0x4b245 movzwl 0x28(%rsp), %eax cmpl $0xa, %eax je 0x4b289 cmpl $0x2, %eax jne 0x4b245 movzwl 0x2a(%rsp), %eax rolw $0x8, %ax movzwl %ax, %ebx jmp 0x4b245 movq %rax, %rbx leaq 0x8(%rsp), %rdi callq 0x5528a movq %rbx, %rdi callq 0xd750
/caozhanhao[P]wxserver/thirdparty/cpp-httplib/httplib.h
bool httplib::detail::write_multipart_ranges_data<httplib::Server::write_content_with_provider(httplib::Stream&, httplib::Request const&, httplib::Response&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)::'lambda'()>(httplib::Stream&, httplib::Request const&, httplib::Response&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, httplib::Server::write_content_with_provider(httplib::Stream&, httplib::Request const&, httplib::Response&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)::'lambda'() const&)
inline bool write_multipart_ranges_data(Stream &strm, const Request &req, Response &res, const std::string &boundary, const std::string &content_type, const T &is_shutting_down) { return process_multipart_ranges_data( req, res, boundary, content_type, [&](const std::string &token) { strm.write(token); }, [&](const std::string &token) { strm.write(token); }, [&](size_t offset, size_t length) { return write_content(strm, res.content_provider_, offset, length, is_shutting_down); }); }
subq $0x38, %rsp movq %rdi, %rax movq %rdi, 0x20(%rsp) movq %rdx, 0x28(%rsp) movq %r9, 0x30(%rsp) movq %r9, 0x10(%rsp) movups 0x20(%rsp), %xmm0 movups %xmm0, (%rsp) movq %rsi, %rdi movq %rdx, %rsi movq %rcx, %rdx movq %r8, %rcx movq %rax, %r8 movq %rax, %r9 callq 0x4f075 addq $0x38, %rsp retq
/caozhanhao[P]wxserver/thirdparty/cpp-httplib/httplib.h
httplib::ClientImpl::create_client_socket(httplib::Error&) const
inline socket_t ClientImpl::create_client_socket(Error &error) const { if (!proxy_host_.empty() && proxy_port_ != -1) { return detail::create_client_socket( proxy_host_, std::string(), proxy_port_, address_family_, tcp_nodelay_, socket_options_, connection_timeout_sec_, connection_timeout_usec_, read_timeout_sec_, read_timeout_usec_, write_timeout_sec_, write_timeout_usec_, interface_, error); } // Check is custom IP specified for host_ std::string ip; auto it = addr_map_.find(host_); if (it != addr_map_.end()) ip = it->second; return detail::create_client_socket( host_, ip, port_, address_family_, tcp_nodelay_, socket_options_, connection_timeout_sec_, connection_timeout_usec_, read_timeout_sec_, read_timeout_usec_, write_timeout_sec_, write_timeout_usec_, interface_, error); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0xa8, %rsp movq %rsi, %r14 movq %rdi, %rbx cmpq $0x0, 0x298(%rdi) je 0x543d0 movl 0x2b0(%rbx), %ebp cmpl $-0x1, %ebp je 0x543d0 leaq 0x58(%rsp), %rax movq %rax, -0x10(%rax) andq $0x0, -0x8(%rax) movb $0x0, (%rax) movl 0x23c(%rbx), %r15d movb 0x240(%rbx), %r12b leaq 0x248(%rbx), %rsi leaq 0x88(%rsp), %rdi callq 0x3ef84 leaq 0x290(%rbx), %rdi movups 0x168(%rbx), %xmm0 movups 0x178(%rbx), %xmm1 movups 0x188(%rbx), %xmm2 addq $0x270, %rbx # imm = 0x270 movq %r14, 0x38(%rsp) movq %rbx, 0x30(%rsp) movups %xmm2, 0x20(%rsp) movups %xmm1, 0x10(%rsp) movups %xmm0, (%rsp) movzbl %r12b, %r8d leaq 0x48(%rsp), %rsi leaq 0x88(%rsp), %r9 movl %ebp, %edx movl %r15d, %ecx callq 0x544df movl %eax, %ebx leaq 0x88(%rsp), %rdi jmp 0x54489 leaq 0x58(%rsp), %rax movq %rax, -0x10(%rax) andq $0x0, -0x8(%rax) movb $0x0, (%rax) leaq 0xc8(%rbx), %rdi leaq 0x8(%rbx), %r15 movq %r15, %rsi callq 0x3b36e leaq 0xd0(%rbx), %rcx cmpq %rcx, %rax je 0x54411 addq $0x40, %rax leaq 0x48(%rsp), %rdi movq %rax, %rsi callq 0x55098 movl 0x28(%rbx), %ebp movl 0x23c(%rbx), %r12d movb 0x240(%rbx), %r13b leaq 0x248(%rbx), %rsi leaq 0x68(%rsp), %rdi callq 0x3ef84 movups 0x168(%rbx), %xmm0 movups 0x178(%rbx), %xmm1 movups 0x188(%rbx), %xmm2 addq $0x270, %rbx # imm = 0x270 movq %r14, 0x38(%rsp) movq %rbx, 0x30(%rsp) movups %xmm2, 0x20(%rsp) movups %xmm1, 0x10(%rsp) movups %xmm0, (%rsp) movzbl %r13b, %r8d leaq 0x48(%rsp), %rsi leaq 0x68(%rsp), %r9 movq %r15, %rdi movl %ebp, %edx movl %r12d, %ecx callq 0x544df movl %eax, %ebx leaq 0x68(%rsp), %rdi callq 0x5528a leaq 0x48(%rsp), %rdi callq 0x10b86 movl %ebx, %eax addq $0xa8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq %rax, %rbx leaq 0x88(%rsp), %rdi jmp 0x544c3 jmp 0x544ca movq %rax, %rbx leaq 0x68(%rsp), %rdi callq 0x5528a jmp 0x544cd movq %rax, %rbx leaq 0x48(%rsp), %rdi callq 0x10b86 movq %rbx, %rdi callq 0xd750
/caozhanhao[P]wxserver/thirdparty/cpp-httplib/httplib.h