name
stringlengths
1
473k
code
stringlengths
7
647k
asm
stringlengths
4
3.39M
file
stringlengths
8
196
ReadDO(MemFile&, std::shared_ptr<Disk>&)
bool ReadDO(MemFile& file, std::shared_ptr<Disk>& disk) { Format fmt{ RegularFormat::DO }; // For now, rely on the file size and extension if (file.size() != fmt.disk_size() || !IsFileExt(file.name(), "do")) return false; file.rewind(); disk->format(fmt, file.data()); disk->strType = "DO"; return true; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x68, %rsp movq %rsi, %rbx movq %rdi, %r14 leaq 0x2c(%rsp), %r12 movq %r12, %rdi movl $0x1d, %esi callq 0x5db04 movq %r14, %rdi callq 0x64c8e movl %eax, %r15d movq %r12, %rdi callq 0x5e142 movl %eax, %r12d movb $0x1, %bpl cmpl %eax, %r15d jne 0x8b410 movq %r14, %rdi callq 0x64ca2 movq %rax, %r13 leaq 0x18(%rsp), %rax movq %rax, -0x10(%rax) leaq 0x26a41(%rip), %rsi # 0xb1e2c leaq 0x26a3c(%rip), %rdx # 0xb1e2e leaq 0x8(%rsp), %rbp movq %rbp, %rdi callq 0x445b8 movq %r13, %rdi movq %rbp, %rsi callq 0x77230 movl %eax, %ebp xorb $0x1, %bpl cmpl %r12d, %r15d jne 0x8b430 leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x8b430 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 testb %bpl, %bpl jne 0x8b47c movq %r14, %rdi callq 0x64db2 movq (%rbx), %r15 movq %r14, %rdi callq 0x64c88 leaq 0x2c(%rsp), %rsi movq %r15, %rdi movq %rax, %rdx xorl %ecx, %ecx callq 0x547da movq (%rbx), %rdi movq 0x80(%rdi), %rdx addq $0x78, %rdi leaq 0x25907(%rip), %rcx # 0xb0d76 movl $0x2, %r8d xorl %esi, %esi callq 0x358f0 xorb $0x1, %bpl movl %ebp, %eax addq $0x68, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq %rax, %rbx movq 0x8(%rsp), %rdi leaq 0x18(%rsp), %rax cmpq %rax, %rdi je 0x8b4b0 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 movq %rbx, %rdi callq 0x35aa0
/simonowen[P]samdisk/src/types/do.cpp
ReadDS2(MemFile&, std::shared_ptr<Disk>&)
bool ReadDS2(MemFile& file, std::shared_ptr<Disk>& disk) { std::string path = file.path(); MemFile file2; Format fmt{ RegularFormat::MGT }; // The input should be half a standard SAM disk in size if (!file.rewind() || file.size() != fmt.disk_size() / 2) return false; // Require the supplied file be head 0 if (!IsFileExt(path, "dsk")) return false; // DSK->DS2 size_t offset = path.length() - 1; path[offset] = '2'; // The DS2 file must also be present try { file2.open(path); } catch (...) { return false; } // The companion file should also contain a single side if (file2.size() != fmt.disk_size() / 2) throw util::exception(path, " file size is incorrect"); // Join the sides Data data(file.data().begin(), file.data().end()); data.insert(data.end(), file2.data().begin(), file2.data().end()); disk->format(fmt, data, true); disk->strType = "DS2"; return true; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0xf8, %rsp movq %rsi, %rbx movq %rdi, %r14 callq 0x64c9e leaq 0x40(%rsp), %r15 movq %r15, -0x10(%r15) movq (%rax), %rsi movq 0x8(%rax), %rdx addq %rsi, %rdx leaq 0x30(%rsp), %rdi callq 0x41ad6 leaq 0x60(%rsp), %r13 movq %r13, -0x10(%r13) xorl %eax, %eax movq %rax, -0x8(%r13) movb %al, (%r13) leaq 0x80(%rsp), %r12 movq %r12, -0x10(%r12) movq %rax, -0x8(%r12) movb %al, (%r12) xorps %xmm0, %xmm0 movups %xmm0, 0x10(%r12) movups %xmm0, 0x20(%r12) movl $0x0, 0x30(%r12) leaq 0xbc(%rsp), %rdi xorl %esi, %esi callq 0x5db04 movq %r14, %rdi callq 0x64db2 testb %al, %al je 0x8b764 movq %r14, %rdi callq 0x64c8e movl %eax, %ebp leaq 0xbc(%rsp), %rdi callq 0x5e142 movl %eax, %ecx shrl $0x1f, %ecx addl %eax, %ecx sarl %ecx cmpl %ecx, %ebp jne 0x8b764 leaq 0x20(%rsp), %r15 movq %r15, -0x10(%r15) leaq 0x2585a(%rip), %rsi # 0xb0e1f leaq 0x25856(%rip), %rdx # 0xb0e22 leaq 0x10(%rsp), %rdi callq 0x445b8 leaq 0x30(%rsp), %rdi leaq 0x10(%rsp), %rsi callq 0x77230 movl %eax, %ebp movq 0x10(%rsp), %rdi cmpq %r15, %rdi je 0x8b5fe movq 0x20(%rsp), %rsi incq %rsi callq 0x355d0 testb %bpl, %bpl leaq 0x40(%rsp), %r15 je 0x8b764 leaq 0x30(%rsp), %rsi movq (%rsi), %rax movq 0x8(%rsi), %rcx movb $0x32, -0x1(%rax,%rcx) leaq 0x50(%rsp), %rdi movl $0x1, %edx callq 0x63f58 leaq 0x50(%rsp), %rdi callq 0x64c8e movl %eax, %ebp leaq 0xbc(%rsp), %rdi callq 0x5e142 movl %eax, %ecx shrl $0x1f, %ecx addl %eax, %ecx sarl %ecx cmpl %ecx, %ebp jne 0x8b70b movq %r14, %rdi callq 0x64c88 movq (%rax), %r15 movq %r14, %rdi callq 0x64c88 movq 0x8(%rax), %rdx leaq 0x10(%rsp), %rdi leaq 0xf(%rsp), %rcx movq %r15, %rsi callq 0x6f45a movq 0x18(%rsp), %r14 leaq 0x50(%rsp), %rdi callq 0x64c88 movq (%rax), %r15 leaq 0x50(%rsp), %rdi callq 0x64c88 movq 0x8(%rax), %rcx leaq 0x10(%rsp), %rdi movq %r14, %rsi movq %r15, %rdx callq 0x393a4 movq (%rbx), %rdi leaq 0xbc(%rsp), %rsi leaq 0x10(%rsp), %rdx movl $0x1, %ecx callq 0x547da movq (%rbx), %rdi movq 0x80(%rdi), %rdx addq $0x78, %rdi leaq 0x2568d(%rip), %rcx # 0xb0d6b movl $0x3, %r8d xorl %esi, %esi callq 0x358f0 movq 0x10(%rsp), %rdi testq %rdi, %rdi leaq 0x40(%rsp), %r15 je 0x8b707 movq 0x20(%rsp), %rsi subq %rdi, %rsi callq 0x355d0 movb $0x1, %bl jmp 0x8b766 movl $0x10, %edi callq 0x35260 movq %rax, %r14 leaq 0x26710(%rip), %rdx # 0xb1e2f leaq 0x30(%rsp), %rsi movq %rax, %rdi callq 0x8b84c leaq 0x5044d(%rip), %rsi # 0xdbb80 movq 0x51846(%rip), %rdx # 0xdcf80 movq %r14, %rdi callq 0x35a50 movq %rax, %rbx movq %r14, %rdi callq 0x35430 jmp 0x8b81d jmp 0x8b81a movq %rax, %rdi callq 0x35200 callq 0x359a0 xorl %ebx, %ebx movq 0x90(%rsp), %rdi testq %rdi, %rdi je 0x8b783 movq 0xa0(%rsp), %rsi subq %rdi, %rsi callq 0x355d0 movq 0x70(%rsp), %rdi cmpq %r12, %rdi je 0x8b79d movq 0x80(%rsp), %rsi incq %rsi callq 0x355d0 movq 0x50(%rsp), %rdi cmpq %r13, %rdi je 0x8b7b4 movq 0x60(%rsp), %rsi incq %rsi callq 0x355d0 movq 0x30(%rsp), %rdi cmpq %r15, %rdi je 0x8b7cb movq 0x40(%rsp), %rsi incq %rsi callq 0x355d0 movl %ebx, %eax addq $0xf8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq jmp 0x8b7fe jmp 0x8b81a movq %rax, %rbx movq 0x10(%rsp), %rdi cmpq %r15, %rdi je 0x8b81d movq 0x20(%rsp), %rsi incq %rsi jmp 0x8b813 jmp 0x8b81a jmp 0x8b81a movq %rax, %rbx movq 0x10(%rsp), %rdi testq %rdi, %rdi je 0x8b81d movq 0x20(%rsp), %rsi subq %rdi, %rsi callq 0x355d0 jmp 0x8b81d movq %rax, %rbx leaq 0x50(%rsp), %rdi callq 0x473c2 movq 0x30(%rsp), %rdi leaq 0x40(%rsp), %rax cmpq %rax, %rdi je 0x8b843 movq 0x40(%rsp), %rsi incq %rsi callq 0x355d0 movq %rbx, %rdi callq 0x35aa0 nop
/simonowen[P]samdisk/src/types/ds2.cpp
util::exception::exception<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, char const (&) [24]>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, char const (&) [24])
explicit exception(Args&& ... args) : std::runtime_error(make_string(std::forward<Args>(args)...)) {}
pushq %r14 pushq %rbx subq $0x28, %rsp movq %rdi, %rbx leaq 0x8(%rsp), %r14 movq %r14, %rdi callq 0x8b8c1 movq %rbx, %rdi movq %r14, %rsi callq 0x35710 leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x8b889 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 leaq 0x50318(%rip), %rax # 0xdbba8 movq %rax, (%rbx) addq $0x28, %rsp popq %rbx popq %r14 retq movq %rax, %rbx leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x8b8b9 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 movq %rbx, %rdi callq 0x35aa0
/simonowen[P]samdisk/include/utils.h
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> util::make_string<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, char const (&) [24]>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, char const (&) [24])
std::string make_string(Args&& ... args) { std::ostringstream ss; (void)std::initializer_list<bool> {(ss << args, false)...}; return ss.str(); }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x178, %rsp # imm = 0x178 movq %rdx, %r14 movq %rsi, %r15 movq %rdi, %rbx movq %rsp, %r12 movq %r12, %rdi callq 0x35760 movq (%r15), %rsi movq 0x8(%r15), %rdx movq %r12, %rdi callq 0x356a0 movq %r14, %rdi callq 0x35210 movq %rsp, %rdi movq %r14, %rsi movq %rax, %rdx callq 0x356a0 leaq 0x8(%rsp), %rsi movq %rbx, %rdi callq 0x35920 movq 0x5165c(%rip), %rsi # 0xdcf78 movq %rsp, %rdi callq 0x352b0 leaq 0x70(%rsp), %rdi callq 0x35180 movq %rbx, %rax addq $0x178, %rsp # imm = 0x178 popq %rbx popq %r12 popq %r14 popq %r15 retq jmp 0x8b942 movq %rax, %rbx movq 0x5162c(%rip), %rsi # 0xdcf78 movq %rsp, %rdi callq 0x352b0 leaq 0x70(%rsp), %rdi callq 0x35180 movq %rbx, %rdi callq 0x35aa0 nop
/simonowen[P]samdisk/include/utils.h
ReadDSC(MemFile&, std::shared_ptr<Disk>&)
bool ReadDSC(MemFile& file, std::shared_ptr<Disk>& disk) { file.rewind(); // ToDo: std::string for file extension std::string strPath = file.path(); MemFile file2; MemFile* pfileHeader = &file, * pfileData = &file2; // If we've been given the header, open the data file if (IsFileExt(strPath, "hdr")) { // HDR->DSC (preserving case) size_t offset = strPath.length() - 3; strPath[offset + 0] = 'D' | (strPath[offset + 0] & 0x20); strPath[offset + 1] = 'S' | (strPath[offset + 1] & 0x20); strPath[offset + 2] = 'C' | (strPath[offset + 2] & 0x20); if (!file2.open(strPath)) throw util::exception("missing .dsc companion file"); } // Or if given the data file, switch to the header else if (IsFileExt(strPath, "dsc")) { // DSC->HDR size_t offset = strPath.length() - 3; strPath[offset + 0] = 'H' | (strPath[offset + 0] & 0x20); strPath[offset + 1] = 'D' | (strPath[offset + 1] & 0x20); strPath[offset + 2] = 'R' | (strPath[offset + 2] & 0x20); if (!file2.open(strPath)) throw util::exception("missing .hdr companion file"); std::swap(pfileHeader, pfileData); } // Reject other file extensions else return false; for (;;) { DSC_TRACK dh; if (!pfileHeader->read(&dh, sizeof(dh))) break; Track track; CylHead cylhead(dh.cyl, dh.head); for (int i = 0; i < dh.sectors; ++i) { DSC_SECTOR ds; if (!pfileHeader->read(&ds, sizeof(ds), 1)) throw util::exception("short file reading %s", CHS(cylhead.cyl, cylhead.head, i)); Sector sector(DataRate::_250K, Encoding::MFM, Header(ds.cyl, ds.head, ds.sector, ds.size)); if (ds.flags & ~0x02) Message(msgWarning, "unknown flags [%02X] for %s", ds.flags & ~0x02, CHSR(cylhead.cyl, cylhead.head, i, ds.sector)); // b1 of flags indicates fill byte if (ds.flags & 0x02) sector.add(Data(sector.size(), ds.fill)); else { DSC_DATA dd; if (!pfileHeader->read(&dd, sizeof(dd))) throw util::exception("short file reading ", CHSR(cylhead.cyl, cylhead.head, i, sector.header.sector)); auto offset = (dd.bOff16M << 24) | (dd.bOff64K << 16) | (dd.bOff256 << 8); if (offset != pfileData->tell()) Message(msgWarning, "header offset (%lu) != data pointer (%lu)", offset, pfileData->tell()); Data data(sector.size()); if (!pfileData->read(data)) throw util::exception("short file reading %s data", CHSR(cylhead.cyl, cylhead.head, i, sector.header.sector)); sector.add(std::move(data)); } track.add(std::move(sector)); } disk->write(cylhead, std::move(track)); } disk->strType = "DSC"; return true; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x138, %rsp # imm = 0x138 movq %rsi, 0x48(%rsp) movq %rdi, %r14 callq 0x64db2 movq %r14, %rdi callq 0x64c9e leaq 0xa0(%rsp), %rcx movq %rcx, -0x10(%rcx) movq (%rax), %rsi movq 0x8(%rax), %rdx addq %rsi, %rdx leaq 0x90(%rsp), %rdi callq 0x41ad6 leaq 0xe0(%rsp), %rcx movq %rcx, -0x10(%rcx) xorl %eax, %eax movq %rax, -0x8(%rcx) movb %al, (%rcx) leaq 0x100(%rsp), %rcx movq %rcx, -0x10(%rcx) movq %rax, -0x8(%rcx) movb %al, (%rcx) xorps %xmm0, %xmm0 movups %xmm0, 0x10(%rcx) movups %xmm0, 0x20(%rcx) movl $0x0, 0x30(%rcx) leaq 0x60(%rsp), %r15 movq %r15, -0x10(%r15) leaq 0x2645f(%rip), %rsi # 0xb1e58 leaq 0x2645b(%rip), %rdx # 0xb1e5b leaq 0x50(%rsp), %rdi callq 0x445b8 leaq 0x90(%rsp), %rdi leaq 0x50(%rsp), %rsi callq 0x77230 movl %eax, %ebx movq 0x50(%rsp), %rdi cmpq %r15, %rdi je 0x8ba35 movq 0x60(%rsp), %rsi incq %rsi callq 0x355d0 testb %bl, %bl je 0x8bad0 leaq 0x90(%rsp), %rsi movq (%rsi), %rax movq 0x8(%rsi), %rcx movb -0x3(%rax,%rcx), %dl andb $0x20, %dl orb $0x44, %dl movb %dl, -0x3(%rax,%rcx) movq (%rsi), %rax movb -0x2(%rax,%rcx), %dl andb $0x20, %dl orb $0x53, %dl movb %dl, -0x2(%rax,%rcx) movq (%rsi), %rax movb -0x1(%rax,%rcx), %dl andb $0x20, %dl orb $0x43, %dl movb %dl, -0x1(%rax,%rcx) leaq 0xd0(%rsp), %r15 movq %r15, %rdi movl $0x1, %edx callq 0x63f58 testb %al, %al jne 0x8bb80 movl $0x10, %edi callq 0x35260 movq %rax, %r14 leaq 0x263af(%rip), %rsi # 0xb1e5c movq %rax, %rdi callq 0x7100e leaq 0x500c4(%rip), %rsi # 0xdbb80 movq 0x514bd(%rip), %rdx # 0xdcf80 movq %r14, %rdi callq 0x35a50 jmp 0x8c012 leaq 0x50(%rsp), %rdi movq %r15, (%rdi) leaq 0x26399(%rip), %rsi # 0xb1e78 leaq 0x26395(%rip), %rdx # 0xb1e7b callq 0x445b8 leaq 0x90(%rsp), %rdi leaq 0x50(%rsp), %rsi callq 0x77230 movl %eax, %ebx movq 0x50(%rsp), %rdi cmpq %r15, %rdi je 0x8bb16 movq 0x60(%rsp), %rsi incq %rsi callq 0x355d0 testb %bl, %bl je 0x8be3d leaq 0x90(%rsp), %rsi movq (%rsi), %rax movq 0x8(%rsi), %rcx movb -0x3(%rax,%rcx), %dl andb $0x20, %dl orb $0x48, %dl movb %dl, -0x3(%rax,%rcx) movq (%rsi), %rax movb -0x2(%rax,%rcx), %dl andb $0x20, %dl orb $0x44, %dl movb %dl, -0x2(%rax,%rcx) movq (%rsi), %rax movb -0x1(%rax,%rcx), %dl andb $0x20, %dl orb $0x52, %dl movb %dl, -0x1(%rax,%rcx) leaq 0xd0(%rsp), %rbx movq %rbx, %rdi movl $0x1, %edx callq 0x63f58 movq %r14, %r15 movq %rbx, %r14 testb %al, %al je 0x8bfe0 leaq 0x78(%rsp), %rbx leaq 0x28(%rsp), %r12 movq %r14, %rdi leaq 0xd(%rsp), %rsi movl $0x2, %edx callq 0x64d0c movb %al, 0xc(%rsp) testb %al, %al je 0x8be12 leaq 0xb0(%rsp), %rdi xorl %esi, %esi callq 0x713b8 movzbl 0xd(%rsp), %edx movl %edx, %esi shrl %esi andl $0x1, %edx leaq 0x18(%rsp), %rdi callq 0x46fa2 cmpb $0x0, 0xe(%rsp) je 0x8bde0 xorl %ebp, %ebp movq %r14, %rdi leaq 0xf(%rsp), %rsi movl $0x6, %edx movl $0x1, %ecx callq 0x64d5c testl %eax, %eax je 0x8bedf movzbl 0xf(%rsp), %esi movzbl 0x10(%rsp), %edx movzbl 0x11(%rsp), %ecx movzbl 0x12(%rsp), %r8d movq %r12, %rdi callq 0x60752 leaq 0x50(%rsp), %rdi movl $0x3d090, %esi # imm = 0x3D090 movl $0x1, %edx movq %r12, %rcx xorl %r8d, %r8d callq 0x6bb84 movzbl 0x13(%rsp), %eax andl $0xfd, %eax je 0x8bc72 movl %eax, 0x20(%rsp) movl 0x18(%rsp), %edi movl 0x1c(%rsp), %esi movzbl 0x11(%rsp), %ecx movl %ebp, %edx callq 0x76d7c movq %rax, 0x28(%rsp) movl $0x3, %edi leaq 0x26233(%rip), %rsi # 0xb1e98 leaq 0x20(%rsp), %rdx movq %r12, %rcx callq 0x3ff22 testb $0x2, 0x13(%rsp) jne 0x8bd6d movq %r14, %r13 movq %r14, %rdi leaq 0x15(%rsp), %rsi movl $0x3, %edx callq 0x64d0c testb %al, %al je 0x8bf8b movq %rbx, %r14 movzbl 0x17(%rsp), %eax shll $0x18, %eax movzbl 0x16(%rsp), %ecx shll $0x10, %ecx orl %eax, %ecx movzbl 0x15(%rsp), %ebx shll $0x8, %ebx orl %ecx, %ebx movl %ebx, 0x44(%rsp) movq %r15, %rdi callq 0x64dea cmpl %eax, %ebx je 0x8bcee movq %r15, %rdi callq 0x64dea movl %eax, 0x28(%rsp) movl $0x3, %edi leaq 0x261d3(%rip), %rsi # 0xb1eb4 leaq 0x44(%rsp), %rdx movq %r12, %rcx callq 0x8c209 leaq 0x50(%rsp), %rdi callq 0x6bce0 movslq %eax, %rsi movq %r12, %rdi leaq 0x20(%rsp), %rdx callq 0x38b58 movq 0x30(%rsp), %rbx subq 0x28(%rsp), %rbx movq %r15, %rdi callq 0x64c96 cmpl %ebx, %eax jl 0x8bf33 movslq %ebx, %rbx movq 0x28(%rsp), %rdi movq 0x58(%r15), %rsi movq %rbx, %rdx callq 0x354c0 addq %rbx, 0x58(%r15) leaq 0x50(%rsp), %rdi movq %r12, %rsi xorl %edx, %edx movl $0xfb, %ecx callq 0x6bd6c movq 0x28(%rsp), %rdi testq %rdi, %rdi je 0x8bd65 movq 0x38(%rsp), %rsi subq %rdi, %rsi callq 0x355d0 movq %r14, %rbx movq %r13, %r14 jmp 0x8bdb7 leaq 0x50(%rsp), %rdi callq 0x6bce0 movslq %eax, %rsi movq %r12, %rdi leaq 0x14(%rsp), %rdx leaq 0x20(%rsp), %rcx callq 0x5bf6a leaq 0x50(%rsp), %rdi movq %r12, %rsi xorl %edx, %edx movl $0xfb, %ecx callq 0x6bd6c movq 0x28(%rsp), %rdi testq %rdi, %rdi je 0x8bdb7 movq 0x38(%rsp), %rsi subq %rdi, %rsi callq 0x355d0 leaq 0xb0(%rsp), %rdi leaq 0x50(%rsp), %rsi callq 0x71b18 movq %rbx, %rdi callq 0x410b8 incl %ebp movzbl 0xe(%rsp), %eax cmpl %eax, %ebp jb 0x8bbda movq 0x48(%rsp), %rax movq (%rax), %rdi leaq 0x18(%rsp), %rsi leaq 0xb0(%rsp), %rdx callq 0x54f3a leaq 0xb8(%rsp), %rdi callq 0x4106a cmpb $0x0, 0xc(%rsp) jne 0x8bb8a movq 0x48(%rsp), %rax movq (%rax), %rdi movq 0x80(%rdi), %rdx addq $0x78, %rdi movb $0x1, %bl leaq 0x24f21(%rip), %rcx # 0xb0d4f movl $0x3, %r8d xorl %esi, %esi callq 0x358f0 jmp 0x8be3f xorl %ebx, %ebx movq 0x110(%rsp), %rdi testq %rdi, %rdi je 0x8be5c movq 0x120(%rsp), %rsi subq %rdi, %rsi callq 0x355d0 movq 0xf0(%rsp), %rdi leaq 0x100(%rsp), %rax cmpq %rax, %rdi je 0x8be81 movq 0x100(%rsp), %rsi incq %rsi callq 0x355d0 movq 0xd0(%rsp), %rdi leaq 0xe0(%rsp), %rax cmpq %rax, %rdi je 0x8bea6 movq 0xe0(%rsp), %rsi incq %rsi callq 0x355d0 movq 0x90(%rsp), %rdi leaq 0xa0(%rsp), %rax cmpq %rax, %rdi je 0x8becb movq 0xa0(%rsp), %rsi incq %rsi callq 0x355d0 movl %ebx, %eax addq $0x138, %rsp # imm = 0x138 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movl $0x10, %edi callq 0x35260 movq %rax, %r14 movb $0x1, %r15b movl 0x18(%rsp), %edi movl 0x1c(%rsp), %esi movl %ebp, %edx callq 0x76b6c leaq 0x50(%rsp), %rdx movq %rax, (%rdx) leaq 0x25e4a(%rip), %rsi # 0xb1d57 movq %r14, %rdi callq 0x8c11e xorl %r15d, %r15d leaq 0x4fc61(%rip), %rsi # 0xdbb80 movq 0x5105a(%rip), %rdx # 0xdcf80 movq %r14, %rdi callq 0x35a50 jmp 0x8c012 movl $0x10, %edi callq 0x35260 movq %rax, %r14 movl 0x18(%rsp), %edi movl 0x1c(%rsp), %esi movb $0x1, %r15b movl 0x58(%rsp), %ecx movl %ebp, %edx callq 0x76d7c leaq 0x20(%rsp), %rdx movq %rax, (%rdx) leaq 0x25f79(%rip), %rsi # 0xb1ede movq %r14, %rdi callq 0x8c3c8 xorl %r15d, %r15d leaq 0x4fc09(%rip), %rsi # 0xdbb80 movq 0x51002(%rip), %rdx # 0xdcf80 movq %r14, %rdi callq 0x35a50 jmp 0x8c012 movl $0x10, %edi callq 0x35260 movq %rax, %r14 movl 0x18(%rsp), %edi movl 0x1c(%rsp), %esi movb $0x1, %r15b movl 0x58(%rsp), %ecx movl %ebp, %edx callq 0x76d7c leaq 0x28(%rsp), %rdx movq %rax, (%rdx) leaq 0x25b4e(%rip), %rsi # 0xb1b0b movq %r14, %rdi callq 0x8c194 xorl %r15d, %r15d leaq 0x4fbb1(%rip), %rsi # 0xdbb80 movq 0x50faa(%rip), %rdx # 0xdcf80 movq %r14, %rdi callq 0x35a50 jmp 0x8c012 movl $0x10, %edi callq 0x35260 movq %rax, %r14 leaq 0x25e88(%rip), %rsi # 0xb1e7c movq %rax, %rdi callq 0x7100e leaq 0x4fb7d(%rip), %rsi # 0xdbb80 movq 0x50f76(%rip), %rdx # 0xdcf80 movq %r14, %rdi callq 0x35a50 jmp 0x8c014 movq %rax, %rbx movq %r14, %rdi callq 0x35430 jmp 0x8c0e4 jmp 0x8c057 jmp 0x8c02e jmp 0x8c057 jmp 0x8c057 jmp 0x8c057 movq %rax, %rbx movq 0x50(%rsp), %rdi cmpq %r15, %rdi je 0x8c0e4 movq 0x60(%rsp), %rsi incq %rsi callq 0x355d0 jmp 0x8c0e4 jmp 0x8c057 jmp 0x8c0d4 jmp 0x8c057 movq %rax, %rbx jmp 0x8c0e4 jmp 0x8c0a9 jmp 0x8c0c5 jmp 0x8c0c5 jmp 0x8c0c5 movq %rax, %rbx testb %r15b, %r15b je 0x8c0c8 movq %r14, %rdi callq 0x35430 jmp 0x8c0c8 jmp 0x8c0c5 jmp 0x8c0c5 jmp 0x8c0c5 jmp 0x8c0c5 movq %rax, %rbx testb %r15b, %r15b je 0x8c0ac movq %r14, %rdi callq 0x35430 jmp 0x8c0ac jmp 0x8c0d4 movq %rax, %rbx testb %r15b, %r15b je 0x8c0d7 movq %r14, %rdi callq 0x35430 jmp 0x8c0d7 jmp 0x8c0c5 movq %rax, %rbx movq 0x28(%rsp), %rdi testq %rdi, %rdi je 0x8c0c8 movq 0x38(%rsp), %rsi subq %rdi, %rsi callq 0x355d0 jmp 0x8c0c8 movq %rax, %rbx leaq 0x78(%rsp), %rdi callq 0x410b8 jmp 0x8c0d7 movq %rax, %rbx leaq 0xb8(%rsp), %rdi callq 0x4106a leaq 0xd0(%rsp), %rdi callq 0x473c2 movq 0x90(%rsp), %rdi leaq 0xa0(%rsp), %rax cmpq %rax, %rdi je 0x8c116 movq 0xa0(%rsp), %rsi incq %rsi callq 0x355d0 movq %rbx, %rdi callq 0x35aa0
/simonowen[P]samdisk/src/types/dsc.cpp
void Message<int&, int>(MsgType, char const*, int&, int&&)
void Message(MsgType type, const char* pcsz_, Args&& ...args) { std::string msg = util::fmt(pcsz_, std::forward<Args>(args)...); if (type == msgError) throw util::exception(msg); if (type != msgStatus) { if (seen_messages.find(msg) != seen_messages.end()) return; seen_messages.insert(msg); } switch (type) { case msgStatus: break; case msgInfo: util::cout << "Info: "; break; case msgFix: util::cout << colour::GREEN << "Fixed: "; break; case msgWarning: util::cout << colour::YELLOW << "Warning: "; break; case msgError: util::cout << colour::RED << "Error: "; break; } if (type == msgStatus) util::cout << ttycmd::statusbegin << "\r" << msg << ttycmd::statusend; else util::cout << msg << colour::none << '\n'; }
pushq %r14 pushq %rbx subq $0x28, %rsp movl %edi, %ebx movl (%rdx), %edx movl (%rcx), %ecx leaq 0x8(%rsp), %rdi xorl %eax, %eax callq 0x784cc testl %ebx, %ebx je 0x8c304 cmpl $0x4, %ebx je 0x8c361 leaq 0x53bbe(%rip), %r14 # 0xdfdf8 leaq 0x8(%rsp), %rsi movq %r14, %rdi callq 0x418a4 addq $0x8, %r14 cmpq %r14, %rax jne 0x8c33e leaq 0x53b9d(%rip), %rdi # 0xdfdf8 leaq 0x8(%rsp), %rsi callq 0x4192e cmpl $0x3, %ebx ja 0x8c2d7 movl %ebx, %eax leaq 0x25bd5(%rip), %rcx # 0xb1e48 movslq (%rcx,%rax,4), %rax addq %rcx, %rax jmpq *%rax leaq 0x5402d(%rip), %rdi # 0xe02b0 leaq 0x1fb0e(%rip), %rsi # 0xabd98 callq 0x4172b jmp 0x8c2d3 leaq 0x54018(%rip), %rdi # 0xe02b0 movl $0xa0, %esi callq 0x788ea leaq 0x1faf6(%rip), %rsi # 0xabd9f movq %rax, %rdi callq 0x41794 jmp 0x8c2d3 leaq 0x53ff6(%rip), %rdi # 0xe02b0 movl $0xa1, %esi callq 0x788ea leaq 0x1fadc(%rip), %rsi # 0xabda7 movq %rax, %rdi callq 0x405c6 testl %ebx, %ebx je 0x8c304 leaq 0x53fd2(%rip), %rdi # 0xe02b0 leaq 0x8(%rsp), %rsi callq 0x3f60b movq %rax, %rdi xorl %esi, %esi callq 0x788ea leaq 0x7(%rsp), %rsi movb $0xa, (%rsi) movq %rax, %rdi callq 0x409e0 jmp 0x8c33e leaq 0x53fa5(%rip), %rdi # 0xe02b0 movl $0x2, %esi callq 0x7897a leaq 0x22b47(%rip), %rsi # 0xaee63 movq %rax, %rdi callq 0x38d1e leaq 0x8(%rsp), %rsi movq %rax, %rdi callq 0x3f60b movq %rax, %rdi movl $0x3, %esi callq 0x7897a leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x8c359 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 addq $0x28, %rsp popq %rbx popq %r14 retq movl $0x10, %edi callq 0x35260 movq %rax, %r14 leaq 0x8(%rsp), %rsi movq %rax, %rdi callq 0x416b6 leaq 0x4f7fe(%rip), %rsi # 0xdbb80 movq 0x50bf7(%rip), %rdx # 0xdcf80 movq %r14, %rdi callq 0x35a50 jmp 0x8c3a2 movq %rax, %rbx movq %r14, %rdi callq 0x35430 jmp 0x8c3a5 jmp 0x8c3a2 movq %rax, %rbx leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x8c3c0 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 movq %rbx, %rdi callq 0x35aa0
/simonowen[P]samdisk/include/Util.h
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> util::make_string<char const (&) [22], char const*>(char const (&) [22], char const*&&)
std::string make_string(Args&& ... args) { std::ostringstream ss; (void)std::initializer_list<bool> {(ss << args, false)...}; return ss.str(); }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x178, %rsp # imm = 0x178 movq %rdx, %r14 movq %rsi, %r15 movq %rdi, %rbx movq %rsp, %r12 movq %r12, %rdi callq 0x35760 movq %r15, %rdi callq 0x35210 movq %r12, %rdi movq %r15, %rsi movq %rax, %rdx callq 0x356a0 movq (%r14), %r14 testq %r14, %r14 je 0x8c495 movq %r14, %rdi callq 0x35210 movq %rsp, %rdi movq %r14, %rsi movq %rax, %rdx callq 0x356a0 jmp 0x8c4ac movq (%rsp), %rax movq -0x18(%rax), %rax leaq (%rsp,%rax), %rdi movl 0x20(%rdi), %esi orl $0x1, %esi callq 0x35a00 leaq 0x8(%rsp), %rsi movq %rbx, %rdi callq 0x35920 movq 0x50ab8(%rip), %rsi # 0xdcf78 movq %rsp, %rdi callq 0x352b0 leaq 0x70(%rsp), %rdi callq 0x35180 movq %rbx, %rax addq $0x178, %rsp # imm = 0x178 popq %rbx popq %r12 popq %r14 popq %r15 retq jmp 0x8c4e6 movq %rax, %rbx movq 0x50a88(%rip), %rsi # 0xdcf78 movq %rsp, %rdi callq 0x352b0 leaq 0x70(%rsp), %rdi callq 0x35180 movq %rbx, %rdi callq 0x35aa0
/simonowen[P]samdisk/include/utils.h
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> util::make_string<char const (&) [20], char const*>(char const (&) [20], char const*&&)
std::string make_string(Args&& ... args) { std::ostringstream ss; (void)std::initializer_list<bool> {(ss << args, false)...}; return ss.str(); }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x178, %rsp # imm = 0x178 movq %rdx, %r14 movq %rsi, %r15 movq %rdi, %rbx movq %rsp, %r12 movq %r12, %rdi callq 0x35760 movq %r15, %rdi callq 0x35210 movq %r12, %rdi movq %r15, %rsi movq %rax, %rdx callq 0x356a0 movq (%r14), %r14 testq %r14, %r14 je 0x8c562 movq %r14, %rdi callq 0x35210 movq %rsp, %rdi movq %r14, %rsi movq %rax, %rdx callq 0x356a0 jmp 0x8c579 movq (%rsp), %rax movq -0x18(%rax), %rax leaq (%rsp,%rax), %rdi movl 0x20(%rdi), %esi orl $0x1, %esi callq 0x35a00 leaq 0x8(%rsp), %rsi movq %rbx, %rdi callq 0x35920 movq 0x509eb(%rip), %rsi # 0xdcf78 movq %rsp, %rdi callq 0x352b0 leaq 0x70(%rsp), %rdi callq 0x35180 movq %rbx, %rax addq $0x178, %rsp # imm = 0x178 popq %rbx popq %r12 popq %r14 popq %r15 retq jmp 0x8c5b3 movq %rax, %rbx movq 0x509bb(%rip), %rsi # 0xdcf78 movq %rsp, %rdi callq 0x352b0 leaq 0x70(%rsp), %rdi callq 0x35180 movq %rbx, %rdi callq 0x35aa0
/simonowen[P]samdisk/include/utils.h
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> util::make_string<char const (&) [27], char const*>(char const (&) [27], char const*&&)
std::string make_string(Args&& ... args) { std::ostringstream ss; (void)std::initializer_list<bool> {(ss << args, false)...}; return ss.str(); }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x178, %rsp # imm = 0x178 movq %rdx, %r14 movq %rsi, %r15 movq %rdi, %rbx movq %rsp, %r12 movq %r12, %rdi callq 0x35760 movq %r15, %rdi callq 0x35210 movq %r12, %rdi movq %r15, %rsi movq %rax, %rdx callq 0x356a0 movq (%r14), %r14 testq %r14, %r14 je 0x8c62f movq %r14, %rdi callq 0x35210 movq %rsp, %rdi movq %r14, %rsi movq %rax, %rdx callq 0x356a0 jmp 0x8c646 movq (%rsp), %rax movq -0x18(%rax), %rax leaq (%rsp,%rax), %rdi movl 0x20(%rdi), %esi orl $0x1, %esi callq 0x35a00 leaq 0x8(%rsp), %rsi movq %rbx, %rdi callq 0x35920 movq 0x5091e(%rip), %rsi # 0xdcf78 movq %rsp, %rdi callq 0x352b0 leaq 0x70(%rsp), %rdi callq 0x35180 movq %rbx, %rax addq $0x178, %rsp # imm = 0x178 popq %rbx popq %r12 popq %r14 popq %r15 retq jmp 0x8c680 movq %rax, %rbx movq 0x508ee(%rip), %rsi # 0xdcf78 movq %rsp, %rdi callq 0x352b0 leaq 0x70(%rsp), %rdi callq 0x35180 movq %rbx, %rdi callq 0x35aa0
/simonowen[P]samdisk/include/utils.h
ReadDSK(MemFile&, std::shared_ptr<Disk>&)
bool ReadDSK(MemFile& file, std::shared_ptr<Disk>& disk) { uint8_t ab[256]; if (!file.rewind() || !file.read(&ab, sizeof(ab))) return false; auto peh = reinterpret_cast<EDSK_HEADER*>(ab); if (memcmp(peh->szSignature, EDSK_SIGNATURE, 8) && // match: "EXTENDED" only memcmp(peh->szSignature, DSK_SIGNATURE, 8)) // match: "MV - CPC" return false; auto pbIndex = reinterpret_cast<const uint8_t*>(peh + 1); auto max_cyls = (sizeof(ab) - sizeof(EDSK_HEADER)) / MAX_SIDES; bool fEDSK = peh->szSignature[0] == EDSK_SIGNATURE[0]; // Warn if the deprecated 'random data errors' flag is set if (peh->bSides & 0x80) { Message(msgWarning, "ignoring deprecated 'random data errors' flag"); peh->bSides &= ~0x80; } uint8_t cyls = peh->bTracks; uint8_t heads = peh->bSides; if (heads > MAX_SIDES) throw util::exception("invalid head count (", heads, ")"); else if (cyls > MAX_TRACKS || cyls > max_cyls) throw util::exception("invalid cylinder count (", cyls, ")"); disk->metadata["creator"] = util::trim(std::string(peh->szCreator, sizeof(peh->szCreator))); MEMORY mem(ESDK_MAX_TRACK_SIZE); bool fWarned6K = false; for (uint8_t cyl = 0; cyl < cyls; ++cyl) { for (uint8_t head = 0; head < heads; ++head) { CylHead cylhead(cyl, head); static const DataRate abEDSKRates[] = { DataRate::_250K, DataRate::_250K, DataRate::_500K, DataRate::_1M }; // Remember the start position auto uTrackStart = file.tell(); // EDSK supports variable track size, DSK has it fixed for the entire image auto uTrackSize = fEDSK ? (pbIndex[cyl * heads + head] << 8) : ((peh->abTrackSize[1] << 8) | peh->abTrackSize[0]); // EDSK doesn't store blank tracks, as indicated by zero size in the index if (fEDSK && !uTrackSize) { disk->write(cylhead, Track()); continue; } // SugarBox (<= 0.22) doesn't write blank tracks at the end of the disk. if (cyl >= 40 && file.tell() == file.size()) { Message(msgWarning, "%s track header is missing, assuming blank track", CH(cyl, head)); disk->write(cylhead, Track()); continue; } EDSK_TRACK th; if (!file.read(&th, sizeof(th))) throw util::exception("short file reading ", cylhead); // Check for "Track-Info", tolerating \r\n missing in bad images (Addams Family) if (memcmp(th.signature, EDSK_TRACK_SIG, 10)) throw util::exception("track signature missing on ", cylhead); // Warn if the track sector size is invalid if (!fEDSK && th.size > SIZE_MASK_765) Message(msgWarning, "invalid sector size code (%s) on %s", SizeStr(th.size), CH(cyl, head)); if (th.track != cyl || th.side != head) { if (th.track != cyl) Message(msgWarning, "header track %s != cyl %s", CylStr(th.track), CylStr(cyl)); else Message(msgWarning, "header side %s != head %s", HeadStr(th.side), HeadStr(head)); } // SAMdisk initially implemented John Elliot's rate+encoding extension in the wrong place. // If we find values in the wrong place, and none set in the right place, move them over! if (th.rate == 0 && th.unused[0]) { th.rate = th.unused[0]; th.unused[0] = 0; } if (th.encoding == 0 && th.unused[1]) { th.encoding = th.unused[1]; th.unused[1] = 0; } // Warn if the unused fields are used if (th.unused[0] || th.unused[1] || th.unused[2]) Message(msgWarning, "unused fields are non-zero (%02X %02X %02X) on %s", th.unused[0], th.unused[1], th.unused[2], CH(cyl, head)); DataRate datarate = (th.rate >= 1 && th.rate <= 3) ? abEDSKRates[th.rate] : DataRate::_250K; Encoding encoding = (th.encoding != 1) ? Encoding::MFM : Encoding::FM; Track track(th.sectors); // Determine the track header size, and the start of the data beyond it // Round the header size to the next 256-byte boundary int uSectorHeaders = (sizeof(EDSK_TRACK) + th.sectors * sizeof(EDSK_SECTOR) + 0xff) & ~0xff; uSectorHeaders -= sizeof(EDSK_TRACK); int uMinimum = th.sectors * sizeof(EDSK_SECTOR); // CPCDiskXP writes a truncated track header if the final track is blank. // Check if only the minimum header size has been supplied. if (uMinimum < uSectorHeaders && (file.size() - file.tell()) == uMinimum) Message(msgWarning, "%s track header is shorter than index size", CH(cyl, head)); else if (!file.read(mem, uSectorHeaders)) throw util::exception("short file reading ", cylhead, " sector headers"); for (uint8_t sec = 0; sec < th.sectors; ++sec) { auto ps = &reinterpret_cast<EDSK_SECTOR*>(mem.pb)[sec]; Sector sector(datarate, encoding, Header(ps->track, ps->side, ps->sector, ps->size)); // Set gap3 on all but final setor if (sec < th.sectors - 1) { sector.gap3 = th.gap3; // If the sector uses a default gap3 size, clear it. This allows overrides by stored gap3 // in ALLGAPS images, and also prevents the default value showing up in track scans. // If the same image is written back, any unset gap3 will be restored to the same value. if (sector.gap3 == EDSK_DEFAULT_GAP3 || sector.gap3 == CPC_DEFAULT_GAP3) sector.gap3 = 0; } uint8_t status1 = ps->status1, status2 = ps->status2; bool id_crc_error = (status1 & SR1_CRC_ERROR) != 0; bool data_not_found = (status2 & SR2_MISSING_ADDRESS_MARK) != 0; bool data_crc_error = (status2 & SR2_CRC_ERROR_IN_SECTOR_DATA) != 0; bool deleted_dam = (status2 & SR2_SECTOR_WITH_DELETED_DATA) != 0; // uPD765 sets both id and data flags for data CRC errors if (data_crc_error) id_crc_error = false; else if (id_crc_error) sector.set_badidcrc(); // Check for an impossible flag combo, used for storing placeholder sectors (Logo Professor test) if (status1 & SR1_CRC_ERROR && status2 & SR2_MISSING_ADDRESS_MARK) { Message(msgWarning, "unsupported placeholder sector on %s", CHSR(cyl, head, sec, sector.header.sector)); status2 &= ~SR2_MISSING_ADDRESS_MARK; } // Check for bits that shouldn't be set in the status bytes if ((status1 & (SR1_WRITE_PROTECT_DETECTED | SR1_RESERVED1 | SR1_RESERVED2)) || (status2 & (SR2_SCAN_COMMAND_FAILED | SR2_SCAN_COMMAND_EQUAL | SR2_RESERVED))) { Message(msgWarning, "invalid status (ST1=%02X ST2=%02X) for %s", status1, status2, CHSR(cyl, head, sec, sector.header.sector)); // Clear the unexpected bits and continue status1 &= ~(SR1_WRITE_PROTECT_DETECTED | SR1_RESERVED1 | SR1_RESERVED2); status2 &= ~(SR2_SCAN_COMMAND_FAILED | SR2_SCAN_COMMAND_EQUAL | SR2_RESERVED); } // Match expected flag combinations, to identify unusual combinations that could indicate a bogus dump if (!( (status1 == SR1_SUCCESS && status2 == SR2_SUCCESS) || // normal data (status1 == SR1_SUCCESS && status2 == SR2_SECTOR_WITH_DELETED_DATA) || // deleted data (status1 == SR1_END_OF_CYLINDER && status2 == SR2_SUCCESS) || // end of track? (status1 == SR1_CRC_ERROR && status2 == SR2_SUCCESS) || // id crc error (status1 == SR1_CRC_ERROR && status2 == SR2_CRC_ERROR_IN_SECTOR_DATA) || // normal data CRC error (status1 == SR1_CRC_ERROR && status2 == (SR2_CRC_ERROR_IN_SECTOR_DATA | SR2_SECTOR_WITH_DELETED_DATA)) || // deleted data CRC error (status1 == SR1_CANNOT_FIND_ID_ADDRESS && status2 == SR2_MISSING_ADDRESS_MARK) || // data field missing (some FDCs set AM in ST1) (status1 == SR1_SUCCESS && status2 == SR2_MISSING_ADDRESS_MARK) || // data field missing (some FDCs don't) (status1 == SR1_CANNOT_FIND_SECTOR_ID && status2 == SR2_SUCCESS) || // CHRN mismatch (status1 == SR1_CANNOT_FIND_SECTOR_ID && status2 == SR2_WRONG_CYLINDER_DETECTED) // CHRN mismatch, including wrong cylinder )) { Message(msgWarning, "unusual status flags (ST1=%02X ST2=%02X) for %s", status1, status2, CHSR(cyl, head, sec, sector.header.sector)); } auto native_size = sector.size(); auto data_size = fEDSK ? (ps->datahigh << 8) | ps->datalow : Sector::SizeCodeToLength(th.size); auto num_copies = data_not_found ? 0 : 1; // EDSK data field with gap data or multiple copies? if (fEDSK && data_size > native_size) { // Multiple error copies extension? // Also accept 48K as 3x16K copies, as found in early public test images. if (data_crc_error && ((data_size % native_size) == 0 || data_size == 49152)) { // Accept 48K as 3x16K, regardless of native size if (data_size == 49152) num_copies = 3; // Otherwise it's a straight multiple else num_copies = data_size / native_size; // Calculate the size stored for each copy data_size /= num_copies; } } // Process each copy for (auto u = 0; u < num_copies; ++u) { // Allocate enough space for the data, with at least the native size Data data(data_size); // Read the data copy if (!file.read(data)) throw util::exception("short file reading ", cylhead, " sector ", sector.header.sector); // CPDRead sometimes stores too much data. If we find a data size that is an exact multiple on an // error free sector, trim it down to the natural size. if (opt.fix != 0 && disk->metadata["creator"].substr(0, 3) == "CPD" && data_size > native_size && !data_crc_error && !(data_size % native_size)) { // Example: Discology +3.dsk (SDP) Message(msgFix, "dropping suspicious excess data on %s", CHSR(cyl, head, sec, sector.header.sector)); data.resize(native_size); } // Data CRC, size 1 above multiple of native, and dummy marker byte at the end of the data? // ToDo: document horrid hack if (data_crc_error && (data_size % native_size) == 1 && data[data_size - 1] == 123) { // Remove the dummy byte data.resize(--data_size); } // Old-style DSK images have some restrictions if (!fEDSK) { // Sectors without a data field have no data if (id_crc_error || data_not_found) continue; // Gap data is not supported if (data_size > native_size) data.resize(data_size); } if (id_crc_error || data_not_found) Message(msgWarning, "ignoring stored data on %s, which has no data field", CHSR(cyl, head, sec, sector.header.sector)); else { auto res = sector.add(std::move(data), data_crc_error, deleted_dam ? 0xf8 : 0xfb); if (res == Sector::Merge::Unchanged) Message(msgInfo, "ignored identical data copy of %s", CHSR(cyl, head, sec, sector.header.sector)); } } track.add(std::move(sector)); } // Calculate the used track size, rounded up to the next 256 bytes auto uTrackEnd = (file.tell() + 0xff) & ~0xff; // Seek past the size indicated by the index file.seek(uTrackStart + uTrackSize); // With EDSK images the used size should match what the index says if (fEDSK && (uTrackEnd - uTrackStart) != uTrackSize) { // If the low 16-bits are different, we'll stick with trusting the index size if (((uTrackEnd - uTrackStart) & 0xffff) != uTrackSize) Message(msgWarning, "%s size (%u) does not match index entry (%u)", CH(cyl, head), uTrackEnd - uTrackStart, uTrackSize); else { // The track size probably overflowed (some WinAPE images), so trust the used size Message(msgWarning, "%s size (%u) does not match index entry (%u)", CH(cyl, head), uTrackEnd - uTrackStart, uTrackSize); file.seek(uTrackEnd); } } // Legacy EDSK images only store 6K data for 8K sectors, so any // checksum bytes the disk may have had are lost. if (!fWarned6K && track.is_8k_sector() && track[0].data_size() == 6144) { Message(msgWarning, "missing checksums needed to verify 8K sector integrity"); fWarned6K = true; } disk->write(cylhead, std::move(track)); } } // Check for Offset-Info header at normal file end EDSK_OFFSETS eo; if (fEDSK && file.read(&eo, sizeof(eo), 1)) { if (!memcmp(eo.signature, EDSK_OFFSETS_SIG, 11)) { Range(cyls, heads).each([&](const CylHead& cylhead) { auto track = disk->read_track(cylhead); uint16_t val; if (file.read(&val, sizeof(val), 1)) track.tracklen = util::letoh(val) * 16; // convert to bitstream bits for (auto& sector : track.sectors()) { if (file.read(&val, sizeof(val), 1)) sector.offset = util::letoh(val) * 16; // convert to bitstream bits } disk->write(cylhead, std::move(track)); }); } else { // Undo non-matching read file.seek(file.tell() - sizeof(eo)); } } // Check for blank track headers that RealSpectrum adds to files, despite the spec saying it shouldn't: // "A size of "0" indicates an unformatted track. In this case there is no data, and no track // information block for this track in the image file!" EDSK_TRACK* pth = reinterpret_cast<EDSK_TRACK*>(ab); while (file.read(ab, sizeof(ab), 1)) { if (!memcmp(pth->signature, EDSK_TRACK_SIG, 10) && !pth->sectors) { // Example: Fun School 2 For The Over-8s.dsk (SDP +3) Message(msgWarning, "blank %s should not have EDSK track block", CH(pth->track, pth->side)); } else { // Undo non-matching read file.seek(file.tell() - sizeof(ab)); break; } } size_t uTail = file.size() - file.tell(); if (uTail) { auto pbTail = file.data().data() + file.tell(); if (!memcmp(pbTail, pbTail + 1, uTail - 1)) { // Example: Compilation Disk 048 (19xx)(-).zip (TOSEC CPC Compilations) Message(msgWarning, "file ends with %u bytes of %02X filler", uTail, *pbTail); } else { // Example: Silva (1985)(Lankhor)(fr)[cr Genesis][t Genesis].zip (TOSEC CPC Games) Message(msgWarning, "%u bytes of unused data found at end of file:", uTail); util::hex_dump(file.data().begin(), file.data().end(), file.tell()); } } disk->strType = "EDSK"; return true; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x258, %rsp # imm = 0x258 movq %rsi, 0x48(%rsp) movq %rdi, %rbx callq 0x64db2 testb %al, %al je 0x8d3cf leaq 0x150(%rsp), %rsi movq %rbx, %rdi movl $0x100, %edx # imm = 0x100 callq 0x64d0c testb %al, %al je 0x8d3cf movq 0x150(%rsp), %rax movabsq $0x4445444e45545845, %rcx # imm = 0x4445444E45545845 cmpq %rcx, %rax je 0x8c711 movabsq $0x435043202d20564d, %rcx # imm = 0x435043202D20564D cmpq %rcx, %rax jne 0x8d3cf movb 0x150(%rsp), %al movb %al, 0x7(%rsp) cmpb $0x0, 0x181(%rsp) jns 0x8c73f leaq 0x25866(%rip), %rsi # 0xb1f93 movl $0x3, %edi callq 0x46c85 andb $0x7f, 0x181(%rsp) movb 0x180(%rsp), %al movb 0x181(%rsp), %cl movb %al, 0xb(%rsp) movb %cl, 0xa(%rsp) cmpb $0x3, %cl jae 0x8d6fc movq %rbx, 0x18(%rsp) cmpb $0x67, %al jae 0x8d726 leaq 0xe0(%rsp), %r14 movq %r14, -0x10(%r14) movq 0x172(%rsp), %rax movq 0x178(%rsp), %rcx movq %rax, (%r14) movq %rcx, 0x6(%r14) movq $0xe, -0x8(%r14) movb $0x0, 0xe(%r14) leaq 0x90(%rsp), %rdi leaq 0xd0(%rsp), %rsi callq 0x78744 movq 0x48(%rsp), %rax movq (%rax), %rbx leaq 0x110(%rsp), %rax movq %rax, -0x10(%rax) leaq 0x24874(%rip), %rsi # 0xb103f leaq 0x24874(%rip), %rdx # 0xb1046 leaq 0x100(%rsp), %rdi callq 0x445b8 addq $0x48, %rbx leaq 0x100(%rsp), %rsi movq %rbx, %rdi callq 0x48d0c leaq 0x90(%rsp), %rsi movq %rax, %rdi callq 0x35700 movq 0x100(%rsp), %rdi leaq 0x110(%rsp), %rax cmpq %rax, %rdi je 0x8c828 movq 0x110(%rsp), %rsi incq %rsi callq 0x355d0 leaq 0xa0(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x8c849 movq 0xa0(%rsp), %rsi incq %rsi callq 0x355d0 movq 0xd0(%rsp), %rdi cmpq %r14, %rdi je 0x8c866 movq 0xe0(%rsp), %rsi incq %rsi callq 0x355d0 movl $0xff00, %edi # imm = 0xFF00 callq 0x77560 movq %rax, 0x70(%rsp) cmpb $0x0, 0xb(%rsp) movq 0x18(%rsp), %r14 je 0x8d368 movq $0x0, 0x10(%rsp) leaq 0x90(%rsp), %r13 leaq 0x58(%rsp), %r12 movq $0x0, 0x120(%rsp) cmpb $0x0, 0xa(%rsp) je 0x8d34f xorl %edx, %edx leaq 0x50(%rsp), %rdi movq 0x10(%rsp), %rsi movl %edx, 0xc(%rsp) callq 0x46fa2 movq %r14, %rdi callq 0x64dea movl %eax, 0x84(%rsp) cmpb $0x45, 0x7(%rsp) je 0x8c8e7 movzwl 0x182(%rsp), %eax jmp 0x8c903 movzbl 0xa(%rsp), %eax imull 0x10(%rsp), %eax movl 0xc(%rsp), %ecx addq %rax, %rcx movzbl 0x184(%rsp,%rcx), %eax shll $0x8, %eax movl %eax, 0x44(%rsp) cmpb $0x45, 0x7(%rsp) jne 0x8c941 testl %eax, %eax jne 0x8c941 movq 0x48(%rsp), %rax movq (%rax), %rbx movq %r13, %rdi xorl %esi, %esi callq 0x713b8 movq %rbx, %rdi leaq 0x50(%rsp), %rsi movq %r13, %rdx callq 0x54f3a leaq 0x98(%rsp), %rdi jmp 0x8d337 cmpl $0x28, 0x10(%rsp) jb 0x8c9ac movq %r14, %rdi callq 0x64dea movl %eax, %ebx movq %r14, %rdi callq 0x64c8e cmpl %eax, %ebx jne 0x8c9ac movq 0x10(%rsp), %rdi movl 0xc(%rsp), %esi callq 0x76a95 movq %rax, 0x90(%rsp) movl $0x3, %edi leaq 0x2566f(%rip), %rsi # 0xb1fef movq %r13, %rdx callq 0x400e2 movq 0x48(%rsp), %rax movq (%rax), %rbx movq %r13, %rdi xorl %esi, %esi callq 0x713b8 movq %rbx, %rdi leaq 0x50(%rsp), %rsi movq %r13, %rdx callq 0x54f3a jmp 0x8c934 movq %r14, %rdi leaq 0x28(%rsp), %rsi movl $0x18, %edx callq 0x64d0c testb %al, %al je 0x8d664 movq 0x28(%rsp), %rax movabsq $0x6e492d6b63617254, %rcx # imm = 0x6E492D6B63617254 xorq %rcx, %rax movzwl 0x30(%rsp), %ecx xorq $0x6f66, %rcx # imm = 0x6F66 orq %rax, %rcx jne 0x8d687 cmpb $0x45, 0x7(%rsp) setne %cl movb 0x3c(%rsp), %al cmpb $0x8, %al setae %dl andb %cl, %dl cmpb $0x1, %dl jne 0x8ca47 movzbl %al, %edi callq 0x76a3c movq %rax, 0x90(%rsp) movq 0x10(%rsp), %rdi movl 0xc(%rsp), %esi callq 0x76a95 movq %rax, 0xd0(%rsp) movl $0x3, %edi leaq 0x25612(%rip), %rsi # 0xb2049 movq %r13, %rdx leaq 0xd0(%rsp), %rcx callq 0x4706b movzbl 0x38(%rsp), %edi movq 0x10(%rsp), %rax movl %eax, %ecx xorl %edi, %ecx movzbl 0x39(%rsp), %eax movl 0xc(%rsp), %edx xorl %eax, %edx orl %ecx, %edx je 0x8cae3 cmpl %edi, 0x10(%rsp) jne 0x8caa8 movl %eax, %edi callq 0x76987 movq %rax, 0x90(%rsp) movl 0xc(%rsp), %edi callq 0x76987 movq %rax, 0xd0(%rsp) movl $0x3, %edi leaq 0x255f1(%rip), %rsi # 0xb2087 movq %r13, %rdx leaq 0xd0(%rsp), %rcx callq 0x4706b jmp 0x8cae3 callq 0x7692b movq %rax, 0x90(%rsp) movq 0x10(%rsp), %rdi callq 0x7692b movq %rax, 0xd0(%rsp) movl $0x3, %edi leaq 0x2559a(%rip), %rsi # 0xb206d movq %r13, %rdx leaq 0xd0(%rsp), %rcx callq 0x4706b cmpb $0x0, 0x3a(%rsp) sete %cl movb 0x35(%rsp), %al testb %al, %al setne %dl andb %cl, %dl cmpb $0x1, %dl jne 0x8cb04 movb %al, 0x3a(%rsp) movb $0x0, 0x35(%rsp) cmpb $0x0, 0x3b(%rsp) sete %cl movb 0x36(%rsp), %al testb %al, %al setne %dl andb %cl, %dl cmpb $0x1, %dl jne 0x8cb25 movb %al, 0x3b(%rsp) movb $0x0, 0x36(%rsp) cmpb $0x0, 0x35(%rsp) jne 0x8cb3a cmpb $0x0, 0x36(%rsp) jne 0x8cb3a cmpb $0x0, 0x37(%rsp) je 0x8cb73 movq 0x10(%rsp), %rdi movl 0xc(%rsp), %esi callq 0x76a95 movq %rax, 0x90(%rsp) movl $0x3, %edi leaq 0x25545(%rip), %rsi # 0xb20a1 leaq 0x35(%rsp), %rdx leaq 0x36(%rsp), %rcx leaq 0x37(%rsp), %r8 movq %r13, %r9 callq 0x8e817 movzbl 0x3a(%rsp), %eax leal -0x1(%rax), %ecx movl $0x3d090, 0x88(%rsp) # imm = 0x3D090 cmpb $0x2, %cl ja 0x8cb9c leaq 0x253be(%rip), %rcx # 0xb1f50 movl (%rcx,%rax,4), %eax movl %eax, 0x88(%rsp) cmpb $0x1, 0x3b(%rsp) sete %r14b movzbl 0x3d(%rsp), %esi leaq 0xd0(%rsp), %rdi callq 0x713b8 movzbl 0x3d(%rsp), %eax leal 0x117(,%rax,8), %ebx movl %eax, %r15d shll $0x3, %r15d andl $0xf00, %ebx # imm = 0xF00 addl $-0x18, %ebx cmpl %r15d, %ebx jle 0x8cc21 movq 0x18(%rsp), %rdi callq 0x64c8e movl %eax, %ebp movq 0x18(%rsp), %rdi callq 0x64dea subl %eax, %ebp cmpl %r15d, %ebp jne 0x8cc21 movq 0x10(%rsp), %rdi movl 0xc(%rsp), %esi callq 0x76a95 movq %rax, 0x90(%rsp) movl $0x3, %edi leaq 0x254bc(%rip), %rsi # 0xb20d3 movq %r13, %rdx callq 0x400e2 jmp 0x8cc3a movq 0x18(%rsp), %rdi movq 0x70(%rsp), %rsi movl %ebx, %edx callq 0x64d0c testb %al, %al je 0x8d6be cmpb $0x0, 0x3d(%rsp) je 0x8d1f8 xorl %eax, %eax movb %r14b, %al incl %eax movl %eax, 0xf4(%rsp) xorl %ebx, %ebx movq 0x70(%rsp), %rax movzbl (%rax,%rbx,8), %esi movzbl 0x1(%rax,%rbx,8), %edx movzbl 0x2(%rax,%rbx,8), %ecx movzbl 0x3(%rax,%rbx,8), %r8d movq %r12, %rdi callq 0x60752 movq %r13, %rdi movl 0x88(%rsp), %esi movl 0xf4(%rsp), %edx movq %r12, %rcx xorl %r8d, %r8d callq 0x6bb84 movzbl 0x3d(%rsp), %eax decl %eax cmpl %ebx, %eax jle 0x8ccbe movzbl 0x3e(%rsp), %eax movl %eax, 0xac(%rsp) cmpl $0x52, %eax je 0x8ccb3 cmpl $0x4e, %eax jne 0x8ccbe movl $0x0, 0xac(%rsp) movq 0x70(%rsp), %rcx movb 0x4(%rcx,%rbx,8), %al movb %al, 0x9(%rsp) movzbl 0x5(%rcx,%rbx,8), %ebp movb %bpl, 0x8(%rsp) movl %ebp, %ecx andl $0x20, %ecx movl %ecx, 0x40(%rsp) je 0x8cce5 xorl %r12d, %r12d jmp 0x8ccff andb $0x20, %al movl %eax, %r12d shrb $0x5, %r12b testb %al, %al je 0x8ccff movq %r13, %rdi movl $0x1, %esi callq 0x6c2de testb $0x20, 0x9(%rsp) je 0x8cd44 testb $0x1, 0x8(%rsp) je 0x8cd44 movl 0x98(%rsp), %ecx movq 0x10(%rsp), %rdi movl 0xc(%rsp), %esi movl %ebx, %edx callq 0x76d7c movq %rax, 0x58(%rsp) movl $0x3, %edi leaq 0x253d9(%rip), %rsi # 0xb210e leaq 0x58(%rsp), %rdx callq 0x400e2 andb $-0x2, 0x8(%rsp) testb $0x4a, 0x9(%rsp) jne 0x8cd52 testb $-0x74, 0x8(%rsp) je 0x8cd98 movl 0x98(%rsp), %ecx movq 0x10(%rsp), %rdi movl 0xc(%rsp), %esi movl %ebx, %edx callq 0x76d7c movq %rax, 0x58(%rsp) movl $0x3, %edi leaq 0x253b9(%rip), %rsi # 0xb2133 leaq 0x9(%rsp), %rdx leaq 0x8(%rsp), %rcx leaq 0x58(%rsp), %r8 callq 0x8ea55 andb $-0x4b, 0x9(%rsp) andb $0x73, 0x8(%rsp) movb 0x9(%rsp), %al testb %al, %al sete %dl movb 0x8(%rsp), %cl testb %cl, %cl sete %sil cmpb $0x40, %cl sete %dil orb %sil, %dil andb %dl, %dil cmpb $-0x80, %al sete %dl andb %sil, %dl orb %dil, %dl jne 0x8ce3c testb %cl, %cl sete %dl movl %ecx, %esi andb $-0x41, %sil cmpb $0x20, %sil sete %sil cmpb $0x20, %al jne 0x8cde1 orb %sil, %dl jne 0x8ce3c cmpb $0x1, %cl sete %dl cmpb $0x2, %al setb %sil testb %dl, %sil jne 0x8ce3c testb $-0x11, %cl sete %cl cmpb $0x4, %al jne 0x8ce00 testb %cl, %cl jne 0x8ce3c movl 0x98(%rsp), %ecx movq 0x10(%rsp), %rdi movl 0xc(%rsp), %esi movl %ebx, %edx callq 0x76d7c movq %rax, 0x58(%rsp) movl $0x3, %edi leaq 0x25335(%rip), %rsi # 0xb215d leaq 0x9(%rsp), %rdx leaq 0x8(%rsp), %rcx leaq 0x58(%rsp), %r8 callq 0x8ea55 movq %r13, %rdi callq 0x6bce0 movl %eax, 0x24(%rsp) cmpb $0x45, 0x7(%rsp) je 0x8ce5e movzbl 0x3c(%rsp), %edi callq 0x6c57a movl %eax, %r14d jmp 0x8ce69 movq 0x70(%rsp), %rax movzwl 0x6(%rax,%rbx,8), %r14d movl %ebp, %r13d andl $0x1, %r13d movl %r13d, %esi xorl $0x1, %esi cmpb $0x45, 0x7(%rsp) jne 0x8cebc cmpl 0x24(%rsp), %r14d jle 0x8cebc cmpl $0x0, 0x40(%rsp) je 0x8cebc movl %r14d, %eax cltd idivl 0x24(%rsp) movl %eax, %ecx cmpl $0xc000, %r14d # imm = 0xC000 je 0x8cea2 testl %edx, %edx jne 0x8cebc cmpl $0xc000, %r14d # imm = 0xC000 movl $0x3, %eax cmovel %eax, %ecx movl %r14d, %eax cltd idivl %ecx movl %ecx, %esi movl %eax, %r14d testl %esi, %esi jle 0x8d1bd orb %r12b, %r13b xorl %eax, %eax testb $0x40, %bpl movslq 0x24(%rsp), %rcx movq %rcx, 0x148(%rsp) sete %al leal (%rax,%rax,2), %eax addl $0xf8, %eax movl %eax, 0xf8(%rsp) movl %esi, 0xfc(%rsp) movslq %r14d, %r12 leaq 0x58(%rsp), %rdi movq %r12, %rsi leaq 0x78(%rsp), %rdx callq 0x38b58 movq 0x60(%rsp), %r15 subq 0x58(%rsp), %r15 movq 0x18(%rsp), %rdi callq 0x64c96 cmpl %r15d, %eax jl 0x8d619 movslq %r15d, %rbp movq 0x58(%rsp), %rdi movq 0x18(%rsp), %r15 movq 0x58(%r15), %rsi movq %rbp, %rdx callq 0x354c0 addq %rbp, 0x58(%r15) leaq 0x527f7(%rip), %rax # 0xdf740 movl 0x5c(%rax), %ecx testl %ecx, %ecx je 0x8d001 movl %ecx, 0x8c(%rsp) movq %r12, %r15 movl %r13d, %r12d movq %rbx, %r13 movq 0x48(%rsp), %rax movq (%rax), %rbp leaq 0x138(%rsp), %rax movq %rax, 0x128(%rsp) leaq 0x128(%rsp), %rbx movq %rbx, %rdi leaq 0x240b1(%rip), %rsi # 0xb103f leaq 0x240b1(%rip), %rdx # 0xb1046 callq 0x445b8 addq $0x48, %rbp movq %rbp, %rdi movq %rbx, %rsi callq 0x48d0c leaq 0x100(%rsp), %rbx movl $0x3, %ecx movq %rbx, %rdi movq %rax, %rsi xorl %edx, %edx callq 0x35600 movq %rbx, %rdi leaq 0x251c0(%rip), %rsi # 0xb218d callq 0x35120 xorl %ebp, %ebp orl 0x40(%rsp), %eax jne 0x8d005 cmpl 0x24(%rsp), %r14d movq %r13, %rbx movl %r12d, %r13d movq %r15, %r12 movl 0x8c(%rsp), %ecx jle 0x8d015 movl %r14d, %eax cltd idivl 0x24(%rsp) testl %edx, %edx sete %bpl jmp 0x8d015 xorl %ebp, %ebp jmp 0x8d015 movq %r13, %rbx movl %r12d, %r13d movq %r15, %r12 movl 0x8c(%rsp), %ecx testl %ecx, %ecx je 0x8d063 movq 0x100(%rsp), %rdi leaq 0x110(%rsp), %rax cmpq %rax, %rdi je 0x8d03e movq 0x110(%rsp), %rsi incq %rsi callq 0x355d0 movq 0x128(%rsp), %rdi leaq 0x138(%rsp), %rax cmpq %rax, %rdi je 0x8d063 movq 0x138(%rsp), %rsi incq %rsi callq 0x355d0 testb %bpl, %bpl je 0x8d0ac movl 0x98(%rsp), %ecx movq 0x10(%rsp), %rdi movl 0xc(%rsp), %esi movl %ebx, %edx callq 0x76d7c movq %rax, 0x78(%rsp) movl $0x2, %edi leaq 0x25101(%rip), %rsi # 0xb2191 leaq 0x78(%rsp), %rdx callq 0x400e2 leaq 0x58(%rsp), %rdi movq 0x148(%rsp), %rsi callq 0x38b2c cmpl $0x0, 0x40(%rsp) je 0x8d0e0 movl %r14d, %eax cltd idivl 0x24(%rsp) cmpl $0x1, %edx jne 0x8d0e0 movq 0x58(%rsp), %rax cmpb $0x7b, -0x1(%rax,%r12) jne 0x8d0e0 decq %r12 leaq 0x58(%rsp), %rdi movq %r12, %rsi callq 0x38b2c movl %r12d, %r14d cmpb $0x45, 0x7(%rsp) je 0x8d104 testb %r13b, %r13b jne 0x8d197 cmpl 0x24(%rsp), %r14d jle 0x8d104 movslq %r14d, %rsi leaq 0x58(%rsp), %rdi callq 0x38b2c testb %r13b, %r13b je 0x8d13d movl 0x98(%rsp), %ecx movq 0x10(%rsp), %rdi movl 0xc(%rsp), %esi movl %ebx, %edx callq 0x76d7c movq %rax, 0x78(%rsp) movl $0x3, %edi leaq 0x25086(%rip), %rsi # 0xb21b7 leaq 0x78(%rsp), %rdx callq 0x400e2 jmp 0x8d197 xorl %edx, %edx cmpl $0x0, 0x40(%rsp) setne %dl movzbl 0xf8(%rsp), %ecx leaq 0x90(%rsp), %rdi leaq 0x58(%rsp), %rsi callq 0x6bd6c movl 0xc(%rsp), %esi testl %eax, %eax jne 0x8d197 movl 0x98(%rsp), %ecx movq 0x10(%rsp), %rdi movl %ebx, %edx callq 0x76d7c movq %rax, 0x78(%rsp) movl $0x1, %edi leaq 0x2505e(%rip), %rsi # 0xb21eb leaq 0x78(%rsp), %rdx callq 0x400e2 movq 0x58(%rsp), %rdi testq %rdi, %rdi je 0x8d1ae movq 0x68(%rsp), %rsi subq %rdi, %rsi callq 0x355d0 movl 0xfc(%rsp), %esi decl %esi jne 0x8ceec leaq 0xd0(%rsp), %rdi leaq 0x90(%rsp), %r13 movq %r13, %rsi callq 0x71b18 leaq 0xb8(%rsp), %rdi callq 0x410b8 incq %rbx movzbl 0x3d(%rsp), %eax cmpq %rax, %rbx leaq 0x58(%rsp), %r12 jb 0x8cc55 movq 0x18(%rsp), %r14 movq %r14, %rdi callq 0x64dea movl %eax, %ebx movl 0x44(%rsp), %esi addl 0x84(%rsp), %esi movq %r14, %rdi callq 0x64dce cmpb $0x45, 0x7(%rsp) jne 0x8d2c1 addl $0xff, %ebx andl $0xffffff00, %ebx # imm = 0xFFFFFF00 movl %ebx, %ebp subl 0x84(%rsp), %ebp movl 0x44(%rsp), %eax cmpl %eax, %ebp je 0x8d2c1 movzwl %bp, %ecx cmpl %eax, %ecx jne 0x8d28b movq 0x10(%rsp), %rdi movl 0xc(%rsp), %esi callq 0x76a95 movq %rax, 0x90(%rsp) movl %ebp, 0x58(%rsp) movl $0x3, %edi leaq 0x24f9e(%rip), %rsi # 0xb220d movq %r13, %rdx movq %r12, %rcx leaq 0x44(%rsp), %r8 callq 0x8ec8f movq %r14, %rdi movl %ebx, %esi callq 0x64dce jmp 0x8d2c1 movq 0x10(%rsp), %rdi movl 0xc(%rsp), %esi callq 0x76a95 movq %rax, 0x90(%rsp) movl %ebp, 0x58(%rsp) movl $0x3, %edi leaq 0x24f5c(%rip), %rsi # 0xb220d movq %r13, %rdx movq %r12, %rcx leaq 0x44(%rsp), %r8 callq 0x8ec8f testb $0x1, 0x120(%rsp) jne 0x8d315 leaq 0xd0(%rsp), %rdi callq 0x717ac testb %al, %al je 0x8d315 leaq 0xd0(%rsp), %rdi xorl %esi, %esi callq 0x71454 movq %rax, %rdi callq 0x6bcbe cmpl $0x1800, %eax # imm = 0x1800 jne 0x8d315 movb $0x1, %al movq %rax, 0x120(%rsp) movl $0x3, %edi leaq 0x24f2a(%rip), %rsi # 0xb223a callq 0x46c85 movq 0x48(%rsp), %rax movq (%rax), %rdi leaq 0x50(%rsp), %rsi leaq 0xd0(%rsp), %rdx callq 0x54f3a leaq 0xd8(%rsp), %rdi callq 0x4106a movl 0xc(%rsp), %edx incl %edx movzbl 0xa(%rsp), %eax cmpl %eax, %edx jb 0x8c8b4 movq 0x10(%rsp), %rcx incl %ecx movzbl 0xb(%rsp), %eax movq %rcx, 0x10(%rsp) cmpl %eax, %ecx jb 0x8c8a7 cmpb $0x45, 0x7(%rsp) jne 0x8d45c leaq 0x28(%rsp), %rsi movq %r14, %rdi movl $0xf, %edx movl $0x1, %ecx callq 0x64d5c testl %eax, %eax je 0x8d45c movabsq $0x492d74657366664f, %rax # imm = 0x492D74657366664F xorq 0x28(%rsp), %rax movabsq $0x6f666e492d746573, %rcx # imm = 0x6F666E492D746573 xorq 0x2b(%rsp), %rcx orq %rax, %rcx je 0x8d3e3 movq %r14, %rdi callq 0x64dea addl $-0xf, %eax movq %r14, %rdi movl %eax, %esi callq 0x64dce jmp 0x8d45c xorl %eax, %eax addq $0x258, %rsp # imm = 0x258 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movzbl 0xb(%rsp), %esi movzbl 0xa(%rsp), %edx leaq 0xd0(%rsp), %rdi callq 0x65916 xorps %xmm0, %xmm0 leaq 0x90(%rsp), %rsi movaps %xmm0, (%rsi) movaps %xmm0, 0x10(%rsi) movq 0x48(%rsp), %rax movq %rax, (%rsi) movq %r14, 0x8(%rsi) leaq 0x1183(%rip), %rax # 0x8e5a2 movq %rax, 0x18(%rsi) leaq 0x1264(%rip), %rax # 0x8e68e movq %rax, 0x10(%rsi) leaq 0xd0(%rsp), %rdi xorl %edx, %edx callq 0x659a2 movq 0xa0(%rsp), %rax testq %rax, %rax je 0x8d45c leaq 0x90(%rsp), %rdi movq %rdi, %rsi movl $0x3, %edx callq *%rax leaq 0x150(%rsp), %rbx leaq 0x24e14(%rip), %r14 # 0xb227f leaq 0x90(%rsp), %r12 movq 0x18(%rsp), %rdi movq %rbx, %rsi movl $0x100, %edx # imm = 0x100 movl $0x1, %ecx callq 0x64d5c testl %eax, %eax je 0x8d50b movq 0x150(%rsp), %rax movabsq $0x6e492d6b63617254, %rcx # imm = 0x6E492D6B63617254 xorq %rcx, %rax movzwl 0x158(%rsp), %ecx xorq $0x6f66, %rcx # imm = 0x6F66 orq %rax, %rcx jne 0x8d4f0 cmpb $0x0, 0x165(%rsp) jne 0x8d4f0 movzbl 0x160(%rsp), %edi movzbl 0x161(%rsp), %esi callq 0x76a95 movq %rax, 0x90(%rsp) movl $0x3, %edi movq %r14, %rsi movq %r12, %rdx callq 0x400e2 jmp 0x8d473 movq 0x18(%rsp), %rdi callq 0x64dea addl $0xffffff00, %eax # imm = 0xFFFFFF00 movq 0x18(%rsp), %rdi movl %eax, %esi callq 0x64dce movq 0x18(%rsp), %r14 movq %r14, %rdi callq 0x64c8e movl %eax, %ebx movq %r14, %rdi callq 0x64dea subl %eax, %ebx movslq %ebx, %rax movq %rax, 0x90(%rsp) je 0x8d5e1 movq 0x18(%rsp), %rdi callq 0x64c88 movq (%rax), %r14 movq 0x18(%rsp), %rdi callq 0x64dea cltq leaq (%r14,%rax), %rbx leaq (%r14,%rax), %rsi incq %rsi movq 0x90(%rsp), %rdx decq %rdx movq %rbx, %rdi callq 0x355f0 testl %eax, %eax je 0x8d5c5 leaq 0x24d59(%rip), %rsi # 0xb22d0 leaq 0x90(%rsp), %rdx movl $0x3, %edi callq 0x8f013 movq 0x18(%rsp), %rdi callq 0x64c88 movq (%rax), %rbx movq 0x18(%rsp), %rdi callq 0x64c88 movq 0x8(%rax), %r14 movq 0x18(%rsp), %rdi callq 0x64dea movl $0x10, %r8d movq %rbx, %rdi movq %r14, %rsi movl %eax, %edx xorl %ecx, %ecx callq 0x52835 jmp 0x8d5e1 leaq 0x24cdd(%rip), %rsi # 0xb22a9 leaq 0x90(%rsp), %rdx movl $0x3, %edi movq %rbx, %rcx callq 0x8ee52 movq 0x48(%rsp), %rax movq (%rax), %rdi movq 0x80(%rdi), %rdx addq $0x78, %rdi leaq 0x24d46(%rip), %rcx # 0xb2341 movl $0x4, %r8d xorl %esi, %esi callq 0x358f0 movq 0x70(%rsp), %rdi callq 0x775ea movb $0x1, %al jmp 0x8d3d1 movl $0x10, %edi callq 0x35260 movq %rax, %r14 leaq 0x98(%rsp), %r8 leaq 0x244d6(%rip), %rsi # 0xb1b0b leaq 0x238c7(%rip), %rcx # 0xb0f03 leaq 0x50(%rsp), %rdx movq %rax, %rdi callq 0x8ec1a leaq 0x4e530(%rip), %rsi # 0xdbb80 movq 0x4f929(%rip), %rdx # 0xdcf80 movq %r14, %rdi callq 0x35a50 jmp 0x8d6fc movl $0x10, %edi callq 0x35260 movq %rax, %r14 leaq 0x24493(%rip), %rsi # 0xb1b0b leaq 0x50(%rsp), %rdx movq %rax, %rdi callq 0x88dc0 jmp 0x8d6a8 movl $0x10, %edi callq 0x35260 movq %rax, %r14 leaq 0x24992(%rip), %rsi # 0xb202d leaq 0x50(%rsp), %rdx movq %rax, %rdi callq 0x8e7a2 leaq 0x4e4d1(%rip), %rsi # 0xdbb80 movq 0x4f8ca(%rip), %rdx # 0xdcf80 movq %r14, %rdi callq 0x35a50 movl $0x10, %edi callq 0x35260 movq %rax, %r14 leaq 0x24439(%rip), %rsi # 0xb1b0b leaq 0x24a25(%rip), %rcx # 0xb20fe leaq 0x50(%rsp), %rdx movq %rax, %rdi callq 0x8e9e0 leaq 0x4e493(%rip), %rsi # 0xdbb80 movq 0x4f88c(%rip), %rdx # 0xdcf80 movq %r14, %rdi callq 0x35a50 movl $0x10, %edi callq 0x35260 movq %rax, %r14 leaq 0x248b1(%rip), %rsi # 0xb1fc1 leaq 0x21889(%rip), %rcx # 0xaefa0 leaq 0xa(%rsp), %rdx movq %rax, %rdi callq 0x8e6b6 jmp 0x8d74e movl $0x10, %edi callq 0x35260 movq %rax, %r14 leaq 0x2489c(%rip), %rsi # 0xb1fd6 leaq 0x2185f(%rip), %rcx # 0xaefa0 leaq 0xb(%rsp), %rdx movq %rax, %rdi callq 0x8e72c leaq 0x4e42b(%rip), %rsi # 0xdbb80 movq 0x4f824(%rip), %rdx # 0xdcf80 movq %r14, %rdi callq 0x35a50 jmp 0x8d949 movq %rax, %rbx movq 0xa0(%rsp), %rax testq %rax, %rax je 0x8d937 leaq 0x90(%rsp), %rdi movq %rdi, %rsi movl $0x3, %edx callq *%rax jmp 0x8d937 jmp 0x8d949 jmp 0x8d8a0 jmp 0x8d7a0 movq %rax, %rbx movq %r14, %rdi callq 0x35430 jmp 0x8d941 jmp 0x8d8a0 jmp 0x8d8a0 jmp 0x8d949 movq %rax, %rbx movq 0x100(%rsp), %rdi leaq 0x110(%rsp), %rax cmpq %rax, %rdi je 0x8d7ec movq 0x110(%rsp), %rsi incq %rsi callq 0x355d0 jmp 0x8d7ec movq %rax, %rbx leaq 0xa0(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x8d812 movq 0xa0(%rsp), %rsi incq %rsi callq 0x355d0 jmp 0x8d812 movq %rax, %rbx movq 0xd0(%rsp), %rdi cmpq %r14, %rdi je 0x8d941 movq 0xe0(%rsp), %rsi incq %rsi callq 0x355d0 jmp 0x8d941 jmp 0x8d8a0 jmp 0x8d8a0 jmp 0x8d8b6 jmp 0x8d8b6 jmp 0x8d8b6 jmp 0x8d8b6 jmp 0x8d8a0 jmp 0x8d8a0 jmp 0x8d8a0 jmp 0x8d8a0 jmp 0x8d888 jmp 0x8d8a0 jmp 0x8d8b6 movq %rax, %rbx movq %r14, %rdi callq 0x35430 jmp 0x8d92a jmp 0x8d868 jmp 0x8d8a0 jmp 0x8d8a0 movq %rax, %rbx movq %r14, %rdi callq 0x35430 jmp 0x8d937 jmp 0x8d8a0 jmp 0x8d8b6 jmp 0x8d8a0 jmp 0x8d8a0 jmp 0x8d8a0 jmp 0x8d8a0 jmp 0x8d8a0 jmp 0x8d8a0 movq %rax, %rbx leaq 0x98(%rsp), %rdi jmp 0x8d932 jmp 0x8d8a0 jmp 0x8d8a0 jmp 0x8d8b6 jmp 0x8d8d2 movq %rax, %rbx jmp 0x8d937 jmp 0x8d8b6 jmp 0x8d8d2 jmp 0x8d8d2 jmp 0x8d8d2 jmp 0x8d8d2 jmp 0x8d8d2 jmp 0x8d8d2 movq %rax, %rbx jmp 0x8d92a jmp 0x8d903 jmp 0x8d903 jmp 0x8d903 movq %rax, %rbx movq %r14, %rdi callq 0x35430 jmp 0x8d906 jmp 0x8d903 jmp 0x8d903 movq %rax, %rbx jmp 0x8d91d jmp 0x8d903 movq %rax, %rbx movq 0x128(%rsp), %rdi leaq 0x138(%rsp), %rax cmpq %rax, %rdi je 0x8d906 movq 0x138(%rsp), %rsi incq %rsi callq 0x355d0 jmp 0x8d906 movq %rax, %rbx movq 0x58(%rsp), %rdi testq %rdi, %rdi je 0x8d91d movq 0x68(%rsp), %rsi subq %rdi, %rsi callq 0x355d0 leaq 0xb8(%rsp), %rdi callq 0x410b8 leaq 0xd8(%rsp), %rdi callq 0x4106a movq 0x70(%rsp), %rdi callq 0x775ea movq %rbx, %rdi callq 0x35aa0 movq %rax, %rdi callq 0x410ac
/simonowen[P]samdisk/src/types/dsk.cpp
WriteDSK(_IO_FILE*, std::shared_ptr<Disk>&)
bool WriteDSK(FILE* f_, std::shared_ptr<Disk>& disk) { MEMORY mem(ESDK_MAX_TRACK_SIZE); auto pbTrack = mem.pb; uint8_t abHeader[256] = {}; // EDSK file header is fixed at 256 bytes - don't change! auto peh = reinterpret_cast<EDSK_HEADER*>(abHeader); auto pbIndex = reinterpret_cast<uint8_t*>(peh + 1); auto max_cyls = (sizeof(abHeader) - sizeof(EDSK_HEADER)) / MAX_SIDES; memcpy(peh->szSignature, EDSK_SIGNATURE, sizeof(EDSK_SIGNATURE) - 1); strncpy(peh->szCreator, util::fmt("SAMdisk%02u%02u%02u", YEAR % 100, MONTH + 1, DAY).c_str(), sizeof(peh->szCreator)); peh->bTracks = static_cast<uint8_t>(disk->cyls()); peh->bSides = static_cast<uint8_t>(disk->heads()); if (peh->bTracks > max_cyls) throw util::exception("too many cylinders for EDSK"); else if (peh->bSides > MAX_SIDES) throw util::exception("too many heads for EDSK"); bool add_offsets_block = true; std::vector<uint16_t> offsets; offsets.reserve((peh->bTracks + 1) * peh->bSides); fseek(f_, sizeof(abHeader), SEEK_SET); for (uint8_t cyl = 0; cyl < peh->bTracks; ++cyl) { for (uint8_t head = 0; head < peh->bSides; ++head) { CylHead cylhead(cyl, head); auto& track = disk->read_track(cylhead); if (track.is_mixed_encoding()) throw util::exception(cylhead, " is mixed-density, which EDSK doesn't support"); bool added_sector_offsets = false; offsets.push_back(util::htole(static_cast<uint16_t>(track.tracklen / 16))); auto pt = reinterpret_cast<EDSK_TRACK*>(mem.pb); auto ps = reinterpret_cast<EDSK_SECTOR*>(pt + 1); Sector typical = GetTypicalSector(cylhead, track, Sector(DataRate::Unknown, Encoding::Unknown)); // The standard track header is 256 bytes, but to allow more than 29 sectors we'll // round up the required size to the next 256-byte boundary int track_header_size = (sizeof(EDSK_TRACK) + track.size() * sizeof(EDSK_SECTOR) + 0xff) & ~0xff; memset(mem, 0, track_header_size); memcpy(pt->signature, EDSK_TRACK_SIG, sizeof(pt->signature)); pt->track = cyl; pt->side = head; pt->sectors = static_cast<uint8_t>(track.size()); pt->fill = 0xe5; pt->size = static_cast<uint8_t>(track.size() ? typical.header.size : EDSK_DEFAULT_SIZE); pt->gap3 = static_cast<uint8_t>(typical.gap3 ? typical.gap3 : EDSK_DEFAULT_GAP3); auto datarate = track.size() ? track[0].datarate : DataRate::Unknown; auto encoding = track.size() ? track[0].encoding : Encoding::Unknown; switch (datarate) { default: pt->rate = 0; break; case DataRate::_250K: pt->rate = 1; break; case DataRate::_300K: pt->rate = 1; break; case DataRate::_500K: pt->rate = 2; break; case DataRate::_1M: pt->rate = 3; break; } pt->encoding = (encoding == Encoding::FM) ? 1 : 0; // Assume 300rpm to determine approximate track capacity auto track_size = 0; // Space saving flags, to squeeze the track into the limited EDSK space bool fFitLegacy = !!opt.legacy; bool fFitErrorCopies = false, fFitErrorSize = false; auto uFitSize = Sector::SizeCodeToLength(GetUnformatSizeCode(datarate)); // Loop to fit any sectors while (track.size()) { // Start with the size of the track header track_size = track_header_size; // Point to the start of the data area and the sector space auto pb = mem + track_header_size; for (int i = 0; i < pt->sectors; ++i) { auto sector = track[i]; // If any offsets are zero we can't generate append an offsets block. if (!sector.offset) add_offsets_block = false; // Take care to only output offsets on the first pass around the fitting loop. else if (!added_sector_offsets) offsets.push_back(util::htole(static_cast<uint16_t>(sector.offset / 16))); auto rpm_time = (sector.datarate == DataRate::_300K) ? RPM_TIME_360 : RPM_TIME_300; auto track_capacity = GetTrackCapacity(rpm_time, sector.datarate, sector.encoding); // Accept only normal and deleted DAMs, removing the data field for other types. // Hercule II (CPC) has a non-standard DAM (0xFD), and expects it to be unreadable. if (sector.dam != 0xfb && sector.dam != 0xf8) { Message(msgWarning, "discarding data from %s due to non-standard DAM %02x", CHR(cyl, head, sector.header.sector), sector.dam); sector.remove_data(); } uint8_t status1 = 0, status2 = 0; if (sector.has_badidcrc()) status1 |= SR1_CRC_ERROR; if (!sector.has_badidcrc() && !sector.has_data()) status2 |= SR2_MISSING_ADDRESS_MARK; if (sector.has_baddatacrc()) { status1 |= SR1_CRC_ERROR; status2 |= SR2_CRC_ERROR_IN_SECTOR_DATA; } if (sector.is_deleted()) status2 |= SR2_SECTOR_WITH_DELETED_DATA; auto num_copies = sector.copies(); auto data_size = sector.data_size(); auto real_size = sector.size(); // Clip extended sizes to the unformat size, to ensure we have a complete revolution if (sector.header.size > 7 && data_size > uFitSize) data_size = uFitSize; // Preserve multiple copies on 8K tracks by extending them to full size if (num_copies > 1 && track.is_8k_sector()) data_size = real_size; // Warn if other error sectors are shorter than real size if (num_copies > 1 && data_size != real_size) { if (data_size > real_size) Message(msgWarning, "discarding gaps from multiple copies of %s", CHR(cyl, head, sector.header.sector)); else if (sector.offset && sector.offset + real_size < track.tracklen) Message(msgWarning, "short data field in multiple copies of %s", CHR(cyl, head, sector.header.sector)); data_size = real_size; } // Drop extra copies on sectors larger than the track, unless it's // an 8K sector with an error during the first 6K of data. else if (data_size > track_capacity && !track.is_8k_sector()) num_copies = 1; // Drop any extra copies of error sectors if (fFitErrorCopies) { if (sector.has_baddatacrc() && num_copies > 1) num_copies = 1; } // Cut extended sectors down to zero data if (fFitErrorSize) { if (sector.has_baddatacrc() && data_size > uFitSize) data_size = uFitSize; } // Force to legacy format? if (fFitLegacy) { if (num_copies > 1) num_copies = 1; if (sector.header.size == 6 && data_size > 6144) data_size = 6144; if (sector.header.size >= 7) data_size = 0; if (data_size > real_size) data_size = real_size; } // Copy the sector data into place for (auto copy = 0; copy < num_copies; ++copy) { const Data& data = sector.data_copy(copy); // Only copy if there's room - we'll check it fits later if (track_size + data_size < mem.size) { if (data.size() >= data_size) memcpy(pb, data.data(), data_size); else { // Extend 8K sectors to full size to preserve multiple copies memcpy(pb, data.data(), data.size()); memset(pb + data.size(), 0, data_size - data.size()); } // Single copy data CRC error and size that conflicts with multiple copies extension? if (data_size && sector.copies() == 1 && sector.has_baddatacrc() && data_size != real_size && (data_size % real_size) == 0) { // Write a dummy marker byte to the end of the data, and increment the stored size pb[data_size++] = 123; } } pb += data_size; track_size += data_size; } ps[i].track = static_cast<uint8_t>(sector.header.cyl); ps[i].side = static_cast<uint8_t>(sector.header.head); ps[i].sector = static_cast<uint8_t>(sector.header.sector); ps[i].size = static_cast<uint8_t>(sector.header.size); ps[i].status1 = status1; ps[i].status2 = status2; data_size *= num_copies; ps[i].datalow = data_size & 0xff; ps[i].datahigh = static_cast<uint8_t>(data_size >> 8); } // If the track fits, we're done if (track_size <= mem.size) { // Clear any unused space, then break out to save it memset(mem + track_size, 0, mem.size - track_size); break; } // Flag that sector offsets have already been generated. added_sector_offsets = true; // Try again using various techniques to make it fit if (!fFitErrorCopies) { fFitErrorCopies = true; continue; } if (!fFitErrorSize) { fFitErrorSize = true; continue; } if (uFitSize > 128) { uFitSize /= 2; continue; } if (!fFitLegacy) { fFitLegacy = true; continue; } // If we run out of methods, fail throw util::exception(cylhead, " size (", track_size, ") exceeds EDSK track limit (", ESDK_MAX_TRACK_SIZE, ")"); } // Round the size up to the next 256-byte boundary, and store the MSB in the index track_size = (track_size + 0xff) & ~0xff; *pbIndex++ = static_cast<uint8_t>(track_size >> 8); // Write the track to the image fwrite(pbTrack, track_size, 1, f_); } } // Add offsets if available, unless they're disabled if (!opt.legacy && add_offsets_block) { EDSK_OFFSETS eo = { EDSK_OFFSETS_SIG, 0 }; fwrite(&eo, sizeof(eo), 1, f_); fwrite(offsets.data(), offsets.size(), sizeof(uint16_t), f_); } fseek(f_, 0, SEEK_SET); if (!fwrite(abHeader, sizeof(abHeader), 1, f_)) throw util::exception("write error"); fseek(f_, 0, SEEK_END); return true; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x248, %rsp # imm = 0x248 movq %rsi, %r12 movq %rdi, %r15 movl $0xff00, %edi # imm = 0xFF00 callq 0x77560 movq %rax, 0x18(%rsp) leaq 0x162(%rsp), %rbx movl $0xde, %edx movq %rbx, %rdi xorl %esi, %esi callq 0x352d0 movups 0x245db(%rip), %xmm0 # 0xb1f70 movaps %xmm0, -0x22(%rbx) movups 0x245e0(%rip), %xmm0 # 0xb1f80 movaps %xmm0, -0x12(%rbx) movw $0xa0d, -0x2(%rbx) # imm = 0xA0D leaq 0x2494d(%rip), %rsi # 0xb22fe leaq 0x100(%rsp), %rdi movl $0x19, %edx movl $0x4, %ecx movl $0x1a, %r8d xorl %eax, %eax callq 0x784cc leaq 0x162(%rsp), %rdi leaq 0x110(%rsp), %r14 movq -0x10(%r14), %rbx movl $0xe, %edx movq %rbx, %rsi callq 0x35290 cmpq %r14, %rbx je 0x8da09 movq 0x110(%rsp), %rsi incq %rsi movq %rbx, %rdi callq 0x355d0 movq (%r12), %rdi callq 0x54940 movb %al, 0x170(%rsp) movq (%r12), %rdi callq 0x54964 movb %al, 0x171(%rsp) movzbl 0x170(%rsp), %ecx cmpq $0x67, %rcx jae 0x8e454 movzbl %al, %edx cmpl $0x3, %edx jae 0x8e472 xorps %xmm0, %xmm0 leaq 0x50(%rsp), %rdi movaps %xmm0, (%rdi) movq $0x0, 0x10(%rdi) incq %rcx movzbl %al, %esi imulq %rcx, %rsi callq 0x7110c movq $0x0, 0xd0(%rsp) movl $0x100, %esi # imm = 0x100 movq %r15, %rdi xorl %edx, %edx callq 0x35660 cmpb $0x0, 0x170(%rsp) je 0x8e2cf leaq 0x174(%rsp), %rax movq %rax, 0xd8(%rsp) movq 0x18(%rsp), %rax addq $0xd, %rax movq %rax, 0xe8(%rsp) movb $0x1, 0x12(%rsp) movl $0x0, 0x24(%rsp) movq %r15, 0xf0(%rsp) movq %r12, 0xe0(%rsp) cmpb $0x0, 0x171(%rsp) je 0x8e2a7 xorl %edx, %edx leaq 0xc8(%rsp), %rbx movq %rbx, %rdi movl 0x24(%rsp), %esi movl %edx, 0x2c(%rsp) callq 0x46fa2 movq (%r12), %rdi movq %rbx, %rsi xorl %edx, %edx callq 0x54cdc movq %rax, %r14 movq %rax, %rdi callq 0x716f2 testb %al, %al jne 0x8e3ae movl (%r14), %ecx leal 0xf(%rcx), %eax testl %ecx, %ecx cmovnsl %ecx, %eax shrl $0x4, %eax movw %ax, 0x100(%rsp) movq 0x58(%rsp), %rsi cmpq 0x60(%rsp), %rsi je 0x8db49 movw %ax, (%rsi) addq $0x2, %rsi movq %rsi, 0x58(%rsp) jmp 0x8db5b leaq 0x50(%rsp), %rdi leaq 0x100(%rsp), %rdx callq 0x7129a xorps %xmm0, %xmm0 movaps %xmm0, 0x40(%rsp) leaq 0x70(%rsp), %rbx movq %rbx, %rdi xorl %esi, %esi xorl %edx, %edx leaq 0x40(%rsp), %rcx xorl %r8d, %r8d callq 0x6bb84 leaq 0x100(%rsp), %rdi leaq 0xc8(%rsp), %rsi movq %r14, %rdx movq %rbx, %rcx callq 0x5a20e leaq 0x98(%rsp), %rdi callq 0x410b8 movq %r14, %rdi callq 0x713fc leal 0x117(,%rax,8), %eax andl $0xffffff00, %eax # imm = 0xFFFFFF00 movl %eax, 0xc0(%rsp) movslq %eax, %rcx leaq -0xd(%rcx), %rax movq %rcx, 0xb8(%rsp) testl %ecx, %ecx movl $0x0, %edx cmovneq %rax, %rdx movq 0xe8(%rsp), %rdi xorl %esi, %esi callq 0x352d0 movq 0x18(%rsp), %rax movabsq $0x6e492d6b63617254, %rcx # imm = 0x6E492D6B63617254 movq %rcx, (%rax) movabsq $0xa0d6f666e492d, %rcx # imm = 0xA0D6F666E492D movq %rcx, 0x5(%rax) movl 0x24(%rsp), %ecx movb %cl, 0x10(%rax) movl 0x2c(%rsp), %ecx movb %cl, 0x11(%rax) movq %r14, %rdi callq 0x713fc movq 0x18(%rsp), %rcx movb %al, 0x15(%rcx) movb $-0x1b, 0x17(%rcx) movq %r14, %rdi callq 0x713fc movl $0x2, %ecx testl %eax, %eax je 0x8dc42 movl 0x10c(%rsp), %ecx movq 0x18(%rsp), %rdx movb %cl, 0x14(%rdx) movl 0x11c(%rsp), %eax testl %eax, %eax movl $0x4e, %ecx cmovel %ecx, %eax movb %al, 0x16(%rdx) movq %r14, %rdi callq 0x713fc testl %eax, %eax je 0x8dc79 movq %r14, %rdi xorl %esi, %esi callq 0x71416 movl 0x10(%rax), %ebx jmp 0x8dc7b xorl %ebx, %ebx movq %r14, %rdi callq 0x713fc testl %eax, %eax je 0x8dc9a movq %r14, %rdi xorl %esi, %esi callq 0x71416 cmpl $0x2, 0x14(%rax) sete %al jmp 0x8dc9c xorl %eax, %eax cmpl $0x7a11f, %ebx # imm = 0x7A11F jg 0x8dcbf cmpl $0x3d090, %ebx # imm = 0x3D090 je 0x8dcb4 cmpl $0x493e0, %ebx # imm = 0x493E0 jne 0x8dcda movq 0x18(%rsp), %rcx movb $0x1, 0x12(%rcx) jmp 0x8dcee cmpl $0x7a120, %ebx # imm = 0x7A120 je 0x8dce5 cmpl $0xf4240, %ebx # imm = 0xF4240 jne 0x8dcda movq 0x18(%rsp), %rcx movb $0x3, 0x12(%rcx) jmp 0x8dcee movq 0x18(%rsp), %rcx movb $0x0, 0x12(%rcx) jmp 0x8dcee movq 0x18(%rsp), %rcx movb $0x2, 0x12(%rcx) movb %al, 0x13(%rcx) movl $0x0, 0x14(%rsp) leaq 0x51a40(%rip), %rax # 0xdf740 movl 0xe8(%rax), %ebp movl %ebx, %edi callq 0x6093d movl %eax, %edi callq 0x6c57a movl %eax, 0x34(%rsp) testl %ebp, %ebp setne 0x11(%rsp) movq 0xb8(%rsp), %rax addq 0x18(%rsp), %rax movq %rax, 0xb8(%rsp) movl $0x0, 0x30(%rsp) movl $0x0, 0x3c(%rsp) movl $0x0, 0x38(%rsp) movq %r14, 0x68(%rsp) movq %r14, %rdi callq 0x713fc testl %eax, %eax je 0x8e244 movl 0xc0(%rsp), %eax movl %eax, 0x14(%rsp) movq 0x18(%rsp), %rax cmpb $0x0, 0x15(%rax) je 0x8e1a7 xorl %ebp, %ebp movq 0xb8(%rsp), %r12 movq %r14, %rdi movq %rbp, 0xf8(%rsp) movl %ebp, %esi callq 0x71416 movl 0x1f(%rax), %ecx movl %ecx, 0x8f(%rsp) movups (%rax), %xmm0 movups 0x10(%rax), %xmm1 movaps %xmm1, 0x80(%rsp) movaps %xmm0, 0x70(%rsp) addq $0x28, %rax leaq 0x98(%rsp), %rdi movq %rax, %rsi callq 0x43028 movl 0x88(%rsp), %eax testl %eax, %eax sete %dl movzbl 0x12(%rsp), %ecx cmovel %eax, %ecx orb 0x30(%rsp), %dl testb $0x1, %dl je 0x8ddf1 movb %cl, 0x12(%rsp) leaq 0x70(%rsp), %r15 jmp 0x8de2f leal 0xf(%rax), %ecx testl %eax, %eax cmovnsl %eax, %ecx shrl $0x4, %ecx movw %cx, 0x40(%rsp) movq 0x58(%rsp), %rsi cmpq 0x60(%rsp), %rsi leaq 0x70(%rsp), %r15 je 0x8de20 movw %cx, (%rsi) addq $0x2, %rsi movq %rsi, 0x58(%rsp) jmp 0x8de2f leaq 0x50(%rsp), %rdi leaq 0x40(%rsp), %rdx callq 0x7129a movl 0x80(%rsp), %esi movl 0x84(%rsp), %edx cmpl $0x493e0, %esi # imm = 0x493E0 movl $0x30d40, %edi # imm = 0x30D40 movl $0x28b0b, %eax # imm = 0x28B0B cmovel %eax, %edi callq 0x608f0 movl %eax, %r13d movzbl 0x90(%rsp), %eax cmpl $0xf8, %eax je 0x8deaa cmpl $0xfb, %eax je 0x8deaa movl 0x78(%rsp), %edx movl 0x24(%rsp), %edi movl 0x2c(%rsp), %esi callq 0x76c4f movq %rax, 0x40(%rsp) movl $0x3, %edi leaq 0x244e4(%rip), %rsi # 0xb2374 leaq 0x40(%rsp), %rdx leaq 0x90(%rsp), %rcx callq 0x8f247 movq %r15, %rdi callq 0x6c14e movq %r15, %rdi callq 0x6c11a movb %al, 0x2b(%rsp) movq %r15, %rdi callq 0x6c11a testb %al, %al je 0x8dec6 xorl %ebx, %ebx jmp 0x8ded3 movq %r15, %rdi callq 0x6c302 movl %eax, %ebx xorb $0x1, %bl movq %r15, %rdi callq 0x6c14a movb %al, 0x13(%rsp) movq %r15, %rdi callq 0x6c37a movzbl %bl, %ecx orb $0x20, %bl movzbl %bl, %edx cmpb $0x0, 0x13(%rsp) cmovel %ecx, %edx leal 0x40(%rdx), %ecx movzbl %cl, %ecx testb %al, %al cmovel %edx, %ecx movl %ecx, 0xc4(%rsp) movq %r15, %rdi callq 0x6bcaa movl %eax, %r14d movq %r15, %rdi callq 0x6bcbe movl %eax, %ebp movq %r15, %rdi callq 0x6bce0 movl %eax, %r15d movl 0x34(%rsp), %ebx cmpl %ebx, %ebp cmovll %ebp, %ebx cmpl $0x8, 0x7c(%rsp) cmovll %ebp, %ebx cmpl $0x2, %r14d jl 0x8df51 movq 0x68(%rsp), %rdi callq 0x717ac testb %al, %al cmovnel %r15d, %ebx cmpl $0x2, %r14d jl 0x8df8c cmpl %r15d, %ebx je 0x8df8c jle 0x8dfa8 movl 0x78(%rsp), %edx movl 0x24(%rsp), %edi movl 0x2c(%rsp), %esi callq 0x76c4f movq %rax, 0x40(%rsp) movl $0x3, %edi leaq 0x24429(%rip), %rsi # 0xb23a9 leaq 0x40(%rsp), %rdx callq 0x400e2 jmp 0x8dfeb cmpl %r13d, %ebx jle 0x8dfee movq 0x68(%rsp), %rdi callq 0x717ac testb %al, %al movl $0x1, %eax cmovel %eax, %r14d jmp 0x8dfee movl 0x88(%rsp), %eax testl %eax, %eax je 0x8dfeb addl %r15d, %eax movq 0x68(%rsp), %rcx cmpl (%rcx), %eax jge 0x8dfeb movl 0x78(%rsp), %edx movl 0x24(%rsp), %edi movl 0x2c(%rsp), %esi callq 0x76c4f movq %rax, 0x40(%rsp) movl $0x3, %edi leaq 0x243f3(%rip), %rsi # 0xb23d4 leaq 0x40(%rsp), %rdx callq 0x400e2 movl %r15d, %ebx testb $0x1, 0x3c(%rsp) je 0x8e011 leaq 0x70(%rsp), %rdi callq 0x6c14a testl %r14d, %r14d movl $0x1, %ecx cmovlel %r14d, %ecx testb %al, %al cmovnel %ecx, %r14d testb $0x1, 0x38(%rsp) je 0x8e030 leaq 0x70(%rsp), %rdi callq 0x6c14a movl 0x34(%rsp), %ecx cmpl %ecx, %ebx cmovll %ebx, %ecx testb %al, %al cmovnel %ecx, %ebx testb $0x1, 0x11(%rsp) je 0x8e068 testl %r14d, %r14d movl $0x1, %eax cmovgl %eax, %r14d movl 0x7c(%rsp), %eax movl $0x1800, %ecx # imm = 0x1800 cmpl %ecx, %ebx cmovll %ebx, %ecx cmpl $0x6, %eax cmovnel %ebx, %ecx movl $0x0, %eax cmovgl %eax, %ecx cmpl %r15d, %ecx cmovgel %r15d, %ecx movl %ecx, %ebx testl %r14d, %r14d jle 0x8e12f xorl %r13d, %r13d leaq 0x70(%rsp), %rdi movl %r13d, %esi callq 0x6bd1e movq %rax, %rbp movl 0x14(%rsp), %eax addl %ebx, %eax cmpl $0xfeff, %eax # imm = 0xFEFF jg 0x8e119 movq (%rbp), %rsi movq 0x8(%rbp), %rax subq %rsi, %rax cmpl %eax, %ebx jle 0x8e0cd movslq %eax, %rdx movq %r12, %rdi callq 0x354c0 movq 0x8(%rbp), %rax subq (%rbp), %rax cltq leaq (%r12,%rax), %rdi movl %ebx, %ecx subl %eax, %ecx movslq %ecx, %rdx xorl %esi, %esi callq 0x352d0 jmp 0x8e0d8 movslq %ebx, %rdx movq %r12, %rdi callq 0x354c0 testl %ebx, %ebx je 0x8e117 leaq 0x70(%rsp), %rdi callq 0x6bcaa cmpl $0x1, %eax jne 0x8e119 leaq 0x70(%rsp), %rdi callq 0x6c14a cmpl %r15d, %ebx setne %cl andb %cl, %al cmpb $0x1, %al jne 0x8e119 movl %ebx, %eax cltd idivl %r15d testl %edx, %edx jne 0x8e119 movslq %ebx, %rax incl %ebx movb $0x7b, (%r12,%rax) jmp 0x8e119 xorl %ebx, %ebx movslq %ebx, %rax addl %eax, 0x14(%rsp) addq %rax, %r12 incl %r13d cmpl %r13d, %r14d jne 0x8e074 movb 0x2b(%rsp), %cl orb 0x13(%rsp), %cl shlb $0x5, %cl movb 0x70(%rsp), %al movq 0x18(%rsp), %rdx movq 0xf8(%rsp), %rbp movb %al, 0x18(%rdx,%rbp,8) movb 0x74(%rsp), %al movb %al, 0x19(%rdx,%rbp,8) movb 0x78(%rsp), %al movb %al, 0x1a(%rdx,%rbp,8) movb 0x7c(%rsp), %al movb %al, 0x1b(%rdx,%rbp,8) movb %cl, 0x1c(%rdx,%rbp,8) movl 0xc4(%rsp), %eax movb %al, 0x1d(%rdx,%rbp,8) imull %r14d, %ebx movb %bl, 0x1e(%rdx,%rbp,8) movb %bh, 0x1f(%rdx,%rbp,8) movq %rdx, %rbx leaq 0x98(%rsp), %rdi callq 0x410b8 incq %rbp movzbl 0x15(%rbx), %eax cmpq %rax, %rbp movq 0x68(%rsp), %r14 jb 0x8dd85 movslq 0x14(%rsp), %rbx cmpq $0xff01, %rbx # imm = 0xFF01 movq 0xf0(%rsp), %r15 jge 0x8e1df movq 0x18(%rsp), %rax leaq (%rax,%rbx), %rdi movl $0xff00, %edx # imm = 0xFF00 subq %rbx, %rdx xorl %esi, %esi callq 0x352d0 movq 0xe0(%rsp), %r12 jmp 0x8e238 movb $0x1, %al movl %eax, 0x30(%rsp) testb $0x1, 0x3c(%rsp) movq 0xe0(%rsp), %r12 movb $0x1, %al je 0x8e214 movl %eax, 0x30(%rsp) testb $0x1, 0x38(%rsp) je 0x8e21a movl 0x34(%rsp), %eax cmpl $0x81, %eax jl 0x8e222 shrl %eax movl %eax, 0x34(%rsp) jmp 0x8e238 movl %eax, 0x3c(%rsp) jmp 0x8e238 movb $0x1, %al movl %eax, 0x38(%rsp) jmp 0x8e238 movb $0x1, %al movl %eax, 0x30(%rsp) testb $0x1, 0x11(%rsp) movb $0x1, 0x11(%rsp) jne 0x8e3ed cmpl $0xff00, %ebx # imm = 0xFF00 jg 0x8dd51 movl 0x14(%rsp), %eax movl $0xff, %ecx addl %ecx, %eax movq 0xd8(%rsp), %rcx movb %ah, (%rcx) andl $0xffffff00, %eax # imm = 0xFFFFFF00 movl %eax, 0x14(%rsp) incq %rcx movq %rcx, 0xd8(%rsp) movslq 0x14(%rsp), %rsi movl $0x1, %edx movq 0x18(%rsp), %rdi movq %r15, %rcx callq 0x35b80 leaq 0x128(%rsp), %rdi callq 0x410b8 movl 0x2c(%rsp), %edx incl %edx movzbl 0x171(%rsp), %eax cmpl %eax, %edx jb 0x8dae0 movl 0x24(%rsp), %ecx incl %ecx movzbl 0x170(%rsp), %eax movl %ecx, 0x24(%rsp) cmpl %eax, %ecx jb 0x8dad0 movb 0x12(%rsp), %al xorb $0x1, %al movq %rax, 0xd0(%rsp) leaq 0x5146a(%rip), %rax # 0xdf740 cmpl $0x0, 0xe8(%rax) jne 0x8e33b testb $0x1, 0xd0(%rsp) jne 0x8e33b movabsq $0xa0d6f666e49, %rax # imm = 0xA0D6F666E49 leaq 0x100(%rsp), %rdi movq %rax, 0x7(%rdi) movabsq $0x492d74657366664f, %rax # imm = 0x492D74657366664F movq %rax, (%rdi) movl $0xf, %esi movl $0x1, %edx movq %r15, %rcx callq 0x35b80 movq 0x50(%rsp), %rdi movq 0x58(%rsp), %rsi subq %rdi, %rsi sarq %rsi movl $0x2, %edx movq %r15, %rcx callq 0x35b80 movq %r15, %rdi xorl %esi, %esi xorl %edx, %edx callq 0x35660 leaq 0x140(%rsp), %rdi movl $0x100, %esi # imm = 0x100 movl $0x1, %edx movq %r15, %rcx callq 0x35b80 testq %rax, %rax je 0x8e4a4 movq %r15, %rdi xorl %esi, %esi movl $0x2, %edx callq 0x35660 movq 0x50(%rsp), %rdi testq %rdi, %rdi je 0x8e390 movq 0x60(%rsp), %rsi subq %rdi, %rsi callq 0x355d0 movq 0x18(%rsp), %rdi callq 0x775ea movb $0x1, %al addq $0x248, %rsp # imm = 0x248 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movl $0x10, %edi callq 0x35260 movq %rax, %r14 leaq 0x23f84(%rip), %rdx # 0xb2346 leaq 0xc8(%rsp), %rsi movq %rax, %rdi callq 0x8f1d2 leaq 0x4d7a7(%rip), %rsi # 0xdbb80 movq 0x4eba0(%rip), %rdx # 0xdcf80 movq %r14, %rdi callq 0x35a50 jmp 0x8e4d6 movl $0x10, %edi callq 0x35260 movq %rax, %r14 leaq 0x70(%rsp), %r9 movl $0xff00, (%r9) # imm = 0xFF00 movb $0x1, %bpl leaq 0x20b90(%rip), %rax # 0xaefa0 movq %rax, (%rsp) leaq 0x24a02(%rip), %rdx # 0xb2e1d leaq 0x23fdc(%rip), %r8 # 0xb23fe leaq 0xc8(%rsp), %rsi leaq 0x14(%rsp), %rcx movq %r14, %rdi callq 0x8f408 xorl %ebp, %ebp leaq 0x4d740(%rip), %rsi # 0xdbb80 movq 0x4eb39(%rip), %rdx # 0xdcf80 movq %r14, %rdi callq 0x35a50 jmp 0x8e4d6 movl $0x10, %edi callq 0x35260 movq %rax, %r14 leaq 0x23eaa(%rip), %rsi # 0xb2312 movq %rax, %rdi callq 0x7100e jmp 0x8e48e movl $0x10, %edi callq 0x35260 movq %rax, %r14 leaq 0x23ea8(%rip), %rsi # 0xb232e movq %rax, %rdi callq 0x5d49e leaq 0x4d6eb(%rip), %rsi # 0xdbb80 movq 0x4eae4(%rip), %rdx # 0xdcf80 movq %r14, %rdi callq 0x35a50 movl $0x10, %edi callq 0x35260 movq %rax, %r14 leaq 0x23f63(%rip), %rsi # 0xb241b movq %rax, %rdi callq 0x8f486 leaq 0x4d6b9(%rip), %rsi # 0xdbb80 movq 0x4eab2(%rip), %rdx # 0xdcf80 movq %r14, %rdi callq 0x35a50 jmp 0x8e4ff jmp 0x8e599 jmp 0x8e4df movq %rax, %rbx movq %r14, %rdi callq 0x35430 jmp 0x8e587 jmp 0x8e4f3 jmp 0x8e533 movq %rax, %rbx jmp 0x8e587 jmp 0x8e533 jmp 0x8e533 movq %rax, %rbx movq %r14, %rdi callq 0x35430 jmp 0x8e570 movq %rax, %rbx testb %bpl, %bpl je 0x8e563 movq %r14, %rdi callq 0x35430 jmp 0x8e563 movq %rax, %rbx leaq 0x98(%rsp), %rdi jmp 0x8e56b jmp 0x8e533 jmp 0x8e54a jmp 0x8e54a jmp 0x8e54a movq %rax, %rbx jmp 0x8e570 jmp 0x8e54a jmp 0x8e54a jmp 0x8e553 jmp 0x8e553 jmp 0x8e553 jmp 0x8e553 jmp 0x8e553 jmp 0x8e553 jmp 0x8e553 movq %rax, %rbx jmp 0x8e563 jmp 0x8e553 jmp 0x8e553 movq %rax, %rbx leaq 0x98(%rsp), %rdi callq 0x410b8 leaq 0x128(%rsp), %rdi callq 0x410b8 movq 0x50(%rsp), %rdi testq %rdi, %rdi je 0x8e587 movq 0x60(%rsp), %rsi subq %rdi, %rsi callq 0x355d0 movq 0x18(%rsp), %rdi callq 0x775ea movq %rbx, %rdi callq 0x35aa0 movq %rax, %rdi callq 0x410ac nop
/simonowen[P]samdisk/src/types/dsk.cpp
util::exception::exception<char const (&) [25], unsigned char&, char const (&) [2]>(char const (&) [25], unsigned char&, char const (&) [2])
explicit exception(Args&& ... args) : std::runtime_error(make_string(std::forward<Args>(args)...)) {}
pushq %r14 pushq %rbx subq $0x28, %rsp movq %rdi, %rbx leaq 0x8(%rsp), %r14 movq %r14, %rdi callq 0x8f5c4 movq %rbx, %rdi movq %r14, %rsi callq 0x35710 leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x8e769 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 leaq 0x4d438(%rip), %rax # 0xdbba8 movq %rax, (%rbx) addq $0x28, %rsp popq %rbx popq %r14 retq movq %rax, %rbx leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x8e799 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 movq %rbx, %rdi callq 0x35aa0 nop
/simonowen[P]samdisk/include/utils.h
util::exception::exception<char const (&) [28], CylHead&>(char const (&) [28], CylHead&)
explicit exception(Args&& ... args) : std::runtime_error(make_string(std::forward<Args>(args)...)) {}
pushq %r14 pushq %rbx subq $0x28, %rsp movq %rdi, %rbx leaq 0x8(%rsp), %r14 movq %r14, %rdi callq 0x8f68d movq %rbx, %rdi movq %r14, %rsi callq 0x35710 leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x8e7df movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 leaq 0x4d3c2(%rip), %rax # 0xdbba8 movq %rax, (%rbx) addq $0x28, %rsp popq %rbx popq %r14 retq movq %rax, %rbx leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x8e80f movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 movq %rbx, %rdi callq 0x35aa0
/simonowen[P]samdisk/include/utils.h
void Message<unsigned char&, unsigned char&, unsigned char&, char const*>(MsgType, char const*, unsigned char&, unsigned char&, unsigned char&, char const*&&)
void Message(MsgType type, const char* pcsz_, Args&& ...args) { std::string msg = util::fmt(pcsz_, std::forward<Args>(args)...); if (type == msgError) throw util::exception(msg); if (type != msgStatus) { if (seen_messages.find(msg) != seen_messages.end()) return; seen_messages.insert(msg); } switch (type) { case msgStatus: break; case msgInfo: util::cout << "Info: "; break; case msgFix: util::cout << colour::GREEN << "Fixed: "; break; case msgWarning: util::cout << colour::YELLOW << "Warning: "; break; case msgError: util::cout << colour::RED << "Error: "; break; } if (type == msgStatus) util::cout << ttycmd::statusbegin << "\r" << msg << ttycmd::statusend; else util::cout << msg << colour::none << '\n'; }
pushq %r14 pushq %rbx subq $0x28, %rsp movl %edi, %ebx movzbl (%rdx), %edx movzbl (%rcx), %ecx movzbl (%r8), %r8d movq (%r9), %r9 leaq 0x8(%rsp), %rdi xorl %eax, %eax callq 0x784cc testl %ebx, %ebx je 0x8e91b cmpl $0x4, %ebx je 0x8e978 leaq 0x515a7(%rip), %r14 # 0xdfdf8 leaq 0x8(%rsp), %rsi movq %r14, %rdi callq 0x418a4 addq $0x8, %r14 cmpq %r14, %rax jne 0x8e955 leaq 0x51586(%rip), %rdi # 0xdfdf8 leaq 0x8(%rsp), %rsi callq 0x4192e cmpl $0x3, %ebx ja 0x8e8ee movl %ebx, %eax leaq 0x23672(%rip), %rcx # 0xb1efc movslq (%rcx,%rax,4), %rax addq %rcx, %rax jmpq *%rax leaq 0x51a16(%rip), %rdi # 0xe02b0 leaq 0x1d4f7(%rip), %rsi # 0xabd98 callq 0x4172b jmp 0x8e8ea leaq 0x51a01(%rip), %rdi # 0xe02b0 movl $0xa0, %esi callq 0x788ea leaq 0x1d4df(%rip), %rsi # 0xabd9f movq %rax, %rdi callq 0x41794 jmp 0x8e8ea leaq 0x519df(%rip), %rdi # 0xe02b0 movl $0xa1, %esi callq 0x788ea leaq 0x1d4c5(%rip), %rsi # 0xabda7 movq %rax, %rdi callq 0x405c6 testl %ebx, %ebx je 0x8e91b leaq 0x519bb(%rip), %rdi # 0xe02b0 leaq 0x8(%rsp), %rsi callq 0x3f60b movq %rax, %rdi xorl %esi, %esi callq 0x788ea leaq 0x7(%rsp), %rsi movb $0xa, (%rsi) movq %rax, %rdi callq 0x409e0 jmp 0x8e955 leaq 0x5198e(%rip), %rdi # 0xe02b0 movl $0x2, %esi callq 0x7897a leaq 0x20530(%rip), %rsi # 0xaee63 movq %rax, %rdi callq 0x38d1e leaq 0x8(%rsp), %rsi movq %rax, %rdi callq 0x3f60b movq %rax, %rdi movl $0x3, %esi callq 0x7897a leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x8e970 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 addq $0x28, %rsp popq %rbx popq %r14 retq movl $0x10, %edi callq 0x35260 movq %rax, %r14 leaq 0x8(%rsp), %rsi movq %rax, %rdi callq 0x416b6 leaq 0x4d1e7(%rip), %rsi # 0xdbb80 movq 0x4e5e0(%rip), %rdx # 0xdcf80 movq %r14, %rdi callq 0x35a50 jmp 0x8e9b9 movq %rax, %rbx movq %r14, %rdi callq 0x35430 jmp 0x8e9bc jmp 0x8e9b9 movq %rax, %rbx leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x8e9d7 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 movq %rbx, %rdi callq 0x35aa0 nop
/simonowen[P]samdisk/include/Util.h
util::exception::exception<char const (&) [20], CylHead&, char const (&) [16]>(char const (&) [20], CylHead&, char const (&) [16])
explicit exception(Args&& ... args) : std::runtime_error(make_string(std::forward<Args>(args)...)) {}
pushq %r14 pushq %rbx subq $0x28, %rsp movq %rdi, %rbx leaq 0x8(%rsp), %r14 movq %r14, %rdi callq 0x8f795 movq %rbx, %rdi movq %r14, %rsi callq 0x35710 leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x8ea1d movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 leaq 0x4d184(%rip), %rax # 0xdbba8 movq %rax, (%rbx) addq $0x28, %rsp popq %rbx popq %r14 retq movq %rax, %rbx leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x8ea4d movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 movq %rbx, %rdi callq 0x35aa0
/simonowen[P]samdisk/include/utils.h
void Message<unsigned char&, unsigned char&, char const*>(MsgType, char const*, unsigned char&, unsigned char&, char const*&&)
void Message(MsgType type, const char* pcsz_, Args&& ...args) { std::string msg = util::fmt(pcsz_, std::forward<Args>(args)...); if (type == msgError) throw util::exception(msg); if (type != msgStatus) { if (seen_messages.find(msg) != seen_messages.end()) return; seen_messages.insert(msg); } switch (type) { case msgStatus: break; case msgInfo: util::cout << "Info: "; break; case msgFix: util::cout << colour::GREEN << "Fixed: "; break; case msgWarning: util::cout << colour::YELLOW << "Warning: "; break; case msgError: util::cout << colour::RED << "Error: "; break; } if (type == msgStatus) util::cout << ttycmd::statusbegin << "\r" << msg << ttycmd::statusend; else util::cout << msg << colour::none << '\n'; }
pushq %r14 pushq %rbx subq $0x28, %rsp movl %edi, %ebx movzbl (%rdx), %edx movzbl (%rcx), %ecx movq (%r8), %r8 leaq 0x8(%rsp), %rdi xorl %eax, %eax callq 0x784cc testl %ebx, %ebx je 0x8eb55 cmpl $0x4, %ebx je 0x8ebb2 leaq 0x5136d(%rip), %r14 # 0xdfdf8 leaq 0x8(%rsp), %rsi movq %r14, %rdi callq 0x418a4 addq $0x8, %r14 cmpq %r14, %rax jne 0x8eb8f leaq 0x5134c(%rip), %rdi # 0xdfdf8 leaq 0x8(%rsp), %rsi callq 0x4192e cmpl $0x3, %ebx ja 0x8eb28 movl %ebx, %eax leaq 0x23448(%rip), %rcx # 0xb1f0c movslq (%rcx,%rax,4), %rax addq %rcx, %rax jmpq *%rax leaq 0x517dc(%rip), %rdi # 0xe02b0 leaq 0x1d2bd(%rip), %rsi # 0xabd98 callq 0x4172b jmp 0x8eb24 leaq 0x517c7(%rip), %rdi # 0xe02b0 movl $0xa0, %esi callq 0x788ea leaq 0x1d2a5(%rip), %rsi # 0xabd9f movq %rax, %rdi callq 0x41794 jmp 0x8eb24 leaq 0x517a5(%rip), %rdi # 0xe02b0 movl $0xa1, %esi callq 0x788ea leaq 0x1d28b(%rip), %rsi # 0xabda7 movq %rax, %rdi callq 0x405c6 testl %ebx, %ebx je 0x8eb55 leaq 0x51781(%rip), %rdi # 0xe02b0 leaq 0x8(%rsp), %rsi callq 0x3f60b movq %rax, %rdi xorl %esi, %esi callq 0x788ea leaq 0x7(%rsp), %rsi movb $0xa, (%rsi) movq %rax, %rdi callq 0x409e0 jmp 0x8eb8f leaq 0x51754(%rip), %rdi # 0xe02b0 movl $0x2, %esi callq 0x7897a leaq 0x202f6(%rip), %rsi # 0xaee63 movq %rax, %rdi callq 0x38d1e leaq 0x8(%rsp), %rsi movq %rax, %rdi callq 0x3f60b movq %rax, %rdi movl $0x3, %esi callq 0x7897a leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x8ebaa movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 addq $0x28, %rsp popq %rbx popq %r14 retq movl $0x10, %edi callq 0x35260 movq %rax, %r14 leaq 0x8(%rsp), %rsi movq %rax, %rdi callq 0x416b6 leaq 0x4cfad(%rip), %rsi # 0xdbb80 movq 0x4e3a6(%rip), %rdx # 0xdcf80 movq %r14, %rdi callq 0x35a50 jmp 0x8ebf3 movq %rax, %rbx movq %r14, %rdi callq 0x35430 jmp 0x8ebf6 jmp 0x8ebf3 movq %rax, %rbx leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x8ec11 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 movq %rbx, %rdi callq 0x35aa0 nop
/simonowen[P]samdisk/include/Util.h
util::exception::exception<char const (&) [20], CylHead&, char const (&) [9], int&>(char const (&) [20], CylHead&, char const (&) [9], int&)
explicit exception(Args&& ... args) : std::runtime_error(make_string(std::forward<Args>(args)...)) {}
pushq %r14 pushq %rbx subq $0x28, %rsp movq %rdi, %rbx leaq 0x8(%rsp), %r14 movq %r14, %rdi callq 0x8f8bf movq %rbx, %rdi movq %r14, %rsi callq 0x35710 leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x8ec57 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 leaq 0x4cf4a(%rip), %rax # 0xdbba8 movq %rax, (%rbx) addq $0x28, %rsp popq %rbx popq %r14 retq movq %rax, %rbx leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x8ec87 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 movq %rbx, %rdi callq 0x35aa0
/simonowen[P]samdisk/include/utils.h
void Message<char const*, int, int&>(MsgType, char const*, char const*&&, int&&, int&)
void Message(MsgType type, const char* pcsz_, Args&& ...args) { std::string msg = util::fmt(pcsz_, std::forward<Args>(args)...); if (type == msgError) throw util::exception(msg); if (type != msgStatus) { if (seen_messages.find(msg) != seen_messages.end()) return; seen_messages.insert(msg); } switch (type) { case msgStatus: break; case msgInfo: util::cout << "Info: "; break; case msgFix: util::cout << colour::GREEN << "Fixed: "; break; case msgWarning: util::cout << colour::YELLOW << "Warning: "; break; case msgError: util::cout << colour::RED << "Error: "; break; } if (type == msgStatus) util::cout << ttycmd::statusbegin << "\r" << msg << ttycmd::statusend; else util::cout << msg << colour::none << '\n'; }
pushq %r14 pushq %rbx subq $0x28, %rsp movl %edi, %ebx movq (%rdx), %rdx movl (%rcx), %ecx movl (%r8), %r8d leaq 0x8(%rsp), %rdi xorl %eax, %eax callq 0x784cc testl %ebx, %ebx je 0x8ed8e cmpl $0x4, %ebx je 0x8edeb leaq 0x51134(%rip), %r14 # 0xdfdf8 leaq 0x8(%rsp), %rsi movq %r14, %rdi callq 0x418a4 addq $0x8, %r14 cmpq %r14, %rax jne 0x8edc8 leaq 0x51113(%rip), %rdi # 0xdfdf8 leaq 0x8(%rsp), %rsi callq 0x4192e cmpl $0x3, %ebx ja 0x8ed61 movl %ebx, %eax leaq 0x2321f(%rip), %rcx # 0xb1f1c movslq (%rcx,%rax,4), %rax addq %rcx, %rax jmpq *%rax leaq 0x515a3(%rip), %rdi # 0xe02b0 leaq 0x1d084(%rip), %rsi # 0xabd98 callq 0x4172b jmp 0x8ed5d leaq 0x5158e(%rip), %rdi # 0xe02b0 movl $0xa0, %esi callq 0x788ea leaq 0x1d06c(%rip), %rsi # 0xabd9f movq %rax, %rdi callq 0x41794 jmp 0x8ed5d leaq 0x5156c(%rip), %rdi # 0xe02b0 movl $0xa1, %esi callq 0x788ea leaq 0x1d052(%rip), %rsi # 0xabda7 movq %rax, %rdi callq 0x405c6 testl %ebx, %ebx je 0x8ed8e leaq 0x51548(%rip), %rdi # 0xe02b0 leaq 0x8(%rsp), %rsi callq 0x3f60b movq %rax, %rdi xorl %esi, %esi callq 0x788ea leaq 0x7(%rsp), %rsi movb $0xa, (%rsi) movq %rax, %rdi callq 0x409e0 jmp 0x8edc8 leaq 0x5151b(%rip), %rdi # 0xe02b0 movl $0x2, %esi callq 0x7897a leaq 0x200bd(%rip), %rsi # 0xaee63 movq %rax, %rdi callq 0x38d1e leaq 0x8(%rsp), %rsi movq %rax, %rdi callq 0x3f60b movq %rax, %rdi movl $0x3, %esi callq 0x7897a leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x8ede3 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 addq $0x28, %rsp popq %rbx popq %r14 retq movl $0x10, %edi callq 0x35260 movq %rax, %r14 leaq 0x8(%rsp), %rsi movq %rax, %rdi callq 0x416b6 leaq 0x4cd74(%rip), %rsi # 0xdbb80 movq 0x4e16d(%rip), %rdx # 0xdcf80 movq %r14, %rdi callq 0x35a50 jmp 0x8ee2c movq %rax, %rbx movq %r14, %rdi callq 0x35430 jmp 0x8ee2f jmp 0x8ee2c movq %rax, %rbx leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x8ee4a movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 movq %rbx, %rdi callq 0x35aa0
/simonowen[P]samdisk/include/Util.h
void Message<unsigned long&, unsigned char const&>(MsgType, char const*, unsigned long&, unsigned char const&)
void Message(MsgType type, const char* pcsz_, Args&& ...args) { std::string msg = util::fmt(pcsz_, std::forward<Args>(args)...); if (type == msgError) throw util::exception(msg); if (type != msgStatus) { if (seen_messages.find(msg) != seen_messages.end()) return; seen_messages.insert(msg); } switch (type) { case msgStatus: break; case msgInfo: util::cout << "Info: "; break; case msgFix: util::cout << colour::GREEN << "Fixed: "; break; case msgWarning: util::cout << colour::YELLOW << "Warning: "; break; case msgError: util::cout << colour::RED << "Error: "; break; } if (type == msgStatus) util::cout << ttycmd::statusbegin << "\r" << msg << ttycmd::statusend; else util::cout << msg << colour::none << '\n'; }
pushq %r14 pushq %rbx subq $0x28, %rsp movl %edi, %ebx movq (%rdx), %rdx movzbl (%rcx), %ecx leaq 0x8(%rsp), %rdi xorl %eax, %eax callq 0x784cc testl %ebx, %ebx je 0x8ef4f cmpl $0x4, %ebx je 0x8efac leaq 0x50f73(%rip), %r14 # 0xdfdf8 leaq 0x8(%rsp), %rsi movq %r14, %rdi callq 0x418a4 addq $0x8, %r14 cmpq %r14, %rax jne 0x8ef89 leaq 0x50f52(%rip), %rdi # 0xdfdf8 leaq 0x8(%rsp), %rsi callq 0x4192e cmpl $0x3, %ebx ja 0x8ef22 movl %ebx, %eax leaq 0x2306e(%rip), %rcx # 0xb1f2c movslq (%rcx,%rax,4), %rax addq %rcx, %rax jmpq *%rax leaq 0x513e2(%rip), %rdi # 0xe02b0 leaq 0x1cec3(%rip), %rsi # 0xabd98 callq 0x4172b jmp 0x8ef1e leaq 0x513cd(%rip), %rdi # 0xe02b0 movl $0xa0, %esi callq 0x788ea leaq 0x1ceab(%rip), %rsi # 0xabd9f movq %rax, %rdi callq 0x41794 jmp 0x8ef1e leaq 0x513ab(%rip), %rdi # 0xe02b0 movl $0xa1, %esi callq 0x788ea leaq 0x1ce91(%rip), %rsi # 0xabda7 movq %rax, %rdi callq 0x405c6 testl %ebx, %ebx je 0x8ef4f leaq 0x51387(%rip), %rdi # 0xe02b0 leaq 0x8(%rsp), %rsi callq 0x3f60b movq %rax, %rdi xorl %esi, %esi callq 0x788ea leaq 0x7(%rsp), %rsi movb $0xa, (%rsi) movq %rax, %rdi callq 0x409e0 jmp 0x8ef89 leaq 0x5135a(%rip), %rdi # 0xe02b0 movl $0x2, %esi callq 0x7897a leaq 0x1fefc(%rip), %rsi # 0xaee63 movq %rax, %rdi callq 0x38d1e leaq 0x8(%rsp), %rsi movq %rax, %rdi callq 0x3f60b movq %rax, %rdi movl $0x3, %esi callq 0x7897a leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x8efa4 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 addq $0x28, %rsp popq %rbx popq %r14 retq movl $0x10, %edi callq 0x35260 movq %rax, %r14 leaq 0x8(%rsp), %rsi movq %rax, %rdi callq 0x416b6 leaq 0x4cbb3(%rip), %rsi # 0xdbb80 movq 0x4dfac(%rip), %rdx # 0xdcf80 movq %r14, %rdi callq 0x35a50 jmp 0x8efed movq %rax, %rbx movq %r14, %rdi callq 0x35430 jmp 0x8eff0 jmp 0x8efed movq %rax, %rbx leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x8f00b movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 movq %rbx, %rdi callq 0x35aa0
/simonowen[P]samdisk/include/Util.h
void Message<unsigned long&>(MsgType, char const*, unsigned long&)
void Message(MsgType type, const char* pcsz_, Args&& ...args) { std::string msg = util::fmt(pcsz_, std::forward<Args>(args)...); if (type == msgError) throw util::exception(msg); if (type != msgStatus) { if (seen_messages.find(msg) != seen_messages.end()) return; seen_messages.insert(msg); } switch (type) { case msgStatus: break; case msgInfo: util::cout << "Info: "; break; case msgFix: util::cout << colour::GREEN << "Fixed: "; break; case msgWarning: util::cout << colour::YELLOW << "Warning: "; break; case msgError: util::cout << colour::RED << "Error: "; break; } if (type == msgStatus) util::cout << ttycmd::statusbegin << "\r" << msg << ttycmd::statusend; else util::cout << msg << colour::none << '\n'; }
pushq %r14 pushq %rbx subq $0x28, %rsp movl %edi, %ebx movq (%rdx), %rdx leaq 0x8(%rsp), %rdi xorl %eax, %eax callq 0x784cc testl %ebx, %ebx je 0x8f10d cmpl $0x4, %ebx je 0x8f16a leaq 0x50db5(%rip), %r14 # 0xdfdf8 leaq 0x8(%rsp), %rsi movq %r14, %rdi callq 0x418a4 addq $0x8, %r14 cmpq %r14, %rax jne 0x8f147 leaq 0x50d94(%rip), %rdi # 0xdfdf8 leaq 0x8(%rsp), %rsi callq 0x4192e cmpl $0x3, %ebx ja 0x8f0e0 movl %ebx, %eax leaq 0x22ec0(%rip), %rcx # 0xb1f3c movslq (%rcx,%rax,4), %rax addq %rcx, %rax jmpq *%rax leaq 0x51224(%rip), %rdi # 0xe02b0 leaq 0x1cd05(%rip), %rsi # 0xabd98 callq 0x4172b jmp 0x8f0dc leaq 0x5120f(%rip), %rdi # 0xe02b0 movl $0xa0, %esi callq 0x788ea leaq 0x1cced(%rip), %rsi # 0xabd9f movq %rax, %rdi callq 0x41794 jmp 0x8f0dc leaq 0x511ed(%rip), %rdi # 0xe02b0 movl $0xa1, %esi callq 0x788ea leaq 0x1ccd3(%rip), %rsi # 0xabda7 movq %rax, %rdi callq 0x405c6 testl %ebx, %ebx je 0x8f10d leaq 0x511c9(%rip), %rdi # 0xe02b0 leaq 0x8(%rsp), %rsi callq 0x3f60b movq %rax, %rdi xorl %esi, %esi callq 0x788ea leaq 0x7(%rsp), %rsi movb $0xa, (%rsi) movq %rax, %rdi callq 0x409e0 jmp 0x8f147 leaq 0x5119c(%rip), %rdi # 0xe02b0 movl $0x2, %esi callq 0x7897a leaq 0x1fd3e(%rip), %rsi # 0xaee63 movq %rax, %rdi callq 0x38d1e leaq 0x8(%rsp), %rsi movq %rax, %rdi callq 0x3f60b movq %rax, %rdi movl $0x3, %esi callq 0x7897a leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x8f162 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 addq $0x28, %rsp popq %rbx popq %r14 retq movl $0x10, %edi callq 0x35260 movq %rax, %r14 leaq 0x8(%rsp), %rsi movq %rax, %rdi callq 0x416b6 leaq 0x4c9f5(%rip), %rsi # 0xdbb80 movq 0x4ddee(%rip), %rdx # 0xdcf80 movq %r14, %rdi callq 0x35a50 jmp 0x8f1ab movq %rax, %rbx movq %r14, %rdi callq 0x35430 jmp 0x8f1ae jmp 0x8f1ab movq %rax, %rbx leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x8f1c9 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 movq %rbx, %rdi callq 0x35aa0 nop
/simonowen[P]samdisk/include/Util.h
util::exception::exception<CylHead&, char const (&) [46]>(CylHead&, char const (&) [46])
explicit exception(Args&& ... args) : std::runtime_error(make_string(std::forward<Args>(args)...)) {}
pushq %r14 pushq %rbx subq $0x28, %rsp movq %rdi, %rbx leaq 0x8(%rsp), %r14 movq %r14, %rdi callq 0x8f9fa movq %rbx, %rdi movq %r14, %rsi callq 0x35710 leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x8f20f movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 leaq 0x4c992(%rip), %rax # 0xdbba8 movq %rax, (%rbx) addq $0x28, %rsp popq %rbx popq %r14 retq movq %rax, %rbx leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x8f23f movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 movq %rbx, %rdi callq 0x35aa0
/simonowen[P]samdisk/include/utils.h
util::exception::exception<CylHead&, char const (&) [8], int&, char const (&) [29], int, char const (&) [2]>(CylHead&, char const (&) [8], int&, char const (&) [29], int&&, char const (&) [2])
explicit exception(Args&& ... args) : std::runtime_error(make_string(std::forward<Args>(args)...)) {}
pushq %r14 pushq %rbx subq $0x28, %rsp movq %rdi, %rbx movq 0x40(%rsp), %rax movq %rax, (%rsp) leaq 0x8(%rsp), %r14 movq %r14, %rdi callq 0x8fb00 movq %rbx, %rdi movq %r14, %rsi callq 0x35710 leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x8f44e movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 leaq 0x4c753(%rip), %rax # 0xdbba8 movq %rax, (%rbx) addq $0x28, %rsp popq %rbx popq %r14 retq movq %rax, %rbx leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x8f47e movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 movq %rbx, %rdi callq 0x35aa0
/simonowen[P]samdisk/include/utils.h
util::exception::exception<char const (&) [12]>(char const (&) [12])
explicit exception(Args&& ... args) : std::runtime_error(make_string(std::forward<Args>(args)...)) {}
pushq %r14 pushq %rbx subq $0x28, %rsp movq %rdi, %rbx leaq 0x8(%rsp), %r14 movq %r14, %rdi callq 0x8fc68 movq %rbx, %rdi movq %r14, %rsi callq 0x35710 leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x8f4c3 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 leaq 0x4c6de(%rip), %rax # 0xdbba8 movq %rax, (%rbx) addq $0x28, %rsp popq %rbx popq %r14 retq movq %rax, %rbx leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x8f4f3 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 movq %rbx, %rdi callq 0x35aa0
/simonowen[P]samdisk/include/utils.h
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> util::make_string<char const (&) [28], CylHead&>(char const (&) [28], CylHead&)
std::string make_string(Args&& ... args) { std::ostringstream ss; (void)std::initializer_list<bool> {(ss << args, false)...}; return ss.str(); }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x198, %rsp # imm = 0x198 movq %rdx, %r14 movq %rsi, %r15 movq %rdi, %rbx leaq 0x20(%rsp), %r12 movq %r12, %rdi callq 0x35760 movq %r15, %rdi callq 0x35210 movq %r12, %rdi movq %r15, %rsi movq %rax, %rdx callq 0x356a0 movl (%r14), %edx movl 0x4(%r14), %ecx leaq 0x1c706(%rip), %rsi # 0xabddb movq %rsp, %rdi xorl %eax, %eax callq 0x784cc movq (%rsp), %rsi movq 0x8(%rsp), %rdx leaq 0x20(%rsp), %rdi callq 0x356a0 leaq 0x10(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x8f70d movq 0x10(%rsp), %rsi incq %rsi callq 0x355d0 leaq 0x28(%rsp), %rsi movq %rbx, %rdi callq 0x35920 movq 0x4d857(%rip), %rsi # 0xdcf78 leaq 0x20(%rsp), %rdi callq 0x352b0 leaq 0x90(%rsp), %rdi callq 0x35180 movq %rbx, %rax addq $0x198, %rsp # imm = 0x198 popq %rbx popq %r12 popq %r14 popq %r15 retq jmp 0x8f76c movq %rax, %rbx leaq 0x10(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x8f76f movq 0x10(%rsp), %rsi incq %rsi callq 0x355d0 jmp 0x8f76f movq %rax, %rbx movq 0x4d802(%rip), %rsi # 0xdcf78 leaq 0x20(%rsp), %rdi callq 0x352b0 leaq 0x90(%rsp), %rdi callq 0x35180 movq %rbx, %rdi callq 0x35aa0
/simonowen[P]samdisk/include/utils.h
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> util::make_string<char const (&) [20], CylHead&, char const (&) [16]>(char const (&) [20], CylHead&, char const (&) [16])
std::string make_string(Args&& ... args) { std::ostringstream ss; (void)std::initializer_list<bool> {(ss << args, false)...}; return ss.str(); }
pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x1a0, %rsp # imm = 0x1A0 movq %rcx, %r14 movq %rdx, %r15 movq %rsi, %r12 movq %rdi, %rbx leaq 0x28(%rsp), %r13 movq %r13, %rdi callq 0x35760 movq %r12, %rdi callq 0x35210 movq %r13, %rdi movq %r12, %rsi movq %rax, %rdx callq 0x356a0 movl (%r15), %edx movl 0x4(%r15), %ecx leaq 0x1c5f9(%rip), %rsi # 0xabddb leaq 0x8(%rsp), %rdi xorl %eax, %eax callq 0x784cc movq 0x8(%rsp), %rsi movq 0x10(%rsp), %rdx leaq 0x28(%rsp), %rdi callq 0x356a0 leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x8f81d movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 movq %r14, %rdi callq 0x35210 leaq 0x28(%rsp), %rdi movq %r14, %rsi movq %rax, %rdx callq 0x356a0 leaq 0x30(%rsp), %rsi movq %rbx, %rdi callq 0x35920 movq 0x4d72f(%rip), %rsi # 0xdcf78 leaq 0x28(%rsp), %rdi callq 0x352b0 leaq 0x98(%rsp), %rdi callq 0x35180 movq %rbx, %rax addq $0x1a0, %rsp # imm = 0x1A0 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 retq jmp 0x8f896 movq %rax, %rbx leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x8f899 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 jmp 0x8f899 movq %rax, %rbx movq 0x4d6d8(%rip), %rsi # 0xdcf78 leaq 0x28(%rsp), %rdi callq 0x352b0 leaq 0x98(%rsp), %rdi callq 0x35180 movq %rbx, %rdi callq 0x35aa0
/simonowen[P]samdisk/include/utils.h
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> util::make_string<char const (&) [20], CylHead&, char const (&) [9], int&>(char const (&) [20], CylHead&, char const (&) [9], int&)
std::string make_string(Args&& ... args) { std::ostringstream ss; (void)std::initializer_list<bool> {(ss << args, false)...}; return ss.str(); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x198, %rsp # imm = 0x198 movq %r8, %r14 movq %rcx, %r15 movq %rdx, %r12 movq %rsi, %r13 movq %rdi, %rbx leaq 0x20(%rsp), %rbp movq %rbp, %rdi callq 0x35760 movq %r13, %rdi callq 0x35210 movq %rbp, %rdi movq %r13, %rsi movq %rax, %rdx callq 0x356a0 movl (%r12), %edx movl 0x4(%r12), %ecx leaq 0x1c4c9(%rip), %rsi # 0xabddb movq %rsp, %rdi xorl %eax, %eax callq 0x784cc movq (%rsp), %rsi movq 0x8(%rsp), %rdx leaq 0x20(%rsp), %rdi callq 0x356a0 leaq 0x10(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x8f94a movq 0x10(%rsp), %rsi incq %rsi callq 0x355d0 movq %r15, %rdi callq 0x35210 leaq 0x20(%rsp), %rdi movq %r15, %rsi movq %rax, %rdx callq 0x356a0 movl (%r14), %esi leaq 0x20(%rsp), %rdi callq 0x35a80 leaq 0x28(%rsp), %rsi movq %rbx, %rdi callq 0x35920 movq 0x4d5f5(%rip), %rsi # 0xdcf78 leaq 0x20(%rsp), %rdi callq 0x352b0 leaq 0x90(%rsp), %rdi callq 0x35180 movq %rbx, %rax addq $0x198, %rsp # imm = 0x198 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq jmp 0x8f9d1 movq %rax, %rbx leaq 0x10(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x8f9d4 movq 0x10(%rsp), %rsi incq %rsi callq 0x355d0 jmp 0x8f9d4 movq %rax, %rbx movq 0x4d59d(%rip), %rsi # 0xdcf78 leaq 0x20(%rsp), %rdi callq 0x352b0 leaq 0x90(%rsp), %rdi callq 0x35180 movq %rbx, %rdi callq 0x35aa0
/simonowen[P]samdisk/include/utils.h
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> util::make_string<CylHead&, char const (&) [46]>(CylHead&, char const (&) [46])
std::string make_string(Args&& ... args) { std::ostringstream ss; (void)std::initializer_list<bool> {(ss << args, false)...}; return ss.str(); }
pushq %r15 pushq %r14 pushq %rbx subq $0x1a0, %rsp # imm = 0x1A0 movq %rdx, %r14 movq %rsi, %r15 movq %rdi, %rbx leaq 0x28(%rsp), %rdi callq 0x35760 movl (%r15), %edx movl 0x4(%r15), %ecx leaq 0x1c3b4(%rip), %rsi # 0xabddb leaq 0x8(%rsp), %rdi xorl %eax, %eax callq 0x784cc movq 0x8(%rsp), %rsi movq 0x10(%rsp), %rdx leaq 0x28(%rsp), %rdi callq 0x356a0 leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x8fa62 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 movq %r14, %rdi callq 0x35210 leaq 0x28(%rsp), %rdi movq %r14, %rsi movq %rax, %rdx callq 0x356a0 leaq 0x30(%rsp), %rsi movq %rbx, %rdi callq 0x35920 movq 0x4d4ea(%rip), %rsi # 0xdcf78 leaq 0x28(%rsp), %rdi callq 0x352b0 leaq 0x98(%rsp), %rdi callq 0x35180 movq %rbx, %rax addq $0x1a0, %rsp # imm = 0x1A0 popq %rbx popq %r14 popq %r15 retq jmp 0x8fad7 movq %rax, %rbx leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x8fada movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 jmp 0x8fada movq %rax, %rbx movq 0x4d497(%rip), %rsi # 0xdcf78 leaq 0x28(%rsp), %rdi callq 0x352b0 leaq 0x98(%rsp), %rdi callq 0x35180 movq %rbx, %rdi callq 0x35aa0
/simonowen[P]samdisk/include/utils.h
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> util::make_string<CylHead&, char const (&) [8], int&, char const (&) [29], int, char const (&) [2]>(CylHead&, char const (&) [8], int&, char const (&) [29], int&&, char const (&) [2])
std::string make_string(Args&& ... args) { std::ostringstream ss; (void)std::initializer_list<bool> {(ss << args, false)...}; return ss.str(); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x198, %rsp # imm = 0x198 movq %r9, %r14 movq %r8, %r15 movq %rcx, %r12 movq %rdx, %r13 movq %rsi, %rbp movq %rdi, %rbx leaq 0x20(%rsp), %rdi callq 0x35760 movl (%rbp), %edx movl 0x4(%rbp), %ecx leaq 0x1c2a1(%rip), %rsi # 0xabddb movq %rsp, %rdi xorl %eax, %eax callq 0x784cc movq (%rsp), %rsi movq 0x8(%rsp), %rdx leaq 0x20(%rsp), %rdi callq 0x356a0 leaq 0x10(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x8fb72 movq 0x10(%rsp), %rsi incq %rsi callq 0x355d0 movq %r13, %rdi callq 0x35210 leaq 0x20(%rsp), %rdi movq %r13, %rsi movq %rax, %rdx callq 0x356a0 movl (%r12), %esi leaq 0x20(%rsp), %rdi callq 0x35a80 movq %r15, %rdi callq 0x35210 leaq 0x20(%rsp), %rdi movq %r15, %rsi movq %rax, %rdx callq 0x356a0 movl (%r14), %esi leaq 0x20(%rsp), %rdi callq 0x35a80 movq 0x1d0(%rsp), %r14 movq %r14, %rdi callq 0x35210 leaq 0x20(%rsp), %rdi movq %r14, %rsi movq %rax, %rdx callq 0x356a0 leaq 0x28(%rsp), %rsi movq %rbx, %rdi callq 0x35920 movq 0x4d387(%rip), %rsi # 0xdcf78 leaq 0x20(%rsp), %rdi callq 0x352b0 leaq 0x90(%rsp), %rdi callq 0x35180 movq %rbx, %rax addq $0x198, %rsp # imm = 0x198 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq jmp 0x8fc3f movq %rax, %rbx leaq 0x10(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x8fc42 movq 0x10(%rsp), %rsi incq %rsi callq 0x355d0 jmp 0x8fc42 movq %rax, %rbx movq 0x4d32f(%rip), %rsi # 0xdcf78 leaq 0x20(%rsp), %rdi callq 0x352b0 leaq 0x90(%rsp), %rdi callq 0x35180 movq %rbx, %rdi callq 0x35aa0
/simonowen[P]samdisk/include/utils.h
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> util::make_string<char const (&) [12]>(char const (&) [12])
std::string make_string(Args&& ... args) { std::ostringstream ss; (void)std::initializer_list<bool> {(ss << args, false)...}; return ss.str(); }
pushq %r15 pushq %r14 pushq %rbx subq $0x180, %rsp # imm = 0x180 movq %rsi, %r14 movq %rdi, %rbx leaq 0x8(%rsp), %r15 movq %r15, %rdi callq 0x35760 movq %r14, %rdi callq 0x35210 movq %r15, %rdi movq %r14, %rsi movq %rax, %rdx callq 0x356a0 leaq 0x10(%rsp), %rsi movq %rbx, %rdi callq 0x35920 movq 0x4d2c7(%rip), %rsi # 0xdcf78 leaq 0x8(%rsp), %rdi callq 0x352b0 leaq 0x78(%rsp), %rdi callq 0x35180 movq %rbx, %rax addq $0x180, %rsp # imm = 0x180 popq %rbx popq %r14 popq %r15 retq jmp 0x8fcd7 movq %rax, %rbx movq 0x4d297(%rip), %rsi # 0xdcf78 leaq 0x8(%rsp), %rdi callq 0x352b0 leaq 0x78(%rsp), %rdi callq 0x35180 movq %rbx, %rdi callq 0x35aa0 nopl (%rax)
/simonowen[P]samdisk/include/utils.h
ReadDTI(MemFile&, std::shared_ptr<Disk>&)
bool ReadDTI(MemFile& file, std::shared_ptr<Disk>& disk) { file.rewind(); DTI_HEADER dh; if (!file.read(&dh, sizeof(dh)) || memcmp(dh.abSignature, DTI_SIGNATURE, sizeof(dh.abSignature))) return false; Format::Validate(dh.bTracks, dh.bSides); auto uBlock = (dh.bBlockHigh << 8) | dh.bBlockLow; if (uBlock != DTI_BLOCK_SIZE) throw util::exception("unsupported track block size (", uBlock, ")"); MEMORY mem(uBlock); for (uint8_t head = 0; head < dh.bSides; head++) { for (uint8_t cyl = 0; cyl < dh.bTracks; cyl++) { CylHead cylhead(cyl, head); if (!file.read(mem, uBlock)) throw util::exception("short file reading %s", cylhead); uint8_t flags = mem[0]; auto uDataLen = (mem[2] << 8) | mem[1]; if (uDataLen > uBlock - static_cast<int>(sizeof(DTI_TRACK))) throw util::exception("invalid data length (", uDataLen, ") on ", cylhead); Track track(1); if (uDataLen) { bool bad_data_crc = (flags & 1) != 0; Sector sector(DataRate::_250K, Encoding::Ace, Header(cylhead, 0, SizeToCode(4096))); Data data(mem.pb + 2, mem.pb + 2 + uDataLen); sector.add(std::move(data), bad_data_crc); track.add(std::move(sector)); } disk->write(cylhead, std::move(track)); } } disk->strType = "DTI"; return true; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0xb8, %rsp movq %rsi, 0x28(%rsp) movq %rdi, %rbx callq 0x64db2 leaq 0xc(%rsp), %rsi movq %rbx, 0x38(%rsp) movq %rbx, %rdi movl $0x8, %edx callq 0x64d0c testb %al, %al je 0x8fd43 cmpl $0x32473248, 0xc(%rsp) # imm = 0x32473248 je 0x8fd57 xorl %eax, %eax addq $0xb8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movzbl 0x10(%rsp), %edi movzbl 0x11(%rsp), %esi movl $0x1, %edx movl $0x200, %ecx # imm = 0x200 xorl %r8d, %r8d callq 0x5e8ce movzwl 0x12(%rsp), %edi movl %edi, 0x18(%rsp) cmpl $0x900, %edi # imm = 0x900 jne 0x8ffa7 callq 0x77560 movq %rax, %rbx cmpb $0x0, 0x11(%rsp) je 0x8fef5 movq %rbx, %rax addq $0x2, %rax movq %rax, 0x30(%rsp) xorl %ebp, %ebp leaq 0x58(%rsp), %r14 cmpb $0x0, 0x10(%rsp) je 0x8fee6 xorl %r12d, %r12d leaq 0x20(%rsp), %rdi movl %r12d, %esi movl %ebp, %edx callq 0x46fa2 movl 0x18(%rsp), %edx movq 0x38(%rsp), %rdi movq %rbx, %rsi callq 0x64d0c testb %al, %al je 0x8ff70 movb (%rbx), %r15b movzwl 0x1(%rbx), %eax movl %eax, 0x14(%rsp) movl 0x18(%rsp), %ecx addl $-0x3, %ecx cmpl %ecx, %eax jg 0x8ff2b movq %r14, %rdi movl $0x1, %esi callq 0x713b8 cmpl $0x0, 0x14(%rsp) je 0x8feb6 movl $0x1000, %edi # imm = 0x1000 callq 0x77ea2 leaq 0x40(%rsp), %r13 movq %r13, %rdi leaq 0x20(%rsp), %rsi xorl %edx, %edx movl %eax, %ecx callq 0x60760 leaq 0x78(%rsp), %rdi movl $0x3d090, %esi # imm = 0x3D090 movl $0x6, %edx movq %r13, %rcx xorl %r8d, %r8d callq 0x6bb84 movslq 0x14(%rsp), %rdx movq 0x30(%rsp), %rsi addq %rsi, %rdx movq %r13, %rdi leaq 0x1f(%rsp), %rcx callq 0x7b334 andb $0x1, %r15b movzbl %r15b, %edx leaq 0x78(%rsp), %r15 movq %r15, %rdi movq %r13, %rsi movl $0xfb, %ecx callq 0x6bd6c movq %r14, %rdi movq %r15, %rsi callq 0x71b18 movq 0x40(%rsp), %rdi testq %rdi, %rdi je 0x8fea9 movq 0x50(%rsp), %rsi subq %rdi, %rsi callq 0x355d0 leaq 0xa0(%rsp), %rdi callq 0x410b8 movq 0x28(%rsp), %rax movq (%rax), %rdi leaq 0x20(%rsp), %rsi movq %r14, %rdx callq 0x54f3a leaq 0x60(%rsp), %rdi callq 0x4106a incl %r12d movzbl 0x10(%rsp), %eax cmpl %eax, %r12d jb 0x8fdbc incl %ebp movzbl 0x11(%rsp), %eax cmpl %eax, %ebp jb 0x8fdae movq 0x28(%rsp), %rax movq (%rax), %rdi movq 0x80(%rdi), %rdx addq $0x78, %rdi leaq 0x20dbf(%rip), %rcx # 0xb0cce movl $0x3, %r8d xorl %esi, %esi callq 0x358f0 movq %rbx, %rdi callq 0x775ea movb $0x1, %al jmp 0x8fd45 movl $0x10, %edi callq 0x35260 movq %rax, %r15 leaq 0x22549(%rip), %rsi # 0xb2488 leaq 0x21c18(%rip), %rcx # 0xb1b5e leaq 0x14(%rsp), %rdx leaq 0x20(%rsp), %r8 movq %rax, %rdi callq 0x904b4 leaq 0x4bc21(%rip), %rsi # 0xdbb80 movq 0x4d01a(%rip), %rdx # 0xdcf80 movq %r15, %rdi callq 0x35a50 jmp 0x8ffa7 movl $0x10, %edi callq 0x35260 movq %rax, %r15 leaq 0x21dd3(%rip), %rsi # 0xb1d57 leaq 0x20(%rsp), %rdx movq %rax, %rdi callq 0x9043e leaq 0x4bbe8(%rip), %rsi # 0xdbb80 movq 0x4cfe1(%rip), %rdx # 0xdcf80 movq %r15, %rdi callq 0x35a50 movl $0x10, %edi callq 0x35260 movq %rax, %rbx leaq 0x224ae(%rip), %rsi # 0xb2469 leaq 0x1efde(%rip), %rcx # 0xaefa0 leaq 0x18(%rsp), %rdx movq %rax, %rdi callq 0x903c8 leaq 0x4bbaa(%rip), %rsi # 0xdbb80 movq 0x4cfa3(%rip), %rdx # 0xdcf80 movq %rbx, %rdi callq 0x35a50 movq %rax, %r14 movq %rbx, %rdi callq 0x35430 jmp 0x90055 jmp 0x9005d jmp 0x90010 jmp 0x90010 jmp 0x8fffc jmp 0x90010 movq %rax, %r14 movq %r15, %rdi callq 0x35430 jmp 0x9004d movq %rax, %r14 jmp 0x90031 jmp 0x90010 movq %rax, %r14 jmp 0x9004d jmp 0x90040 movq %rax, %r14 movq 0x40(%rsp), %rdi testq %rdi, %rdi je 0x90031 movq 0x50(%rsp), %rsi subq %rdi, %rsi callq 0x355d0 leaq 0xa0(%rsp), %rdi callq 0x410b8 jmp 0x90043 movq %rax, %r14 leaq 0x60(%rsp), %rdi callq 0x4106a movq %rbx, %rdi callq 0x775ea movq %r14, %rdi callq 0x35aa0 movq %rax, %rdi callq 0x410ac
/simonowen[P]samdisk/src/types/dti.cpp
util::exception::exception<char const (&) [31], int&, char const (&) [2]>(char const (&) [31], int&, char const (&) [2])
explicit exception(Args&& ... args) : std::runtime_error(make_string(std::forward<Args>(args)...)) {}
pushq %r14 pushq %rbx subq $0x28, %rsp movq %rdi, %rbx leaq 0x8(%rsp), %r14 movq %r14, %rdi callq 0x9059f movq %rbx, %rdi movq %r14, %rsi callq 0x35710 leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x90405 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 leaq 0x4b79c(%rip), %rax # 0xdbba8 movq %rax, (%rbx) addq $0x28, %rsp popq %rbx popq %r14 retq movq %rax, %rbx leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x90435 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 movq %rbx, %rdi callq 0x35aa0 nop
/simonowen[P]samdisk/include/utils.h
util::exception::exception<char const (&) [22], CylHead&>(char const (&) [22], CylHead&)
explicit exception(Args&& ... args) : std::runtime_error(make_string(std::forward<Args>(args)...)) {}
pushq %r14 pushq %rbx subq $0x28, %rsp movq %rdi, %rbx leaq 0x8(%rsp), %r14 movq %r14, %rdi callq 0x90667 movq %rbx, %rdi movq %r14, %rsi callq 0x35710 leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x9047b movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 leaq 0x4b726(%rip), %rax # 0xdbba8 movq %rax, (%rbx) addq $0x28, %rsp popq %rbx popq %r14 retq movq %rax, %rbx leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x904ab movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 movq %rbx, %rdi callq 0x35aa0 nop
/simonowen[P]samdisk/include/utils.h
util::exception::exception<char const (&) [22], int&, char const (&) [6], CylHead&>(char const (&) [22], int&, char const (&) [6], CylHead&)
explicit exception(Args&& ... args) : std::runtime_error(make_string(std::forward<Args>(args)...)) {}
pushq %r14 pushq %rbx subq $0x28, %rsp movq %rdi, %rbx leaq 0x8(%rsp), %r14 movq %r14, %rdi callq 0x9076f movq %rbx, %rdi movq %r14, %rsi callq 0x35710 leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x904f1 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 leaq 0x4b6b0(%rip), %rax # 0xdbba8 movq %rax, (%rbx) addq $0x28, %rsp popq %rbx popq %r14 retq movq %rax, %rbx leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x90521 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 movq %rbx, %rdi callq 0x35aa0 nop
/simonowen[P]samdisk/include/utils.h
util::exception::exception<char const (&) [35], char&, char const (&) [2]>(char const (&) [35], char&, char const (&) [2])
explicit exception(Args&& ... args) : std::runtime_error(make_string(std::forward<Args>(args)...)) {}
pushq %r14 pushq %rbx subq $0x28, %rsp movq %rdi, %rbx leaq 0x8(%rsp), %r14 movq %r14, %rdi callq 0x908a9 movq %rbx, %rdi movq %r14, %rsi callq 0x35710 leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x90567 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 leaq 0x4b63a(%rip), %rax # 0xdbba8 movq %rax, (%rbx) addq $0x28, %rsp popq %rbx popq %r14 retq movq %rax, %rbx leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x90597 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 movq %rbx, %rdi callq 0x35aa0
/simonowen[P]samdisk/include/utils.h
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> util::make_string<char const (&) [31], int&, char const (&) [2]>(char const (&) [31], int&, char const (&) [2])
std::string make_string(Args&& ... args) { std::ostringstream ss; (void)std::initializer_list<bool> {(ss << args, false)...}; return ss.str(); }
pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x180, %rsp # imm = 0x180 movq %rcx, %r14 movq %rdx, %r15 movq %rsi, %r12 movq %rdi, %rbx leaq 0x8(%rsp), %r13 movq %r13, %rdi callq 0x35760 movq %r12, %rdi callq 0x35210 movq %r13, %rdi movq %r12, %rsi movq %rax, %rdx callq 0x356a0 movl (%r15), %esi leaq 0x8(%rsp), %rdi callq 0x35a80 movq %r14, %rdi callq 0x35210 leaq 0x8(%rsp), %rdi movq %r14, %rsi movq %rax, %rdx callq 0x356a0 leaq 0x10(%rsp), %rsi movq %rbx, %rdi callq 0x35920 movq 0x4c961(%rip), %rsi # 0xdcf78 leaq 0x8(%rsp), %rdi callq 0x352b0 leaq 0x78(%rsp), %rdi callq 0x35180 movq %rbx, %rax addq $0x180, %rsp # imm = 0x180 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 retq jmp 0x90641 movq %rax, %rbx movq 0x4c92d(%rip), %rsi # 0xdcf78 leaq 0x8(%rsp), %rdi callq 0x352b0 leaq 0x78(%rsp), %rdi callq 0x35180 movq %rbx, %rdi callq 0x35aa0
/simonowen[P]samdisk/include/utils.h
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> util::make_string<char const (&) [22], CylHead&>(char const (&) [22], CylHead&)
std::string make_string(Args&& ... args) { std::ostringstream ss; (void)std::initializer_list<bool> {(ss << args, false)...}; return ss.str(); }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x198, %rsp # imm = 0x198 movq %rdx, %r14 movq %rsi, %r15 movq %rdi, %rbx leaq 0x20(%rsp), %r12 movq %r12, %rdi callq 0x35760 movq %r15, %rdi callq 0x35210 movq %r12, %rdi movq %r15, %rsi movq %rax, %rdx callq 0x356a0 movl (%r14), %edx movl 0x4(%r14), %ecx leaq 0x1b72c(%rip), %rsi # 0xabddb movq %rsp, %rdi xorl %eax, %eax callq 0x784cc movq (%rsp), %rsi movq 0x8(%rsp), %rdx leaq 0x20(%rsp), %rdi callq 0x356a0 leaq 0x10(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x906e7 movq 0x10(%rsp), %rsi incq %rsi callq 0x355d0 leaq 0x28(%rsp), %rsi movq %rbx, %rdi callq 0x35920 movq 0x4c87d(%rip), %rsi # 0xdcf78 leaq 0x20(%rsp), %rdi callq 0x352b0 leaq 0x90(%rsp), %rdi callq 0x35180 movq %rbx, %rax addq $0x198, %rsp # imm = 0x198 popq %rbx popq %r12 popq %r14 popq %r15 retq jmp 0x90746 movq %rax, %rbx leaq 0x10(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x90749 movq 0x10(%rsp), %rsi incq %rsi callq 0x355d0 jmp 0x90749 movq %rax, %rbx movq 0x4c828(%rip), %rsi # 0xdcf78 leaq 0x20(%rsp), %rdi callq 0x352b0 leaq 0x90(%rsp), %rdi callq 0x35180 movq %rbx, %rdi callq 0x35aa0
/simonowen[P]samdisk/include/utils.h
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> util::make_string<char const (&) [35], char&, char const (&) [2]>(char const (&) [35], char&, char const (&) [2])
std::string make_string(Args&& ... args) { std::ostringstream ss; (void)std::initializer_list<bool> {(ss << args, false)...}; return ss.str(); }
pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x180, %rsp # imm = 0x180 movq %rcx, %r14 movq %rdx, %r15 movq %rsi, %r12 movq %rdi, %rbx leaq 0x8(%rsp), %r13 movq %r13, %rdi callq 0x35760 movq %r12, %rdi callq 0x35210 movq %r13, %rdi movq %r12, %rsi movq %rax, %rdx callq 0x356a0 movb (%r15), %al leaq 0x7(%rsp), %rsi movb %al, (%rsi) leaq 0x8(%rsp), %rdi movl $0x1, %edx callq 0x356a0 movq %r14, %rdi callq 0x35210 leaq 0x8(%rsp), %rdi movq %r14, %rsi movq %rax, %rdx callq 0x356a0 leaq 0x10(%rsp), %rsi movq %rbx, %rdi callq 0x35920 movq 0x4c64b(%rip), %rsi # 0xdcf78 leaq 0x8(%rsp), %rdi callq 0x352b0 leaq 0x78(%rsp), %rdi callq 0x35180 movq %rbx, %rax addq $0x180, %rsp # imm = 0x180 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 retq jmp 0x90957 movq %rax, %rbx movq 0x4c617(%rip), %rsi # 0xdcf78 leaq 0x8(%rsp), %rdi callq 0x352b0 leaq 0x78(%rsp), %rdi callq 0x35180 movq %rbx, %rdi callq 0x35aa0 nopl (%rax)
/simonowen[P]samdisk/include/utils.h
ReadFD(MemFile&, std::shared_ptr<Disk>&)
bool ReadFD(MemFile& file, std::shared_ptr<Disk>& disk) { Format fmt; if (!IsFileExt(file.name(), "fd")) return false; switch (file.size()) { case 655360: fmt = RegularFormat::TO_640K_MFM; break; case 327680: fmt = RegularFormat::TO_320K_MFM; break; case 163840: if (opt.encoding == Encoding::FM) fmt = RegularFormat::TO_160K_FM; else fmt = RegularFormat::TO_160K_MFM; break; case 81920: fmt = RegularFormat::TO_80K_FM; break; default: return false; } assert(fmt.disk_size() == file.size()); disk->format(fmt, file.data(), fmt.cyls_first); disk->strType = "FD"; return true; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x88, %rsp movq %rsi, %rbx movq %rdi, %r14 movaps 0x1b6d2(%rip), %xmm0 # 0xac070 movups %xmm0, (%rsp) movaps 0x1b6d7(%rip), %xmm0 # 0xac080 movups %xmm0, 0x10(%rsp) movsd 0x1dc3a(%rip), %xmm0 # 0xae5f0 movups %xmm0, 0x20(%rsp) movq $0x1, 0x30(%rsp) movw $0x0, 0x38(%rsp) callq 0x64ca2 movq %rax, %r15 leaq 0x58(%rsp), %r13 movq %r13, -0x10(%r13) leaq 0x21b03(%rip), %rsi # 0xb24e6 leaq 0x21afe(%rip), %rdx # 0xb24e8 leaq 0x48(%rsp), %r12 movq %r12, %rdi callq 0x445b8 movq %r15, %rdi movq %r12, %rsi callq 0x77230 movl %eax, %ebp movq 0x48(%rsp), %rdi cmpq %r13, %rdi je 0x90a1b movq 0x58(%rsp), %rsi incq %rsi callq 0x355d0 testb %bpl, %bpl je 0x90a67 movq %r14, %rdi callq 0x64c8e movl %eax, %ecx xorl %eax, %eax cmpl $0x4ffff, %ecx # imm = 0x4FFFF jg 0x90a6e cmpl $0x14000, %ecx # imm = 0x14000 je 0x90a91 cmpl $0x28000, %ecx # imm = 0x28000 jne 0x90b3e leaq 0x4ecf1(%rip), %rax # 0xdf740 cmpl $0x2, 0x134(%rax) jne 0x90aaf leaq 0x48(%rsp), %r15 movq %r15, %rdi movl $0x11, %esi jmp 0x90abc xorl %eax, %eax jmp 0x90b3e cmpl $0x50000, %ecx # imm = 0x50000 je 0x90aa0 cmpl $0xa0000, %ecx # imm = 0xA0000 jne 0x90b3e leaq 0x48(%rsp), %r15 movq %r15, %rdi movl $0xe, %esi jmp 0x90abc leaq 0x48(%rsp), %r15 movq %r15, %rdi movl $0x12, %esi jmp 0x90abc leaq 0x48(%rsp), %r15 movq %r15, %rdi movl $0xf, %esi jmp 0x90abc leaq 0x48(%rsp), %r15 movq %r15, %rdi movl $0x10, %esi callq 0x5db04 movups (%r15), %xmm0 movups 0x10(%r15), %xmm1 movups 0x20(%r15), %xmm2 movups 0x2a(%r15), %xmm3 movups %xmm3, 0x2a(%rsp) movaps %xmm2, 0x20(%rsp) movaps %xmm1, 0x10(%rsp) movaps %xmm0, (%rsp) movq %rsp, %rdi callq 0x5e142 movl %eax, %ebp movq %r14, %rdi callq 0x64c8e cmpl %eax, %ebp jne 0x90b50 movq (%rbx), %r15 movq %r14, %rdi callq 0x64c88 movq %rsp, %rsi movzbl 0x39(%rsi), %ecx movq %r15, %rdi movq %rax, %rdx callq 0x547da movq (%rbx), %rdi movq 0x80(%rdi), %rdx addq $0x78, %rdi leaq 0x20244(%rip), %rcx # 0xb0d73 movl $0x2, %r8d xorl %esi, %esi callq 0x358f0 movb $0x1, %al addq $0x88, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq leaq 0x21992(%rip), %rdi # 0xb24e9 leaq 0x219aa(%rip), %rsi # 0xb2508 leaq 0x219fa(%rip), %rcx # 0xb255f movl $0x2e, %edx callq 0x35380 movq %rax, %rbx movq 0x48(%rsp), %rdi cmpq %r13, %rdi je 0x90b89 movq 0x58(%rsp), %rsi incq %rsi callq 0x355d0 movq %rbx, %rdi callq 0x35aa0
/simonowen[P]samdisk/src/types/fd.cpp
ReadFDI(MemFile&, std::shared_ptr<Disk>&)
bool ReadFDI(MemFile& file, std::shared_ptr<Disk>& disk) { FDI_HEADER fh; if (!file.rewind() || !file.read(&fh, sizeof(fh))) return false; else if (memcmp(fh.abSignature, FDI_SIGNATURE, sizeof(fh.abSignature))) return false; int cyls = fh.bTracks[0]; int heads = fh.bSides[0]; Format::Validate(cyls, heads); auto data_pos = (fh.bDataOffset[1] << 8) | fh.bDataOffset[0]; auto header_pos = static_cast<int>(sizeof(FDI_HEADER)) + ((fh.bExtraSize[1] << 8) | fh.bExtraSize[0]); file.seek(header_pos); // uint8_t* pbData = pb + fh.bDataOffset[0]; // auto pbHeaders = (uint8_t*)&fh.bExtraSize + sizeof(fh.bExtraSize) + ((fh.bExtraSize[1] << 8) | fh.bExtraSize[0]); for (auto cyl = 0; cyl < cyls; ++cyl) { for (auto head = 0; head < heads; ++head) { CylHead cylhead(cyl, head); Track track; FDI_TRACK ft; if (!file.read(&ft, sizeof(ft))) throw util::exception("short file reading ", cylhead); if (ft.sectors > MAX_SECTORS) throw util::exception(cylhead, " has too many sectors (", ft.sectors, ")"); auto track_pos = data_pos + (/*(ft.abTrackOffset[3] << 24) |*/ (ft.abTrackOffset[2] << 16) | (ft.abTrackOffset[1] << 8) | ft.abTrackOffset[0]); for (int i = 0; i < ft.sectors; ++i) { FDI_SECTOR fs; if (!file.read(&fs, sizeof(fs))) throw util::exception("short file reading ", cylhead, " sector index ", i); Sector sector(DataRate::_250K, Encoding::MFM, Header(fs.bTrack, fs.bSide, fs.bSector, fs.bSize)); bool deleted_data = (fs.bFlags & 0x80) != 0; bool no_data = (fs.bFlags & 0x40) != 0; bool bad_data = true; // until we learn otherwise uint8_t dam = deleted_data ? 0xf8 : 0xfb; auto old_pos = file.tell(); auto sector_pos = track_pos + ((fs.bSectorOffset[1] << 8) | fs.bSectorOffset[0]); if (!file.seek(sector_pos)) throw util::exception("failed to seek to ", cylhead, " sector ", fs.bSector, " data @", sector_pos); // Use only 2 bits of the size, to match FD1793 behaviour uint8_t b1793Size = fs.bSize & 3; auto sector_size = Sector::SizeCodeToLength(b1793Size); Data data(sector_size); // always allocate full PC size, plus room for CRC file.read(data.data(), 1, static_cast<int>(data.size())); file.seek(old_pos); // Loop through valid size codes to check the flag bits for (uint8_t size = 0; !no_data && size <= 3; ++size) { auto ssize = Sector::SizeCodeToLength(size); // Does the size match the PC treatment of the size code? if (ssize == Sector::SizeCodeToLength(fs.bSize)) { // If the flags say no error, clear the data CRC error if (fs.bFlags & (1 << size)) bad_data = false; } // Or is it within the current FD1793 size? else if (size <= b1793Size) { CRC16 crc(CRC16::A1A1A1); crc.add(dam); crc.add(data.data(), ssize); // If the size matches, there are no CRC bytes in the data if (size == b1793Size) { // Do the flags indicate the CRC is good? if (fs.bFlags & (1 << size)) { // Add the calculated CRC bytes to to preserve the status data.push_back(crc >> 8); data.push_back(crc & 0xff); } } else { // Continue reading into the data to check the CRC crc.add(data.data() + ssize, 2); // Ensure the CRC status matches the flags if (!!(fs.bFlags & (1 << size)) != (crc ? 0 : 1)) Message(msgWarning, "inconsistent CRC flag for size=%d for %s", sector_size, CHR(cyl, head, fs.bSector)); } } else { // Skip clearing the flag so we warn any set bit below continue; } // Reset the bit for this size, whether or not we used it fs.bFlags &= ~(1 << size); } // Warn about any remaining flags, in case we're missing something if (fs.bFlags & ~0xc0) Message(msgWarning, "unexpected flags (%02X) on %s", fs.bFlags, CHSR(cyl, head, i, fs.bSector)); sector.add(std::move(data), bad_data, dam); track.add(std::move(sector)); } disk->write(cylhead, std::move(track)); } } auto desc_pos = (fh.bDescOffset[1] << 8) | fh.bDescOffset[0]; if (desc_pos && file.seek(desc_pos)) { // Read the comment block auto len = (data_pos > desc_pos) ? (data_pos - desc_pos) : 256; std::vector<char> comment(len); if (!file.read(comment)) throw util::exception("short file reading comment"); std::string str = std::string(comment.data(), comment.size()); // To avoid confusion, don't store the default TDCVT comment if (str.substr(0, 29) != "\r\n'This file created by TDCVT" && str.substr(0, 3) != "FDI") disk->metadata["comment"] = str; } disk->strType = "FDI"; return true; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x108, %rsp # imm = 0x108 movq %rsi, 0xa8(%rsp) movq %rdi, %r12 callq 0x64db2 testb %al, %al je 0x90d92 leaq 0x5a(%rsp), %rsi movq %r12, %rdi movl $0xe, %edx callq 0x64d0c testb %al, %al je 0x90d92 movzwl 0x5a(%rsp), %eax xorl $0x4446, %eax # imm = 0x4446 movzbl 0x5c(%rsp), %ecx xorl $0x49, %ecx orw %ax, %cx je 0x90da6 xorl %eax, %eax addq $0x108, %rsp # imm = 0x108 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movzbl 0x5e(%rsp), %ebx movzbl 0x60(%rsp), %esi movl %ebx, %edi movl %esi, 0x38(%rsp) movl $0x1, %edx movl $0x200, %ecx # imm = 0x200 xorl %r8d, %r8d callq 0x5e8ce movzwl 0x64(%rsp), %eax movl %eax, 0x34(%rsp) movzwl 0x66(%rsp), %esi addl $0xe, %esi movq %r12, %rdi callq 0x64dce movl %ebx, 0xb8(%rsp) testl %ebx, %ebx je 0x91205 leaq 0x68(%rsp), %rbx movl $0x0, 0x18(%rsp) movq %r12, 0xb0(%rsp) cmpb $0x0, 0x38(%rsp) je 0x911ee xorl %edx, %edx leaq 0x40(%rsp), %rdi movl 0x18(%rsp), %esi movl %edx, 0x30(%rsp) callq 0x46fa2 leaq 0x88(%rsp), %rdi xorl %esi, %esi callq 0x713b8 movq %r12, %rdi leaq 0x21(%rsp), %rsi movl $0x7, %edx callq 0x64d0c testb %al, %al je 0x914ee cmpb $-0x6f, 0x27(%rsp) jae 0x914bf movzbl 0x23(%rsp), %eax movzbl 0x22(%rsp), %edx movzbl 0x21(%rsp), %ecx movl $0x0, 0x1c(%rsp) cmpb $0x0, 0x27(%rsp) je 0x911b4 shll $0x10, %eax shll $0x8, %edx orl %eax, %edx orl %ecx, %edx addl 0x34(%rsp), %edx movl %edx, 0xbc(%rsp) movq %r12, %rdi leaq 0xf(%rsp), %rsi movl $0x7, %edx callq 0x64d0c testb %al, %al je 0x91477 movzbl 0xf(%rsp), %esi movzbl 0x10(%rsp), %edx movzbl 0x11(%rsp), %ecx movzbl 0x12(%rsp), %r8d movq %rbx, %rdi callq 0x60752 leaq 0xc8(%rsp), %rdi movl $0x3d090, %esi # imm = 0x3D090 movl $0x1, %edx movq %rbx, %rcx xorl %r8d, %r8d callq 0x6bb84 movb 0x13(%rsp), %r15b xorl %r14d, %r14d testb %r15b, %r15b setns %bpl movq %r12, %rdi callq 0x64dea movl %eax, %ebx movzwl 0x14(%rsp), %esi addl 0xbc(%rsp), %esi movl %esi, 0xc4(%rsp) movq %r12, %rdi callq 0x64dce testb %al, %al je 0x9141c movzbl 0x12(%rsp), %r12d andl $0x3, %r12d movl %r12d, %edi callq 0x6c57a movl %eax, 0xc0(%rsp) movslq %eax, %rsi leaq 0x68(%rsp), %rdi leaq 0x28(%rsp), %rdx callq 0x38b58 movq 0x68(%rsp), %rsi movl 0x70(%rsp), %ecx subl %esi, %ecx movq 0xb0(%rsp), %rdi movl $0x1, %edx callq 0x64d5c movq 0xb0(%rsp), %rdi movl %ebx, %esi callq 0x64dce movb %bpl, %r14b leal (%r14,%r14,2), %eax addl $0xf8, %eax movb $0x1, %r14b movzbl %al, %eax movl %eax, 0x3c(%rsp) testb $0x40, %r15b jne 0x910fd movzbl %r12b, %ebp movb $0x1, %r14b xorl %r12d, %r12d movl %r12d, %edi callq 0x6c57a movl %eax, %r13d movzbl 0x12(%rsp), %edi callq 0x6c57a cmpl %eax, %r13d jne 0x90fe2 movzbl 0x13(%rsp), %eax btl %r12d, %eax movzbl %r14b, %r14d movl $0x0, %eax cmovbl %eax, %r14d movl $0x1, %eax movl %r12d, %ecx shll %cl, %eax notb %al andb %al, 0x13(%rsp) jmp 0x90fe7 cmpl %ebp, %r12d jbe 0x91004 testb $0x40, %r15b jne 0x910fd leal 0x1(%r12), %eax cmpl $0x3, %r12d movl %eax, %r12d jb 0x90fa0 jmp 0x910fd leaq 0x16(%rsp), %rbx movq %rbx, %rdi movl $0xcdb4, %esi # imm = 0xCDB4 callq 0x5349c movq %rbx, %rdi movl 0x3c(%rsp), %esi callq 0x535b8 movq 0x68(%rsp), %rsi movslq %r13d, %r13 movq %rbx, %rdi movq %r13, %rdx callq 0x53578 cmpl %r12d, %ebp jne 0x91084 movzbl 0x13(%rsp), %eax btl %r12d, %eax jae 0x90fd0 leaq 0x16(%rsp), %rdi callq 0x535b4 movb %ah, 0x28(%rsp) leaq 0x68(%rsp), %rdi leaq 0x28(%rsp), %rsi callq 0x5c39a leaq 0x16(%rsp), %rdi callq 0x535b4 movb %al, 0x28(%rsp) leaq 0x68(%rsp), %rdi leaq 0x28(%rsp), %rsi callq 0x5c39a jmp 0x90fd0 addq 0x68(%rsp), %r13 movl $0x2, %edx leaq 0x16(%rsp), %rbx movq %rbx, %rdi movq %r13, %rsi callq 0x53578 movzbl 0x13(%rsp), %r13d movq %rbx, %rdi callq 0x535b4 movl %r12d, %ecx shrl %cl, %r13d testw %ax, %ax setne %al xorb %r13b, %al testb $0x1, %al jne 0x90fd0 movzbl 0x11(%rsp), %edx movl 0x18(%rsp), %edi movl 0x30(%rsp), %esi callq 0x76c4f movq %rax, 0x28(%rsp) movl $0x3, %edi leaq 0x214fc(%rip), %rsi # 0xb25e2 leaq 0xc0(%rsp), %rdx leaq 0x28(%rsp), %rcx callq 0x88bff jmp 0x90fd0 testb $0x3f, 0x13(%rsp) je 0x9113a movl 0x1c(%rsp), %edx movzbl 0x11(%rsp), %ecx movl 0x18(%rsp), %edi movl 0x30(%rsp), %esi callq 0x76d7c movq %rax, 0x28(%rsp) movl $0x3, %edi leaq 0x214e0(%rip), %rsi # 0xb260b leaq 0x13(%rsp), %rdx leaq 0x28(%rsp), %rcx callq 0x91820 movzbl %r14b, %edx andl $0x1, %edx leaq 0xc8(%rsp), %rdi leaq 0x68(%rsp), %rsi movl 0x3c(%rsp), %ecx callq 0x6bd6c leaq 0x88(%rsp), %rdi leaq 0xc8(%rsp), %rsi callq 0x71b18 movq 0x68(%rsp), %rdi testq %rdi, %rdi je 0x91183 movq 0x78(%rsp), %rsi subq %rdi, %rsi callq 0x355d0 leaq 0xf0(%rsp), %rdi callq 0x410b8 movl 0x1c(%rsp), %eax incl %eax movl %eax, 0x1c(%rsp) movzbl 0x27(%rsp), %ecx cmpl %ecx, %eax movq 0xb0(%rsp), %r12 leaq 0x68(%rsp), %rbx jl 0x90e8f movq 0xa8(%rsp), %rax movq (%rax), %rdi leaq 0x40(%rsp), %rsi leaq 0x88(%rsp), %rdx callq 0x54f3a leaq 0x90(%rsp), %rdi callq 0x4106a movl 0x30(%rsp), %edx incl %edx cmpl 0x38(%rsp), %edx jne 0x90e12 movl 0x18(%rsp), %eax incl %eax movl %eax, 0x18(%rsp) cmpl 0xb8(%rsp), %eax jne 0x90e05 movzwl 0x62(%rsp), %ebx testl %ebx, %ebx je 0x913eb movq %r12, %rdi movl %ebx, %esi callq 0x64dce testb %al, %al je 0x913eb movl 0x34(%rsp), %ecx subl %ebx, %ecx movl $0x100, %eax # imm = 0x100 cmoval %ecx, %eax movslq %eax, %rsi leaq 0x40(%rsp), %rdi leaq 0xc8(%rsp), %rdx callq 0x78a06 movq 0x48(%rsp), %rbx subq 0x40(%rsp), %rbx movq %r12, %rdi callq 0x64c96 cmpl %ebx, %eax jl 0x91525 movq 0x40(%rsp), %rdi movq 0x58(%r12), %rsi movslq %ebx, %rbx movq %rbx, %rdx callq 0x354c0 addq %rbx, 0x58(%r12) movq 0x40(%rsp), %rsi movq 0x48(%rsp), %rdx leaq 0xd8(%rsp), %r14 movq %r14, -0x10(%r14) leaq 0xc8(%rsp), %rdi callq 0x445b8 leaq 0x88(%rsp), %rdi leaq 0xc8(%rsp), %rsi movl $0x1d, %ecx xorl %edx, %edx callq 0x35600 leaq 0x21368(%rip), %rsi # 0xb2629 leaq 0x88(%rsp), %rdi callq 0x35120 movl %eax, %ebx testl %eax, %eax je 0x91306 leaq 0x68(%rsp), %rdi leaq 0xc8(%rsp), %rsi movl $0x3, %ecx xorl %edx, %edx callq 0x35600 leaq 0x1f9d6(%rip), %rsi # 0xb0cca leaq 0x68(%rsp), %rdi callq 0x35120 testl %eax, %eax setne %bpl jmp 0x91308 xorl %ebp, %ebp testl %ebx, %ebx je 0x91327 leaq 0x78(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x91327 movq 0x78(%rsp), %rsi incq %rsi callq 0x355d0 leaq 0x98(%rsp), %r15 movq -0x10(%r15), %rdi cmpq %r15, %rdi je 0x91348 movq 0x98(%rsp), %rsi incq %rsi callq 0x355d0 testb %bpl, %bpl je 0x913b7 movq 0xa8(%rsp), %rax movq (%rax), %rbx leaq 0x88(%rsp), %rdi movq %r15, (%rdi) leaq 0x20443(%rip), %rsi # 0xb17ad leaq 0x20443(%rip), %rdx # 0xb17b4 callq 0x445b8 addq $0x48, %rbx leaq 0x88(%rsp), %rsi movq %rbx, %rdi callq 0x48d0c leaq 0xc8(%rsp), %rsi movq %rax, %rdi callq 0x352c0 movq 0x88(%rsp), %rdi cmpq %r15, %rdi je 0x913b7 movq 0x98(%rsp), %rsi incq %rsi callq 0x355d0 movq 0xc8(%rsp), %rdi cmpq %r14, %rdi je 0x913d4 movq 0xd8(%rsp), %rsi incq %rsi callq 0x355d0 movq 0x40(%rsp), %rdi testq %rdi, %rdi je 0x913eb movq 0x50(%rsp), %rsi subq %rdi, %rsi callq 0x355d0 movq 0xa8(%rsp), %rax movq (%rax), %rdi movq 0x80(%rdi), %rdx addq $0x78, %rdi leaq 0x1f8c2(%rip), %rcx # 0xb0cca movl $0x3, %r8d xorl %esi, %esi callq 0x358f0 movb $0x1, %al jmp 0x90d94 movl $0x10, %edi callq 0x35260 movq %rax, %r14 leaq 0xc4(%rsp), %rax movq %rax, (%rsp) leaq 0x2118b(%rip), %rsi # 0xb25c7 leaq 0x1fac0(%rip), %rcx # 0xb0f03 leaq 0x21190(%rip), %r9 # 0xb25da leaq 0x40(%rsp), %rdx movq %r14, %rdi leaq 0x11(%rsp), %r8 callq 0x917a2 leaq 0x4a71d(%rip), %rsi # 0xdbb80 movq 0x4bb16(%rip), %rdx # 0xdcf80 movq %r14, %rdi callq 0x35a50 jmp 0x91557 movl $0x10, %edi callq 0x35260 movq %rax, %r14 leaq 0x20680(%rip), %rsi # 0xb1b0b leaq 0x21126(%rip), %rcx # 0xb25b8 leaq 0x40(%rsp), %rdx leaq 0x1c(%rsp), %r8 movq %rax, %rdi callq 0x9172c leaq 0x4a6d5(%rip), %rsi # 0xdbb80 movq 0x4bace(%rip), %rdx # 0xdcf80 movq %r14, %rdi callq 0x35a50 jmp 0x91557 movl $0x10, %edi callq 0x35260 movq %rax, %r14 leaq 0x210cd(%rip), %rdx # 0xb25a0 leaq 0x1dac6(%rip), %r8 # 0xaefa0 leaq 0x40(%rsp), %rsi movq %rax, %rdi leaq 0x27(%rsp), %rcx callq 0x916b6 jmp 0x9150f movl $0x10, %edi callq 0x35260 movq %rax, %r14 leaq 0x20609(%rip), %rsi # 0xb1b0b leaq 0x40(%rsp), %rdx movq %rax, %rdi callq 0x88dc0 leaq 0x4a66a(%rip), %rsi # 0xdbb80 movq 0x4ba63(%rip), %rdx # 0xdcf80 movq %r14, %rdi callq 0x35a50 movl $0x10, %edi callq 0x35260 movq %rax, %r14 leaq 0x20261(%rip), %rsi # 0xb179a movq %rax, %rdi callq 0x84a92 leaq 0x4a638(%rip), %rsi # 0xdbb80 movq 0x4ba31(%rip), %rdx # 0xdcf80 movq %r14, %rdi callq 0x35a50 movq %rax, %rbx movq %r14, %rdi callq 0x35430 jmp 0x915cd jmp 0x9159e movq %rax, %rbx leaq 0x98(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi jne 0x9158c jmp 0x915a1 movq %rax, %rbx movq 0x88(%rsp), %rdi cmpq %r15, %rdi je 0x915a1 movq 0x98(%rsp), %rsi incq %rsi callq 0x355d0 jmp 0x915a1 movq %rax, %rbx movq 0xc8(%rsp), %rdi cmpq %r14, %rdi je 0x915cd movq 0xd8(%rsp), %rsi incq %rsi callq 0x355d0 jmp 0x915cd jmp 0x915ca movq %rax, %rbx jmp 0x91664 movq %rax, %rbx movq 0x40(%rsp), %rdi testq %rdi, %rdi je 0x91664 movq 0x50(%rsp), %rsi subq %rdi, %rsi callq 0x355d0 jmp 0x91664 jmp 0x915f6 jmp 0x915f6 jmp 0x91623 jmp 0x91623 jmp 0x91623 jmp 0x91623 movq %rax, %rbx movq %r14, %rdi callq 0x35430 jmp 0x91657 jmp 0x9161a movq %rax, %rbx movq %r14, %rdi callq 0x35430 jmp 0x9164a jmp 0x9161a jmp 0x91623 jmp 0x9161a jmp 0x9161a movq %rax, %rbx jmp 0x9164a jmp 0x91630 jmp 0x91630 movq %rax, %rbx jmp 0x91657 jmp 0x91630 jmp 0x91630 jmp 0x91630 jmp 0x91630 movq %rax, %rbx movq 0x68(%rsp), %rdi testq %rdi, %rdi je 0x9164a movq 0x78(%rsp), %rsi subq %rdi, %rsi callq 0x355d0 leaq 0xf0(%rsp), %rdi callq 0x410b8 leaq 0x90(%rsp), %rdi callq 0x4106a movq %rbx, %rdi callq 0x35aa0
/simonowen[P]samdisk/src/types/fdi.cpp
util::exception::exception<char const (&) [20], CylHead&, char const (&) [15], int&>(char const (&) [20], CylHead&, char const (&) [15], int&)
explicit exception(Args&& ... args) : std::runtime_error(make_string(std::forward<Args>(args)...)) {}
pushq %r14 pushq %rbx subq $0x28, %rsp movq %rdi, %rbx leaq 0x8(%rsp), %r14 movq %r14, %rdi callq 0x91b1c movq %rbx, %rdi movq %r14, %rsi callq 0x35710 leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x91769 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 leaq 0x4a438(%rip), %rax # 0xdbba8 movq %rax, (%rbx) addq $0x28, %rsp popq %rbx popq %r14 retq movq %rax, %rbx leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x91799 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 movq %rbx, %rdi callq 0x35aa0 nop
/simonowen[P]samdisk/include/utils.h
void Message<unsigned char&, char const*>(MsgType, char const*, unsigned char&, char const*&&)
void Message(MsgType type, const char* pcsz_, Args&& ...args) { std::string msg = util::fmt(pcsz_, std::forward<Args>(args)...); if (type == msgError) throw util::exception(msg); if (type != msgStatus) { if (seen_messages.find(msg) != seen_messages.end()) return; seen_messages.insert(msg); } switch (type) { case msgStatus: break; case msgInfo: util::cout << "Info: "; break; case msgFix: util::cout << colour::GREEN << "Fixed: "; break; case msgWarning: util::cout << colour::YELLOW << "Warning: "; break; case msgError: util::cout << colour::RED << "Error: "; break; } if (type == msgStatus) util::cout << ttycmd::statusbegin << "\r" << msg << ttycmd::statusend; else util::cout << msg << colour::none << '\n'; }
pushq %r14 pushq %rbx subq $0x28, %rsp movl %edi, %ebx movzbl (%rdx), %edx movq (%rcx), %rcx leaq 0x8(%rsp), %rdi xorl %eax, %eax callq 0x784cc testl %ebx, %ebx je 0x9191d cmpl $0x4, %ebx je 0x9197a leaq 0x4e5a5(%rip), %r14 # 0xdfdf8 leaq 0x8(%rsp), %rsi movq %r14, %rdi callq 0x418a4 addq $0x8, %r14 cmpq %r14, %rax jne 0x91957 leaq 0x4e584(%rip), %rdi # 0xdfdf8 leaq 0x8(%rsp), %rsi callq 0x4192e cmpl $0x3, %ebx ja 0x918f0 movl %ebx, %eax leaq 0x20d04(%rip), %rcx # 0xb2590 movslq (%rcx,%rax,4), %rax addq %rcx, %rax jmpq *%rax leaq 0x4ea14(%rip), %rdi # 0xe02b0 leaq 0x1a4f5(%rip), %rsi # 0xabd98 callq 0x4172b jmp 0x918ec leaq 0x4e9ff(%rip), %rdi # 0xe02b0 movl $0xa0, %esi callq 0x788ea leaq 0x1a4dd(%rip), %rsi # 0xabd9f movq %rax, %rdi callq 0x41794 jmp 0x918ec leaq 0x4e9dd(%rip), %rdi # 0xe02b0 movl $0xa1, %esi callq 0x788ea leaq 0x1a4c3(%rip), %rsi # 0xabda7 movq %rax, %rdi callq 0x405c6 testl %ebx, %ebx je 0x9191d leaq 0x4e9b9(%rip), %rdi # 0xe02b0 leaq 0x8(%rsp), %rsi callq 0x3f60b movq %rax, %rdi xorl %esi, %esi callq 0x788ea leaq 0x7(%rsp), %rsi movb $0xa, (%rsi) movq %rax, %rdi callq 0x409e0 jmp 0x91957 leaq 0x4e98c(%rip), %rdi # 0xe02b0 movl $0x2, %esi callq 0x7897a leaq 0x1d52e(%rip), %rsi # 0xaee63 movq %rax, %rdi callq 0x38d1e leaq 0x8(%rsp), %rsi movq %rax, %rdi callq 0x3f60b movq %rax, %rdi movl $0x3, %esi callq 0x7897a leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x91972 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 addq $0x28, %rsp popq %rbx popq %r14 retq movl $0x10, %edi callq 0x35260 movq %rax, %r14 leaq 0x8(%rsp), %rsi movq %rax, %rdi callq 0x416b6 leaq 0x4a1e5(%rip), %rsi # 0xdbb80 movq 0x4b5de(%rip), %rdx # 0xdcf80 movq %r14, %rdi callq 0x35a50 jmp 0x919bb movq %rax, %rbx movq %r14, %rdi callq 0x35430 jmp 0x919be jmp 0x919bb movq %rax, %rbx leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x919d9 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 movq %rbx, %rdi callq 0x35aa0
/simonowen[P]samdisk/include/Util.h
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> util::make_string<CylHead&, char const (&) [24], unsigned char&, char const (&) [2]>(CylHead&, char const (&) [24], unsigned char&, char const (&) [2])
std::string make_string(Args&& ... args) { std::ostringstream ss; (void)std::initializer_list<bool> {(ss << args, false)...}; return ss.str(); }
pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x1a0, %rsp # imm = 0x1A0 movq %r8, %r14 movq %rcx, %r15 movq %rdx, %r12 movq %rsi, %r13 movq %rdi, %rbx leaq 0x28(%rsp), %rdi callq 0x35760 movl (%r13), %edx movl 0x4(%r13), %ecx leaq 0x1a3c2(%rip), %rsi # 0xabddb leaq 0x8(%rsp), %rdi xorl %eax, %eax callq 0x784cc movq 0x8(%rsp), %rsi movq 0x10(%rsp), %rdx leaq 0x28(%rsp), %rdi callq 0x356a0 leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x91a54 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 movq %r12, %rdi callq 0x35210 leaq 0x28(%rsp), %rdi movq %r12, %rsi movq %rax, %rdx callq 0x356a0 movzbl (%r15), %esi leaq 0x28(%rsp), %rdi callq 0x35a80 movq %r14, %rdi callq 0x35210 leaq 0x28(%rsp), %rdi movq %r14, %rsi movq %rax, %rdx callq 0x356a0 leaq 0x30(%rsp), %rsi movq %rbx, %rdi callq 0x35920 movq 0x4b4d2(%rip), %rsi # 0xdcf78 leaq 0x28(%rsp), %rdi callq 0x352b0 leaq 0x98(%rsp), %rdi callq 0x35180 movq %rbx, %rax addq $0x1a0, %rsp # imm = 0x1A0 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 retq jmp 0x91af3 movq %rax, %rbx leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x91af6 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 jmp 0x91af6 movq %rax, %rbx movq 0x4b47b(%rip), %rsi # 0xdcf78 leaq 0x28(%rsp), %rdi callq 0x352b0 leaq 0x98(%rsp), %rdi callq 0x35180 movq %rbx, %rdi callq 0x35aa0
/simonowen[P]samdisk/include/utils.h
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> util::make_string<char const (&) [20], CylHead&, char const (&) [15], int&>(char const (&) [20], CylHead&, char const (&) [15], int&)
std::string make_string(Args&& ... args) { std::ostringstream ss; (void)std::initializer_list<bool> {(ss << args, false)...}; return ss.str(); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x198, %rsp # imm = 0x198 movq %r8, %r14 movq %rcx, %r15 movq %rdx, %r12 movq %rsi, %r13 movq %rdi, %rbx leaq 0x20(%rsp), %rbp movq %rbp, %rdi callq 0x35760 movq %r13, %rdi callq 0x35210 movq %rbp, %rdi movq %r13, %rsi movq %rax, %rdx callq 0x356a0 movl (%r12), %edx movl 0x4(%r12), %ecx leaq 0x1a26c(%rip), %rsi # 0xabddb movq %rsp, %rdi xorl %eax, %eax callq 0x784cc movq (%rsp), %rsi movq 0x8(%rsp), %rdx leaq 0x20(%rsp), %rdi callq 0x356a0 leaq 0x10(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x91ba7 movq 0x10(%rsp), %rsi incq %rsi callq 0x355d0 movq %r15, %rdi callq 0x35210 leaq 0x20(%rsp), %rdi movq %r15, %rsi movq %rax, %rdx callq 0x356a0 movl (%r14), %esi leaq 0x20(%rsp), %rdi callq 0x35a80 leaq 0x28(%rsp), %rsi movq %rbx, %rdi callq 0x35920 movq 0x4b398(%rip), %rsi # 0xdcf78 leaq 0x20(%rsp), %rdi callq 0x352b0 leaq 0x90(%rsp), %rdi callq 0x35180 movq %rbx, %rax addq $0x198, %rsp # imm = 0x198 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq jmp 0x91c2e movq %rax, %rbx leaq 0x10(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x91c31 movq 0x10(%rsp), %rsi incq %rsi callq 0x355d0 jmp 0x91c31 movq %rax, %rbx movq 0x4b340(%rip), %rsi # 0xdcf78 leaq 0x20(%rsp), %rdi callq 0x352b0 leaq 0x90(%rsp), %rdi callq 0x35180 movq %rbx, %rdi callq 0x35aa0
/simonowen[P]samdisk/include/utils.h
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> util::make_string<char const (&) [19], CylHead&, char const (&) [9], unsigned char&, char const (&) [8], int&>(char const (&) [19], CylHead&, char const (&) [9], unsigned char&, char const (&) [8], int&)
std::string make_string(Args&& ... args) { std::ostringstream ss; (void)std::initializer_list<bool> {(ss << args, false)...}; return ss.str(); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x1a8, %rsp # imm = 0x1A8 movq %r9, %r14 movq %r8, %r15 movq %rcx, %r12 movq %rdx, %r13 movq %rsi, %rbp movq %rdi, 0x8(%rsp) leaq 0x30(%rsp), %rbx movq %rbx, %rdi callq 0x35760 movq %rbp, %rdi callq 0x35210 movq %rbx, %rdi movq %rbp, %rsi movq %rax, %rdx callq 0x356a0 movl (%r13), %edx movl 0x4(%r13), %ecx leaq 0x1a12d(%rip), %rsi # 0xabddb leaq 0x10(%rsp), %rdi xorl %eax, %eax callq 0x784cc movq 0x10(%rsp), %rsi movq 0x18(%rsp), %rdx leaq 0x30(%rsp), %rdi callq 0x356a0 leaq 0x20(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x91ce9 movq 0x20(%rsp), %rsi incq %rsi callq 0x355d0 movq %r12, %rdi callq 0x35210 leaq 0x30(%rsp), %rdi movq %r12, %rsi movq %rax, %rdx callq 0x356a0 movzbl (%r15), %esi leaq 0x30(%rsp), %rdi callq 0x35a80 movq %r14, %rdi callq 0x35210 leaq 0x30(%rsp), %rdi movq %r14, %rsi movq %rax, %rdx callq 0x356a0 movq 0x1e0(%rsp), %rax movl (%rax), %esi leaq 0x30(%rsp), %rdi callq 0x35a80 leaq 0x38(%rsp), %rsi movq 0x8(%rsp), %rbx movq %rbx, %rdi callq 0x35920 movq 0x4b224(%rip), %rsi # 0xdcf78 leaq 0x30(%rsp), %rdi callq 0x352b0 leaq 0xa0(%rsp), %rdi callq 0x35180 movq %rbx, %rax addq $0x1a8, %rsp # imm = 0x1A8 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq jmp 0x91da2 movq %rax, %rbx leaq 0x20(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x91da5 movq 0x20(%rsp), %rsi incq %rsi callq 0x355d0 jmp 0x91da5 movq %rax, %rbx movq 0x4b1cc(%rip), %rsi # 0xdcf78 leaq 0x30(%rsp), %rdi callq 0x352b0 leaq 0xa0(%rsp), %rdi callq 0x35180 movq %rbx, %rdi callq 0x35aa0 nop
/simonowen[P]samdisk/include/utils.h
to_string[abi:cxx11](FloppyInterfaceMode)
std::string to_string(FloppyInterfaceMode interface_mode) { switch (interface_mode) { case IBMPC_DD_FLOPPYMODE: return "IBMPC_DD_FLOPPYMODE"; break; case IBMPC_HD_FLOPPYMODE: return "IBMPC_HD_FLOPPYMODE"; break; case ATARIST_DD_FLOPPYMODE: return "ATARIST_DD_FLOPPYMODE"; break; case ATARIST_HD_FLOPPYMODE: return "ATARIST_HD_FLOPPYMODE"; break; case AMIGA_DD_FLOPPYMODE: return "AMIGA_DD_FLOPPYMODE"; break; case AMIGA_HD_FLOPPYMODE: return "AMIGA_HD_FLOPPYMODE"; break; case CPC_DD_FLOPPYMODE: return "CPC_DD_FLOPPYMODE"; break; case GENERIC_SHUGART_DD_FLOPPYMODE: return "GENERIC_SHUGART_DD_FLOPPYMODE"; break; case IBMPC_ED_FLOPPYMODE: return "IBMPC_ED_FLOPPYMODE"; break; case MSX2_DD_FLOPPYMODE: return "MSX2_DD_FLOPPYMODE"; break; case C64_DD_FLOPPYMODE: return "C64_DD_FLOPPYMODE"; break; case EMU_SHUGART_FLOPPYMODE:return "EMU_SHUGART_FLOPPYMODE"; break; case S950_DD_FLOPPYMODE: return "S950_DD_FLOPPYMODE"; break; case S950_HD_FLOPPYMODE: return "S950_HD_FLOPPYMODE"; break; case DISABLE_FLOPPYMODE: return "DISABLE_FLOPPYMODE"; break; } return "Unknown"; }
pushq %rbx movq %rdi, %rbx leaq 0x10(%rdi), %rax movq %rax, (%rdi) cmpl $0xd, %esi ja 0x91e01 movl %esi, %eax leaq 0x2087f(%rip), %rcx # 0xb2664 movslq (%rcx,%rax,4), %rax addq %rcx, %rax jmpq *%rax leaq 0x208b7(%rip), %rsi # 0xb26ac leaq 0x208c3(%rip), %rdx # 0xb26bf jmp 0x91f0d cmpl $0xfe, %esi jne 0x91e8f leaq 0x209ba(%rip), %rsi # 0xb27ce leaq 0x209c5(%rip), %rdx # 0xb27e0 jmp 0x91f0d leaq 0x2096a(%rip), %rsi # 0xb2791 leaq 0x20979(%rip), %rdx # 0xb27a7 jmp 0x91f0d leaq 0x208c6(%rip), %rsi # 0xb2700 leaq 0x208d2(%rip), %rdx # 0xb2713 jmp 0x91f0d leaq 0x2095b(%rip), %rsi # 0xb27a8 leaq 0x20966(%rip), %rdx # 0xb27ba jmp 0x91f0d leaq 0x2090c(%rip), %rsi # 0xb276c leaq 0x20917(%rip), %rdx # 0xb277e jmp 0x91f0d leaq 0x20861(%rip), %rsi # 0xb26d4 leaq 0x2086f(%rip), %rdx # 0xb26e9 jmp 0x91f0d leaq 0x20864(%rip), %rsi # 0xb26ea leaq 0x20872(%rip), %rdx # 0xb26ff jmp 0x91f0d leaq 0x1ccbc(%rip), %rsi # 0xaeb52 leaq 0x1ccbc(%rip), %rdx # 0xaeb59 jmp 0x91f0d leaq 0x20894(%rip), %rsi # 0xb273a leaq 0x208aa(%rip), %rdx # 0xb2757 jmp 0x91f0d leaq 0x2080a(%rip), %rsi # 0xb26c0 leaq 0x20816(%rip), %rdx # 0xb26d3 jmp 0x91f0d leaq 0x2084e(%rip), %rsi # 0xb2714 leaq 0x2085a(%rip), %rdx # 0xb2727 jmp 0x91f0d leaq 0x208e5(%rip), %rsi # 0xb27bb leaq 0x208f0(%rip), %rdx # 0xb27cd jmp 0x91f0d leaq 0x20842(%rip), %rsi # 0xb2728 leaq 0x2084c(%rip), %rdx # 0xb2739 jmp 0x91f0d leaq 0x20889(%rip), %rsi # 0xb277f leaq 0x20893(%rip), %rdx # 0xb2790 jmp 0x91f0d leaq 0x20852(%rip), %rsi # 0xb2758 leaq 0x2085e(%rip), %rdx # 0xb276b movq %rbx, %rdi callq 0x445b8 movq %rbx, %rax popq %rbx retq
/simonowen[P]samdisk/src/types/hfe.cpp
to_string[abi:cxx11](TrackEncoding)
std::string to_string(TrackEncoding track_encoding) { switch (track_encoding) { case ISOIBM_MFM_ENCODING: return "ISOIBM_MFM_ENCODING"; break; case AMIGA_MFM_ENCODING: return "AMIGA_MFM_ENCODING"; break; case ISOIBM_FM_ENCODING: return "ISOIBM_FM_ENCODING"; break; case EMU_FM_ENCODING: return "EMU_FM_ENCODING"; break; case UNKNOWN_ENCODING: return "UNKNOWN_ENCODING"; break; } return "Unknown"; }
pushq %rbx movq %rdi, %rbx leaq 0x10(%rdi), %rax movq %rax, (%rdi) cmpl $0x3, %esi ja 0x91f4c movl %esi, %eax leaq 0x20769(%rip), %rcx # 0xb269c movslq (%rcx,%rax,4), %rax addq %rcx, %rax jmpq *%rax leaq 0x2089e(%rip), %rsi # 0xb27e1 leaq 0x208aa(%rip), %rdx # 0xb27f4 jmp 0x91fa2 cmpl $0xff, %esi jne 0x91f64 leaq 0x208d0(%rip), %rsi # 0xb282b leaq 0x208d9(%rip), %rdx # 0xb283b jmp 0x91fa2 leaq 0x1cbe7(%rip), %rsi # 0xaeb52 leaq 0x1cbe7(%rip), %rdx # 0xaeb59 jmp 0x91fa2 leaq 0x2088d(%rip), %rsi # 0xb2808 leaq 0x20898(%rip), %rdx # 0xb281a jmp 0x91fa2 leaq 0x20890(%rip), %rsi # 0xb281b leaq 0x20898(%rip), %rdx # 0xb282a jmp 0x91fa2 leaq 0x2085a(%rip), %rsi # 0xb27f5 leaq 0x20865(%rip), %rdx # 0xb2807 movq %rbx, %rdi callq 0x445b8 movq %rbx, %rax popq %rbx retq
/simonowen[P]samdisk/src/types/hfe.cpp
ReadHFE(MemFile&, std::shared_ptr<Disk>&)
bool ReadHFE(MemFile& file, std::shared_ptr<Disk>& disk) { HFE_HEADER hh; if (!file.rewind() || !file.read(&hh, sizeof(hh)) || memcmp(&hh.header_signature, HFE_SIGNATURE, sizeof(hh.header_signature))) return false; if (hh.format_revision != 0) throw util::exception("unsupported HFE format revision (", hh.format_revision, ")"); HFE_TRACK aTrackLUT[256]; auto track_lut_offset = util::letoh(hh.track_list_offset) << 9; if (!file.seek(track_lut_offset) || !file.read(aTrackLUT, sizeof(aTrackLUT))) throw util::exception("failed to read track LUT (@", track_lut_offset, ")"); auto datarate = DataRate::Unknown; auto data_bitrate = util::letoh(hh.bitrate_kbps); if (data_bitrate >= 240 && data_bitrate <= 260) datarate = DataRate::_250K; else if (data_bitrate >= 290 && data_bitrate <= 310) datarate = DataRate::_300K; else if (data_bitrate >= 490 && data_bitrate <= 510) datarate = DataRate::_500K; else if (data_bitrate == 0xffff) throw util::exception("variable bitrate images are not supported"); else throw util::exception("unsupported data rate (", data_bitrate, "Kbps)"); Format::Validate(hh.number_of_tracks, hh.number_of_sides); // 64K should be enough for maximum MFM track size, and we'll check later anyway MEMORY mem(0x10000); auto pbTrack = mem.pb; for (uint8_t cyl = 0; cyl < hh.number_of_tracks; ++cyl) { // Offset is in 512-byte blocks, data length covers both heads auto uTrackDataOffset = util::letoh(aTrackLUT[cyl].offset) << 9; auto uTrackDataLen = util::letoh(aTrackLUT[cyl].track_len) >> 1; if (uTrackDataLen > mem.size) throw util::exception("invalid track size (", uTrackDataLen, ") for track ", CylStr(cyl)); for (uint8_t head = 0; head < hh.number_of_sides; ++head) { // Head 1 data starts 256 bytes in if (head == 1) uTrackDataOffset += 256; auto uRead = 0; while (uRead < uTrackDataLen) { auto chunk = std::min(uTrackDataLen - uRead, 256); // Read the next interleaved chunk if (!file.seek(uTrackDataOffset + (uRead * 2)) || !file.read(pbTrack + uRead, chunk)) throw util::exception("EOF reading track data for ", CH(cyl, head)); uRead += chunk; } BitBuffer bitbuf(datarate, pbTrack, uTrackDataLen * 8); disk->write(CylHead(cyl, head), std::move(bitbuf)); } } disk->metadata["interface_mode"] = to_string(static_cast<FloppyInterfaceMode>(hh.floppy_interface_mode)); disk->metadata["track_encoding"] = to_string(static_cast<TrackEncoding>(hh.track_encoding)); disk->metadata["data_bitrate"] = std::to_string(hh.bitrate_kbps) + "Kbps"; if (hh.floppy_rpm) disk->metadata["floppy_rpm"] = std::to_string(hh.floppy_rpm); disk->strType = "HFE"; return true; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x508, %rsp # imm = 0x508 movq %rsi, 0x18(%rsp) movq %rdi, %r15 callq 0x64db2 testb %al, %al je 0x91ff8 leaq 0x52(%rsp), %rsi movq %r15, %rdi movl $0x1a, %edx callq 0x64d0c testb %al, %al je 0x91ff8 movabsq $0x4546434950435848, %rax # imm = 0x4546434950435848 cmpq %rax, 0x52(%rsp) je 0x9200c xorl %eax, %eax addq $0x508, %rsp # imm = 0x508 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq cmpb $0x0, 0x5a(%rsp) jne 0x9263a movzwl 0x64(%rsp), %esi shll $0x9, %esi movl %esi, 0x74(%rsp) movq %r15, %rdi callq 0x64dce testb %al, %al je 0x92610 leaq 0x100(%rsp), %rsi movq %r15, %rdi movl $0x400, %edx # imm = 0x400 callq 0x64d0c testb %al, %al je 0x92610 movzwl 0x5e(%rsp), %r14d movw %r14w, 0x16(%rsp) movl %r14d, %eax addl $0xffffff10, %eax # imm = 0xFFFFFF10 movl $0x3d090, 0xc(%rsp) # imm = 0x3D090 cmpw $0x15, %ax jb 0x920a0 leal -0x122(%r14), %eax movl $0x493e0, 0xc(%rsp) # imm = 0x493E0 cmpw $0x15, %ax jb 0x920a0 leal -0x1ea(%r14), %eax movl $0x7a120, 0xc(%rsp) # imm = 0x7A120 cmpw $0x15, %ax jae 0x9267b movzbl 0x5b(%rsp), %edi movzbl 0x5c(%rsp), %esi movl $0x1, %edx movl $0x200, %ecx # imm = 0x200 xorl %r8d, %r8d callq 0x5e8ce movl $0x10000, %edi # imm = 0x10000 callq 0x77560 movq %rax, 0x48(%rsp) cmpb $0x0, 0x5b(%rsp) je 0x9224c movq $0x0, 0x40(%rsp) movl $0x100, %r13d # imm = 0x100 cmpb $0x0, 0x5c(%rsp) je 0x92231 movq 0x40(%rsp), %rax movzwl 0x102(%rsp,%rax,4), %ecx movl %ecx, 0x70(%rsp) movl %ecx, %r12d shrl %r12d movzwl 0x100(%rsp,%rax,4), %ebx shll $0x9, %ebx leal (,%r12,8), %eax movl %eax, 0x6c(%rsp) xorl %ebp, %ebp movl %ebx, %eax leal 0x100(%rax), %ebx movl %ebp, 0x10(%rsp) cmpl $0x1, %ebp cmovnel %eax, %ebx cmpw $0x2, 0x70(%rsp) jb 0x92182 xorl %ebp, %ebp movl %r12d, %r14d subl %ebp, %r14d cmpl %r13d, %r14d cmovgel %r13d, %r14d leal (%rbx,%rbp,2), %esi movq %r15, %rdi callq 0x64dce testb %al, %al je 0x925c4 movslq %ebp, %rsi addq 0x48(%rsp), %rsi movq %r15, %rdi movl %r14d, %edx callq 0x64d0c testb %al, %al je 0x925c4 addl %ebp, %r14d movl %r14d, %ebp cmpl %r12d, %r14d jl 0x9213c leaq 0x78(%rsp), %rbp movq %rbp, %rdi movl 0xc(%rsp), %esi movq 0x48(%rsp), %rdx movl 0x6c(%rsp), %ecx callq 0x37bda movq 0x18(%rsp), %rax movq (%rax), %r14 leaq 0x20(%rsp), %rdi movq 0x40(%rsp), %rsi movl 0x10(%rsp), %edx callq 0x46fa2 movq %r14, %rdi leaq 0x20(%rsp), %rsi movq %rbp, %rdx callq 0x54ff6 movq 0xb0(%rsp), %rdi testq %rdi, %rdi je 0x921e4 movq 0xc0(%rsp), %rsi subq %rdi, %rsi callq 0x355d0 movq 0x98(%rsp), %rdi testq %rdi, %rdi movl 0x10(%rsp), %ebp je 0x92205 movq 0xa8(%rsp), %rsi subq %rdi, %rsi callq 0x355d0 movq 0x80(%rsp), %rdi testq %rdi, %rdi je 0x92222 movq 0x90(%rsp), %rsi subq %rdi, %rsi callq 0x355d0 incl %ebp movzbl 0x5c(%rsp), %eax cmpl %eax, %ebp jb 0x92120 movq 0x40(%rsp), %rdx incq %rdx movzbl 0x5b(%rsp), %eax movq %rdx, 0x40(%rsp) cmpq %rax, %rdx jb 0x920e5 movzbl 0x62(%rsp), %esi leaq 0x78(%rsp), %rdi callq 0x91dcc movq 0x18(%rsp), %rax movq (%rax), %r14 leaq 0x30(%rsp), %r12 movq %r12, -0x10(%r12) leaq 0x20673(%rip), %rsi # 0xb28e7 leaq 0x2067a(%rip), %rdx # 0xb28f5 leaq 0x20(%rsp), %rdi callq 0x445b8 addq $0x48, %r14 leaq 0x20(%rsp), %rsi movq %r14, %rdi callq 0x48d0c leaq 0x78(%rsp), %rsi movq %rax, %rdi callq 0x35700 movq 0x20(%rsp), %rdi cmpq %r12, %rdi je 0x922ba movq 0x30(%rsp), %rsi incq %rsi callq 0x355d0 leaq 0x88(%rsp), %r13 movq -0x10(%r13), %rdi cmpq %r13, %rdi je 0x922db movq 0x88(%rsp), %rsi incq %rsi callq 0x355d0 movzbl 0x5d(%rsp), %esi leaq 0x78(%rsp), %rdi callq 0x91f1a movq 0x18(%rsp), %rax movq (%rax), %r14 leaq 0x20(%rsp), %rdi movq %r12, (%rdi) leaq 0x205f5(%rip), %rsi # 0xb28f6 leaq 0x205fc(%rip), %rdx # 0xb2904 callq 0x445b8 addq $0x48, %r14 leaq 0x20(%rsp), %rsi movq %r14, %rdi callq 0x48d0c leaq 0x78(%rsp), %rsi movq %rax, %rdi callq 0x35700 movq 0x20(%rsp), %rdi cmpq %r12, %rdi je 0x92342 movq 0x30(%rsp), %rsi incq %rsi callq 0x355d0 movq 0x78(%rsp), %rdi cmpq %r13, %rdi je 0x9235c movq 0x88(%rsp), %rsi incq %rsi callq 0x355d0 movzwl 0x5e(%rsp), %ebp movl $0x1, %r14d cmpl $0xa, %ebp jb 0x92396 movl $0x2, %r14d cmpw $0x64, %bp jb 0x92396 movl $0x3, %r14d cmpl $0x3e8, %ebp # imm = 0x3E8 jb 0x92396 cmpl $0x2710, %ebp # imm = 0x2710 movl $0x5, %r14d sbbl $0x0, %r14d movl %r14d, %esi leaq 0x20(%rsp), %rdi movq %r12, (%rdi) movl $0x2d, %edx callq 0x356c0 leaq 0x20(%rsp), %r15 movq (%r15), %rdi movl %r14d, %esi movl %ebp, %edx callq 0x799ef leaq 0x1c77b(%rip), %rsi # 0xaeb3f movq %r15, %rdi callq 0x35b60 movq %r13, 0x78(%rsp) movq (%rax), %rdx movq %rax, %rcx addq $0x10, %rcx cmpq %rcx, %rdx je 0x923f2 movq %rdx, 0x78(%rsp) movq (%rcx), %rdx movq %rdx, 0x88(%rsp) jmp 0x923fa movups (%rcx), %xmm0 movups %xmm0, (%r13) movq 0x8(%rax), %rdx movq %rdx, 0x80(%rsp) movq %rcx, (%rax) movq $0x0, 0x8(%rax) movb $0x0, 0x10(%rax) movq 0x18(%rsp), %rax movq (%rax), %r14 leaq 0xf0(%rsp), %rbx movq %rbx, -0x10(%rbx) leaq 0x204d5(%rip), %rsi # 0xb2905 leaq 0x204da(%rip), %rdx # 0xb2911 leaq 0xe0(%rsp), %rdi callq 0x445b8 addq $0x48, %r14 leaq 0xe0(%rsp), %rsi movq %r14, %rdi callq 0x48d0c leaq 0x78(%rsp), %rsi movq %rax, %rdi callq 0x35700 movq 0xe0(%rsp), %rdi cmpq %rbx, %rdi je 0x92482 movq 0xf0(%rsp), %rsi incq %rsi callq 0x355d0 movq 0x78(%rsp), %rdi cmpq %r13, %rdi je 0x9249c movq 0x88(%rsp), %rsi incq %rsi callq 0x355d0 movq 0x20(%rsp), %rdi cmpq %r12, %rdi je 0x924b3 movq 0x30(%rsp), %rsi incq %rsi callq 0x355d0 movzwl 0x60(%rsp), %ebp testl %ebp, %ebp je 0x9258c movl $0x1, %r14d cmpw $0xa, %bp jb 0x924f6 movl $0x2, %r14d cmpw $0x64, %bp jb 0x924f6 movl $0x3, %r14d cmpl $0x3e8, %ebp # imm = 0x3E8 jb 0x924f6 cmpl $0x2710, %ebp # imm = 0x2710 movl $0x5, %r14d sbbl $0x0, %r14d movl %r14d, %esi leaq 0x78(%rsp), %rdi movq %r13, (%rdi) movl $0x2d, %edx callq 0x356c0 movq 0x78(%rsp), %rdi movl %r14d, %esi movl %ebp, %edx callq 0x799ef movq 0x18(%rsp), %rax movq (%rax), %r14 leaq 0x20(%rsp), %rdi movq %r12, (%rdi) leaq 0x203e1(%rip), %rsi # 0xb2912 leaq 0x203e4(%rip), %rdx # 0xb291c callq 0x445b8 addq $0x48, %r14 leaq 0x20(%rsp), %rsi movq %r14, %rdi callq 0x48d0c leaq 0x78(%rsp), %rsi movq %rax, %rdi callq 0x35700 movq 0x20(%rsp), %rdi cmpq %r12, %rdi je 0x92572 movq 0x30(%rsp), %rsi incq %rsi callq 0x355d0 movq 0x78(%rsp), %rdi cmpq %r13, %rdi je 0x9258c movq 0x88(%rsp), %rsi incq %rsi callq 0x355d0 movq 0x18(%rsp), %rax movq (%rax), %rdi movq 0x80(%rdi), %rdx addq $0x78, %rdi leaq 0x1e75a(%rip), %rcx # 0xb0d00 movl $0x3, %r8d xorl %esi, %esi callq 0x358f0 movq 0x48(%rsp), %rdi callq 0x775ea movb $0x1, %al jmp 0x91ffa movl $0x10, %edi callq 0x35260 movq %rax, %r15 movb $0x1, %bl movq 0x40(%rsp), %rdi movl 0x10(%rsp), %esi callq 0x76a95 leaq 0x78(%rsp), %rdx movq %rax, (%rdx) leaq 0x202db(%rip), %rsi # 0xb28cb movq %r15, %rdi callq 0x93192 xorl %ebx, %ebx leaq 0x4957f(%rip), %rsi # 0xdbb80 movq 0x4a978(%rip), %rdx # 0xdcf80 movq %r15, %rdi callq 0x35a50 movl $0x10, %edi callq 0x35260 movq %rax, %rbx leaq 0x20243(%rip), %rsi # 0xb2867 leaq 0x1c975(%rip), %rcx # 0xaefa0 leaq 0x74(%rsp), %rdx movq %rax, %rdi callq 0x64eea jmp 0x92665 leaq 0x5a(%rsp), %r14 movl $0x10, %edi callq 0x35260 movq %rax, %rbx leaq 0x201f2(%rip), %rsi # 0xb2845 leaq 0x1c946(%rip), %rcx # 0xaefa0 movq %rax, %rdi movq %r14, %rdx callq 0x930a6 leaq 0x49514(%rip), %rsi # 0xdbb80 movq 0x4a90d(%rip), %rdx # 0xdcf80 movq %rbx, %rdi callq 0x35a50 movl $0x10, %edi callq 0x35260 movq %rax, %rbx cmpw $-0x1, %r14w jne 0x926a0 leaq 0x201ed(%rip), %rsi # 0xb2883 movq %rbx, %rdi callq 0x84a1c jmp 0x92665 leaq 0x20206(%rip), %rsi # 0xb28ad leaq 0x20217(%rip), %rcx # 0xb28c5 leaq 0x16(%rsp), %rdx movq %rbx, %rdi callq 0x9311c jmp 0x92665 jmp 0x927b1 jmp 0x927b1 jmp 0x927b1 jmp 0x92740 jmp 0x9275c jmp 0x927e0 jmp 0x927f5 jmp 0x927e0 movq %rax, %r14 movq 0xe0(%rsp), %rdi cmpq %rbx, %rdi je 0x92707 movq 0xf0(%rsp), %rsi incq %rsi callq 0x355d0 jmp 0x92707 movq %rax, %r14 movq 0x78(%rsp), %rdi cmpq %r13, %rdi je 0x92726 movq 0x88(%rsp), %rsi incq %rsi callq 0x355d0 jmp 0x92726 movq %rax, %r14 movq 0x20(%rsp), %rdi cmpq %r12, %rdi je 0x927e3 movq 0x30(%rsp), %rsi jmp 0x927a5 jmp 0x927e0 movq %rax, %r14 movq 0x20(%rsp), %rdi cmpq %r12, %rdi je 0x9275f movq 0x30(%rsp), %rsi incq %rsi callq 0x355d0 jmp 0x9275f movq %rax, %r14 movq 0x78(%rsp), %rdi cmpq %r13, %rdi jne 0x9279d jmp 0x927e3 jmp 0x927e0 movq %rax, %r14 movq 0x20(%rsp), %rdi cmpq %r12, %rdi je 0x9278c movq 0x30(%rsp), %rsi incq %rsi callq 0x355d0 jmp 0x9278c movq %rax, %r14 leaq 0x88(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x927e3 movq 0x88(%rsp), %rsi incq %rsi callq 0x355d0 jmp 0x927e3 jmp 0x927e0 movq %rax, %r14 movq %rbx, %rdi callq 0x35430 jmp 0x927ed movq %rax, %r14 leaq 0x78(%rsp), %rdi callq 0x38cd8 jmp 0x927e3 jmp 0x927e0 movq %rax, %r14 testb %bl, %bl je 0x927e3 movq %r15, %rdi callq 0x35430 jmp 0x927e3 movq %rax, %r14 movq 0x48(%rsp), %rdi callq 0x775ea movq %r14, %rdi callq 0x35aa0 movq %rax, %rdi callq 0x410ac
/simonowen[P]samdisk/src/types/hfe.cpp
WriteHFE(_IO_FILE*, std::shared_ptr<Disk>&)
bool WriteHFE(FILE* f_, std::shared_ptr<Disk>& disk) { std::vector<uint8_t> header(256, 0xff); auto& hh = *reinterpret_cast<HFE_HEADER*>(header.data()); auto& track0 = disk->read_track({ 0, 0 }); strncpy(hh.header_signature, HFE_SIGNATURE, sizeof(hh.header_signature)); hh.format_revision = 0x00; hh.number_of_tracks = static_cast<uint8_t>(disk->cyls()); hh.number_of_sides = static_cast<uint8_t>(disk->heads()); hh.track_encoding = HfeTrackEncoding(track0); hh.bitrate_kbps = util::htole(HfeDataRate(track0)); hh.floppy_rpm = 0; hh.floppy_interface_mode = HfeInterfaceMode(track0); hh.do_not_use = 0x01; hh.track_list_offset = util::htole(static_cast<uint16_t>(0x200 >> 9)); hh.write_allowed = 0xff; hh.single_step = 0xff; hh.track0s0_altencoding = 0xff; hh.track0s0_encoding = 0xff; hh.track0s1_altencoding = 0xff; hh.track0s1_encoding = 0xff; if (!fwrite(header.data(), header.size(), 1, f_)) throw util::exception("write error"); if (fseek(f_, hh.track_list_offset << 9, SEEK_SET)) throw util::exception("seek error"); std::array<HFE_TRACK, MAX_TRACKS> aTrackLUT{}; std::map<CylHead, BitBuffer> bitstreams; int data_offset = 2; auto max_disk_track_bytes = 0; for (uint8_t cyl = 0; cyl < hh.number_of_tracks; ++cyl) { auto max_track_bytes = 0; for (uint8_t head = 0; head < hh.number_of_sides; ++head) { CylHead cylhead(cyl, head); auto trackdata = disk->read(cylhead); auto bitstream = trackdata.preferred().bitstream(); auto track_bytes = (bitstream.track_bitsize() + 7) / 8; max_track_bytes = std::max(track_bytes, max_track_bytes); max_disk_track_bytes = std::max(max_disk_track_bytes, max_track_bytes); bitstreams[cylhead] = std::move(bitstream); } aTrackLUT[cyl].offset = util::htole(static_cast<uint16_t>(data_offset)); aTrackLUT[cyl].track_len = util::htole(static_cast<uint16_t>(max_track_bytes * 2)); data_offset += ((max_track_bytes * 2) / 512) + 1; } if (fwrite(aTrackLUT.data(), sizeof(aTrackLUT[0]), aTrackLUT.size(), f_) != aTrackLUT.size()) throw util::exception("write error"); MEMORY mem(max_disk_track_bytes * 2 + 512); for (uint8_t cyl = 0; cyl < hh.number_of_tracks; ++cyl) { uint8_t* pbTrack{}; for (uint8_t head = 0; head < hh.number_of_sides; ++head) { auto& bitstream = bitstreams[{ cyl, head }]; auto track_bytes = (bitstream.track_bitsize() + 7) / 8; bitstream.seek(0); pbTrack = mem.pb + head * 256; while (track_bytes > 0) { auto chunk_size = std::min(track_bytes, 0x100); for (int i = 0; i < chunk_size; ++i) *pbTrack++ = bitstream.read8_lsb(); memset(pbTrack, 0x55, 0x100 - chunk_size); pbTrack += 0x200 - chunk_size; track_bytes -= chunk_size; } } fseek(f_, util::letoh(aTrackLUT[cyl].offset) * 512, SEEK_SET); auto track_len = (util::letoh(aTrackLUT[cyl].track_len) + 511) & ~0x1ff; if (fwrite(mem.pb, 1, track_len, f_) != static_cast<size_t>(track_len)) throw util::exception("write error"); } return true; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x448, %rsp # imm = 0x448 movq %rsi, %r13 movq %rdi, %r12 movl $0x100, %edi # imm = 0x100 callq 0x355b0 movq %rax, %r14 movl $0x100, %edx # imm = 0x100 movq %rax, %rdi movl $0xff, %esi callq 0x352d0 movq (%r13), %rdi leaq 0x248(%rsp), %rsi movq $0x0, (%rsi) xorl %edx, %edx movq %r14, (%rsp) callq 0x54cdc movq %rax, %rbx movabsq $0x4546434950435848, %rax # imm = 0x4546434950435848 movq %rax, (%r14) movb $0x0, 0x8(%r14) movq (%r13), %rdi callq 0x54940 movq (%rsp), %rcx movb %al, 0x9(%rcx) movq (%r13), %rdi callq 0x54964 movq (%rsp), %rcx movb %al, 0xa(%rcx) leaq 0x4ceb3(%rip), %r14 # 0xdf740 movl 0x134(%r14), %ecx testl %ecx, %ecx jne 0x928b3 movq %rbx, %rdi callq 0x713f0 xorl %ecx, %ecx testb %al, %al jne 0x928b3 movq %rbx, %rdi xorl %esi, %esi callq 0x71416 movl 0x14(%rax), %ecx movl %ecx, %eax decl %eax leal -0x8(,%rcx,8), %ecx movabsq $0xffff01000200, %rdx # imm = 0xFFFF01000200 shrq %cl, %rdx cmpl $0x8, %eax movl $0xff, %eax cmovbl %edx, %eax movq (%rsp), %rcx movb %al, 0xb(%rcx) movl 0x138(%r14), %ecx testl %ecx, %ecx jne 0x92903 movq %rbx, %rdi callq 0x713f0 xorl %ecx, %ecx testb %al, %al jne 0x92903 movq %rbx, %rdi xorl %esi, %esi callq 0x71416 movl 0x10(%rax), %ecx movl %ecx, %eax imulq $0x10624dd3, %rax, %rax # imm = 0x10624DD3 shrq $0x26, %rax testl %ecx, %ecx movl $0xfa, %ecx cmovnel %eax, %ecx movq (%rsp), %rax movw %cx, 0xc(%rax) movw $0x0, 0xe(%rax) movq %rbx, %rdi callq 0x713f0 movb $0x7, %bpl testb %al, %al jne 0x929a9 movq %rbx, %rdi xorl %esi, %esi callq 0x71416 movl 0x14(%rax), %eax leal -0x1(%rax), %ecx cmpl $0x2, %ecx jae 0x9297a movq %rbx, %rdi xorl %esi, %esi callq 0x71416 movl 0x10(%rax), %eax cmpl $0x7a120, %eax # imm = 0x7A120 movl $0x1, %ecx movl $0x7, %edx cmovel %ecx, %edx cmpl $0xf4240, %eax # imm = 0xF4240 movl $0x8, %ebp cmovnel %edx, %ebp jmp 0x929a9 cmpl $0x4, %eax jne 0x929a9 movq %rbx, %rdi xorl %esi, %esi callq 0x71416 movl 0x10(%rax), %eax cmpl $0x7a120, %eax # imm = 0x7A120 setne %cl addb %cl, %cl orb $0x5, %cl cmpl $0x3d090, %eax # imm = 0x3D090 movzbl %cl, %eax movl $0x4, %ebp cmovnel %eax, %ebp movq (%rsp), %rbx movb %bpl, 0x10(%rbx) movb $0x1, 0x11(%rbx) movw $0x1, 0x12(%rbx) movl $0xffffffff, 0x14(%rbx) # imm = 0xFFFFFFFF movw $0xffff, 0x18(%rbx) # imm = 0xFFFF movl $0x100, %esi # imm = 0x100 movl $0x1, %edx movq %rbx, %rdi movq %r12, %rcx callq 0x35b80 testq %rax, %rax je 0x92f2e movzwl 0x12(%rbx), %esi shll $0x9, %esi movq %r12, %rdi xorl %edx, %edx callq 0x35660 testl %eax, %eax jne 0x92f4c leaq 0x248(%rsp), %rdi xorl %r15d, %r15d movl $0x200, %edx # imm = 0x200 xorl %esi, %esi callq 0x352d0 leaq 0xb0(%rsp), %rax movl $0x0, (%rax) movq %r15, 0x8(%rax) movq %rax, 0x10(%rax) movq %rax, 0x18(%rax) movq %r15, 0x20(%rax) cmpb $0x0, 0x9(%rbx) movq %r12, 0x18(%rsp) je 0x92d47 movq %r13, 0x8(%rsp) leaq 0x48(%rsp), %r12 movl $0x98, %eax leaq 0x190(%rsp), %rcx addq %rax, %rcx movq %rcx, 0x30(%rsp) leaq 0xd8(%rsp), %rcx addq %rcx, %rax movq %rax, 0x28(%rsp) movl $0x2, %edx movq $0x0, 0x10(%rsp) movq (%rsp), %rcx movq %rdx, 0x20(%rsp) cmpb $0x0, 0xa(%rcx) je 0x92cf9 xorl %r14d, %r14d xorl %r13d, %r13d leaq 0x38(%rsp), %rbx movq %rbx, %rdi movq 0x10(%rsp), %rsi movl %r14d, %edx callq 0x46fa2 movq 0x8(%rsp), %rax movq (%rax), %rdi movq (%rdi), %rax movq %rbx, %rsi xorl %edx, %edx callq *0x20(%rax) leaq 0xd8(%rsp), %rbp movq %rbp, %rdi movq %rax, %rsi callq 0x4778e leaq 0x190(%rsp), %rbx movq %rbx, %rdi movq %rbp, %rsi callq 0x74ef6 movq %rbx, %rdi callq 0x74e48 movq %rax, %rbx movq (%rax), %rax movq %rax, 0x40(%rsp) leaq 0x8(%rbx), %rsi movq %r12, %rdi callq 0x43192 leaq 0x20(%rbx), %rsi leaq 0x60(%rsp), %rdi callq 0x47a54 movq %rbx, %rsi addq $0x38, %rsi leaq 0x78(%rsp), %rdi callq 0x47a54 movb 0x60(%rbx), %al movb %al, 0x58(%r12) movups 0x50(%rbx), %xmm0 movups %xmm0, 0x48(%r12) movq 0x30(%rsp), %rdi callq 0x42e7a movq 0x1f8(%rsp), %rdi testq %rdi, %rdi je 0x92b5e movq 0x208(%rsp), %rsi subq %rdi, %rsi callq 0x355d0 movq 0x1e0(%rsp), %rdi testq %rdi, %rdi je 0x92b7b movq 0x1f0(%rsp), %rsi subq %rdi, %rsi callq 0x355d0 movq 0x1c8(%rsp), %rdi testq %rdi, %rdi je 0x92b98 movq 0x1d8(%rsp), %rsi subq %rdi, %rsi callq 0x355d0 leaq 0x1a8(%rsp), %rdi callq 0x4106a leaq 0x40(%rsp), %rdi callq 0x387b0 movl %eax, %ebx leal 0x7(%rbx), %eax addl $0xe, %ebx testl %eax, %eax cmovnsl %eax, %ebx sarl $0x3, %ebx cmpl %r13d, %ebx cmovlel %r13d, %ebx cmpl %ebx, %r15d cmovlel %ebx, %r15d leaq 0xa8(%rsp), %rdi leaq 0x38(%rsp), %rsi callq 0x9327e movq %rax, %r13 movq 0x40(%rsp), %rax movq %rax, (%r13) leaq 0x8(%r13), %rdi movq %r12, %rsi callq 0x3909e leaq 0x20(%r13), %rdi leaq 0x60(%rsp), %rsi callq 0x390de movq %r13, %rdi addq $0x38, %rdi leaq 0x78(%rsp), %rsi callq 0x390de movb 0x58(%r12), %al movb %al, 0x60(%r13) movups 0x48(%r12), %xmm0 movups %xmm0, 0x50(%r13) movq 0x78(%rsp), %rdi testq %rdi, %rdi je 0x92c44 movq 0x88(%rsp), %rsi subq %rdi, %rsi callq 0x355d0 movq 0x60(%rsp), %rdi testq %rdi, %rdi je 0x92c5b movq 0x70(%rsp), %rsi subq %rdi, %rsi callq 0x355d0 movq 0x48(%rsp), %rdi testq %rdi, %rdi je 0x92c72 movq 0x58(%rsp), %rsi subq %rdi, %rsi callq 0x355d0 movq 0x28(%rsp), %rdi callq 0x42e7a movq 0x140(%rsp), %rdi testq %rdi, %rdi je 0x92c99 movq 0x150(%rsp), %rsi subq %rdi, %rsi callq 0x355d0 movq 0x128(%rsp), %rdi testq %rdi, %rdi je 0x92cb6 movq 0x138(%rsp), %rsi subq %rdi, %rsi callq 0x355d0 movq 0x110(%rsp), %rdi testq %rdi, %rdi je 0x92cd3 movq 0x120(%rsp), %rsi subq %rdi, %rsi callq 0x355d0 leaq 0xf0(%rsp), %rdi callq 0x4106a incl %r14d movq (%rsp), %rax movzbl 0xa(%rax), %eax movl %ebx, %r13d cmpl %eax, %r14d jb 0x92a99 jmp 0x92cfb xorl %ebx, %ebx movq 0x20(%rsp), %rdx movq 0x10(%rsp), %rsi movw %dx, 0x248(%rsp,%rsi,4) leal (%rbx,%rbx), %eax movw %ax, 0x24a(%rsp,%rsi,4) shrl $0x8, %ebx addl %ebx, %edx incl %edx incq %rsi movq (%rsp), %rcx movzbl 0x9(%rcx), %eax movq %rsi, 0x10(%rsp) cmpq %rax, %rsi jb 0x92a84 leal 0x200(,%r15,2), %ebx movq 0x18(%rsp), %r12 jmp 0x92d4c movl $0x200, %ebx # imm = 0x200 leaq 0x248(%rsp), %rdi movl $0x4, %esi movl $0x80, %edx movq %r12, %rcx callq 0x35b80 cmpq $0x80, %rax jne 0x92f7e movl %ebx, %edi callq 0x77560 movq %rax, 0x8(%rsp) movq (%rsp), %rax cmpb $0x0, 0x9(%rax) je 0x92ebe xorl %r15d, %r15d cmpb $0x0, 0xa(%rax) je 0x92e5e xorl %r12d, %r12d movq %r15, 0x10(%rsp) leaq 0xd8(%rsp), %rbx movq %rbx, %rdi movl %r15d, %esi movl %r12d, %edx callq 0x46fa2 leaq 0xa8(%rsp), %rdi movq %rbx, %rsi callq 0x932fe movq %rax, %rbp movq %rax, %rdi callq 0x387b0 movl %eax, %ebx movq %rbp, %rdi xorl %esi, %esi callq 0x3807c testl %ebx, %ebx jle 0x92e45 movq %r12, %r13 shlq $0x8, %r13 addq 0x8(%rsp), %r13 addl $0x7, %ebx shrl $0x3, %ebx movl $0x100, %eax # imm = 0x100 cmpl %eax, %ebx movl $0x100, %r15d # imm = 0x100 cmovll %ebx, %r15d movl %r15d, %r14d testl %ebx, %ebx jle 0x92e20 movq %rbp, %rdi callq 0x383a4 movb %al, (%r13) incq %r13 decl %r14d jne 0x92e0c movl $0x100, %edx # imm = 0x100 subl %r15d, %edx movq %r13, %rdi movl $0x55, %esi callq 0x352d0 movl $0x200, %eax # imm = 0x200 subl %r15d, %eax addq %rax, %r13 subl %r15d, %ebx jg 0x92df4 incq %r12 movq (%rsp), %rax movzbl 0xa(%rax), %eax cmpl %eax, %r12d movq 0x10(%rsp), %r15 jb 0x92da1 movl %r15d, %ebx movzwl 0x248(%rsp,%rbx,4), %esi shll $0x9, %esi movq 0x18(%rsp), %r14 movq %r14, %rdi xorl %edx, %edx callq 0x35660 movzwl 0x24a(%rsp,%rbx,4), %ebx addl $0x1ff, %ebx # imm = 0x1FF andl $0x1fe00, %ebx # imm = 0x1FE00 movl $0x1, %esi movq 0x8(%rsp), %rdi movq %rbx, %rdx movq %r14, %rcx callq 0x35b80 cmpq %rbx, %rax jne 0x92ef7 incb %r15b movzbl %r15b, %r15d movq (%rsp), %rax cmpb 0x9(%rax), %r15b jb 0x92d8f movq 0x8(%rsp), %rdi callq 0x775ea leaq 0xa8(%rsp), %rdi callq 0x9337e movl $0x100, %esi # imm = 0x100 movq (%rsp), %rdi callq 0x355d0 movb $0x1, %al addq $0x448, %rsp # imm = 0x448 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movl $0x10, %edi callq 0x35260 movq %rax, %rbx leaq 0x1f510(%rip), %rsi # 0xb241b movq %rax, %rdi callq 0x8f486 leaq 0x48c66(%rip), %rsi # 0xdbb80 movq 0x4a05f(%rip), %rdx # 0xdcf80 movq %rbx, %rdi callq 0x35a50 jmp 0x92fb0 movl $0x10, %edi callq 0x35260 movq %rax, %rbx leaq 0x1f4d9(%rip), %rsi # 0xb241b movq %rax, %rdi callq 0x8f486 jmp 0x92f68 movl $0x10, %edi callq 0x35260 movq %rax, %rbx leaq 0x1f9bd(%rip), %rsi # 0xb291d movq %rax, %rdi callq 0x93208 leaq 0x48c11(%rip), %rsi # 0xdbb80 movq 0x4a00a(%rip), %rdx # 0xdcf80 movq %rbx, %rdi callq 0x35a50 movl $0x10, %edi callq 0x35260 movq %rax, %rbx leaq 0x1f489(%rip), %rsi # 0xb241b movq %rax, %rdi callq 0x8f486 leaq 0x48bdf(%rip), %rsi # 0xdbb80 movq 0x49fd8(%rip), %rdx # 0xdcf80 movq %rbx, %rdi callq 0x35a50 jmp 0x9304a movq %rax, %r14 movq %rbx, %rdi callq 0x35430 jmp 0x9307b jmp 0x92fc7 movq %rax, %r14 movq %rbx, %rdi callq 0x35430 jmp 0x93088 jmp 0x9309e jmp 0x9304a jmp 0x92fe0 movq %rax, %r14 jmp 0x93088 jmp 0x9306e movq %rax, %r14 movq %rbx, %rdi callq 0x35430 jmp 0x93071 jmp 0x9306e movq %rax, %r14 jmp 0x9301b movq %rax, %r14 movq 0x60(%rsp), %rdi testq %rdi, %rdi je 0x9301b movq 0x70(%rsp), %rsi subq %rdi, %rsi callq 0x355d0 movq 0x48(%rsp), %rdi testq %rdi, %rdi je 0x93052 movq 0x58(%rsp), %rsi subq %rdi, %rsi callq 0x355d0 jmp 0x93052 movq %rax, %r14 jmp 0x9305f jmp 0x9306e movq %rax, %r14 leaq 0x40(%rsp), %rdi callq 0x38cd8 jmp 0x9305f movq %rax, %r14 jmp 0x9307b movq %rax, %r14 leaq 0x190(%rsp), %rdi callq 0x42c00 leaq 0xd8(%rsp), %rdi callq 0x42c00 jmp 0x9307b movq %rax, %r14 movq 0x8(%rsp), %rdi callq 0x775ea leaq 0xa8(%rsp), %rdi callq 0x9337e movl $0x100, %esi # imm = 0x100 movq (%rsp), %rdi callq 0x355d0 movq %r14, %rdi callq 0x35aa0 movq %rax, %rdi callq 0x410ac
/simonowen[P]samdisk/src/types/hfe.cpp
util::exception::exception<char const (&) [34], unsigned char&, char const (&) [2]>(char const (&) [34], unsigned char&, char const (&) [2])
explicit exception(Args&& ... args) : std::runtime_error(make_string(std::forward<Args>(args)...)) {}
pushq %r14 pushq %rbx subq $0x28, %rsp movq %rdi, %rbx leaq 0x8(%rsp), %r14 movq %r14, %rdi callq 0x93420 movq %rbx, %rdi movq %r14, %rsi callq 0x35710 leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x930e3 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 leaq 0x48abe(%rip), %rax # 0xdbba8 movq %rax, (%rbx) addq $0x28, %rsp popq %rbx popq %r14 retq movq %rax, %rbx leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x93113 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 movq %rbx, %rdi callq 0x35aa0 nop
/simonowen[P]samdisk/include/utils.h
util::exception::exception<char const (&) [11]>(char const (&) [11])
explicit exception(Args&& ... args) : std::runtime_error(make_string(std::forward<Args>(args)...)) {}
pushq %r14 pushq %rbx subq $0x28, %rsp movq %rdi, %rbx leaq 0x8(%rsp), %r14 movq %r14, %rdi callq 0x9367f movq %rbx, %rdi movq %r14, %rsi callq 0x35710 leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x93245 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 leaq 0x4895c(%rip), %rax # 0xdbba8 movq %rax, (%rbx) addq $0x28, %rsp popq %rbx popq %r14 retq movq %rax, %rbx leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x93275 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 movq %rbx, %rdi callq 0x35aa0 nop
/simonowen[P]samdisk/include/utils.h
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> util::make_string<char const (&) [34], unsigned char&, char const (&) [2]>(char const (&) [34], unsigned char&, char const (&) [2])
std::string make_string(Args&& ... args) { std::ostringstream ss; (void)std::initializer_list<bool> {(ss << args, false)...}; return ss.str(); }
pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x180, %rsp # imm = 0x180 movq %rcx, %r14 movq %rdx, %r15 movq %rsi, %r12 movq %rdi, %rbx leaq 0x8(%rsp), %r13 movq %r13, %rdi callq 0x35760 movq %r12, %rdi callq 0x35210 movq %r13, %rdi movq %r12, %rsi movq %rax, %rdx callq 0x356a0 movzbl (%r15), %esi leaq 0x8(%rsp), %rdi callq 0x35a80 movq %r14, %rdi callq 0x35210 leaq 0x8(%rsp), %rdi movq %r14, %rsi movq %rax, %rdx callq 0x356a0 leaq 0x10(%rsp), %rsi movq %rbx, %rdi callq 0x35920 movq 0x49adf(%rip), %rsi # 0xdcf78 leaq 0x8(%rsp), %rdi callq 0x352b0 leaq 0x78(%rsp), %rdi callq 0x35180 movq %rbx, %rax addq $0x180, %rsp # imm = 0x180 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 retq jmp 0x934c3 movq %rax, %rbx movq 0x49aab(%rip), %rsi # 0xdcf78 leaq 0x8(%rsp), %rdi callq 0x352b0 leaq 0x78(%rsp), %rdi callq 0x35180 movq %rbx, %rdi callq 0x35aa0
/simonowen[P]samdisk/include/utils.h
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> util::make_string<char const (&) [24], unsigned short&, char const (&) [6]>(char const (&) [24], unsigned short&, char const (&) [6])
std::string make_string(Args&& ... args) { std::ostringstream ss; (void)std::initializer_list<bool> {(ss << args, false)...}; return ss.str(); }
pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x180, %rsp # imm = 0x180 movq %rcx, %r14 movq %rdx, %r15 movq %rsi, %r12 movq %rdi, %rbx leaq 0x8(%rsp), %r13 movq %r13, %rdi callq 0x35760 movq %r12, %rdi callq 0x35210 movq %r13, %rdi movq %r12, %rsi movq %rax, %rdx callq 0x356a0 movzwl (%r15), %esi leaq 0x8(%rsp), %rdi callq 0x353c0 movq %r14, %rdi callq 0x35210 leaq 0x8(%rsp), %rdi movq %r14, %rsi movq %rax, %rdx callq 0x356a0 leaq 0x10(%rsp), %rsi movq %rbx, %rdi callq 0x35920 movq 0x49a16(%rip), %rsi # 0xdcf78 leaq 0x8(%rsp), %rdi callq 0x352b0 leaq 0x78(%rsp), %rdi callq 0x35180 movq %rbx, %rax addq $0x180, %rsp # imm = 0x180 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 retq jmp 0x9358c movq %rax, %rbx movq 0x499e2(%rip), %rsi # 0xdcf78 leaq 0x8(%rsp), %rdi callq 0x352b0 leaq 0x78(%rsp), %rdi callq 0x35180 movq %rbx, %rdi callq 0x35aa0
/simonowen[P]samdisk/include/utils.h
WriteIMD(_IO_FILE*, std::shared_ptr<Disk>&)
bool WriteIMD(FILE* /*f_*/, std::shared_ptr<Disk>&/*disk*/) { throw std::logic_error("IMD writing not implemented"); #if 0 time_t now = time(NULL); struct tm* tm = localtime(&now); // Format a suitable ASCII header auto strHeader = util::fmt("IMD SAMdisk%02u%02u%02u, %02u/%02u/%04u %02u:%02u:%02u", YEAR % 100, MONTH + 1, DAY, tm->tm_mday, tm->tm_mon + 1, 1900 + tm->tm_year, tm->tm_hour, tm->tm_min, tm->tm_sec); fwrite(strHeader.c_str(), strHeader.length(), 1, f_); // Write the comment field, plus a terminating EOF fwrite(pd_->strComment.c_str(), pd_->strComment.length(), 1, f_); fwrite("\x1a", sizeof(char), 1, f_); for (BYTE cyl = 0; cyl < pd_->bUsedCyls; cyl++) { for (BYTE head = 0; head < pd_->bUsedHeads; head++) { PCTRACK pt = pd_->PeekTrack(cyl, head); int i; // Empty tracks aren't included in the image if (!pt->sectors) continue; // Map encrate to IMD track mode static BYTE modes[] = { 0, 1, 2, 6, 3, 4, 5, 7 }; IMD_TRACK it; it.mode = modes[(pt->IsMFM() ? 4 : 0) | (pt->encrate & FD_RATE_MASK)]; it.cyl = cyl; it.head = head; it.sectors = pt->sectors; it.size = pt->sector[0].size; // default to first sector's size BYTE cmap[MAX_SECTORS], hmap[MAX_SECTORS], rmap[MAX_SECTORS], nmap[MAX_SECTORS * 2], hflags = 0; // First pass over the sectors to check for oddities for (i = 0; i < pt->sectors; i++) { PCSECTOR ps = &pt->sector[i]; // Ensure the sector size is legal if (ps->size > 7) { throw util::exception(CHSR(pt->cyl, pt->head, i, ps->sector), " uses an extended size code, which IMD doesn't support"); // ToDo! ScanTrack(pt, true); return retUnsuitableTarget; } else if (pt->IsMFM() && ps->IsFM()) { throw util::exception(CH(pt->cyl, pt->head), " is mixed-density, which IMD doesn't support"); // ToDo! ScanTrack(pt, true); return retUnsuitableTarget; } // Update the sector, cylinder and head maps cmap[i] = ps->cyl; hmap[i] = ps->head; rmap[i] = ps->sector; nmap[i * 2] = SectorSize(ps->size) & 0xff; nmap[i * 2 + 1] = static_cast<uint8_t>(SectorSize(ps->size) >> 8); // Note deviations from the physical cyl/head values, and fixed sector size if (ps->cyl != cyl) hflags |= 0x80; if (ps->head != head) hflags |= 0x40; if (ps->size != it.size) it.size = 0xff; } // Add the flag bits to the track head value it.head |= hflags; // Write the track header if (!fwrite(&it, sizeof(it), 1, f_)) return retWriteError; // Write the sector map if (!fwrite(rmap, i, 1, f_)) return retWriteError; // Write the cylinder map if non-standard values were used if ((hflags & 0x80) && !fwrite(cmap, i, 1, f_)) return retWriteError; // Write the head map if non-standard values were used if ((hflags & 0x40) && !fwrite(hmap, i, 1, f_)) return retWriteError; // Write the size map if mixed sector sizes were used if (it.size == 0xff && !fwrite(nmap, 2, i, f_)) return retWriteError; // Second pass over sectors to write the data out for (i = 0; i < pt->sectors; i++) { PCSECTOR ps = &pt->sector[i]; unsigned uDataSize = SectorSize(ps->size); // Check for missing data field if (!ps->apbData[0]) { BYTE bType = 0; // Write the sector data as 'not present' if (!fwrite(&bType, 1, 1, f_)) return retWriteError; } // Sector filled with the same value? else if (!memcmp(ps->apbData[0], ps->apbData[0] + 1, uDataSize - 1)) { BYTE bType = ps->IsDeleted() ? 4 : 2; if (ps->IsDataCRC()) bType += 4; // Write the type and the fill byte to repeat BYTE bFill = ps->apbData[0][0]; if (!fwrite(&bType, sizeof(bType), 1, f_) || !fwrite(&bFill, sizeof(bFill), 1, f_)) return retWriteError; } else { BYTE bType = ps->IsDeleted() ? 3 : 1; if (ps->IsDataCRC()) bType += 4; // Write the type and the full sector data if (!fwrite(&bType, 1, 1, f_) || !fwrite(ps->apbData[0], uDataSize, 1, f_)) return retWriteError; } } } } return retOK; #endif }
pushq %r14 pushq %rbx pushq %rax movl $0x10, %edi callq 0x35260 movq %rax, %rbx leaq 0x1e527(%rip), %rsi # 0xb29ff movq %rax, %rdi callq 0x35850 movq 0x48ae9(%rip), %rsi # 0xdcfd0 movq 0x48aa2(%rip), %rdx # 0xdcf90 movq %rbx, %rdi callq 0x35a50 movq %rax, %r14 movq %rbx, %rdi callq 0x35430 movq %r14, %rdi callq 0x35aa0 nop
/simonowen[P]samdisk/src/types/imd.cpp
util::exception::exception<char const (&) [22], unsigned char&, char const (&) [6], CylHead&, char const (&) [9], int&>(char const (&) [22], unsigned char&, char const (&) [6], CylHead&, char const (&) [9], int&)
explicit exception(Args&& ... args) : std::runtime_error(make_string(std::forward<Args>(args)...)) {}
pushq %r14 pushq %rbx subq $0x28, %rsp movq %rdi, %rbx movq 0x40(%rsp), %rax movq %rax, (%rsp) leaq 0x8(%rsp), %r14 movq %r14, %rdi callq 0x94b1e movq %rbx, %rdi movq %r14, %rsi callq 0x35710 leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x946ba movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 leaq 0x474e7(%rip), %rax # 0xdbba8 movq %rax, (%rbx) addq $0x28, %rsp popq %rbx popq %r14 retq movq %rax, %rbx leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x946ea movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 movq %rbx, %rdi callq 0x35aa0
/simonowen[P]samdisk/include/utils.h
util::exception::exception<char const (&) [34], CylHead&, char const (&) [9], int&>(char const (&) [34], CylHead&, char const (&) [9], int&)
explicit exception(Args&& ... args) : std::runtime_error(make_string(std::forward<Args>(args)...)) {}
pushq %r14 pushq %rbx subq $0x28, %rsp movq %rdi, %rbx leaq 0x8(%rsp), %r14 movq %r14, %rdi callq 0x94c92 movq %rbx, %rdi movq %r14, %rsi callq 0x35710 leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x9472f movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 leaq 0x47472(%rip), %rax # 0xdbba8 movq %rax, (%rbx) addq $0x28, %rsp popq %rbx popq %r14 retq movq %rax, %rbx leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x9475f movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 movq %rbx, %rdi callq 0x35aa0
/simonowen[P]samdisk/include/utils.h
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> util::make_string<char const (&) [22], unsigned char&, char const (&) [6], CylHead&, char const (&) [9], int&>(char const (&) [22], unsigned char&, char const (&) [6], CylHead&, char const (&) [9], int&)
std::string make_string(Args&& ... args) { std::ostringstream ss; (void)std::initializer_list<bool> {(ss << args, false)...}; return ss.str(); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x1a8, %rsp # imm = 0x1A8 movq %r9, %r14 movq %r8, %r15 movq %rcx, %r12 movq %rdx, %r13 movq %rsi, %rbp movq %rdi, 0x8(%rsp) leaq 0x30(%rsp), %rbx movq %rbx, %rdi callq 0x35760 movq %rbp, %rdi callq 0x35210 movq %rbx, %rdi movq %rbp, %rsi movq %rax, %rdx callq 0x356a0 movzbl (%r13), %esi leaq 0x30(%rsp), %rdi callq 0x35a80 movq %r12, %rdi callq 0x35210 leaq 0x30(%rsp), %rdi movq %r12, %rsi movq %rax, %rdx callq 0x356a0 movl (%r15), %edx movl 0x4(%r15), %ecx leaq 0x17240(%rip), %rsi # 0xabddb leaq 0x10(%rsp), %rdi xorl %eax, %eax callq 0x784cc movq 0x10(%rsp), %rsi movq 0x18(%rsp), %rdx leaq 0x30(%rsp), %rdi callq 0x356a0 leaq 0x20(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x94bd6 movq 0x20(%rsp), %rsi incq %rsi callq 0x355d0 movq %r14, %rdi callq 0x35210 leaq 0x30(%rsp), %rdi movq %r14, %rsi movq %rax, %rdx callq 0x356a0 movq 0x1e0(%rsp), %rax movl (%rax), %esi leaq 0x30(%rsp), %rdi callq 0x35a80 leaq 0x38(%rsp), %rsi movq 0x8(%rsp), %rbx movq %rbx, %rdi callq 0x35920 movq 0x4835d(%rip), %rsi # 0xdcf78 leaq 0x30(%rsp), %rdi callq 0x352b0 leaq 0xa0(%rsp), %rdi callq 0x35180 movq %rbx, %rax addq $0x1a8, %rsp # imm = 0x1A8 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq jmp 0x94c69 movq %rax, %rbx leaq 0x20(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x94c6c movq 0x20(%rsp), %rsi incq %rsi callq 0x355d0 jmp 0x94c6c movq %rax, %rbx movq 0x48305(%rip), %rsi # 0xdcf78 leaq 0x30(%rsp), %rdi callq 0x352b0 leaq 0xa0(%rsp), %rdi callq 0x35180 movq %rbx, %rdi callq 0x35aa0
/simonowen[P]samdisk/include/utils.h
ReadLIF(MemFile&, std::shared_ptr<Disk>&)
bool ReadLIF(MemFile& file, std::shared_ptr<Disk>& disk) { Format fmt{ RegularFormat::LIF }; // For now, rely on the file size and extension if (file.size() != fmt.disk_size() || !IsFileExt(file.name(), "lif")) return false; file.rewind(); disk->format(fmt, file.data()); disk->strType = "LIF"; return true; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x68, %rsp movq %rsi, %rbx movq %rdi, %r14 leaq 0x2c(%rsp), %r12 movq %r12, %rdi movl $0x1b, %esi callq 0x5db04 movq %r14, %rdi callq 0x64c8e movl %eax, %r15d movq %r12, %rdi callq 0x5e142 movl %eax, %r12d movb $0x1, %bpl cmpl %eax, %r15d jne 0x95d8c movq %r14, %rdi callq 0x64ca2 movq %rax, %r13 leaq 0x18(%rsp), %rax movq %rax, -0x10(%rax) leaq 0x1b0ec(%rip), %rsi # 0xb0e53 leaq 0x1b0e8(%rip), %rdx # 0xb0e56 leaq 0x8(%rsp), %rbp movq %rbp, %rdi callq 0x445b8 movq %r13, %rdi movq %rbp, %rsi callq 0x77230 movl %eax, %ebp xorb $0x1, %bpl cmpl %r12d, %r15d jne 0x95dac leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x95dac movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 testb %bpl, %bpl jne 0x95df8 movq %r14, %rdi callq 0x64db2 movq (%rbx), %r15 movq %r14, %rdi callq 0x64c88 leaq 0x2c(%rsp), %rsi movq %r15, %rdi movq %rax, %rdx xorl %ecx, %ecx callq 0x547da movq (%rbx), %rdi movq 0x80(%rdi), %rdx addq $0x78, %rdi leaq 0x1af5c(%rip), %rcx # 0xb0d47 movl $0x3, %r8d xorl %esi, %esi callq 0x358f0 xorb $0x1, %bpl movl %ebp, %eax addq $0x68, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq %rax, %rbx movq 0x8(%rsp), %rdi leaq 0x18(%rsp), %rax cmpq %rax, %rdi je 0x95e2c movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 movq %rbx, %rdi callq 0x35aa0
/simonowen[P]samdisk/src/types/lif.cpp
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> util::make_string<char const (&) [22], CylHead const&, char const (&) [3], unsigned int&>(char const (&) [22], CylHead const&, char const (&) [3], unsigned int&)
std::string make_string(Args&& ... args) { std::ostringstream ss; (void)std::initializer_list<bool> {(ss << args, false)...}; return ss.str(); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x198, %rsp # imm = 0x198 movq %r8, %r14 movq %rcx, %r15 movq %rdx, %r12 movq %rsi, %r13 movq %rdi, %rbx leaq 0x20(%rsp), %rbp movq %rbp, %rdi callq 0x35760 movq %r13, %rdi callq 0x35210 movq %rbp, %rdi movq %r13, %rsi movq %rax, %rdx callq 0x356a0 movl (%r12), %edx movl 0x4(%r12), %ecx leaq 0x14165(%rip), %rsi # 0xabddb movq %rsp, %rdi xorl %eax, %eax callq 0x784cc movq (%rsp), %rsi movq 0x8(%rsp), %rdx leaq 0x20(%rsp), %rdi callq 0x356a0 leaq 0x10(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x97cae movq 0x10(%rsp), %rsi incq %rsi callq 0x355d0 movq %r15, %rdi callq 0x35210 leaq 0x20(%rsp), %rdi movq %r15, %rsi movq %rax, %rdx callq 0x356a0 movl (%r14), %esi leaq 0x20(%rsp), %rdi callq 0x353c0 leaq 0x28(%rsp), %rsi movq %rbx, %rdi callq 0x35920 movq 0x45291(%rip), %rsi # 0xdcf78 leaq 0x20(%rsp), %rdi callq 0x352b0 leaq 0x90(%rsp), %rdi callq 0x35180 movq %rbx, %rax addq $0x198, %rsp # imm = 0x198 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq jmp 0x97d35 movq %rax, %rbx leaq 0x10(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x97d38 movq 0x10(%rsp), %rsi incq %rsi callq 0x355d0 jmp 0x97d38 movq %rax, %rbx movq 0x45239(%rip), %rsi # 0xdcf78 leaq 0x20(%rsp), %rdi callq 0x352b0 leaq 0x90(%rsp), %rdi callq 0x35180 movq %rbx, %rdi callq 0x35aa0
/simonowen[P]samdisk/include/utils.h
ReadMGT(MemFile&, std::shared_ptr<Disk>&)
bool ReadMGT(MemFile& file, std::shared_ptr<Disk>& disk) { if (file.size() != MGT_DISK_SIZE) return false; // Read the first sector, which contains disk information. std::array<uint8_t, SECTOR_SIZE> sector0; if (!file.rewind() || !file.read(sector0)) return false; MGT_DISK_INFO di{}; GetDiskInfo(sector0.data(), di); // Check the expected chain offset in MGT images (alternating sides). std::array<uint8_t, 2> buf; auto offset = (di.dir_tracks * MGT_SIDES * MGT_TRACK_SIZE) + SECTOR_SIZE - 2; bool mgt = file.seek(offset) && file.read(buf) && buf[0] == di.dir_tracks && buf[1] == 2; // Check the expected chain offset in IMG images (side 0 then side 1). offset = (di.dir_tracks * MGT_TRACK_SIZE) + SECTOR_SIZE - 2; bool img = file.seek(offset) && file.read(buf) && buf[0] == di.dir_tracks && buf[1] == 2; // If neither signature matched this probably isn't an MGT file. // However, accept it if it has a .mgt file extension. if (!mgt && !img && !IsFileExt(file.name(), "mgt")) return false; file.rewind(); disk->format(Format(RegularFormat::MGT), file.data(), img); disk->strType = img ? "IMG" : "MGT"; return true; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x298, %rsp # imm = 0x298 movq %rsi, %rbx movq %rdi, %r14 callq 0x64c8e cmpl $0xc8000, %eax # imm = 0xC8000 jne 0x98583 movq %r14, %rdi callq 0x64db2 testb %al, %al je 0x98583 movq %r14, %rdi callq 0x64c96 cmpl $0x200, %eax # imm = 0x200 jl 0x98583 movq 0x58(%r14), %r15 leaq 0x98(%rsp), %r12 movl $0x200, %edx # imm = 0x200 movq %r12, %rdi movq %r15, %rsi callq 0x354c0 addq $0x200, %r15 # imm = 0x200 movq %r15, 0x58(%r14) movabsq $0x400000000, %rax # imm = 0x400000000 leaq 0x40(%rsp), %rcx movq %rax, -0x18(%rcx) movq %rcx, -0x10(%rcx) movq $0x0, -0x8(%rcx) movb $0x0, (%rcx) movl $0x0, 0x10(%rcx) leaq 0x28(%rsp), %rsi movq %r12, %rdi callq 0x65a5c movl 0x2c(%rsp), %eax shll $0xb, %eax leal (%rax,%rax,4), %esi addl $0x1fe, %esi # imm = 0x1FE movq %r14, %rdi callq 0x64dce testb %al, %al je 0x98599 movq %r14, %rdi callq 0x64c96 cmpl $0x2, %eax jl 0x98566 movq 0x58(%r14), %rcx movzwl (%rcx), %ebp movl %ebp, %r15d shrl $0x8, %r15d addq $0x2, %rcx movq %rcx, 0x58(%r14) cmpl $0x2, %eax jl 0x9859e movzbl %bpl, %eax cmpl %eax, 0x2c(%rsp) sete %al cmpb $0x2, %r15b sete %r12b andb %al, %r12b jmp 0x985a1 xorl %ebp, %ebp movl %ebp, %eax addq $0x298, %rsp # imm = 0x298 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq xorl %r12d, %r12d jmp 0x985a1 xorl %r12d, %r12d movl 0x2c(%rsp), %eax shll $0xa, %eax leal (%rax,%rax,4), %esi addl $0x1fe, %esi # imm = 0x1FE movq %r14, %rdi callq 0x64dce testb %al, %al je 0x985fd movq %r14, %rdi callq 0x64c96 cmpl $0x2, %eax jl 0x985e0 movq 0x58(%r14), %rcx movzwl (%rcx), %ebp movl %ebp, %r15d shrl $0x8, %r15d addq $0x2, %rcx movq %rcx, 0x58(%r14) cmpl $0x2, %eax jl 0x985fd movzbl %bpl, %eax cmpl %eax, 0x2c(%rsp) sete %al cmpb $0x2, %r15b sete %r13b andb %al, %r13b jmp 0x98600 xorl %r13d, %r13d orb %r13b, %r12b testb $0x1, %r12b je 0x9860d xorl %ebp, %ebp jmp 0x9864c movq %r14, %rdi callq 0x64ca2 movq %rax, %r15 leaq 0x18(%rsp), %rax movq %rax, -0x10(%rax) leaq 0x187fb(%rip), %rsi # 0xb0e23 leaq 0x187f7(%rip), %rdx # 0xb0e26 leaq 0x8(%rsp), %rdi callq 0x445b8 leaq 0x8(%rsp), %rsi movq %r15, %rdi callq 0x77230 movl %eax, %ebp xorb $0x1, %bpl testb $0x1, %r12b jne 0x9866d leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x9866d movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 testb %bpl, %bpl jne 0x986d5 movq %r14, %rdi callq 0x64db2 movq (%rbx), %r15 leaq 0x5c(%rsp), %rdi xorl %esi, %esi callq 0x5db04 movq %r14, %rdi callq 0x64c88 movzbl %r13b, %ecx leaq 0x5c(%rsp), %rsi movq %r15, %rdi movq %rax, %rdx callq 0x547da leaq 0x1a62e(%rip), %rax # 0xb2cda leaq 0x186b4(%rip), %rcx # 0xb0d67 testb %r13b, %r13b cmovneq %rax, %rcx movq (%rbx), %rdi movq 0x80(%rdi), %rdx addq $0x78, %rdi movl $0x3, %r8d xorl %esi, %esi callq 0x358f0 movq 0x30(%rsp), %rdi leaq 0x40(%rsp), %rax cmpq %rax, %rdi je 0x986f1 movq 0x40(%rsp), %rsi incq %rsi callq 0x355d0 xorb $0x1, %bpl jmp 0x98585 movq %rax, %rbx movq 0x8(%rsp), %rdi leaq 0x18(%rsp), %rax cmpq %rax, %rdi je 0x98726 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 jmp 0x98726 jmp 0x98723 jmp 0x98723 jmp 0x98723 jmp 0x98723 movq %rax, %rbx movq 0x30(%rsp), %rdi leaq 0x40(%rsp), %rax cmpq %rax, %rdi je 0x98742 movq 0x40(%rsp), %rsi incq %rsi callq 0x355d0 movq %rbx, %rdi callq 0x35aa0
/simonowen[P]samdisk/src/types/mgt.cpp
util::exception::exception<char const (&) [20], CylHead&, char const (&) [8]>(char const (&) [20], CylHead&, char const (&) [8])
explicit exception(Args&& ... args) : std::runtime_error(make_string(std::forward<Args>(args)...)) {}
pushq %r14 pushq %rbx subq $0x28, %rsp movq %rdi, %rbx leaq 0x8(%rsp), %r14 movq %r14, %rdi callq 0x99003 movq %rbx, %rdi movq %r14, %rsi callq 0x35710 leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x98d7d movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 leaq 0x42e24(%rip), %rax # 0xdbba8 movq %rax, (%rbx) addq $0x28, %rsp popq %rbx popq %r14 retq movq %rax, %rbx leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x98dad movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 movq %rbx, %rdi callq 0x35aa0 nop
/simonowen[P]samdisk/include/utils.h
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> util::make_string<char const (&) [20], CylHead&, char const (&) [8]>(char const (&) [20], CylHead&, char const (&) [8])
std::string make_string(Args&& ... args) { std::ostringstream ss; (void)std::initializer_list<bool> {(ss << args, false)...}; return ss.str(); }
pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x1a0, %rsp # imm = 0x1A0 movq %rcx, %r14 movq %rdx, %r15 movq %rsi, %r12 movq %rdi, %rbx leaq 0x28(%rsp), %r13 movq %r13, %rdi callq 0x35760 movq %r12, %rdi callq 0x35210 movq %r13, %rdi movq %r12, %rsi movq %rax, %rdx callq 0x356a0 movl (%r15), %edx movl 0x4(%r15), %ecx leaq 0x12d8b(%rip), %rsi # 0xabddb leaq 0x8(%rsp), %rdi xorl %eax, %eax callq 0x784cc movq 0x8(%rsp), %rsi movq 0x10(%rsp), %rdx leaq 0x28(%rsp), %rdi callq 0x356a0 leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x9908b movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 movq %r14, %rdi callq 0x35210 leaq 0x28(%rsp), %rdi movq %r14, %rsi movq %rax, %rdx callq 0x356a0 leaq 0x30(%rsp), %rsi movq %rbx, %rdi callq 0x35920 movq 0x43ec1(%rip), %rsi # 0xdcf78 leaq 0x28(%rsp), %rdi callq 0x352b0 leaq 0x98(%rsp), %rdi callq 0x35180 movq %rbx, %rax addq $0x1a0, %rsp # imm = 0x1A0 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 retq jmp 0x99104 movq %rax, %rbx leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x99107 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 jmp 0x99107 movq %rax, %rbx movq 0x43e6a(%rip), %rsi # 0xdcf78 leaq 0x28(%rsp), %rdi callq 0x352b0 leaq 0x98(%rsp), %rdi callq 0x35180 movq %rbx, %rdi callq 0x35aa0
/simonowen[P]samdisk/include/utils.h
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> util::make_string<char const (&) [43], CylHead&>(char const (&) [43], CylHead&)
std::string make_string(Args&& ... args) { std::ostringstream ss; (void)std::initializer_list<bool> {(ss << args, false)...}; return ss.str(); }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x198, %rsp # imm = 0x198 movq %rdx, %r14 movq %rsi, %r15 movq %rdi, %rbx leaq 0x20(%rsp), %r12 movq %r12, %rdi callq 0x35760 movq %r15, %rdi callq 0x35210 movq %r12, %rdi movq %r15, %rsi movq %rax, %rdx callq 0x356a0 movl (%r14), %edx movl 0x4(%r14), %ecx leaq 0x12813(%rip), %rsi # 0xabddb movq %rsp, %rdi xorl %eax, %eax callq 0x784cc movq (%rsp), %rsi movq 0x8(%rsp), %rdx leaq 0x20(%rsp), %rdi callq 0x356a0 leaq 0x10(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x99600 movq 0x10(%rsp), %rsi incq %rsi callq 0x355d0 leaq 0x28(%rsp), %rsi movq %rbx, %rdi callq 0x35920 movq 0x43964(%rip), %rsi # 0xdcf78 leaq 0x20(%rsp), %rdi callq 0x352b0 leaq 0x90(%rsp), %rdi callq 0x35180 movq %rbx, %rax addq $0x198, %rsp # imm = 0x198 popq %rbx popq %r12 popq %r14 popq %r15 retq jmp 0x9965f movq %rax, %rbx leaq 0x10(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x99662 movq 0x10(%rsp), %rsi incq %rsi callq 0x355d0 jmp 0x99662 movq %rax, %rbx movq 0x4390f(%rip), %rsi # 0xdcf78 leaq 0x20(%rsp), %rdi callq 0x352b0 leaq 0x90(%rsp), %rdi callq 0x35180 movq %rbx, %rdi callq 0x35aa0
/simonowen[P]samdisk/include/utils.h
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> util::make_string<char const (&) [24], int, char const (&) [5], int&, char const (&) [6], CylHead&, char const (&) [8]>(char const (&) [24], int&&, char const (&) [5], int&, char const (&) [6], CylHead&, char const (&) [8])
std::string make_string(Args&& ... args) { std::ostringstream ss; (void)std::initializer_list<bool> {(ss << args, false)...}; return ss.str(); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x1a8, %rsp # imm = 0x1A8 movq %r9, %r14 movq %r8, %r15 movq %rcx, %r12 movq %rdx, %r13 movq %rsi, %rbp movq %rdi, 0x8(%rsp) leaq 0x30(%rsp), %rbx movq %rbx, %rdi callq 0x35760 movq %rbp, %rdi callq 0x35210 movq %rbx, %rdi movq %rbp, %rsi movq %rax, %rdx callq 0x356a0 movl (%r13), %esi leaq 0x30(%rsp), %rdi callq 0x35a80 movq %r12, %rdi callq 0x35210 leaq 0x30(%rsp), %rdi movq %r12, %rsi movq %rax, %rdx callq 0x356a0 movl (%r15), %esi leaq 0x30(%rsp), %rdi callq 0x35a80 movq %r14, %rdi callq 0x35210 leaq 0x30(%rsp), %rdi movq %r14, %rsi movq %rax, %rdx callq 0x356a0 movq 0x1e0(%rsp), %rax movl (%rax), %edx movl 0x4(%rax), %ecx leaq 0x9cca(%rip), %rsi # 0xabddb leaq 0x10(%rsp), %rdi xorl %eax, %eax callq 0x784cc movq 0x10(%rsp), %rsi movq 0x18(%rsp), %rdx leaq 0x30(%rsp), %rdi callq 0x356a0 movq 0x1e8(%rsp), %r14 leaq 0x20(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0xa2154 movq 0x20(%rsp), %rsi incq %rsi callq 0x355d0 movq %r14, %rdi callq 0x35210 leaq 0x30(%rsp), %rdi movq %r14, %rsi movq %rax, %rdx callq 0x356a0 leaq 0x38(%rsp), %rsi movq 0x8(%rsp), %rbx movq %rbx, %rdi callq 0x35920 movq 0x3adf3(%rip), %rsi # 0xdcf78 leaq 0x30(%rsp), %rdi callq 0x352b0 leaq 0xa0(%rsp), %rdi callq 0x35180 movq %rbx, %rax addq $0x1a8, %rsp # imm = 0x1A8 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq jmp 0xa21d3 movq %rax, %rbx leaq 0x20(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0xa21d6 movq 0x20(%rsp), %rsi incq %rsi callq 0x355d0 jmp 0xa21d6 movq %rax, %rbx movq 0x3ad9b(%rip), %rsi # 0xdcf78 leaq 0x30(%rsp), %rdi callq 0x352b0 leaq 0xa0(%rsp), %rdi callq 0x35180 movq %rbx, %rdi callq 0x35aa0
/simonowen[P]samdisk/include/utils.h
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> util::make_string<char const (&) [20], CylHead&, char const (&) [13]>(char const (&) [20], CylHead&, char const (&) [13])
std::string make_string(Args&& ... args) { std::ostringstream ss; (void)std::initializer_list<bool> {(ss << args, false)...}; return ss.str(); }
pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x1a0, %rsp # imm = 0x1A0 movq %rcx, %r14 movq %rdx, %r15 movq %rsi, %r12 movq %rdi, %rbx leaq 0x28(%rsp), %r13 movq %r13, %rdi callq 0x35760 movq %r12, %rdi callq 0x35210 movq %r13, %rdi movq %r12, %rsi movq %rax, %rdx callq 0x356a0 movl (%r15), %edx movl 0x4(%r15), %ecx leaq 0x9b92(%rip), %rsi # 0xabddb leaq 0x8(%rsp), %rdi xorl %eax, %eax callq 0x784cc movq 0x8(%rsp), %rsi movq 0x10(%rsp), %rdx leaq 0x28(%rsp), %rdi callq 0x356a0 leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0xa2284 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 movq %r14, %rdi callq 0x35210 leaq 0x28(%rsp), %rdi movq %r14, %rsi movq %rax, %rdx callq 0x356a0 leaq 0x30(%rsp), %rsi movq %rbx, %rdi callq 0x35920 movq 0x3acc8(%rip), %rsi # 0xdcf78 leaq 0x28(%rsp), %rdi callq 0x352b0 leaq 0x98(%rsp), %rdi callq 0x35180 movq %rbx, %rax addq $0x1a0, %rsp # imm = 0x1A0 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 retq jmp 0xa22fd movq %rax, %rbx leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0xa2300 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 jmp 0xa2300 movq %rax, %rbx movq 0x3ac71(%rip), %rsi # 0xdcf78 leaq 0x28(%rsp), %rdi callq 0x352b0 leaq 0x98(%rsp), %rdi callq 0x35180 movq %rbx, %rdi callq 0x35aa0
/simonowen[P]samdisk/include/utils.h
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> util::make_string<char const (&) [21], CylHead&, char const (&) [6]>(char const (&) [21], CylHead&, char const (&) [6])
std::string make_string(Args&& ... args) { std::ostringstream ss; (void)std::initializer_list<bool> {(ss << args, false)...}; return ss.str(); }
pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x1a0, %rsp # imm = 0x1A0 movq %rcx, %r14 movq %rdx, %r15 movq %rsi, %r12 movq %rdi, %rbx leaq 0x28(%rsp), %r13 movq %r13, %rdi callq 0x35760 movq %r12, %rdi callq 0x35210 movq %r13, %rdi movq %r12, %rsi movq %rax, %rdx callq 0x356a0 movl (%r15), %edx movl 0x4(%r15), %ecx leaq 0x9a43(%rip), %rsi # 0xabddb leaq 0x8(%rsp), %rdi xorl %eax, %eax callq 0x784cc movq 0x8(%rsp), %rsi movq 0x10(%rsp), %rdx leaq 0x28(%rsp), %rdi callq 0x356a0 leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0xa23d3 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 movq %r14, %rdi callq 0x35210 leaq 0x28(%rsp), %rdi movq %r14, %rsi movq %rax, %rdx callq 0x356a0 leaq 0x30(%rsp), %rsi movq %rbx, %rdi callq 0x35920 movq 0x3ab79(%rip), %rsi # 0xdcf78 leaq 0x28(%rsp), %rdi callq 0x352b0 leaq 0x98(%rsp), %rdi callq 0x35180 movq %rbx, %rax addq $0x1a0, %rsp # imm = 0x1A0 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 retq jmp 0xa244c movq %rax, %rbx leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0xa244f movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 jmp 0xa244f movq %rax, %rbx movq 0x3ab22(%rip), %rsi # 0xdcf78 leaq 0x28(%rsp), %rdi callq 0x352b0 leaq 0x98(%rsp), %rdi callq 0x35180 movq %rbx, %rdi callq 0x35aa0 nop
/simonowen[P]samdisk/include/utils.h
ReadSuperCardPro(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::shared_ptr<Disk>&)
bool ReadSuperCardPro(const std::string& path, std::shared_ptr<Disk>& disk) { // ToDo: use path to select from multiple devices? if (util::lowercase(path) != "scp:") return false; auto supercardpro = SuperCardPro::Open(); if (!supercardpro) throw util::exception("failed to open SuperCard Pro device"); int hw_version = 0, fw_version = 0; supercardpro->GetInfo(hw_version, fw_version); auto scp_dev_disk = std::make_shared<SCPDevDisk>(std::move(supercardpro)); scp_dev_disk->extend(CylHead(83 - 1, 2 - 1)); scp_dev_disk->metadata["hw_version"] = VersionString(hw_version); scp_dev_disk->metadata["fw_version"] = VersionString(fw_version); scp_dev_disk->strType = "SuperCard Pro"; disk = scp_dev_disk; return true; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x68, %rsp movq %rsi, %r14 movq %rdi, %rsi leaq 0x18(%rsp), %r15 movq %r15, %rdi callq 0x78866 leaq 0x110d6(%rip), %rsi # 0xb3766 movq %r15, %rdi callq 0x35120 movl %eax, %ebx movq (%r15), %rdi leaq 0x28(%rsp), %r13 cmpq %r13, %rdi je 0xa26b4 movq 0x28(%rsp), %rsi incq %rsi callq 0x355d0 testl %ebx, %ebx jne 0xa287e leaq 0x38(%rsp), %r15 movq %r15, %rdi callq 0x7018c movq (%r15), %rdi testq %rdi, %rdi je 0xa2892 xorl %eax, %eax leaq 0x44(%rsp), %rsi movl %eax, (%rsi) leaq 0x40(%rsp), %rdx movl %eax, (%rdx) callq 0x70d02 leaq 0x10(%rsp), %r15 movq $0x0, -0x8(%r15) leaq 0x8(%rsp), %rsi leaq 0x18(%rsp), %rdx leaq 0x38(%rsp), %rcx movq %r15, %rdi callq 0xa2ce0 movq 0x8(%rsp), %rdi movabsq $0x100000052, %rax # imm = 0x100000052 leaq 0x18(%rsp), %rsi movq %rax, (%rsi) callq 0x53684 movl 0x44(%rsp), %esi leaq 0x18(%rsp), %rdi callq 0xa2946 movq 0x8(%rsp), %r12 leaq 0x58(%rsp), %rbp movq %rbp, -0x10(%rbp) leaq 0x10ec5(%rip), %rsi # 0xb3612 leaq 0x10ec8(%rip), %rdx # 0xb361c leaq 0x48(%rsp), %rdi callq 0x445b8 addq $0x48, %r12 leaq 0x48(%rsp), %rsi movq %r12, %rdi callq 0x48d0c leaq 0x18(%rsp), %rsi movq %rax, %rdi callq 0x35700 movq 0x48(%rsp), %rdi cmpq %rbp, %rdi je 0xa2793 movq 0x58(%rsp), %rsi incq %rsi callq 0x355d0 movq 0x18(%rsp), %rdi cmpq %r13, %rdi je 0xa27aa movq 0x28(%rsp), %rsi incq %rsi callq 0x355d0 movl 0x40(%rsp), %esi leaq 0x18(%rsp), %rdi callq 0xa2946 movq 0x8(%rsp), %r12 leaq 0x48(%rsp), %rdi movq %rbp, (%rdi) leaq 0x10e51(%rip), %rsi # 0xb361d leaq 0x10e54(%rip), %rdx # 0xb3627 callq 0x445b8 addq $0x48, %r12 leaq 0x48(%rsp), %rsi movq %r12, %rdi callq 0x48d0c leaq 0x18(%rsp), %rsi movq %rax, %rdi callq 0x35700 movq 0x48(%rsp), %rdi cmpq %rbp, %rdi je 0xa280d movq 0x58(%rsp), %rsi incq %rsi callq 0x355d0 movq 0x18(%rsp), %rdi cmpq %r13, %rdi je 0xa2824 movq 0x28(%rsp), %rsi incq %rsi callq 0x355d0 movq 0x8(%rsp), %rdi movq 0x80(%rdi), %rdx addq $0x78, %rdi leaq 0x10e02(%rip), %rcx # 0xb363d movl $0xd, %r8d xorl %esi, %esi callq 0x358f0 movq 0x8(%rsp), %rax movq %rax, (%r14) addq $0x8, %r14 movq %r14, %rdi movq %r15, %rsi callq 0x7a762 movq 0x10(%rsp), %rdi testq %rdi, %rdi je 0xa286e callq 0x4740e movq 0x38(%rsp), %rdi testq %rdi, %rdi je 0xa287e movq (%rdi), %rax callq *0x8(%rax) testl %ebx, %ebx sete %al addq $0x68, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movl $0x10, %edi callq 0x35260 movq %rax, %r14 leaq 0x10ec5(%rip), %rsi # 0xb376b movq %rax, %rdi callq 0x6a1b4 leaq 0x392cb(%rip), %rsi # 0xdbb80 movq 0x3a6c4(%rip), %rdx # 0xdcf80 movq %r14, %rdi callq 0x35a50 jmp 0xa292b movq %rax, %rbx movq %r14, %rdi callq 0x35430 jmp 0xa292e jmp 0xa2915 jmp 0xa28db jmp 0xa28f7 jmp 0xa2915 movq %rax, %rbx movq 0x48(%rsp), %rdi cmpq %rbp, %rdi je 0xa28fa movq 0x58(%rsp), %rsi incq %rsi callq 0x355d0 jmp 0xa28fa movq %rax, %rbx movq 0x18(%rsp), %rdi cmpq %r13, %rdi je 0xa2918 movq 0x28(%rsp), %rsi incq %rsi callq 0x355d0 jmp 0xa2918 jmp 0xa2915 movq %rax, %rbx movq 0x10(%rsp), %rdi testq %rdi, %rdi je 0xa292e callq 0x4740e jmp 0xa292e jmp 0xa292b movq %rax, %rbx movq 0x38(%rsp), %rdi testq %rdi, %rdi je 0xa293e movq (%rdi), %rax callq *0x8(%rax) movq %rbx, %rdi callq 0x35aa0
/simonowen[P]samdisk/src/types/scp_dev.cpp
VersionString[abi:cxx11](int)
static std::string VersionString(int version) { std::stringstream ss; if (version) ss << (version >> 4) << "." << (version & 0xf); return ss.str(); }
pushq %rbp pushq %r14 pushq %rbx subq $0x190, %rsp # imm = 0x190 movl %esi, %ebp movq %rdi, %rbx leaq 0x8(%rsp), %rdi callq 0x353f0 testl %ebp, %ebp je 0xa2997 leaq 0x18(%rsp), %rdi movl %ebp, %esi sarl $0x4, %esi callq 0x35a80 movq %rax, %r14 leaq 0x983e(%rip), %rsi # 0xac1bb movl $0x1, %edx movq %rax, %rdi callq 0x356a0 andl $0xf, %ebp movq %r14, %rdi movl %ebp, %esi callq 0x35a80 leaq 0x20(%rsp), %rsi movq %rbx, %rdi callq 0x35920 movq 0x3a57d(%rip), %rsi # 0xdcf28 leaq 0x8(%rsp), %rdi callq 0x35450 leaq 0x88(%rsp), %rdi callq 0x35180 movq %rbx, %rax addq $0x190, %rsp # imm = 0x190 popq %rbx popq %r14 popq %rbp retq movq %rax, %rbx movq 0x3a54d(%rip), %rsi # 0xdcf28 leaq 0x8(%rsp), %rdi callq 0x35450 leaq 0x88(%rsp), %rdi callq 0x35180 movq %rbx, %rdi callq 0x35aa0
/simonowen[P]samdisk/src/types/scp_dev.cpp
WriteSuperCardPro(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::shared_ptr<Disk>&)
bool WriteSuperCardPro(const std::string& path, std::shared_ptr<Disk>& disk) { if (util::lowercase(path) != "scp:") return false; auto supercardpro = SuperCardPro::Open(); if (!supercardpro) throw util::exception("failed to open SuperCard Pro device"); auto scp_dev_disk = std::make_shared<SCPDevDisk>(std::move(supercardpro)); ValidateRange(opt.range, MAX_TRACKS, MAX_SIDES, 1, scp_dev_disk->cyls(), scp_dev_disk->heads()); opt.range.each([&](const CylHead& cylhead) { auto trackdata = disk->read(cylhead); Message(msgStatus, "Writing %s", CH(cylhead.cyl, cylhead.head)); scp_dev_disk->write(std::move(trackdata)); }); return true; }
pushq %rbp pushq %r15 pushq %r14 pushq %rbx subq $0x48, %rsp movq %rsi, %r14 movq %rdi, %rsi leaq 0x20(%rsp), %r15 movq %r15, %rdi callq 0x78866 leaq 0x10d48(%rip), %rsi # 0xb3766 movq %r15, %rdi callq 0x35120 movl %eax, %ebx movq (%r15), %rdi leaq 0x30(%rsp), %rax cmpq %rax, %rdi je 0xa2a42 movq 0x30(%rsp), %rsi incq %rsi callq 0x355d0 testl %ebx, %ebx jne 0xa2b2e leaq 0x8(%rsp), %r15 movq %r15, %rdi callq 0x7018c cmpq $0x0, (%r15) je 0xa2b3e leaq 0x18(%rsp), %rdi movq $0x0, -0x8(%rdi) leaq 0x10(%rsp), %r15 leaq 0x20(%rsp), %rdx leaq 0x8(%rsp), %rcx movq %r15, %rsi callq 0xa2ce0 movq 0x10(%rsp), %rdi callq 0x54940 movl %eax, %ebp movq 0x10(%rsp), %rdi callq 0x54964 leaq 0x3cc9e(%rip), %rdi # 0xdf740 movl $0x80, %esi movl $0x2, %edx movl $0x1, %ecx movl %ebp, %r8d movl %eax, %r9d callq 0x77d3f xorps %xmm0, %xmm0 leaq 0x20(%rsp), %rsi movaps %xmm0, (%rsi) movaps %xmm0, 0x10(%rsi) movq %r14, (%rsi) movq %r15, 0x8(%rsi) leaq 0xfd(%rip), %rax # 0xa2bd6 movq %rax, 0x18(%rsi) leaq 0x1d4(%rip), %rax # 0xa2cb8 movq %rax, 0x10(%rsi) leaq 0x3cc51(%rip), %rdi # 0xdf740 xorl %edx, %edx callq 0x659a2 movq 0x30(%rsp), %rax testq %rax, %rax je 0xa2b0f leaq 0x20(%rsp), %rdi movq %rdi, %rsi movl $0x3, %edx callq *%rax movq 0x18(%rsp), %rdi testq %rdi, %rdi je 0xa2b1e callq 0x4740e movq 0x8(%rsp), %rdi testq %rdi, %rdi je 0xa2b2e movq (%rdi), %rax callq *0x8(%rax) testl %ebx, %ebx sete %al addq $0x48, %rsp popq %rbx popq %r14 popq %r15 popq %rbp retq movl $0x10, %edi callq 0x35260 movq %rax, %r14 leaq 0x10c19(%rip), %rsi # 0xb376b movq %rax, %rdi callq 0x6a1b4 leaq 0x3901f(%rip), %rsi # 0xdbb80 movq 0x3a418(%rip), %rdx # 0xdcf80 movq %r14, %rdi callq 0x35a50 jmp 0xa2ba7 movq %rax, %rbx movq %r14, %rdi callq 0x35430 jmp 0xa2bbe jmp 0xa2b9f movq %rax, %rbx movq 0x30(%rsp), %rax testq %rax, %rax je 0xa2baf leaq 0x20(%rsp), %rdi movq %rdi, %rsi movl $0x3, %edx callq *%rax jmp 0xa2baf movq %rax, %rdi callq 0x410ac movq %rax, %rbx jmp 0xa2bbe movq %rax, %rbx movq 0x18(%rsp), %rdi testq %rdi, %rdi je 0xa2bbe callq 0x4740e movq 0x8(%rsp), %rdi testq %rdi, %rdi je 0xa2bce movq (%rdi), %rax callq *0x8(%rax) movq %rbx, %rdi callq 0x35aa0
/simonowen[P]samdisk/src/types/scp_dev.cpp
util::exception::exception<char const (&) [13], unsigned int&, char const (&) [14], CylHead&>(char const (&) [13], unsigned int&, char const (&) [14], CylHead&)
explicit exception(Args&& ... args) : std::runtime_error(make_string(std::forward<Args>(args)...)) {}
pushq %r14 pushq %rbx subq $0x28, %rsp movq %rdi, %rbx leaq 0x8(%rsp), %r14 movq %r14, %rdi callq 0xa6547 movq %rbx, %rdi movq %r14, %rsi callq 0x35710 leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0xa6391 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 leaq 0x35810(%rip), %rax # 0xdbba8 movq %rax, (%rbx) addq $0x28, %rsp popq %rbx popq %r14 retq movq %rax, %rbx leaq 0x18(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0xa63c1 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 movq %rbx, %rdi callq 0x35aa0 nop
/simonowen[P]samdisk/include/utils.h
ReadUnsupported(MemFile&, std::shared_ptr<Disk>&)
bool ReadUnsupported(MemFile& file, std::shared_ptr<Disk>&/*disk*/) { std::array<char, SECTOR_SIZE> buf; if (!file.rewind() || !file.read(buf)) return false; std::string strType; if (std::string(buf.data() + 0x00, 12) == "CPC-Emulator" && std::string(buf.data() + 0x10, 10) == "DiskImageV") strType = "CPCemu"; else if (std::string(buf.data() + 0x00, 4) == "CPCD") strType = "EmuCPC"; else if (std::string(buf.data() + 0x00, 8) == "NORMDISK") strType = "CPD"; if (!strType.empty()) throw util::exception(strType, " disk images are not currently supported"); return false; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x78, %rsp movq %rdi, %rbx callq 0x64db2 testb %al, %al je 0xa6983 movq %rbx, %rdi callq 0x64c96 cmpl $0x200, %eax # imm = 0x200 jl 0xa6983 movq 0x58(%rbx), %rax movq (%rax), %r12 movl 0x8(%rax), %ecx movq 0x12(%rax), %rdx movq %rdx, 0xe(%rsp) movq 0xc(%rax), %rdx movq %rdx, 0x8(%rsp) addq $0x200, %rax # imm = 0x200 movq %rax, 0x58(%rbx) leaq 0x48(%rsp), %r15 movq %r15, -0x10(%r15) movq $0x0, -0x8(%r15) xorl %ebp, %ebp movb %bpl, (%r15) leaq 0x28(%rsp), %r13 movq %r13, -0x10(%r13) movq %r12, (%r13) movl %ecx, 0x8(%r13) movq $0xc, -0x8(%r13) movb %bpl, 0xc(%r13) leaq 0xd580(%rip), %rsi # 0xb3d9d leaq 0x18(%rsp), %rdi callq 0x35120 movl %eax, %ebx testl %eax, %eax jne 0xa686a leaq 0x68(%rsp), %rax movq %rax, -0x10(%rax) movq 0xc(%rsp), %rcx movq %rcx, (%rax) movzwl 0x14(%rsp), %ecx movw %cx, 0x8(%rax) movq $0xa, -0x8(%rax) movb $0x0, 0xa(%rax) leaq 0xd550(%rip), %rsi # 0xb3daa leaq 0x58(%rsp), %rdi callq 0x35120 testl %eax, %eax sete %bpl testl %ebx, %ebx jne 0xa6889 leaq 0x68(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0xa6889 movq 0x68(%rsp), %rsi incq %rsi callq 0x355d0 movq 0x18(%rsp), %rdi cmpq %r13, %rdi je 0xa68a0 movq 0x28(%rsp), %rsi incq %rsi callq 0x355d0 movl $0x6, %ebx testb %bpl, %bpl je 0xa68b6 leaq 0xd504(%rip), %rcx # 0xb3db5 jmp 0xa6951 leaq 0x18(%rsp), %r14 movq %r13, (%r14) movl %r12d, 0x10(%r14) movq $0x4, 0x8(%r14) movb $0x0, 0x14(%r14) leaq 0xd4e6(%rip), %rsi # 0xb3dbc movq %r14, %rdi callq 0x35120 movl %eax, %ebp movq (%r14), %rdi cmpq %r13, %rdi je 0xa68f5 movq 0x28(%rsp), %rsi incq %rsi callq 0x355d0 testl %ebp, %ebp je 0xa694a leaq 0x18(%rsp), %r14 movq %r13, (%r14) movq %r12, 0x10(%r14) movq $0x8, 0x8(%r14) movb $0x0, 0x18(%r14) leaq 0xd4af(%rip), %rsi # 0xb3dc8 movq %r14, %rdi callq 0x35120 movl %eax, %ebx movq (%r14), %rdi cmpq %r13, %rdi je 0xa6938 movq 0x28(%rsp), %rsi incq %rsi callq 0x355d0 testl %ebx, %ebx jne 0xa6964 movl $0x3, %ebx leaq 0xb845(%rip), %rcx # 0xb218d jmp 0xa6951 leaq 0xd470(%rip), %rcx # 0xb3dc1 leaq 0x38(%rsp), %rdi movq 0x8(%rdi), %rdx xorl %esi, %esi movq %rbx, %r8 callq 0x358f0 cmpq $0x0, 0x40(%rsp) jne 0xa6994 movq 0x38(%rsp), %rdi cmpq %r15, %rdi je 0xa6983 movq 0x48(%rsp), %rsi incq %rsi callq 0x355d0 xorl %eax, %eax addq $0x78, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movl $0x10, %edi callq 0x35260 movq %rax, %r14 leaq 0xd429(%rip), %rdx # 0xb3dd1 leaq 0x38(%rsp), %rsi movq %rax, %rdi callq 0xa69fa leaq 0x351c4(%rip), %rsi # 0xdbb80 movq 0x365bd(%rip), %rdx # 0xdcf80 movq %r14, %rdi callq 0x35a50 movq %rax, %rbx movq %r14, %rdi callq 0x35430 jmp 0xa69db movq %rax, %rbx movq 0x38(%rsp), %rdi cmpq %r15, %rdi je 0xa69f2 movq 0x48(%rsp), %rsi incq %rsi callq 0x355d0 movq %rbx, %rdi callq 0x35aa0
/simonowen[P]samdisk/src/types/unsupp.cpp
ReadWOZ(MemFile&, std::shared_ptr<Disk>&)
bool ReadWOZ(MemFile& file, std::shared_ptr<Disk>& disk) { WOZ_HEADER wh; if (!file.rewind() || !file.read(&wh, sizeof(wh)) || memcmp(&wh.sig, WOZ_SIGNATURE, sizeof(wh.sig))) return false; else if (wh.ff != 0xff || memcmp(&wh.lfcrlf, "\n\r\n", 3)) return false; auto crc = util::le_value(wh.crc32); if (crc && crc32(file.ptr<uint8_t>(), file.size() - file.tell()) != crc) Message(msgWarning, "file checksum is incorrect!"); INFO_CHUNK info{}; TMAP_CHUNK tmap{}; WOZ_CHUNK wc{}; while (file.read(&wc, sizeof(wc))) { auto chunk_id = util::be_value(wc.type); // big-endian for text auto chunk_size = util::le_value(wc.size); auto next_pos = file.tell() + chunk_size; switch (chunk_id) { case id_value("INFO"): { if (!file.read(&info, sizeof(info))) throw util::exception("short file reading info"); disk->metadata["disk_type"] = (info.disk_type == 1) ? "5.25\"" : (info.disk_type == 2) ? "3.5\"" : std::to_string(info.disk_type); disk->metadata["read_only"] = info.write_protect ? "yes" : "no"; disk->metadata["synchronised"] = info.synchronised ? "yes" : "no"; disk->metadata["cleaned"] = info.cleaned ? "yes" : "no"; disk->metadata["creator"] = util::trim(std::string(info.creator, sizeof(info.creator))); break; } case id_value("TMAP"): if (!file.read(&tmap, sizeof(tmap))) throw util::exception("short file reading track map"); break; case id_value("TRKS"): { if (chunk_size % sizeof(TRKS_CHUNK)) throw util::exception("TRKS chunk size is mis-aligned"); auto tracks = chunk_size / sizeof(TRKS_CHUNK); std::vector<TRKS_CHUNK> trks(tracks); for (size_t i = 0; i < tracks; ++i) { if (!file.read(&trks[i], sizeof(trks[i]))) throw util::exception("short file reading track data"); else if (util::le_value(trks[i].used_bytes) != (util::le_value(trks[i].used_bits) + 7) / 8) throw util::exception("bit/byte counts inconsistent on track ", i); util::bit_reverse(trks[i].data, util::le_value(trks[i].used_bytes)); } int cyl_step = (info.disk_type == 1) ? 4 : 1; for (size_t i = 0; i < tmap.map.size(); i += cyl_step) { if (tmap.map[i] < trks.size()) { auto& trk = trks[tmap.map[i]]; BitBuffer bitbuf(DataRate::_250K, trk.data, util::le_value(trk.used_bits)); auto splicepos = util::le_value(trk.splice_pos); if (splicepos != 0xffff) bitbuf.splicepos(splicepos); auto cylhead = CylHead(tmap.map[i], static_cast<int>((i / cyl_step) / trks.size())); disk->write(cylhead, std::move(bitbuf)); } } break; } case id_value("META"): { std::vector<char> meta(chunk_size); if (!file.read(meta)) throw util::exception("short file reading meta chunk"); auto str_meta = std::string(meta.data(), meta.size()); for (auto& row : util::split(str_meta, '\n')) { auto columns = util::split(row, '\t'); if (columns.size() == 2) disk->metadata[columns[0]] = columns[1]; } break; } default: Message(msgWarning, "unknown WOZ chunk: %.*s [%02X %02X %02X %02X] with size %u", sizeof(wc.type), reinterpret_cast<const char*>(wc.type), wc.type[0], wc.type[1], wc.type[2], wc.type[3], chunk_size); file.seek(file.tell() + chunk_size); break; } file.seek(next_pos); } disk->strType = "WOZ"; return true; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x1c8, %rsp # imm = 0x1C8 movq %rsi, 0x28(%rsp) movq %rdi, %r14 callq 0x64db2 testb %al, %al je 0xa757d leaq 0xd4(%rsp), %rsi movq %r14, %rdi movl $0xc, %edx callq 0x64d0c testb %al, %al je 0xa757d xorl %r15d, %r15d cmpl $0x315a4f57, 0xd4(%rsp) # imm = 0x315A4F57 jne 0xa7580 cmpb $-0x1, 0xd8(%rsp) jne 0xa7580 movzwl 0xd9(%rsp), %eax xorl $0xd0a, %eax # imm = 0xD0A movzbl 0xdb(%rsp), %ecx xorl $0xa, %ecx xorl %r15d, %r15d orw %ax, %cx jne 0xa7580 leaq 0xdc(%rsp), %rax xorl %ecx, %ecx movzbl (%rax), %edx shll %cl, %edx orl %edx, %r15d addq $0x8, %rcx incq %rax cmpq $0x20, %rcx jne 0xa6ba7 testl %r15d, %r15d je 0xa6c26 movq 0x58(%r14), %r12 movq %r14, %rdi callq 0x64c8e movl %eax, %ebp movq %r14, %rdi callq 0x64dea xorl %ecx, %ecx subl %eax, %ebp je 0xa6c10 movslq %ebp, %rax movl $0xffffffff, %ecx # imm = 0xFFFFFFFF movzbl (%r12), %edx xorl %edx, %ecx movl $0x8, %edx movl %ecx, %esi shrl %esi andl $0x1, %ecx negl %ecx andl $0xedb88320, %ecx # imm = 0xEDB88320 xorl %esi, %ecx decl %edx jne 0xa6bf1 incq %r12 decq %rax jne 0xa6be5 notl %ecx cmpl %r15d, %ecx je 0xa6c26 leaq 0xc86a(%rip), %rsi # 0xb3486 movl $0x3, %edi callq 0x46c85 xorps %xmm0, %xmm0 movaps %xmm0, 0xf0(%rsp) movaps %xmm0, 0xe0(%rsp) xorl %r12d, %r12d movq %r12, 0xfd(%rsp) leaq 0x128(%rsp), %rdi movl $0xa0, %edx xorl %esi, %esi callq 0x352d0 leaq 0x30(%rsp), %rsi movq %r12, (%rsi) movq %r14, %rdi movl $0x8, %edx callq 0x64d0c testb %al, %al je 0xa7551 leaq 0x18(%rsp), %rbp leaq 0x40(%rsp), %r15 leaq 0x110(%rsp), %rbx xorl %ecx, %ecx movzbl 0x30(%rsp,%rcx), %eax shll $0x8, %r12d orl %eax, %r12d incq %rcx cmpq $0x4, %rcx jne 0xa6c89 xorl %ecx, %ecx leaq 0x34(%rsp), %rax xorl %edx, %edx movzbl (%rax), %esi shll %cl, %esi orl %esi, %edx addq $0x8, %rcx incq %rax cmpq $0x20, %rcx jne 0xa6ca7 movl %edx, 0x3c(%rsp) movq %r14, %rdi callq 0x64dea movl %eax, 0xd0(%rsp) movl 0x3c(%rsp), %eax movq %rax, 0xa8(%rsp) cmpl $0x544d414f, %r12d # imm = 0x544D414F jg 0xa6df6 cmpl $0x494e464f, %r12d # imm = 0x494E464F je 0xa70af cmpl $0x4d455441, %r12d # imm = 0x4D455441 jne 0xa7049 leaq 0x8(%rsp), %rdi movq 0xa8(%rsp), %rsi movq %r15, %rdx callq 0x78a06 movq 0x10(%rsp), %r15 subq 0x8(%rsp), %r15 movq %r14, %rdi callq 0x64c96 cmpl %r15d, %eax jl 0xa7608 movq 0x8(%rsp), %rdi movq 0x58(%r14), %rsi movslq %r15d, %r12 movq %r12, %rdx callq 0x354c0 addq %r12, 0x58(%r14) movq 0x8(%rsp), %rsi movq 0x10(%rsp), %rdx leaq 0x50(%rsp), %rax movq %rax, 0x40(%rsp) leaq 0x40(%rsp), %r15 movq %r15, %rdi callq 0x445b8 leaq 0xb0(%rsp), %rdi movq %r15, %rsi movl $0xa, %edx xorl %ecx, %ecx callq 0x78621 movq 0xb0(%rsp), %r13 movq 0xb8(%rsp), %r15 cmpq %r15, %r13 je 0xa7130 movq %rbx, %rdi movq %r13, %rsi movl $0x9, %edx xorl %ecx, %ecx callq 0x78621 movq 0x110(%rsp), %r12 movq 0x118(%rsp), %rax subq %r12, %rax cmpq $0x40, %rax jne 0xa6de8 movq 0x28(%rsp), %rax movq (%rax), %rdi addq $0x48, %rdi movq %r12, %rsi callq 0x79782 addq $0x20, %r12 movq %rax, %rdi movq %r12, %rsi callq 0x352c0 movq %rbx, %rdi callq 0x44540 addq $0x20, %r13 jmp 0xa6d91 cmpl $0x544d4150, %r12d # imm = 0x544D4150 je 0xa710e cmpl $0x54524b53, %r12d # imm = 0x54524B53 jne 0xa7049 movq 0xa8(%rsp), %rsi movq %rsi, %rax movabsq $0x9d89d89d89d8a, %rcx # imm = 0x9D89D89D89D8A mulq %rcx movq %rdx, %r13 movabsq $0x4ec4ec4ec4ec4ec5, %rdx # imm = 0x4EC4EC4EC4EC4EC5 imulq %rdx, %rsi rorq $0x9, %rsi cmpq %rcx, %rsi leaq 0x8(%rsp), %rdi jae 0xa75ea movq %r13, %rsi movq %r15, %rdx callq 0xa7804 movq $0x0, 0x40(%rsp) cmpl $0x1a00, 0xa8(%rsp) # imm = 0x1A00 jb 0xa6ed5 xorl %eax, %eax imulq $0x1a00, %rax, %rsi # imm = 0x1A00 addq 0x8(%rsp), %rsi movq %r14, %rdi movl $0x1a00, %edx # imm = 0x1A00 callq 0x64d0c testb %al, %al je 0xa7595 movq 0x8(%rsp), %rdi imulq $0x1a00, 0x40(%rsp), %rax # imm = 0x1A00 movzwl 0x19f6(%rdi,%rax), %esi movzwl 0x19f8(%rdi,%rax), %ecx addl $0x7, %ecx shrl $0x3, %ecx cmpl %esi, %ecx jne 0xa75b3 addq %rax, %rdi callq 0x787f2 movq 0x40(%rsp), %rax incq %rax movq %rax, 0x40(%rsp) cmpq %r13, %rax jb 0xa6e6e xorl %eax, %eax cmpb $0x1, 0xe1(%rsp) sete %al leal (%rax,%rax), %ecx movq %rcx, 0x108(%rsp) leaq (%rax,%rax,2), %r15 incq %r15 xorl %ebp, %ebp movzbl 0x128(%rsp,%rbp), %eax movq 0x8(%rsp), %rcx movq 0x10(%rsp), %rdx subq %rcx, %rdx sarq $0x9, %rdx movabsq $0x4ec4ec4ec4ec4ec5, %rsi # imm = 0x4EC4EC4EC4EC4EC5 imulq %rsi, %rdx cmpq %rax, %rdx jbe 0xa7013 imulq $0x1a00, %rax, %rax # imm = 0x1A00 leaq (%rcx,%rax), %r12 movzwl 0x19f8(%rcx,%rax), %ecx leaq 0x40(%rsp), %rdi movl $0x3d090, %esi # imm = 0x3D090 movq %r12, %rdx callq 0x37bda movq %rbx, %r13 movzwl 0x19fa(%r12), %esi cmpl $0xffff, %esi # imm = 0xFFFF leaq 0x40(%rsp), %r12 je 0xa6f6c movq %r12, %rdi callq 0x3811e movzbl 0x128(%rsp,%rbp), %esi movq %rbp, %rax movq 0x108(%rsp), %rcx shrq %cl, %rax movq 0x10(%rsp), %rcx subq 0x8(%rsp), %rcx sarq $0x9, %rcx movabsq $0x4ec4ec4ec4ec4ec5, %rdx # imm = 0x4EC4EC4EC4EC4EC5 imulq %rdx, %rcx xorl %edx, %edx divq %rcx leaq 0xb0(%rsp), %rbx movq %rbx, %rdi movl %eax, %edx callq 0x46fa2 movq 0x28(%rsp), %rax movq (%rax), %rdi movq %rbx, %rsi movq %r12, %rdx callq 0x54ff6 movq 0x78(%rsp), %rdi testq %rdi, %rdi je 0xa6fe2 movq 0x88(%rsp), %rsi subq %rdi, %rsi callq 0x355d0 movq 0x60(%rsp), %rdi testq %rdi, %rdi movq %r13, %rbx je 0xa6ffc movq 0x70(%rsp), %rsi subq %rdi, %rsi callq 0x355d0 movq 0x48(%rsp), %rdi testq %rdi, %rdi je 0xa7013 movq 0x58(%rsp), %rsi subq %rdi, %rsi callq 0x355d0 addq %r15, %rbp cmpq $0xa0, %rbp jb 0xa6ef6 movq 0x8(%rsp), %rdi testq %rdi, %rdi leaq 0x40(%rsp), %r15 je 0xa703f movq 0x18(%rsp), %rsi subq %rdi, %rsi callq 0x355d0 leaq 0x18(%rsp), %rbp jmp 0xa7518 movq $0x4, 0x40(%rsp) leaq 0x30(%rsp), %r8 movq %r8, 0x8(%rsp) subq $0x8, %rsp movl $0x3, %edi leaq 0xce1c(%rip), %rsi # 0xb3e88 movq %r15, %rdx leaq 0x10(%rsp), %rcx leaq 0x39(%rsp), %r9 leaq 0x44(%rsp), %rax pushq %rax leaq 0x43(%rsp), %rax pushq %rax leaq 0x4a(%rsp), %rax pushq %rax callq 0x797fe addq $0x20, %rsp movq %r14, %rdi callq 0x64dea addl 0x3c(%rsp), %eax movq %r14, %rdi movl %eax, %esi callq 0x64dce jmp 0xa7518 movq %r14, %rdi leaq 0xe0(%rsp), %rsi movl $0x25, %edx callq 0x64d0c testb %al, %al je 0xa763a movzbl 0xe1(%rsp), %r13d cmpl $0x2, %r13d je 0xa7179 cmpl $0x1, %r13d jne 0xa719b leaq 0x50(%rsp), %rax movq %rax, 0x40(%rsp) movq %r15, %rdi leaq 0x9f1c(%rip), %rsi # 0xb1019 leaq 0x9f1a(%rip), %rdx # 0xb101e callq 0x445b8 jmp 0xa71e0 movq %r14, %rdi leaq 0x128(%rsp), %rsi movl $0xa0, %edx callq 0x64d0c testb %al, %al jne 0xa7518 jmp 0xa7658 leaq 0xb0(%rsp), %rdi callq 0x44540 movq 0x40(%rsp), %rdi leaq 0x50(%rsp), %rax cmpq %rax, %rdi je 0xa7159 movq 0x50(%rsp), %rsi incq %rsi callq 0x355d0 movq 0x8(%rsp), %rdi testq %rdi, %rdi leaq 0x40(%rsp), %r15 je 0xa7518 movq 0x18(%rsp), %rsi subq %rdi, %rsi jmp 0xa7513 leaq 0x50(%rsp), %rax movq %rax, 0x40(%rsp) movq %r15, %rdi leaq 0x9e92(%rip), %rsi # 0xb101f leaq 0x9e8f(%rip), %rdx # 0xb1023 callq 0x445b8 jmp 0xa71e0 cmpb $0x64, %r13b movl $0x3, %r12d sbbl $0x0, %r12d cmpb $0xa, %r13b movl $0x1, %eax cmovbl %eax, %r12d leaq 0x50(%rsp), %rax movq %rax, 0x40(%rsp) movq %r15, %rdi movq %r12, %rsi movl $0x2d, %edx callq 0x356c0 movq 0x40(%rsp), %rdi movl %r12d, %esi movl %r13d, %edx callq 0x799ef movq 0x28(%rsp), %rax movq (%rax), %r12 movq %rbp, 0x8(%rsp) leaq 0x8(%rsp), %r13 movq %r13, %rdi leaq 0x9e28(%rip), %rsi # 0xb1024 leaq 0x9e2a(%rip), %rdx # 0xb102d callq 0x445b8 addq $0x48, %r12 movq %r12, %rdi movq %r13, %rsi callq 0x48d0c movq %rax, %rdi movq %r15, %rsi callq 0x35700 movq 0x8(%rsp), %rdi cmpq %rbp, %rdi je 0xa7239 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 movq 0x40(%rsp), %rdi leaq 0x50(%rsp), %rax cmpq %rax, %rdi je 0xa7255 movq 0x50(%rsp), %rsi incq %rsi callq 0x355d0 movb 0xe2(%rsp), %bpl testb %bpl, %bpl leaq 0x9dc7(%rip), %r13 # 0xb102e leaq 0x9dc4(%rip), %rax # 0xb1032 cmoveq %rax, %r13 movq 0x28(%rsp), %rax movq (%rax), %r12 leaq 0x50(%rsp), %rax movq %rax, 0x40(%rsp) movq %r15, %rdi leaq 0x9da7(%rip), %rsi # 0xb1035 leaq 0x9da9(%rip), %rdx # 0xb103e callq 0x445b8 addq $0x48, %r12 movq %r12, %rdi movq %r15, %rsi callq 0x48d0c movq 0x8(%rax), %rdx cmpb $0x1, %bpl movl $0x3, %r8d sbbq $0x0, %r8 movq %rax, %rdi xorl %esi, %esi movq %r13, %rcx callq 0x358f0 movq 0x40(%rsp), %rdi leaq 0x50(%rsp), %rax cmpq %rax, %rdi je 0xa72e4 movq 0x50(%rsp), %rsi incq %rsi callq 0x355d0 movb 0xe3(%rsp), %bpl testb %bpl, %bpl leaq 0x9d38(%rip), %r13 # 0xb102e leaq 0x9d35(%rip), %rax # 0xb1032 cmoveq %rax, %r13 movq 0x28(%rsp), %rax movq (%rax), %r12 leaq 0x50(%rsp), %rax movq %rax, 0x40(%rsp) movq %r15, %rdi leaq 0xc330(%rip), %rsi # 0xb364d leaq 0xc335(%rip), %rdx # 0xb3659 callq 0x445b8 addq $0x48, %r12 movq %r12, %rdi movq %r15, %rsi callq 0x48d0c movq 0x8(%rax), %rdx cmpb $0x1, %bpl movl $0x3, %r8d sbbq $0x0, %r8 movq %rax, %rdi xorl %esi, %esi movq %r13, %rcx callq 0x358f0 movq 0x40(%rsp), %rdi leaq 0x50(%rsp), %rax cmpq %rax, %rdi je 0xa7373 movq 0x50(%rsp), %rsi incq %rsi callq 0x355d0 movb 0xe4(%rsp), %bpl testb %bpl, %bpl leaq 0x9ca9(%rip), %r13 # 0xb102e leaq 0x9ca6(%rip), %rax # 0xb1032 cmoveq %rax, %r13 movq 0x28(%rsp), %rax movq (%rax), %r12 leaq 0x50(%rsp), %rax movq %rax, 0x40(%rsp) movq %r15, %rdi leaq 0xca53(%rip), %rsi # 0xb3dff leaq 0xca53(%rip), %rdx # 0xb3e06 callq 0x445b8 addq $0x48, %r12 movq %r12, %rdi movq %r15, %rsi callq 0x48d0c movq 0x8(%rax), %rdx cmpb $0x1, %bpl movl $0x3, %r8d sbbq $0x0, %r8 movq %rax, %rdi xorl %esi, %esi movq %r13, %rcx callq 0x358f0 movq 0x40(%rsp), %rdi leaq 0x50(%rsp), %rax cmpq %rax, %rdi leaq 0x8(%rsp), %r12 je 0xa7407 movq 0x50(%rsp), %rsi incq %rsi callq 0x355d0 leaq 0x18(%rsp), %rbp movq %rbp, 0x8(%rsp) movq $0x20, 0xb0(%rsp) movq %r12, %rdi leaq 0xb0(%rsp), %rsi xorl %edx, %edx callq 0x35ad0 movq %rax, 0x8(%rsp) movq 0xb0(%rsp), %rcx movq %rcx, 0x18(%rsp) leaq 0xe5(%rsp), %rdx movups (%rdx), %xmm0 movups 0x10(%rdx), %xmm1 movups %xmm1, 0x10(%rax) movups %xmm0, (%rax) movq %rcx, 0x10(%rsp) movq 0x8(%rsp), %rax movb $0x0, (%rax,%rcx) movq %r15, %rdi movq %r12, %rsi callq 0x78744 movq 0x28(%rsp), %rax movq (%rax), %r12 leaq 0xc0(%rsp), %rax movq %rax, 0xb0(%rsp) leaq 0xb0(%rsp), %r13 movq %r13, %rdi leaq 0x9ba5(%rip), %rsi # 0xb103f leaq 0x9ba5(%rip), %rdx # 0xb1046 callq 0x445b8 addq $0x48, %r12 movq %r12, %rdi movq %r13, %rsi callq 0x48d0c movq %rax, %rdi movq %r15, %rsi callq 0x35700 movq 0xb0(%rsp), %rdi leaq 0xc0(%rsp), %rax cmpq %rax, %rdi je 0xa74e5 movq 0xc0(%rsp), %rsi incq %rsi callq 0x355d0 movq 0x40(%rsp), %rdi leaq 0x50(%rsp), %rax cmpq %rax, %rdi je 0xa7501 movq 0x50(%rsp), %rsi incq %rsi callq 0x355d0 movq 0x8(%rsp), %rdi cmpq %rbp, %rdi je 0xa7518 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 movq 0xa8(%rsp), %rsi addl 0xd0(%rsp), %esi movq %r14, %rdi callq 0x64dce movq %r14, %rdi leaq 0x30(%rsp), %rsi movl $0x8, %edx callq 0x64d0c xorl %r12d, %r12d movl $0x0, %ecx testb %al, %al jne 0xa6c89 movq 0x28(%rsp), %rax movq (%rax), %rdi movq 0x80(%rdi), %rdx addq $0x78, %rdi leaq 0x97a6(%rip), %rcx # 0xb0d11 movl $0x3, %r8d xorl %esi, %esi callq 0x358f0 movb $0x1, %r15b jmp 0xa7580 xorl %r15d, %r15d movl %r15d, %eax addq $0x1c8, %rsp # imm = 0x1C8 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movl $0x10, %edi callq 0x35260 movq %rax, %r14 leaq 0xc89a(%rip), %rsi # 0xb3e43 movq %rax, %rdi callq 0x4c240 jmp 0xa75d4 movl $0x10, %edi callq 0x35260 movq %rax, %r14 leaq 0xc89a(%rip), %rsi # 0xb3e61 leaq 0x40(%rsp), %rdx movq %rax, %rdi callq 0xa78ce leaq 0x345a5(%rip), %rsi # 0xdbb80 movq 0x3599e(%rip), %rdx # 0xdcf80 movq %r14, %rdi callq 0x35a50 movl $0x10, %edi callq 0x35260 movq %rax, %r14 leaq 0xc826(%rip), %rsi # 0xb3e24 movq %rax, %rdi callq 0x61666 jmp 0xa7674 movl $0x10, %edi callq 0x35260 movq %rax, %r14 leaq 0x9a73(%rip), %rsi # 0xb108f movq %rax, %rdi callq 0x4c240 leaq 0x34555(%rip), %rsi # 0xdbb80 movq 0x3594e(%rip), %rdx # 0xdcf80 movq %r14, %rdi callq 0x35a50 movl $0x10, %edi callq 0x35260 movq %rax, %r14 leaq 0x99b3(%rip), %rsi # 0xb1001 movq %rax, %rdi callq 0x5d49e jmp 0xa7674 movl $0x10, %edi callq 0x35260 movq %rax, %r14 leaq 0xc79b(%rip), %rsi # 0xb3e07 movq %rax, %rdi callq 0x6392e leaq 0x34505(%rip), %rsi # 0xdbb80 movq 0x358fe(%rip), %rdx # 0xdcf80 movq %r14, %rdi callq 0x35a50 jmp 0xa774c jmp 0xa769d jmp 0xa769d jmp 0xa77e1 jmp 0xa777f movq %rax, %rbx movq %r14, %rdi callq 0x35430 jmp 0xa77fb jmp 0xa774c movq %rax, %rbx movq 0xb0(%rsp), %rdi leaq 0xc0(%rsp), %rax cmpq %rax, %rdi je 0xa76ff movq 0xc0(%rsp), %rsi incq %rsi callq 0x355d0 jmp 0xa76ff jmp 0xa774c jmp 0xa774c movq %rax, %rbx movq 0x8(%rsp), %rdi cmpq %rbp, %rdi je 0xa7760 movq 0x18(%rsp), %rsi incq %rsi callq 0x355d0 jmp 0xa7760 movq %rax, %rbx movq 0x40(%rsp), %rdi leaq 0x50(%rsp), %rax cmpq %rax, %rdi je 0xa7722 movq 0x50(%rsp), %rsi incq %rsi callq 0x355d0 jmp 0xa7722 jmp 0xa775d movq %rax, %rbx movq 0x8(%rsp), %rdi leaq 0x18(%rsp), %rax cmpq %rax, %rdi je 0xa77fb movq 0x18(%rsp), %rsi jmp 0xa7778 jmp 0xa774c jmp 0xa774c jmp 0xa774c movq %rax, %rbx jmp 0xa77c3 jmp 0xa77e1 movq %rax, %rbx jmp 0xa77fb jmp 0xa77e1 jmp 0xa775d jmp 0xa775d movq %rax, %rbx movq 0x40(%rsp), %rdi leaq 0x50(%rsp), %rax cmpq %rax, %rdi je 0xa77fb movq 0x50(%rsp), %rsi incq %rsi jmp 0xa77f6 jmp 0xa777f movq %rax, %rbx movq %r14, %rdi callq 0x35430 jmp 0xa77e4 jmp 0xa7790 jmp 0xa77e1 movq %rax, %rbx leaq 0x40(%rsp), %rdi callq 0x38cd8 jmp 0xa77e4 jmp 0xa77e1 movq %rax, %rbx jmp 0xa77b6 movq %rax, %rbx leaq 0x110(%rsp), %rdi callq 0x44540 leaq 0xb0(%rsp), %rdi callq 0x44540 movq 0x40(%rsp), %rdi leaq 0x50(%rsp), %rax cmpq %rax, %rdi je 0xa77e4 movq 0x50(%rsp), %rsi incq %rsi callq 0x355d0 jmp 0xa77e4 movq %rax, %rbx movq 0x8(%rsp), %rdi testq %rdi, %rdi je 0xa77fb movq 0x18(%rsp), %rsi subq %rdi, %rsi callq 0x355d0 movq %rbx, %rdi callq 0x35aa0 nop
/simonowen[P]samdisk/src/types/woz.cpp
unzOpen2
extern unzFile ZEXPORT unzOpen2(const char* path, zlib_filefunc_def* pzlib_filefunc32_def) { if (pzlib_filefunc32_def != NULL) { zlib_filefunc64_32_def zlib_filefunc64_32_def_fill; fill_zlib_filefunc64_32_def_from_filefunc32(&zlib_filefunc64_32_def_fill, pzlib_filefunc32_def); return unzOpenInternal(path, &zlib_filefunc64_32_def_fill, 0); } else return unzOpenInternal(path, NULL, 0); }
pushq %r14 pushq %rbx subq $0x58, %rsp movq %rdi, %rbx testq %rsi, %rsi je 0xa852c movq %rsp, %r14 movq %r14, %rdi callq 0xa823b movq %rbx, %rdi movq %r14, %rsi xorl %edx, %edx callq 0xa853c addq $0x58, %rsp popq %rbx popq %r14 retq movq %rbx, %rdi xorl %esi, %esi xorl %edx, %edx addq $0x58, %rsp popq %rbx popq %r14 jmp 0xa853c
/simonowen[P]samdisk/src/unzip.c
unzOpenInternal
local unzFile unzOpenInternal(const void* path, zlib_filefunc64_32_def* pzlib_filefunc64_32_def, int is64bitOpenFunction) { unz64_s us; unz64_s* s; ZPOS64_T central_pos; uLong uL; uLong number_disk; /* number of the current dist, used for spaning ZIP, unsupported, always 0*/ uLong number_disk_with_CD; /* number the the disk with central dir, used for spaning ZIP, unsupported, always 0*/ ZPOS64_T number_entry_CD; /* total number of entries in the central dir (same than number_entry on nospan) */ int err = UNZ_OK; if (unz_copyright[0] != ' ') return NULL; us.z_filefunc.zseek32_file = NULL; us.z_filefunc.ztell32_file = NULL; if (pzlib_filefunc64_32_def == NULL) fill_fopen64_filefunc(&us.z_filefunc.zfile_func64); else us.z_filefunc = *pzlib_filefunc64_32_def; us.is64bitOpenFunction = is64bitOpenFunction; us.filestream = ZOPEN64(us.z_filefunc, path, ZLIB_FILEFUNC_MODE_READ | ZLIB_FILEFUNC_MODE_EXISTING); if (us.filestream == NULL) return NULL; central_pos = unz64local_SearchCentralDir64(&us.z_filefunc, us.filestream); if (central_pos) { uLong uS; ZPOS64_T uL64; us.isZip64 = 1; if (ZSEEK64(us.z_filefunc, us.filestream, central_pos, ZLIB_FILEFUNC_SEEK_SET) != 0) err = UNZ_ERRNO; /* the signature, already checked */ if (unz64local_getLong(&us.z_filefunc, us.filestream, &uL) != UNZ_OK) err = UNZ_ERRNO; /* size of zip64 end of central directory record */ if (unz64local_getLong64(&us.z_filefunc, us.filestream, &uL64) != UNZ_OK) err = UNZ_ERRNO; /* version made by */ if (unz64local_getShort(&us.z_filefunc, us.filestream, &uS) != UNZ_OK) err = UNZ_ERRNO; /* version needed to extract */ if (unz64local_getShort(&us.z_filefunc, us.filestream, &uS) != UNZ_OK) err = UNZ_ERRNO; /* number of this disk */ if (unz64local_getLong(&us.z_filefunc, us.filestream, &number_disk) != UNZ_OK) err = UNZ_ERRNO; /* number of the disk with the start of the central directory */ if (unz64local_getLong(&us.z_filefunc, us.filestream, &number_disk_with_CD) != UNZ_OK) err = UNZ_ERRNO; /* total number of entries in the central directory on this disk */ if (unz64local_getLong64(&us.z_filefunc, us.filestream, &us.gi.number_entry) != UNZ_OK) err = UNZ_ERRNO; /* total number of entries in the central directory */ if (unz64local_getLong64(&us.z_filefunc, us.filestream, &number_entry_CD) != UNZ_OK) err = UNZ_ERRNO; if ((number_entry_CD != us.gi.number_entry) || (number_disk_with_CD != 0) || (number_disk != 0)) err = UNZ_BADZIPFILE; /* size of the central directory */ if (unz64local_getLong64(&us.z_filefunc, us.filestream, &us.size_central_dir) != UNZ_OK) err = UNZ_ERRNO; /* offset of start of central directory with respect to the starting disk number */ if (unz64local_getLong64(&us.z_filefunc, us.filestream, &us.offset_central_dir) != UNZ_OK) err = UNZ_ERRNO; us.gi.size_comment = 0; } else { central_pos = unz64local_SearchCentralDir(&us.z_filefunc, us.filestream); if (central_pos == 0) err = UNZ_ERRNO; us.isZip64 = 0; if (ZSEEK64(us.z_filefunc, us.filestream, central_pos, ZLIB_FILEFUNC_SEEK_SET) != 0) err = UNZ_ERRNO; /* the signature, already checked */ if (unz64local_getLong(&us.z_filefunc, us.filestream, &uL) != UNZ_OK) err = UNZ_ERRNO; /* number of this disk */ if (unz64local_getShort(&us.z_filefunc, us.filestream, &number_disk) != UNZ_OK) err = UNZ_ERRNO; /* number of the disk with the start of the central directory */ if (unz64local_getShort(&us.z_filefunc, us.filestream, &number_disk_with_CD) != UNZ_OK) err = UNZ_ERRNO; /* total number of entries in the central dir on this disk */ if (unz64local_getShort(&us.z_filefunc, us.filestream, &uL) != UNZ_OK) err = UNZ_ERRNO; us.gi.number_entry = uL; /* total number of entries in the central dir */ if (unz64local_getShort(&us.z_filefunc, us.filestream, &uL) != UNZ_OK) err = UNZ_ERRNO; number_entry_CD = uL; if ((number_entry_CD != us.gi.number_entry) || (number_disk_with_CD != 0) || (number_disk != 0)) err = UNZ_BADZIPFILE; /* size of the central directory */ if (unz64local_getLong(&us.z_filefunc, us.filestream, &uL) != UNZ_OK) err = UNZ_ERRNO; us.size_central_dir = uL; /* offset of start of central directory with respect to the starting disk number */ if (unz64local_getLong(&us.z_filefunc, us.filestream, &uL) != UNZ_OK) err = UNZ_ERRNO; us.offset_central_dir = uL; /* zipfile comment length */ if (unz64local_getShort(&us.z_filefunc, us.filestream, &us.gi.size_comment) != UNZ_OK) err = UNZ_ERRNO; } if ((central_pos < us.offset_central_dir + us.size_central_dir) && (err == UNZ_OK)) err = UNZ_BADZIPFILE; if (err != UNZ_OK) { ZCLOSE64(us.z_filefunc, us.filestream); return NULL; } us.byte_before_the_zipfile = central_pos - (us.offset_central_dir + us.size_central_dir); us.central_pos = central_pos; us.pfile_in_zip_read = NULL; us.encrypted = 0; s = (unz64_s*)ALLOC(sizeof(unz64_s)); if (s != NULL) { *s = us; unzGoToFirstFile((unzFile)s); } return (unzFile)s; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x1c8, %rsp # imm = 0x1C8 movl %edx, %ebp movq %rdi, %rbx xorps %xmm0, %xmm0 movups %xmm0, 0xc0(%rsp) leaq 0x78(%rsp), %rdi testq %rsi, %rsi je 0xa8571 movl $0xb, %ecx rep movsq (%rsi), %es:(%rdi) jmp 0xa8576 callq 0xa83a1 leaq 0x78(%rsp), %r15 movl %ebp, 0x58(%r15) movq %r15, %rdi movq %rbx, %rsi movl $0x5, %edx callq 0xa81fc movq %rax, 0x60(%r15) testq %rax, %rax je 0xa8c2c movq %rax, %r14 xorl %r15d, %r15d leaq 0x78(%rsp), %rdi movq %rax, %rsi xorl %edx, %edx movl $0x2, %ecx callq 0xa820e testq %rax, %rax jne 0xa8740 leaq 0x78(%rsp), %rdi movq %r14, %rsi callq 0xa8221 movq %rax, %rbx movl $0xffff, %r15d # imm = 0xFFFF cmpq %r15, %rax cmovbq %rax, %r15 movl $0x404, %edi # imm = 0x404 callq 0x35750 testq %rax, %rax je 0xa873d movq %rax, %r12 movq %r14, 0x30(%rsp) leaq -0x4(%rbx), %rax movq %rax, 0x40(%rsp) movl $0x4, %r13d movq $0x0, 0x20(%rsp) movq %rbx, %rdx movq %r15, 0x28(%rsp) cmpq %r15, %r13 jae 0xa86f5 addq $0x400, %r13 # imm = 0x400 cmpq %r15, %r13 cmovaeq %r15, %r13 movq %rdx, %r14 subq %r13, %rdx movl $0x404, %eax # imm = 0x404 cmpq %rax, %r13 movl $0x404, %ebp # imm = 0x404 cmovbq %r13, %rbp xorl %ebx, %ebx leaq 0x78(%rsp), %rdi movq 0x30(%rsp), %r15 movq %r15, %rsi xorl %ecx, %ecx callq 0xa820e testq %rax, %rax jne 0xa86c4 movq 0xb0(%rsp), %rdi movq %r15, %rsi movq %r12, %rdx movq %rbp, %rcx callq *0x80(%rsp) cmpq %rbp, %rax jne 0xa86c2 movq %r14, %rdx cmpq $0x4, %r14 movq 0x28(%rsp), %r15 jb 0xa86d6 movq 0x20(%rsp), %rcx cmpb $0x50, -0x4(%r12,%rbp) jne 0xa86b0 cmpb $0x4b, -0x3(%r12,%rbp) jne 0xa86b0 cmpb $0x6, -0x2(%r12,%rbp) jne 0xa86b0 cmpb $0x7, -0x1(%r12,%rbp) je 0xa86e8 leaq -0x1(%rbp), %rax addq $-0x4, %rbp testq %rbp, %rbp movq %rax, %rbp jg 0xa8690 jmp 0xa86db xorl %ebx, %ebx movq %r14, %rdx movq 0x28(%rsp), %r15 testb %bl, %bl jne 0xa8617 jmp 0xa86f5 movq 0x20(%rsp), %rcx movq %rcx, 0x20(%rsp) testq %rcx, %rcx sete %bl jmp 0xa86cc movq 0x40(%rsp), %rcx subq %r13, %rcx addq %rbp, %rcx jmp 0xa86db movq %r12, %rdi callq 0x356d0 movq 0x20(%rsp), %rdx testq %rdx, %rdx je 0xa873d leaq 0x78(%rsp), %rdi xorl %r15d, %r15d movq 0x30(%rsp), %r14 movq %r14, %rsi xorl %ecx, %ecx callq 0xa820e testq %rax, %rax jne 0xa8740 leaq 0x78(%rsp), %rdi leaq 0x38(%rsp), %rdx movq %r14, %rsi callq 0xaa383 testl %eax, %eax je 0xa8c43 xorl %r15d, %r15d testq %r15, %r15 je 0xa88b2 leaq 0x78(%rsp), %r14 movl $0x1, 0x14c(%r14) movq 0x60(%r14), %rsi movq %r14, %rdi movq %r15, %rdx xorl %ecx, %ecx callq 0xa820e testq %rax, %rax setne 0x28(%rsp) movq 0x60(%r14), %rsi leaq 0x38(%rsp), %rdx movq %r14, %rdi callq 0xaa383 movl %eax, 0x20(%rsp) movq 0x60(%r14), %rsi leaq 0x68(%rsp), %rdx movq %r14, %rdi callq 0xaa42a movl %eax, 0x40(%rsp) movq 0x60(%r14), %rsi leaq 0x70(%rsp), %rbx movq %r14, %rdi movq %rbx, %rdx callq 0xaa5ac movl %eax, 0x5c(%rsp) movq 0x60(%r14), %rsi movq %r14, %rdi movq %rbx, %rdx callq 0xaa5ac movq %r15, 0x30(%rsp) movl %eax, %r12d movq 0x60(%r14), %rsi leaq 0x48(%rsp), %rdx movq %r14, %rdi callq 0xaa383 movl %eax, %ebx movq 0x60(%r14), %rsi leaq 0x50(%rsp), %rdx movq %r14, %rdi callq 0xaa383 movl %eax, %r15d movq 0x60(%r14), %rsi leaq 0xe0(%rsp), %rbp movq %r14, %rdi movq %rbp, %rdx callq 0xaa42a movl %eax, %r13d movq -0x8(%rbp), %rsi leaq 0x60(%rsp), %rdx movq %r14, %rdi callq 0xaa42a orl %r13d, %eax orl %ebx, %r15d orl %eax, %r15d orl 0x5c(%rsp), %r12d orl 0x40(%rsp), %r12d orl %r15d, %r12d orl 0x20(%rsp), %r12d setne %al orb 0x28(%rsp), %al movzbl %al, %eax leaq 0x60(%rsp), %rcx movq (%rcx), %rcx xorq (%rbp), %rcx leaq 0x50(%rsp), %rdx orq (%rdx), %rcx negl %eax leaq 0x48(%rsp), %rdx orq (%rdx), %rcx movl $0xffffff99, %r15d # imm = 0xFFFFFF99 cmovel %eax, %r15d movq -0x8(%rbp), %rsi leaq 0x118(%rsp), %rbx movq %r14, %rdi movq %rbx, %rdx callq 0xaa42a movl %eax, %ebp movq -0x40(%rbx), %rsi leaq 0x120(%rsp), %rbx movq %r14, %rdi movq %rbx, %rdx callq 0xaa42a orl %ebp, %eax movl $0xffffffff, %eax # imm = 0xFFFFFFFF cmovel %r15d, %eax movq $0x0, -0x38(%rbx) jmp 0xa8b4d leaq 0x78(%rsp), %rdi movq 0x60(%rdi), %r14 xorl %ebx, %ebx movq %r14, %rsi xorl %edx, %edx movl $0x2, %ecx callq 0xa820e testq %rax, %rax jne 0xa8a16 leaq 0x78(%rsp), %rdi movq %r14, %rsi callq 0xa8221 movq %rax, %r15 movl $0xffff, %ebx # imm = 0xFFFF cmpq %rbx, %rax cmovbq %rax, %rbx movl $0x404, %edi # imm = 0x404 callq 0x35750 testq %rax, %rax je 0xa8a14 movq %rax, %r12 movq %r14, 0x28(%rsp) leaq -0x4(%r15), %rax movq %rax, 0x40(%rsp) movl $0x4, %r13d movq $0x0, 0x30(%rsp) movq %r15, %rdx movq %rbx, 0x20(%rsp) cmpq %rbx, %r13 jae 0xa8a05 addq $0x400, %r13 # imm = 0x400 cmpq %rbx, %r13 cmovaeq %rbx, %r13 movq %rdx, %r14 subq %r13, %rdx movl $0x404, %eax # imm = 0x404 cmpq %rax, %r13 movl $0x404, %ebp # imm = 0x404 cmovbq %r13, %rbp xorl %r15d, %r15d leaq 0x78(%rsp), %rdi movq 0x28(%rsp), %rbx movq %rbx, %rsi xorl %ecx, %ecx callq 0xa820e testq %rax, %rax jne 0xa89e0 movq 0xb0(%rsp), %rdi movq %rbx, %rsi movq %r12, %rdx movq %rbp, %rcx callq *0x80(%rsp) cmpq %rbp, %rax jne 0xa89dd movq %r14, %rdx cmpq $0x4, %r14 movq 0x20(%rsp), %rbx jb 0xa89d1 cmpb $0x50, -0x4(%r12,%rbp) jne 0xa89c1 cmpb $0x4b, -0x3(%r12,%rbp) jne 0xa89c1 cmpb $0x5, -0x2(%r12,%rbp) jne 0xa89c1 cmpb $0x6, -0x1(%r12,%rbp) je 0xa89f3 leaq -0x1(%rbp), %rax addq $-0x4, %rbp testq %rbp, %rbp movq %rax, %rbp jg 0xa89a1 cmpq $0x0, 0x30(%rsp) sete %r15b jmp 0xa89e8 xorl %r15d, %r15d movq %r14, %rdx movq 0x20(%rsp), %rbx testb %r15b, %r15b jne 0xa892c jmp 0xa8a05 movq 0x40(%rsp), %rax subq %r13, %rax addq %rbp, %rax movq %rax, 0x30(%rsp) jmp 0xa89d1 movq %r12, %rdi callq 0x356d0 movq 0x30(%rsp), %rbx jmp 0xa8a16 xorl %ebx, %ebx movq %rbx, 0x30(%rsp) testq %rbx, %rbx sete 0x28(%rsp) leaq 0x78(%rsp), %r14 movl $0x0, 0x14c(%r14) movq 0x60(%r14), %rsi movq %r14, %rdi movq %rbx, %rdx xorl %ecx, %ecx callq 0xa820e testq %rax, %rax setne %bpl movq 0x60(%r14), %rsi leaq 0x38(%rsp), %r15 movq %r14, %rdi movq %r15, %rdx callq 0xaa383 movl %eax, 0x20(%rsp) movq 0x60(%r14), %rsi leaq 0x48(%rsp), %rdx movq %r14, %rdi callq 0xaa5ac movl %eax, %r13d movq 0x60(%r14), %rsi leaq 0x50(%rsp), %rdx movq %r14, %rdi callq 0xaa5ac movl %eax, %r12d movq 0x60(%r14), %rsi movq %r14, %rdi movq %r15, %rdx callq 0xaa5ac movl %eax, %ebx movq (%r15), %rax movq %rax, 0x68(%r14) movq 0x60(%r14), %rsi movq %r14, %rdi movq %r15, %rdx callq 0xaa5ac orl %ebx, %eax orl %r13d, %r12d orl %eax, %r12d orl 0x20(%rsp), %r12d setne %al orb 0x28(%rsp), %bpl orb %al, %bpl movzbl %bpl, %eax negl %eax movq (%r15), %rcx movq %rcx, 0x60(%rsp) xorq 0x68(%r14), %rcx leaq 0x50(%rsp), %rdx orq (%rdx), %rcx leaq 0x48(%rsp), %rdx orq (%rdx), %rcx movl $0xffffff99, %r12d # imm = 0xFFFFFF99 cmovel %eax, %r12d movq 0x60(%r14), %rsi movq %r14, %rdi movq %r15, %rdx callq 0xaa383 movl %eax, %ebx movq (%r15), %rax movq %rax, 0xa0(%r14) movq 0x60(%r14), %rsi movq %r14, %rdi movq %r15, %rdx callq 0xaa383 movl %eax, %ebp movq (%r15), %rax movq %rax, 0xa8(%r14) movq 0x60(%r14), %rsi leaq 0xe8(%rsp), %rdx movq %r14, %rdi callq 0xaa5ac orl %ebp, %eax orl %ebx, %eax movl $0xffffffff, %eax # imm = 0xFFFFFFFF cmovel %r12d, %eax movq 0x118(%rsp), %rdx addq 0x120(%rsp), %rdx movq 0x30(%rsp), %rsi movq %rsi, %rcx subq %rdx, %rcx jb 0xa8c15 testl %eax, %eax jne 0xa8c15 movq %rcx, 0xf0(%rsp) movq %rsi, 0x110(%rsp) movq $0x0, 0x1b8(%rsp) movl $0x0, 0x1c0(%rsp) movl $0x150, %edi # imm = 0x150 callq 0x35750 movq %rax, %rbx testq %rax, %rax je 0xa8c2e leaq 0x78(%rsp), %rsi movl $0x150, %edx # imm = 0x150 movq %rbx, %rdi callq 0x354c0 movq 0xa8(%rbx), %rax movq %rax, 0x88(%rbx) xorl %eax, %eax movq %rax, 0x80(%rbx) leaq 0xb0(%rbx), %rsi movq %rbx, %rdx addq $0x138, %rdx # imm = 0x138 movq %rax, 0x10(%rsp) xorps %xmm0, %xmm0 movups %xmm0, (%rsp) movq %rbx, %rdi xorl %ecx, %ecx xorl %r8d, %r8d xorl %r9d, %r9d callq 0xa8e94 xorl %ecx, %ecx testl %eax, %eax sete %cl movq %rcx, 0x90(%rbx) jmp 0xa8c2e movq 0xb0(%rsp), %rdi movq 0xd8(%rsp), %rsi callq *0xa0(%rsp) xorl %ebx, %ebx movq %rbx, %rax addq $0x1c8, %rsp # imm = 0x1C8 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq leaq 0x78(%rsp), %rdi leaq 0x38(%rsp), %rdx movq %r14, %rsi callq 0xaa383 xorl %r15d, %r15d testl %eax, %eax jne 0xa8740 cmpq $0x0, 0x38(%rsp) jne 0xa8740 leaq 0x78(%rsp), %rdi leaq 0x48(%rsp), %rdx movq %r14, %rsi callq 0xaa42a testl %eax, %eax jne 0xa873d leaq 0x78(%rsp), %rdi leaq 0x38(%rsp), %rdx movq %r14, %rsi callq 0xaa383 xorl %r15d, %r15d testl %eax, %eax jne 0xa8740 cmpq $0x1, 0x38(%rsp) jne 0xa8740 movq 0x48(%rsp), %rbx leaq 0x78(%rsp), %rdi xorl %r15d, %r15d movq %r14, %rsi movq %rbx, %rdx xorl %ecx, %ecx callq 0xa820e testq %rax, %rax jne 0xa8740 leaq 0x78(%rsp), %rdi leaq 0x38(%rsp), %r15 movq %r14, %rsi movq %r15, %rdx callq 0xaa383 xorl %ecx, %ecx cmpq $0x6064b50, (%r15) # imm = 0x6064B50 cmovneq %rcx, %rbx testl %eax, %eax cmovneq %rcx, %rbx movq %rbx, %r15 jmp 0xa8740
/simonowen[P]samdisk/src/unzip.c
unzClose
extern int ZEXPORT unzClose(unzFile file) { unz64_s* s; if (file == NULL) return UNZ_PARAMERROR; s = (unz64_s*)file; if (s->pfile_in_zip_read != NULL) unzCloseCurrentFile(file); ZCLOSE64(s->z_filefunc, s->filestream); TRYFREE(s); return UNZ_OK; }
testq %rdi, %rdi je 0xa8d95 pushq %rbx movq %rdi, %rbx cmpq $0x0, 0x140(%rdi) je 0xa8d7e movq %rbx, %rdi callq 0xa8d9b movq 0x38(%rbx), %rdi movq 0x60(%rbx), %rsi callq *0x28(%rbx) movq %rbx, %rdi callq 0x356d0 xorl %eax, %eax popq %rbx retq movl $0xffffff9a, %eax # imm = 0xFFFFFF9A retq
/simonowen[P]samdisk/src/unzip.c
unzCloseCurrentFile
extern int ZEXPORT unzCloseCurrentFile(unzFile file) { int err = UNZ_OK; unz64_s* s; file_in_zip64_read_info_s* pfile_in_zip_read_info; if (file == NULL) return UNZ_PARAMERROR; s = (unz64_s*)file; pfile_in_zip_read_info = s->pfile_in_zip_read; if (pfile_in_zip_read_info == NULL) return UNZ_PARAMERROR; if ((pfile_in_zip_read_info->rest_read_uncompressed == 0) && (!pfile_in_zip_read_info->raw)) { if (pfile_in_zip_read_info->crc32 != pfile_in_zip_read_info->crc32_wait) err = UNZ_CRCERROR; } TRYFREE(pfile_in_zip_read_info->read_buffer); pfile_in_zip_read_info->read_buffer = NULL; if (pfile_in_zip_read_info->stream_initialised == Z_DEFLATED) inflateEnd(&pfile_in_zip_read_info->stream); #ifdef HAVE_BZIP2 else if (pfile_in_zip_read_info->stream_initialised == Z_BZIP2ED) BZ2_bzDecompressEnd(&pfile_in_zip_read_info->bstream); #endif pfile_in_zip_read_info->stream_initialised = 0; TRYFREE(pfile_in_zip_read_info); s->pfile_in_zip_read = NULL; return err; }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx pushq %rax movl $0xffffff9a, %ebx # imm = 0xFFFFFF9A testq %rdi, %rdi je 0xa8e2a movq %rdi, %r14 movq 0x140(%rdi), %r15 testq %r15, %r15 je 0xa8e2a xorl %ebx, %ebx cmpq $0x0, 0xc0(%r15) jne 0xa8dea cmpl $0x0, 0x138(%r15) jne 0xa8dea movq 0xa8(%r15), %rax xorl %ecx, %ecx cmpq 0xb0(%r15), %rax movl $0xffffff97, %ebx # imm = 0xFFFFFF97 cmovel %ecx, %ebx movq (%r15), %rdi testq %rdi, %rdi je 0xa8df7 callq 0x356d0 movq $0x0, (%r15) cmpq $0x8, 0x80(%r15) jne 0xa8e11 leaq 0x8(%r15), %rdi callq 0x35620 xorl %r12d, %r12d movq %r12, 0x80(%r15) movq %r15, %rdi callq 0x356d0 movq %r12, 0x140(%r14) movl %ebx, %eax addq $0x8, %rsp popq %rbx popq %r12 popq %r14 popq %r15 retq
/simonowen[P]samdisk/src/unzip.c
unz64local_GetCurrentFileInfoInternal
local int unz64local_GetCurrentFileInfoInternal(unzFile file, unz_file_info64* pfile_info, unz_file_info64_internal * pfile_info_internal, char* szFileName, uLong fileNameBufferSize, void* extraField, uLong extraFieldBufferSize, char* szComment, uLong commentBufferSize) { unz64_s* s; unz_file_info64 file_info; unz_file_info64_internal file_info_internal; int err = UNZ_OK; uLong uMagic; long lSeek = 0; uLong uL; if (file == NULL) return UNZ_PARAMERROR; s = (unz64_s*)file; if (ZSEEK64(s->z_filefunc, s->filestream, s->pos_in_central_dir + s->byte_before_the_zipfile, ZLIB_FILEFUNC_SEEK_SET) != 0) err = UNZ_ERRNO; /* we check the magic */ if (err == UNZ_OK) { if (unz64local_getLong(&s->z_filefunc, s->filestream, &uMagic) != UNZ_OK) err = UNZ_ERRNO; else if (uMagic != 0x02014b50) err = UNZ_BADZIPFILE; } if (unz64local_getShort(&s->z_filefunc, s->filestream, &file_info.version) != UNZ_OK) err = UNZ_ERRNO; if (unz64local_getShort(&s->z_filefunc, s->filestream, &file_info.version_needed) != UNZ_OK) err = UNZ_ERRNO; if (unz64local_getShort(&s->z_filefunc, s->filestream, &file_info.flag) != UNZ_OK) err = UNZ_ERRNO; if (unz64local_getShort(&s->z_filefunc, s->filestream, &file_info.compression_method) != UNZ_OK) err = UNZ_ERRNO; if (unz64local_getLong(&s->z_filefunc, s->filestream, &file_info.dosDate) != UNZ_OK) err = UNZ_ERRNO; unz64local_DosDateToTmuDate(file_info.dosDate, &file_info.tmu_date); if (unz64local_getLong(&s->z_filefunc, s->filestream, &file_info.crc) != UNZ_OK) err = UNZ_ERRNO; if (unz64local_getLong(&s->z_filefunc, s->filestream, &uL) != UNZ_OK) err = UNZ_ERRNO; file_info.compressed_size = uL; if (unz64local_getLong(&s->z_filefunc, s->filestream, &uL) != UNZ_OK) err = UNZ_ERRNO; file_info.uncompressed_size = uL; if (unz64local_getShort(&s->z_filefunc, s->filestream, &file_info.size_filename) != UNZ_OK) err = UNZ_ERRNO; if (unz64local_getShort(&s->z_filefunc, s->filestream, &file_info.size_file_extra) != UNZ_OK) err = UNZ_ERRNO; if (unz64local_getShort(&s->z_filefunc, s->filestream, &file_info.size_file_comment) != UNZ_OK) err = UNZ_ERRNO; if (unz64local_getShort(&s->z_filefunc, s->filestream, &file_info.disk_num_start) != UNZ_OK) err = UNZ_ERRNO; if (unz64local_getShort(&s->z_filefunc, s->filestream, &file_info.internal_fa) != UNZ_OK) err = UNZ_ERRNO; if (unz64local_getLong(&s->z_filefunc, s->filestream, &file_info.external_fa) != UNZ_OK) err = UNZ_ERRNO; // relative offset of local header if (unz64local_getLong(&s->z_filefunc, s->filestream, &uL) != UNZ_OK) err = UNZ_ERRNO; file_info_internal.offset_curfile = uL; lSeek += file_info.size_filename; if ((err == UNZ_OK) && (szFileName != NULL)) { uLong uSizeRead; if (file_info.size_filename < fileNameBufferSize) { *(szFileName + file_info.size_filename) = '\0'; uSizeRead = file_info.size_filename; } else uSizeRead = fileNameBufferSize; if ((file_info.size_filename > 0) && (fileNameBufferSize > 0)) if (ZREAD64(s->z_filefunc, s->filestream, szFileName, uSizeRead) != uSizeRead) err = UNZ_ERRNO; lSeek -= uSizeRead; } // Read extrafield if ((err == UNZ_OK) && (extraField != NULL)) { ZPOS64_T uSizeRead; if (file_info.size_file_extra < extraFieldBufferSize) uSizeRead = file_info.size_file_extra; else uSizeRead = extraFieldBufferSize; if (lSeek != 0) { if (ZSEEK64(s->z_filefunc, s->filestream, lSeek, ZLIB_FILEFUNC_SEEK_CUR) == 0) lSeek = 0; else err = UNZ_ERRNO; } if ((file_info.size_file_extra > 0) && (extraFieldBufferSize > 0)) if (ZREAD64(s->z_filefunc, s->filestream, extraField, (uLong)uSizeRead) != uSizeRead) err = UNZ_ERRNO; lSeek += file_info.size_file_extra - (uLong)uSizeRead; } else lSeek += file_info.size_file_extra; if ((err == UNZ_OK) && (file_info.size_file_extra != 0)) { uLong acc = 0; // since lSeek now points to after the extra field we need to move back lSeek -= file_info.size_file_extra; if (lSeek != 0) { if (ZSEEK64(s->z_filefunc, s->filestream, lSeek, ZLIB_FILEFUNC_SEEK_CUR) == 0) lSeek = 0; else err = UNZ_ERRNO; } while (acc < file_info.size_file_extra) { uLong headerId; uLong dataSize; if (unz64local_getShort(&s->z_filefunc, s->filestream, &headerId) != UNZ_OK) err = UNZ_ERRNO; if (unz64local_getShort(&s->z_filefunc, s->filestream, &dataSize) != UNZ_OK) err = UNZ_ERRNO; /* ZIP64 extra fields */ if (headerId == 0x0001) { if (file_info.uncompressed_size == (ZPOS64_T)(unsigned long)-1) { if (unz64local_getLong64(&s->z_filefunc, s->filestream, &file_info.uncompressed_size) != UNZ_OK) err = UNZ_ERRNO; } if (file_info.compressed_size == (ZPOS64_T)(unsigned long)-1) { if (unz64local_getLong64(&s->z_filefunc, s->filestream, &file_info.compressed_size) != UNZ_OK) err = UNZ_ERRNO; } if (file_info_internal.offset_curfile == (ZPOS64_T)(unsigned long)-1) { /* Relative Header offset */ if (unz64local_getLong64(&s->z_filefunc, s->filestream, &file_info_internal.offset_curfile) != UNZ_OK) err = UNZ_ERRNO; } if (file_info.disk_num_start == (unsigned long)-1) { /* Disk Start Number */ if (unz64local_getLong(&s->z_filefunc, s->filestream, &uL) != UNZ_OK) err = UNZ_ERRNO; } } else { if (ZSEEK64(s->z_filefunc, s->filestream, dataSize, ZLIB_FILEFUNC_SEEK_CUR) != 0) err = UNZ_ERRNO; } acc += 2 + 2 + dataSize; } } if ((err == UNZ_OK) && (szComment != NULL)) { uLong uSizeRead; if (file_info.size_file_comment < commentBufferSize) { *(szComment + file_info.size_file_comment) = '\0'; uSizeRead = file_info.size_file_comment; } else uSizeRead = commentBufferSize; if (lSeek != 0) { if (ZSEEK64(s->z_filefunc, s->filestream, lSeek, ZLIB_FILEFUNC_SEEK_CUR) == 0) lSeek = 0; else err = UNZ_ERRNO; } if ((file_info.size_file_comment > 0) && (commentBufferSize > 0)) if (ZREAD64(s->z_filefunc, s->filestream, szComment, uSizeRead) != uSizeRead) err = UNZ_ERRNO; lSeek += file_info.size_file_comment - uSizeRead; } else lSeek += file_info.size_file_comment; if ((err == UNZ_OK) && (pfile_info != NULL)) *pfile_info = file_info; if ((err == UNZ_OK) && (pfile_info_internal != NULL)) *pfile_info_internal = file_info_internal; return err; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0xe8, %rsp movq %rdx, 0x40(%rsp) movq %rsi, 0x38(%rsp) testq %rdi, %rdi je 0xa915c movq %rdi, %r15 movq %r8, 0x28(%rsp) movq %rcx, 0x30(%rsp) movq %r9, 0x8(%rsp) movq 0x60(%rdi), %rsi movq 0x78(%rdi), %rdx addq 0x88(%rdi), %rdx xorl %ecx, %ecx callq 0xa820e movl $0xffffffff, %r12d # imm = 0xFFFFFFFF movl $0xffffffff, %ecx # imm = 0xFFFFFFFF testq %rax, %rax jne 0xa8f1d movq 0x60(%r15), %rsi leaq 0x58(%rsp), %rdx movq %r15, %rdi callq 0xaa383 movl $0xffffffff, %ecx # imm = 0xFFFFFFFF testl %eax, %eax jne 0xa8f1d xorl %eax, %eax cmpq $0x2014b50, 0x58(%rsp) # imm = 0x2014B50 movl $0xffffff99, %ecx # imm = 0xFFFFFF99 cmovel %eax, %ecx movl %ecx, 0x1c(%rsp) movq 0x60(%r15), %rsi leaq 0x60(%rsp), %rdx movq %r15, %rdi callq 0xaa5ac movl %eax, %ebx movq 0x60(%r15), %rsi leaq 0x68(%rsp), %rdx movq %r15, %rdi callq 0xaa5ac movl %eax, %ebp orl %ebx, %ebp movq 0x60(%r15), %rsi leaq 0x70(%rsp), %rdx movq %r15, %rdi callq 0xaa5ac movl %eax, %ebx movq 0x60(%r15), %rsi leaq 0x78(%rsp), %rdx movq %r15, %rdi callq 0xaa5ac movl %eax, %r13d orl %ebx, %r13d orl %ebp, %r13d movq 0x60(%r15), %rsi leaq 0x80(%rsp), %r14 movq %r15, %rdi movq %r14, %rdx callq 0xaa383 movl %eax, %ebp movl (%r14), %eax movl %eax, %ecx shrl $0x10, %ecx andl $0x1f, %ecx movl %ecx, 0x5c(%r14) movl %eax, %ecx shrl $0x15, %ecx andl $0xf, %ecx decl %ecx movl %ecx, 0x60(%r14) movl %eax, %ecx shrl $0x19, %ecx addl $0x7bc, %ecx # imm = 0x7BC movl %ecx, 0x64(%r14) movl %eax, %ecx shrl $0xb, %ecx andl $0x1f, %ecx movl %ecx, 0x58(%r14) movl %eax, %ecx shrl $0x5, %ecx andl $0x3f, %ecx movl %ecx, 0x54(%r14) addl %eax, %eax andl $0x3e, %eax movl %eax, 0x50(%r14) movq 0x60(%r15), %rsi leaq 0x88(%rsp), %rdx movq %r15, %rdi callq 0xaa383 movl %eax, %r14d orl %ebp, %r14d movq 0x60(%r15), %rsi leaq 0x50(%rsp), %rbx movq %r15, %rdi movq %rbx, %rdx callq 0xaa383 movl %eax, %ebp orl %r14d, %ebp orl %r13d, %ebp movq %rbx, %r13 movq (%rbx), %rax leaq 0x88(%rsp), %rbx movq %rax, 0x8(%rbx) movq 0x60(%r15), %rsi movq %r15, %rdi movq %r13, %rdx callq 0xaa383 movl %eax, %r14d movq (%r13), %rax movq %rax, 0x10(%rbx) movq 0x60(%r15), %rsi leaq 0xa0(%rsp), %rdx movq %r15, %rdi callq 0xaa5ac movl %eax, %ebx orl %r14d, %ebx movq 0x60(%r15), %rsi leaq 0xa8(%rsp), %rdx movq %r15, %rdi callq 0xaa5ac movl %eax, %r14d orl %ebx, %r14d movq 0x60(%r15), %rsi leaq 0xb0(%rsp), %rdx movq %r15, %rdi callq 0xaa5ac movl %eax, %ebx orl %r14d, %ebx orl %ebp, %ebx movq 0x60(%r15), %rsi leaq 0xb8(%rsp), %rdx movq %r15, %rdi callq 0xaa5ac movl %eax, %ebp movq 0x60(%r15), %rsi leaq 0xc0(%rsp), %rdx movq %r15, %rdi callq 0xaa5ac movl %eax, %r14d orl %ebp, %r14d orl %ebx, %r14d movq 0x60(%r15), %rsi leaq 0xc8(%rsp), %rbx movq %r15, %rdi movq %rbx, %rdx callq 0xaa383 movl %eax, %ebp movq 0x60(%r15), %rsi movq %r15, %rdi movq %r13, %rdx callq 0xaa383 orl %ebp, %eax orl %r14d, %eax cmovel 0x1c(%rsp), %r12d movq (%r13), %rax movq %rax, 0x10(%rsp) movq -0x28(%rbx), %r14 movq 0x30(%rsp), %rdx testq %rdx, %rdx je 0xa9167 testl %r12d, %r12d movq 0x8(%rsp), %rbx jne 0xa916c movq 0x28(%rsp), %rcx movq %rcx, %r13 cmpq %rcx, %r14 jae 0xa9128 movb $0x0, (%rdx,%r14) movq %r14, %r13 testq %r14, %r14 sete %al testq %rcx, %rcx sete %cl xorl %r12d, %r12d orb %al, %cl jne 0xa9157 movq 0x38(%r15), %rdi movq 0x60(%r15), %rsi movq %r13, %rcx callq *0x8(%r15) xorl %r12d, %r12d cmpq %r13, %rax setne %r12b negl %r12d subq %r13, %r14 jmp 0xa916c movl $0xffffff9a, %r12d # imm = 0xFFFFFF9A jmp 0xa945b movq 0x8(%rsp), %rbx movq 0xa8(%rsp), %rbp testq %rbx, %rbx je 0xa91f8 testl %r12d, %r12d jne 0xa91f8 movq 0x120(%rsp), %r13 cmpq %r13, %rbp movq %r13, %rbx cmovbq %rbp, %rbx testq %r14, %r14 je 0xa91bc movq 0x60(%r15), %rsi movq %r15, %rdi movq %r14, %rdx movl $0x1, %ecx callq 0xa820e xorl %r12d, %r12d testq %rax, %rax setne %r12b cmoveq %rax, %r14 negl %r12d jmp 0xa91c2 xorl %r12d, %r12d xorl %r14d, %r14d testq %rbp, %rbp sete %al testq %r13, %r13 sete %cl orb %al, %cl jne 0xa91f5 movq 0x38(%r15), %rdi movq 0x60(%r15), %rsi movq 0x8(%rsp), %rdx movq %rbx, %rcx callq *0x8(%r15) cmpq %rbx, %rax movl $0xffffffff, %eax # imm = 0xFFFFFFFF cmovel %r12d, %eax movl %eax, %r12d subq %rbx, %rbp addq %r14, %rbp movq 0x128(%rsp), %rbx testl %r12d, %r12d sete %cl movq 0xa8(%rsp), %rax testq %rax, %rax setne %dl andb %cl, %dl cmpb $0x1, %dl jne 0xa938f subq %rax, %rbp jne 0xa922e xorl %r12d, %r12d xorl %ebp, %ebp jmp 0xa9253 movq 0x60(%r15), %rsi movq %r15, %rdi movq %rbp, %rdx movl $0x1, %ecx callq 0xa820e xorl %r12d, %r12d testq %rax, %rax setne %r12b cmoveq %rax, %rbp negl %r12d cmpq $0x0, 0xa8(%rsp) je 0xa938f movq %rbp, 0x8(%rsp) xorl %ebp, %ebp leaq 0x20(%rsp), %rbx movl $0xffffffff, %r14d # imm = 0xFFFFFFFF movq 0x60(%r15), %rsi movq %r15, %rdi leaq 0x48(%rsp), %rdx callq 0xaa5ac movl %eax, %r13d movq 0x60(%r15), %rsi movq %r15, %rdi movq %rbx, %rdx callq 0xaa5ac orl %r13d, %eax cmovnel %r14d, %r12d cmpq $0x1, 0x48(%rsp) jne 0xa9345 cmpq $-0x1, 0x98(%rsp) jne 0xa92d5 movq 0x60(%r15), %rsi movq %r15, %rdi leaq 0x98(%rsp), %rdx callq 0xaa42a negl %eax movl $0x0, %eax sbbl %eax, %eax orl %eax, %r12d cmpq $-0x1, 0x90(%rsp) jne 0xa9300 movq 0x60(%r15), %rsi movq %r15, %rdi leaq 0x90(%rsp), %rdx callq 0xaa42a negl %eax movl $0x0, %eax sbbl %eax, %eax orl %eax, %r12d cmpq $-0x1, 0x10(%rsp) jne 0xa9325 movq 0x60(%r15), %rsi movq %r15, %rdi leaq 0x10(%rsp), %rdx callq 0xaa42a negl %eax movl $0x0, %eax sbbl %eax, %eax orl %eax, %r12d cmpq $-0x1, 0xb8(%rsp) jne 0xa9368 movq 0x60(%r15), %rsi movq %r15, %rdi leaq 0x50(%rsp), %rdx callq 0xaa383 negl %eax jmp 0xa935e movq 0x60(%r15), %rsi movq 0x20(%rsp), %rdx movq %r15, %rdi movl $0x1, %ecx callq 0xa820e negq %rax movl $0x0, %eax sbbl %eax, %eax orl %eax, %r12d movq 0x20(%rsp), %rax addq %rax, %rbp addq $0x4, %rbp cmpq 0xa8(%rsp), %rbp jb 0xa9274 movq 0x8(%rsp), %rbp movq 0x128(%rsp), %rbx testq %rbx, %rbx je 0xa9426 testl %r12d, %r12d jne 0xa9426 movq 0x130(%rsp), %r14 movq 0xb0(%rsp), %r13 movq %r14, %rbx cmpq %r14, %r13 jae 0xa93c9 movq 0x128(%rsp), %rax movb $0x0, (%rax,%r13) movq %r13, %rbx testq %rbp, %rbp je 0xa93ed movq 0x60(%r15), %rsi movq %r15, %rdi movq %rbp, %rdx movl $0x1, %ecx callq 0xa820e xorl %r12d, %r12d negq %rax sbbl %r12d, %r12d jmp 0xa93f0 xorl %r12d, %r12d testq %r13, %r13 sete %al testq %r14, %r14 sete %cl orb %al, %cl jne 0xa9426 movq 0x38(%r15), %rdi movq 0x60(%r15), %rsi movq 0x128(%rsp), %rdx movq %rbx, %rcx callq *0x8(%r15) cmpq %rbx, %rax movl $0xffffffff, %eax # imm = 0xFFFFFFFF cmovel %r12d, %eax movl %eax, %r12d movq 0x38(%rsp), %rdi testq %rdi, %rdi je 0xa9444 testl %r12d, %r12d jne 0xa9444 leaq 0x60(%rsp), %rsi movl $0x88, %edx callq 0x354c0 movq 0x40(%rsp), %rcx testq %rcx, %rcx je 0xa945b testl %r12d, %r12d jne 0xa945b movq 0x10(%rsp), %rax movq %rax, (%rcx) movl %r12d, %eax addq $0xe8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/simonowen[P]samdisk/src/unzip.c
unzGetCurrentFileInfo
extern int ZEXPORT unzGetCurrentFileInfo(unzFile file, unz_file_info* pfile_info, char* szFileName, uLong fileNameBufferSize, void* extraField, uLong extraFieldBufferSize, char* szComment, uLong commentBufferSize) { int err; unz_file_info64 file_info64; err = unz64local_GetCurrentFileInfoInternal(file, &file_info64, NULL, szFileName, fileNameBufferSize, extraField, extraFieldBufferSize, szComment, commentBufferSize); if (err == UNZ_OK) { pfile_info->version = file_info64.version; pfile_info->version_needed = file_info64.version_needed; pfile_info->flag = file_info64.flag; pfile_info->compression_method = file_info64.compression_method; pfile_info->dosDate = file_info64.dosDate; pfile_info->crc = file_info64.crc; pfile_info->size_filename = file_info64.size_filename; pfile_info->size_file_extra = file_info64.size_file_extra; pfile_info->size_file_comment = file_info64.size_file_comment; pfile_info->disk_num_start = file_info64.disk_num_start; pfile_info->internal_fa = file_info64.internal_fa; pfile_info->external_fa = file_info64.external_fa; pfile_info->tmu_date = file_info64.tmu_date, pfile_info->compressed_size = (uLong)file_info64.compressed_size; pfile_info->uncompressed_size = (uLong)file_info64.uncompressed_size; } return err; }
pushq %rbx subq $0xa0, %rsp movq %r8, %rax movq %rcx, %r8 movq %rdx, %rcx movq %rsi, %rbx movaps 0xb0(%rsp), %xmm0 movups %xmm0, 0x8(%rsp) movq %r9, (%rsp) leaq 0x18(%rsp), %rsi xorl %edx, %edx movq %rax, %r9 callq 0xa8e94 testl %eax, %eax jne 0xa9547 movq 0x18(%rsp), %rcx movq %rcx, (%rbx) movq 0x20(%rsp), %rcx movq %rcx, 0x8(%rbx) movq 0x28(%rsp), %rcx movq %rcx, 0x10(%rbx) movq 0x30(%rsp), %rcx movq %rcx, 0x18(%rbx) movq 0x38(%rsp), %rcx movq %rcx, 0x20(%rbx) movq 0x40(%rsp), %rcx movq %rcx, 0x28(%rbx) movq 0x58(%rsp), %rcx movq %rcx, 0x40(%rbx) movq 0x60(%rsp), %rcx movq %rcx, 0x48(%rbx) movq 0x68(%rsp), %rcx movq %rcx, 0x50(%rbx) movq 0x70(%rsp), %rcx movq %rcx, 0x58(%rbx) movq 0x78(%rsp), %rcx movq %rcx, 0x60(%rbx) movq 0x80(%rsp), %rcx movq %rcx, 0x68(%rbx) movups 0x88(%rsp), %xmm0 movups %xmm0, 0x70(%rbx) movq 0x98(%rsp), %rcx movq %rcx, 0x80(%rbx) movq 0x48(%rsp), %rcx movq %rcx, 0x30(%rbx) movq 0x50(%rsp), %rcx movq %rcx, 0x38(%rbx) addq $0xa0, %rsp popq %rbx retq
/simonowen[P]samdisk/src/unzip.c
unzLocateFile
extern int ZEXPORT unzLocateFile(unzFile file, const char* szFileName, int iCaseSensitivity) { unz64_s* s; int err; /* We remember the 'current' position in the file so that we can jump * back there if we fail. */ unz_file_info64 cur_file_infoSaved; unz_file_info64_internal cur_file_info_internalSaved; ZPOS64_T num_fileSaved; ZPOS64_T pos_in_central_dirSaved; if (file == NULL) return UNZ_PARAMERROR; if (strlen(szFileName) >= UNZ_MAXFILENAMEINZIP) return UNZ_PARAMERROR; s = (unz64_s*)file; if (!s->current_file_ok) return UNZ_END_OF_LIST_OF_FILE; /* Save the current state */ num_fileSaved = s->num_file; pos_in_central_dirSaved = s->pos_in_central_dir; cur_file_infoSaved = s->cur_file_info; cur_file_info_internalSaved = s->cur_file_info_internal; err = unzGoToFirstFile(file); while (err == UNZ_OK) { char szCurrentFileName[UNZ_MAXFILENAMEINZIP + 1]; err = unzGetCurrentFileInfo64(file, NULL, szCurrentFileName, sizeof(szCurrentFileName) - 1, NULL, 0, NULL, 0); if (err == UNZ_OK) { if (unzStringFileNameCompare(szCurrentFileName, szFileName, iCaseSensitivity) == 0) return UNZ_OK; err = unzGoToNextFile(file); } } /* We failed, so restore the state of the 'current file' to where we * were. */ s->num_file = num_fileSaved; s->pos_in_central_dir = pos_in_central_dirSaved; s->cur_file_info = cur_file_infoSaved; s->cur_file_info_internal = cur_file_info_internalSaved; return err; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x1c8, %rsp # imm = 0x1C8 movl $0xffffff9a, %r12d # imm = 0xFFFFFF9A testq %rdi, %rdi je 0xa97f5 movl %edx, %ebp movq %rsi, %r14 movq %rdi, %rbx movq %rsi, %rdi callq 0x35210 cmpq $0xff, %rax ja 0xa97f5 cmpq $0x0, 0x90(%rbx) je 0xa97b0 movq 0x80(%rbx), %rax movq %rax, 0x28(%rsp) movq 0x88(%rbx), %rax movq %rax, 0x20(%rsp) leaq 0xb0(%rbx), %r15 leaq 0x38(%rsp), %rdi movl $0x88, %edx movq %r15, %rsi callq 0x354c0 leaq 0x138(%rbx), %rdx movq 0xa8(%rbx), %rax movq 0x138(%rbx), %rcx movq %rcx, 0x18(%rsp) movq %rax, 0x88(%rbx) xorl %eax, %eax movq %rax, 0x80(%rbx) movq %rax, 0x10(%rsp) xorps %xmm0, %xmm0 movups %xmm0, (%rsp) movq %rbx, %rdi movq %r15, 0x30(%rsp) movq %r15, %rsi xorl %ecx, %ecx xorl %r8d, %r8d xorl %r9d, %r9d callq 0xa8e94 movl %eax, %r12d xorl %eax, %eax testl %r12d, %r12d sete %al movq %rax, 0x90(%rbx) leaq 0xc0(%rsp), %r13 testl %r12d, %r12d jne 0xa97b8 xorps %xmm0, %xmm0 movups %xmm0, (%rsp) movq $0x0, 0x10(%rsp) movl $0x100, %r8d # imm = 0x100 movq %rbx, %rdi xorl %esi, %esi xorl %edx, %edx movq %r13, %rcx xorl %r9d, %r9d callq 0xa8e94 movb $0x1, %r15b testl %eax, %eax jne 0xa979e movq %r13, %rdi movq %r14, %rsi movl %ebp, %edx callq 0xa847c testl %eax, %eax je 0xa97a8 movq %rbx, %rdi callq 0xa95b5 movl %eax, %r12d testb %r15b, %r15b jne 0xa9751 jmp 0xa97f2 xorl %r12d, %r12d xorl %r15d, %r15d jmp 0xa97a1 movl $0xffffff9c, %r12d # imm = 0xFFFFFF9C jmp 0xa97f5 movq 0x28(%rsp), %rax movq %rax, 0x80(%rbx) movq 0x20(%rsp), %rax movq %rax, 0x88(%rbx) leaq 0x38(%rsp), %rsi movl $0x88, %edx movq 0x30(%rsp), %rdi callq 0x354c0 movq 0x18(%rsp), %rax movq %rax, 0x138(%rbx) jmp 0xa97f5 xorl %r12d, %r12d movl %r12d, %eax addq $0x1c8, %rsp # imm = 0x1C8 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/simonowen[P]samdisk/src/unzip.c
unzGetFilePos
extern int ZEXPORT unzGetFilePos64(unzFile file, unz64_file_pos* file_pos) { unz64_s* s; if (file == NULL || file_pos == NULL) return UNZ_PARAMERROR; s = (unz64_s*)file; if (!s->current_file_ok) return UNZ_END_OF_LIST_OF_FILE; file_pos->pos_in_zip_directory = s->pos_in_central_dir; file_pos->num_of_file = s->num_file; return UNZ_OK; }
testq %rdi, %rdi je 0xa986b xorl %eax, %eax cmpq $0x0, 0x90(%rdi) je 0xa9874 movq 0x80(%rdi), %rcx movq 0x88(%rdi), %rdx movb $0x1, %dil jmp 0xa987b movl $0xffffff9a, %eax # imm = 0xFFFFFF9A xorl %edi, %edi jmp 0xa987b movl $0xffffff9c, %eax # imm = 0xFFFFFF9C xorl %edi, %edi testb %dil, %dil je 0xa9887 movq %rdx, (%rsi) movq %rcx, 0x8(%rsi) retq
/simonowen[P]samdisk/src/unzip.c
unzGoToFilePos
extern int ZEXPORT unzGoToFilePos( unzFile file, unz_file_pos* file_pos) { unz64_file_pos file_pos64; if (file_pos == NULL) return UNZ_PARAMERROR; file_pos64.pos_in_zip_directory = file_pos->pos_in_zip_directory; file_pos64.num_of_file = file_pos->num_of_file; return unzGoToFilePos64(file, &file_pos64); }
testq %rsi, %rsi je 0xa9922 subq $0x18, %rsp movq (%rsi), %rcx leaq 0x8(%rsp), %rax movq %rcx, (%rax) movq 0x8(%rsi), %rcx movq %rcx, 0x8(%rax) movq %rax, %rsi callq 0xa9888 addq $0x18, %rsp retq movl $0xffffff9a, %eax # imm = 0xFFFFFF9A retq
/simonowen[P]samdisk/src/unzip.c
unzReadCurrentFile
extern int ZEXPORT unzReadCurrentFile(unzFile file, voidp buf, unsigned len) { int err = UNZ_OK; uInt iRead = 0; unz64_s* s; file_in_zip64_read_info_s* pfile_in_zip_read_info; if (file == NULL) return UNZ_PARAMERROR; s = (unz64_s*)file; pfile_in_zip_read_info = s->pfile_in_zip_read; if (pfile_in_zip_read_info == NULL) return UNZ_PARAMERROR; if (pfile_in_zip_read_info->read_buffer == NULL) return UNZ_END_OF_LIST_OF_FILE; if (len == 0) return 0; pfile_in_zip_read_info->stream.next_out = (Bytef*)buf; pfile_in_zip_read_info->stream.avail_out = (uInt)len; if ((len > pfile_in_zip_read_info->rest_read_uncompressed) && (!(pfile_in_zip_read_info->raw))) pfile_in_zip_read_info->stream.avail_out = (uInt)pfile_in_zip_read_info->rest_read_uncompressed; if ((len > pfile_in_zip_read_info->rest_read_compressed + pfile_in_zip_read_info->stream.avail_in) && (pfile_in_zip_read_info->raw)) pfile_in_zip_read_info->stream.avail_out = (uInt)pfile_in_zip_read_info->rest_read_compressed + pfile_in_zip_read_info->stream.avail_in; while (pfile_in_zip_read_info->stream.avail_out > 0) { if ((pfile_in_zip_read_info->stream.avail_in == 0) && (pfile_in_zip_read_info->rest_read_compressed > 0)) { uInt uReadThis = UNZ_BUFSIZE; if (pfile_in_zip_read_info->rest_read_compressed < uReadThis) uReadThis = (uInt)pfile_in_zip_read_info->rest_read_compressed; if (uReadThis == 0) return UNZ_EOF; if (ZSEEK64(pfile_in_zip_read_info->z_filefunc, pfile_in_zip_read_info->filestream, pfile_in_zip_read_info->pos_in_zipfile + pfile_in_zip_read_info->byte_before_the_zipfile, ZLIB_FILEFUNC_SEEK_SET) != 0) return UNZ_ERRNO; if (ZREAD64(pfile_in_zip_read_info->z_filefunc, pfile_in_zip_read_info->filestream, pfile_in_zip_read_info->read_buffer, uReadThis) != uReadThis) return UNZ_ERRNO; # ifndef NOUNCRYPT if (s->encrypted) { uInt i; for (i = 0; i < uReadThis; i++) pfile_in_zip_read_info->read_buffer[i] = zdecode(s->keys, s->pcrc_32_tab, pfile_in_zip_read_info->read_buffer[i]); } # endif pfile_in_zip_read_info->pos_in_zipfile += uReadThis; pfile_in_zip_read_info->rest_read_compressed -= uReadThis; pfile_in_zip_read_info->stream.next_in = (Bytef*)pfile_in_zip_read_info->read_buffer; pfile_in_zip_read_info->stream.avail_in = (uInt)uReadThis; } if ((pfile_in_zip_read_info->compression_method == 0) || (pfile_in_zip_read_info->raw)) { uInt uDoCopy, i; if ((pfile_in_zip_read_info->stream.avail_in == 0) && (pfile_in_zip_read_info->rest_read_compressed == 0)) return (iRead == 0) ? UNZ_EOF : iRead; if (pfile_in_zip_read_info->stream.avail_out < pfile_in_zip_read_info->stream.avail_in) uDoCopy = pfile_in_zip_read_info->stream.avail_out; else uDoCopy = pfile_in_zip_read_info->stream.avail_in; for (i = 0; i < uDoCopy; i++) *(pfile_in_zip_read_info->stream.next_out + i) = *(pfile_in_zip_read_info->stream.next_in + i); pfile_in_zip_read_info->total_out_64 = pfile_in_zip_read_info->total_out_64 + uDoCopy; pfile_in_zip_read_info->crc32 = crc32(pfile_in_zip_read_info->crc32, pfile_in_zip_read_info->stream.next_out, uDoCopy); pfile_in_zip_read_info->rest_read_uncompressed -= uDoCopy; pfile_in_zip_read_info->stream.avail_in -= uDoCopy; pfile_in_zip_read_info->stream.avail_out -= uDoCopy; pfile_in_zip_read_info->stream.next_out += uDoCopy; pfile_in_zip_read_info->stream.next_in += uDoCopy; pfile_in_zip_read_info->stream.total_out += uDoCopy; iRead += uDoCopy; } else if (pfile_in_zip_read_info->compression_method == Z_BZIP2ED) { #ifdef HAVE_BZIP2 uLong uTotalOutBefore, uTotalOutAfter; const Bytef* bufBefore; uLong uOutThis; pfile_in_zip_read_info->bstream.next_in = (char*)pfile_in_zip_read_info->stream.next_in; pfile_in_zip_read_info->bstream.avail_in = pfile_in_zip_read_info->stream.avail_in; pfile_in_zip_read_info->bstream.total_in_lo32 = pfile_in_zip_read_info->stream.total_in; pfile_in_zip_read_info->bstream.total_in_hi32 = 0; pfile_in_zip_read_info->bstream.next_out = (char*)pfile_in_zip_read_info->stream.next_out; pfile_in_zip_read_info->bstream.avail_out = pfile_in_zip_read_info->stream.avail_out; pfile_in_zip_read_info->bstream.total_out_lo32 = pfile_in_zip_read_info->stream.total_out; pfile_in_zip_read_info->bstream.total_out_hi32 = 0; uTotalOutBefore = pfile_in_zip_read_info->bstream.total_out_lo32; bufBefore = (const Bytef*)pfile_in_zip_read_info->bstream.next_out; err = BZ2_bzDecompress(&pfile_in_zip_read_info->bstream); uTotalOutAfter = pfile_in_zip_read_info->bstream.total_out_lo32; uOutThis = uTotalOutAfter - uTotalOutBefore; pfile_in_zip_read_info->total_out_64 = pfile_in_zip_read_info->total_out_64 + uOutThis; pfile_in_zip_read_info->crc32 = crc32(pfile_in_zip_read_info->crc32, bufBefore, (uInt)(uOutThis)); pfile_in_zip_read_info->rest_read_uncompressed -= uOutThis; iRead += (uInt)(uTotalOutAfter - uTotalOutBefore); pfile_in_zip_read_info->stream.next_in = (Bytef*)pfile_in_zip_read_info->bstream.next_in; pfile_in_zip_read_info->stream.avail_in = pfile_in_zip_read_info->bstream.avail_in; pfile_in_zip_read_info->stream.total_in = pfile_in_zip_read_info->bstream.total_in_lo32; pfile_in_zip_read_info->stream.next_out = (Bytef*)pfile_in_zip_read_info->bstream.next_out; pfile_in_zip_read_info->stream.avail_out = pfile_in_zip_read_info->bstream.avail_out; pfile_in_zip_read_info->stream.total_out = pfile_in_zip_read_info->bstream.total_out_lo32; if (err == BZ_STREAM_END) return (iRead == 0) ? UNZ_EOF : iRead; if (err != BZ_OK) break; #endif } // end Z_BZIP2ED else { ZPOS64_T uTotalOutBefore, uTotalOutAfter; const Bytef* bufBefore; ZPOS64_T uOutThis; int flush = Z_SYNC_FLUSH; uTotalOutBefore = pfile_in_zip_read_info->stream.total_out; bufBefore = pfile_in_zip_read_info->stream.next_out; /* if ((pfile_in_zip_read_info->rest_read_uncompressed == pfile_in_zip_read_info->stream.avail_out) && (pfile_in_zip_read_info->rest_read_compressed == 0)) flush = Z_FINISH; */ err = inflate(&pfile_in_zip_read_info->stream, flush); if ((err >= 0) && (pfile_in_zip_read_info->stream.msg != NULL)) err = Z_DATA_ERROR; uTotalOutAfter = pfile_in_zip_read_info->stream.total_out; uOutThis = uTotalOutAfter - uTotalOutBefore; pfile_in_zip_read_info->total_out_64 = pfile_in_zip_read_info->total_out_64 + uOutThis; pfile_in_zip_read_info->crc32 = crc32(pfile_in_zip_read_info->crc32, bufBefore, (uInt)(uOutThis)); pfile_in_zip_read_info->rest_read_uncompressed -= uOutThis; iRead += (uInt)(uTotalOutAfter - uTotalOutBefore); if (err == Z_STREAM_END) return (iRead == 0) ? UNZ_EOF : iRead; if (err != Z_OK) break; } } if (err == Z_OK) return iRead; return err; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x18, %rsp movl $0xffffff9a, %ebp # imm = 0xFFFFFF9A testq %rdi, %rdi je 0xaa0ee movq 0x140(%rdi), %r14 testq %r14, %r14 je 0xaa0ee cmpq $0x0, (%r14) je 0xaa0d5 testl %edx, %edx je 0xaa0dc movq %rsi, 0x20(%r14) movl %edx, 0x28(%r14) movl %edx, %eax movq 0xc0(%r14), %rcx cmpq %rax, %rcx jae 0xa9e9a cmpl $0x0, 0x138(%r14) jne 0xa9e9a movl %ecx, 0x28(%r14) movq 0xb8(%r14), %rcx movl 0x10(%r14), %edx leaq (%rcx,%rdx), %rsi cmpq %rax, %rsi jae 0xa9ebe cmpl $0x0, 0x138(%r14) je 0xa9ebe addl %edx, %ecx movl %ecx, 0x28(%r14) cmpl $0x0, 0x28(%r14) je 0xaa0e0 leaq 0x8(%r14), %rax movq %rax, 0x8(%rsp) leaq 0xc8(%r14), %rax movq %rax, 0x10(%rsp) xorl %r13d, %r13d xorl %ebx, %ebx cmpl $0x0, 0x10(%r14) jne 0xa9f8a movq 0xb8(%r14), %r12 testq %r12, %r12 je 0xa9f8a movq %r13, (%rsp) movl $0x4000, %eax # imm = 0x4000 cmpq %rax, %r12 cmovaeq %rax, %r12 movq 0x120(%r14), %rsi movq 0x130(%r14), %rdx addq 0x78(%r14), %rdx xorl %r13d, %r13d movq 0x10(%rsp), %rdi xorl %ecx, %ecx callq 0xa820e movl $0xffffffff, %ebp # imm = 0xFFFFFFFF testq %rax, %rax jne 0xa9f7a movq (%r14), %rdx movq 0x100(%r14), %rdi movq 0x120(%r14), %rsi movq %r12, %rcx callq *0xd0(%r14) cmpq %r12, %rax jne 0xa9f77 addq %r12, 0x78(%r14) subq %r12, 0xb8(%r14) movq (%r14), %rax movq %rax, 0x8(%r14) movl %r12d, 0x10(%r14) movb $0x1, %r13b movl %r15d, %ebp jmp 0xa9f7a xorl %r13d, %r13d movl %ebp, %r15d testb %r13b, %r13b movq (%rsp), %r13 je 0xaa0ee movq 0x128(%r14), %rax testq %rax, %rax je 0xa9fa4 cmpl $0x0, 0x138(%r14) je 0xaa03c movl 0x10(%r14), %ebp testl %ebp, %ebp jne 0xa9fba cmpq $0x0, 0xb8(%r14) je 0xaa0cb movl 0x28(%r14), %eax cmpl %ebp, %eax cmovbl %eax, %ebp movl %ebp, %r12d testl %ebp, %ebp je 0xa9fe2 xorl %eax, %eax movq 0x8(%r14), %rcx movq 0x20(%r14), %rdx movb (%rcx,%rax), %cl movb %cl, (%rdx,%rax) incq %rax cmpq %rax, %r12 jne 0xa9fcc addq %r12, 0xa0(%r14) movq 0x20(%r14), %rsi movq 0xa8(%r14), %rdi movl %ebp, %edx callq 0x35410 movq %rax, 0xa8(%r14) subq %r12, 0xc0(%r14) subl %ebp, 0x10(%r14) subl %ebp, 0x28(%r14) addq %r12, 0x20(%r14) addq %r12, 0x8(%r14) addq %r12, 0x30(%r14) addl %ebp, %ebx movb $0x1, %al movl %r15d, %ebp testb %al, %al je 0xaa0ee cmpl $0x0, 0x28(%r14) jne 0xa9ee3 jmp 0xaa0e5 cmpq $0xc, %rax je 0xaa02c movq 0x20(%r14), %rax movq %rax, (%rsp) movq 0x30(%r14), %rbp movq 0x8(%rsp), %rdi movl $0x2, %esi callq 0x354a0 movl %eax, %r12d testl %eax, %eax js 0xaa072 cmpq $0x0, 0x38(%r14) movl $0xfffffffd, %ecx # imm = 0xFFFFFFFD cmovnel %ecx, %r12d movq 0x30(%r14), %r13 subq %rbp, %r13 movq 0xa8(%r14), %rdi addq %r13, 0xa0(%r14) movq (%rsp), %rsi movl %r13d, %edx callq 0x35410 movq %rax, 0xa8(%r14) subq %r13, 0xc0(%r14) addl %r13d, %ebx testl %r12d, %r12d movq %r12, %r13 movl %r13d, %eax je 0xaa0bc movl %ebx, %ebp cmpl $0x1, %r13d je 0xaa0bf movl $0x3, %eax movl %r15d, %ebp testl %eax, %eax jne 0xaa0ff movl %ebp, %r15d jmp 0xaa02c xorl %eax, %eax movl %ebx, %r15d jmp 0xaa021 movl $0xffffff9c, %ebp # imm = 0xFFFFFF9C jmp 0xaa0ee xorl %ebp, %ebp jmp 0xaa0ee xorl %ebx, %ebx xorl %r13d, %r13d testl %r13d, %r13d cmovnel %r13d, %ebx movl %ebx, %ebp movl %ebp, %eax addq $0x18, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq cmpl $0x3, %eax je 0xaa0e5 jmp 0xaa0ee
/simonowen[P]samdisk/src/unzip.c
unztell
extern z_off_t ZEXPORT unztell(unzFile file) { unz64_s* s; file_in_zip64_read_info_s* pfile_in_zip_read_info; if (file == NULL) return UNZ_PARAMERROR; s = (unz64_s*)file; pfile_in_zip_read_info = s->pfile_in_zip_read; if (pfile_in_zip_read_info == NULL) return UNZ_PARAMERROR; return (z_off_t)pfile_in_zip_read_info->stream.total_out; }
movq $-0x66, %rax testq %rdi, %rdi je 0xaa122 movq 0x140(%rdi), %rcx testq %rcx, %rcx je 0xaa122 movq 0x30(%rcx), %rax retq
/simonowen[P]samdisk/src/unzip.c
unzeof
extern int ZEXPORT unzeof(unzFile file) { unz64_s* s; file_in_zip64_read_info_s* pfile_in_zip_read_info; if (file == NULL) return UNZ_PARAMERROR; s = (unz64_s*)file; pfile_in_zip_read_info = s->pfile_in_zip_read; if (pfile_in_zip_read_info == NULL) return UNZ_PARAMERROR; if (pfile_in_zip_read_info->rest_read_uncompressed == 0) return 1; else return 0; }
movl $0xffffff9a, %eax # imm = 0xFFFFFF9A testq %rdi, %rdi je 0xaa166 movq 0x140(%rdi), %rcx testq %rcx, %rcx je 0xaa166 xorl %eax, %eax cmpq $0x0, 0xc0(%rcx) sete %al retq
/simonowen[P]samdisk/src/unzip.c
unzGetLocalExtrafield
extern int ZEXPORT unzGetLocalExtrafield(unzFile file, voidp buf, unsigned len) { unz64_s* s; file_in_zip64_read_info_s* pfile_in_zip_read_info; uInt read_now; ZPOS64_T size_to_read; if (file == NULL) return UNZ_PARAMERROR; s = (unz64_s*)file; pfile_in_zip_read_info = s->pfile_in_zip_read; if (pfile_in_zip_read_info == NULL) return UNZ_PARAMERROR; size_to_read = (pfile_in_zip_read_info->size_local_extrafield - pfile_in_zip_read_info->pos_local_extrafield); if (buf == NULL) return (int)size_to_read; if (len > size_to_read) read_now = (uInt)size_to_read; else read_now = (uInt)len; if (read_now == 0) return 0; if (ZSEEK64(pfile_in_zip_read_info->z_filefunc, pfile_in_zip_read_info->filestream, pfile_in_zip_read_info->offset_local_extrafield + pfile_in_zip_read_info->pos_local_extrafield, ZLIB_FILEFUNC_SEEK_SET) != 0) return UNZ_ERRNO; if (ZREAD64(pfile_in_zip_read_info->z_filefunc, pfile_in_zip_read_info->filestream, buf, read_now) != read_now) return UNZ_ERRNO; return (int)read_now; }
movl $0xffffff9a, %eax # imm = 0xFFFFFF9A testq %rdi, %rdi je 0xaa226 pushq %r15 pushq %r14 pushq %r12 pushq %rbx pushq %rax movq 0x140(%rdi), %r12 testq %r12, %r12 je 0xaa21b movq %rsi, %rbx movl 0x90(%r12), %r15d movq 0x98(%r12), %rax subq %rax, %r15 testq %rsi, %rsi je 0xaa214 movl %edx, %ecx cmpq %rcx, %r15 cmovael %edx, %r15d testl %r15d, %r15d je 0xaa219 leaq 0xc8(%r12), %rdi movq 0x120(%r12), %rsi addq 0x88(%r12), %rax movq %rax, %rdx xorl %ecx, %ecx callq 0xa820e movq %rax, %rcx movl $0xffffffff, %eax # imm = 0xFFFFFFFF testq %rcx, %rcx jne 0xaa21b movq 0x100(%r12), %rdi movq 0x120(%r12), %rsi movl %r15d, %r14d movq %rbx, %rdx movq %r14, %rcx callq *0xd0(%r12) cmpq %r14, %rax movl $0xffffffff, %eax # imm = 0xFFFFFFFF cmovel %r15d, %eax jmp 0xaa21b movl %r15d, %eax jmp 0xaa21b xorl %eax, %eax addq $0x8, %rsp popq %rbx popq %r12 popq %r14 popq %r15 retq
/simonowen[P]samdisk/src/unzip.c
unzGetOffset64
extern ZPOS64_T ZEXPORT unzGetOffset64(unzFile file) { unz64_s* s; if (file == NULL) return 0; //UNZ_PARAMERROR; s = (unz64_s*)file; if (!s->current_file_ok) return 0; if (s->gi.number_entry != 0 && s->gi.number_entry != 0xffff) if (s->num_file == s->gi.number_entry) return 0; return s->pos_in_central_dir; }
testq %rdi, %rdi je 0xaa2db cmpq $0x0, 0x90(%rdi) je 0xaa2db movq 0x68(%rdi), %rax testq %rax, %rax je 0xaa2de cmpq $0xffff, %rax # imm = 0xFFFF je 0xaa2de cmpq %rax, 0x80(%rdi) jne 0xaa2de xorl %eax, %eax retq movq 0x88(%rdi), %rax retq
/simonowen[P]samdisk/src/unzip.c
unzSetOffset64
extern int ZEXPORT unzSetOffset64(unzFile file, ZPOS64_T pos) { unz64_s* s; int err; if (file == NULL) return UNZ_PARAMERROR; s = (unz64_s*)file; s->pos_in_central_dir = pos; s->num_file = s->gi.number_entry; /* hack */ err = unz64local_GetCurrentFileInfoInternal(file, &s->cur_file_info, &s->cur_file_info_internal, NULL, 0, NULL, 0, NULL, 0); s->current_file_ok = (err == UNZ_OK); return err; }
testq %rdi, %rdi je 0xaa378 pushq %rbx subq $0x20, %rsp movq %rdi, %rbx movq %rsi, 0x88(%rdi) movq 0x68(%rdi), %rax movq %rax, 0x80(%rdi) leaq 0xb0(%rdi), %rsi leaq 0x138(%rdi), %rdx xorps %xmm0, %xmm0 movups %xmm0, (%rsp) movq $0x0, 0x10(%rsp) xorl %ecx, %ecx xorl %r8d, %r8d xorl %r9d, %r9d callq 0xa8e94 xorl %ecx, %ecx testl %eax, %eax sete %cl movq %rcx, 0x90(%rbx) addq $0x20, %rsp popq %rbx retq movl $0xffffff9a, %eax # imm = 0xFFFFFF9A retq
/simonowen[P]samdisk/src/unzip.c
unz64local_getLong
local int unz64local_getLong(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, uLong* pX) { uLong x; int i = 0; int err; err = unz64local_getByte(pzlib_filefunc_def, filestream, &i); x = (uLong)i; if (err == UNZ_OK) err = unz64local_getByte(pzlib_filefunc_def, filestream, &i); x |= ((uLong)i) << 8; if (err == UNZ_OK) err = unz64local_getByte(pzlib_filefunc_def, filestream, &i); x |= ((uLong)i) << 16; if (err == UNZ_OK) err = unz64local_getByte(pzlib_filefunc_def, filestream, &i); x += ((uLong)i) << 24; if (err == UNZ_OK) *pX = x; else *pX = 0; return err; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movq %rdx, %rbx movq %rsi, %r14 movq %rdi, %r15 leaq 0x4(%rsp), %r12 movl $0x0, (%r12) movq %r12, %rdx callq 0xaa614 movslq (%r12), %r12 testl %eax, %eax jne 0xaa3c4 leaq 0x4(%rsp), %rdx movq %r15, %rdi movq %r14, %rsi callq 0xaa614 movslq 0x4(%rsp), %r13 testl %eax, %eax jne 0xaa3dd leaq 0x4(%rsp), %rdx movq %r15, %rdi movq %r14, %rsi callq 0xaa614 movslq 0x4(%rsp), %rbp testl %eax, %eax jne 0xaa3f6 leaq 0x4(%rsp), %rdx movq %r15, %rdi movq %r14, %rsi callq 0xaa614 shlq $0x8, %r13 orq %r12, %r13 shlq $0x10, %rbp orq %r13, %rbp movslq 0x4(%rsp), %rcx shlq $0x18, %rcx addq %rbp, %rcx xorl %edx, %edx testl %eax, %eax cmoveq %rcx, %rdx movq %rdx, (%rbx) addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/simonowen[P]samdisk/src/unzip.c
unz64local_getLong64
local int unz64local_getLong64(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, ZPOS64_T* pX) { ZPOS64_T x; int i = 0; int err; err = unz64local_getByte(pzlib_filefunc_def, filestream, &i); x = (ZPOS64_T)i; if (err == UNZ_OK) err = unz64local_getByte(pzlib_filefunc_def, filestream, &i); x |= ((ZPOS64_T)i) << 8; if (err == UNZ_OK) err = unz64local_getByte(pzlib_filefunc_def, filestream, &i); x |= ((ZPOS64_T)i) << 16; if (err == UNZ_OK) err = unz64local_getByte(pzlib_filefunc_def, filestream, &i); x |= ((ZPOS64_T)i) << 24; if (err == UNZ_OK) err = unz64local_getByte(pzlib_filefunc_def, filestream, &i); x |= ((ZPOS64_T)i) << 32; if (err == UNZ_OK) err = unz64local_getByte(pzlib_filefunc_def, filestream, &i); x |= ((ZPOS64_T)i) << 40; if (err == UNZ_OK) err = unz64local_getByte(pzlib_filefunc_def, filestream, &i); x |= ((ZPOS64_T)i) << 48; if (err == UNZ_OK) err = unz64local_getByte(pzlib_filefunc_def, filestream, &i); x |= ((ZPOS64_T)i) << 56; if (err == UNZ_OK) *pX = x; else *pX = 0; return err; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x28, %rsp movq %rdx, 0x20(%rsp) movq %rsi, %r14 movq %rdi, %r15 leaq 0x4(%rsp), %r12 movl $0x0, (%r12) movq %r12, %rdx callq 0xaa614 movslq (%r12), %rcx movq %rcx, 0x18(%rsp) testl %eax, %eax je 0xaa469 xorl %eax, %eax jmp 0xaa47e leaq 0x4(%rsp), %rdx movq %r15, %rdi movq %r14, %rsi callq 0xaa614 testl %eax, %eax sete %al movslq 0x4(%rsp), %r13 testb %al, %al je 0xaa49e leaq 0x4(%rsp), %rdx movq %r15, %rdi movq %r14, %rsi callq 0xaa614 testl %eax, %eax sete %al jmp 0xaa4a0 xorl %eax, %eax movslq 0x4(%rsp), %rcx movq %rcx, 0x10(%rsp) testb %al, %al je 0xaa4c5 leaq 0x4(%rsp), %rdx movq %r15, %rdi movq %r14, %rsi callq 0xaa614 testl %eax, %eax sete %al jmp 0xaa4c7 xorl %eax, %eax movslq 0x4(%rsp), %rbx testb %al, %al je 0xaa4e7 leaq 0x4(%rsp), %rdx movq %r15, %rdi movq %r14, %rsi callq 0xaa614 testl %eax, %eax sete %al jmp 0xaa4e9 xorl %eax, %eax movslq 0x4(%rsp), %r12 testb %al, %al je 0xaa509 leaq 0x4(%rsp), %rdx movq %r15, %rdi movq %r14, %rsi callq 0xaa614 testl %eax, %eax sete %al jmp 0xaa50b xorl %eax, %eax movl 0x4(%rsp), %ebp testb %al, %al movq %r14, 0x8(%rsp) je 0xaa52f leaq 0x4(%rsp), %rdx movq %r15, %rdi movq %r14, %rsi callq 0xaa614 testl %eax, %eax sete %cl jmp 0xaa531 xorl %ecx, %ecx movl 0x4(%rsp), %r14d movl $0xffffffff, %eax # imm = 0xFFFFFFFF testb %cl, %cl je 0xaa551 leaq 0x4(%rsp), %rdx movq %r15, %rdi movq 0x8(%rsp), %rsi callq 0xaa614 shlq $0x8, %r13 orq 0x18(%rsp), %r13 movq 0x10(%rsp), %rcx shlq $0x10, %rcx shlq $0x18, %rbx orq %rcx, %rbx orq %r13, %rbx shlq $0x20, %r12 shlq $0x28, %rbp orq %r12, %rbp shlq $0x30, %r14 orq %rbp, %r14 orq %rbx, %r14 movl 0x4(%rsp), %ecx shlq $0x38, %rcx orq %r14, %rcx xorl %edx, %edx testl %eax, %eax cmoveq %rcx, %rdx movq 0x20(%rsp), %rcx movq %rdx, (%rcx) addq $0x28, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/simonowen[P]samdisk/src/unzip.c
unz64local_getShort
local int unz64local_getShort(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, uLong* pX) { uLong x; int i = 0; int err; err = unz64local_getByte(pzlib_filefunc_def, filestream, &i); x = (uLong)i; if (err == UNZ_OK) err = unz64local_getByte(pzlib_filefunc_def, filestream, &i); x |= ((uLong)i) << 8; if (err == UNZ_OK) *pX = x; else *pX = 0; return err; }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx pushq %rax movq %rdx, %rbx movq %rsi, %r14 movq %rdi, %r15 leaq 0x4(%rsp), %r12 movl $0x0, (%r12) movq %r12, %rdx callq 0xaa614 movl %eax, %ecx movslq (%r12), %r12 movl $0xffffffff, %eax # imm = 0xFFFFFFFF testl %ecx, %ecx jne 0xaa5f1 leaq 0x4(%rsp), %rdx movq %r15, %rdi movq %r14, %rsi callq 0xaa614 movslq 0x4(%rsp), %rcx shlq $0x8, %rcx orq %r12, %rcx xorl %edx, %edx testl %eax, %eax cmoveq %rcx, %rdx movq %rdx, (%rbx) addq $0x8, %rsp popq %rbx popq %r12 popq %r14 popq %r15 retq
/simonowen[P]samdisk/src/unzip.c
test_bitstream_r_3
static void test_bitstream_r_3(void) { uint64_t result; START_TEST(); bitstream_r_init(&_stream_r, buffer, 3); /* try to read 24 bits */ CHECK_TRUE(bitstream_r_read(&_stream_r, &result, 25), "should fail reading 57 bits"); END_TEST(); }
pushq %rbp movq %rsp, %rbp subq $0x10, %rsp leaq 0x1bd4(%rip), %rdi # 0x30f3 callq 0x1f30 leaq 0x3b85(%rip), %rdi # 0x50b0 leaq 0x3b5e(%rip), %rsi # 0x5090 movl $0x3, %edx callq 0x1070 leaq 0x3b6d(%rip), %rdi # 0x50b0 leaq -0x8(%rbp), %rsi movl $0x19, %edx callq 0x1050 cmpl $0x0, %eax setne %al movzbl %al, %edi andl $0x1, %edi leaq 0x1b8f(%rip), %rsi # 0x30f3 leaq 0x1b6c(%rip), %rcx # 0x30d7 xorl %eax, %eax movl $0x7c, %edx callq 0x1fe0 leaq 0x1b75(%rip), %rdi # 0x30f3 callq 0x1f80 addq $0x10, %rsp popq %rbp retq nopl (%rax)
/OLSR[P]OONF/src/tests/common/test_common_bitstream.c
cunit_named_check
void cunit_named_check(bool cond, const char *name, int line, const char *format, ...) { va_list ap; if (cond) { success++; return; } fail++; va_start(ap, format); printf("\t%s (%d) fail: ", name, line); vprintf(format, ap); puts("\n"); va_end(ap); }
pushq %rbp movq %rsp, %rbp subq $0xf0, %rsp testb %al, %al je 0x201b movaps %xmm0, -0xc0(%rbp) movaps %xmm1, -0xb0(%rbp) movaps %xmm2, -0xa0(%rbp) movaps %xmm3, -0x90(%rbp) movaps %xmm4, -0x80(%rbp) movaps %xmm5, -0x70(%rbp) movaps %xmm6, -0x60(%rbp) movaps %xmm7, -0x50(%rbp) movq %r9, -0xc8(%rbp) movq %r8, -0xd0(%rbp) movb %dil, %al andb $0x1, %al movb %al, -0x1(%rbp) movq %rsi, -0x10(%rbp) movl %edx, -0x14(%rbp) movq %rcx, -0x20(%rbp) testb $0x1, -0x1(%rbp) je 0x2053 movl 0x30a8(%rip), %eax # 0x50f0 addl $0x1, %eax movl %eax, 0x309f(%rip) # 0x50f0 jmp 0x20b8 movl 0x309b(%rip), %eax # 0x50f4 addl $0x1, %eax movl %eax, 0x3092(%rip) # 0x50f4 leaq -0x40(%rbp), %rax leaq -0xf0(%rbp), %rcx movq %rcx, 0x10(%rax) leaq 0x10(%rbp), %rcx movq %rcx, 0x8(%rax) movl $0x30, 0x4(%rax) movl $0x20, (%rax) movq -0x10(%rbp), %rsi movl -0x14(%rbp), %edx leaq 0x13e4(%rip), %rdi # 0x3478 movb $0x0, %al callq 0x1040 movq -0x20(%rbp), %rdi leaq -0x40(%rbp), %rsi callq 0x10a0 leaq 0x1374(%rip), %rdi # 0x3423 callq 0x1030 leaq -0x40(%rbp), %rax addq $0xf0, %rsp popq %rbp retq
/OLSR[P]OONF/src/tests/cunit/cunit.c
secp256k1_ge_set_gej_var
static void secp256k1_ge_set_gej_var(secp256k1_ge *r, secp256k1_gej *a) { secp256k1_fe z2, z3; r->infinity = a->infinity; if (a->infinity) { return; } secp256k1_fe_inv_var(&a->z, &a->z); secp256k1_fe_sqr(&z2, &a->z); secp256k1_fe_mul(&z3, &a->z, &z2); secp256k1_fe_mul(&a->x, &a->x, &z2); secp256k1_fe_mul(&a->y, &a->y, &z3); secp256k1_fe_set_int(&a->z, 1); r->x = a->x; r->y = a->y; }
movl 0x78(%rsi), %eax movl %eax, 0x50(%rdi) testl %eax, %eax je 0xd07c retq pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x50, %rsp movq %rsi, %r14 movq %rdi, %rbx leaq 0x50(%rsi), %r15 movq %r15, %rdi movq %r15, %rsi callq 0x183d4 leaq 0x28(%rsp), %r12 movq %r12, %rdi movq %r15, %rsi callq 0x18060 movq %rsp, %r13 movq %r13, %rdi movq %r15, %rsi movq %r12, %rdx callq 0x17a5f movq %r14, %rdi movq %r14, %rsi movq %r12, %rdx callq 0x17a5f leaq 0x28(%r14), %rdi movq %rdi, %rsi movq %r13, %rdx callq 0x17a5f movq $0x1, 0x50(%r14) xorps %xmm0, %xmm0 movups %xmm0, 0x68(%r14) movups %xmm0, 0x58(%r14) movq 0x20(%r14), %rax movq %rax, 0x20(%rbx) movups (%r14), %xmm0 movups 0x10(%r14), %xmm1 movups %xmm1, 0x10(%rbx) movups %xmm0, (%rbx) movups 0x28(%r14), %xmm0 movups %xmm0, 0x28(%rbx) movups 0x38(%r14), %xmm0 movups %xmm0, 0x38(%rbx) movq 0x48(%r14), %rax movq %rax, 0x48(%rbx) addq $0x50, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 retq
/tangramproject[P]secp256k1-zkp/src/group_impl.h
secp256k1_aggsig_export_secnonce_single
int secp256k1_aggsig_export_secnonce_single(const secp256k1_context* ctx, unsigned char* secnonce32, const unsigned char* seed) { secp256k1_scalar secnonce; secp256k1_gej pubnonce; secp256k1_rfc6979_hmac_sha256 rng; VERIFY_CHECK(ctx != NULL); ARG_CHECK(secp256k1_ecmult_gen_context_is_built(&ctx->ecmult_gen_ctx)); ARG_CHECK(secnonce32 != NULL); secp256k1_rfc6979_hmac_sha256_initialize(&rng, seed, 32); if (secp256k1_aggsig_generate_nonce_single(ctx, &secnonce, &pubnonce, &rng) == 0){ return 0; } secp256k1_scalar_get_b32(secnonce32, &secnonce); return 1; }
pushq %r15 pushq %r14 pushq %rbx subq $0xf0, %rsp movq %rdi, %r14 cmpq $0x0, 0x8(%rdi) je 0x1301d movq %rdx, %rax movq %rsi, %rbx leaq 0x2c(%rsp), %r15 movl $0x20, %edx movq %r15, %rdi movq %rax, %rsi callq 0xf20d leaq 0x8(%rsp), %rsi leaq 0x70(%rsp), %rdx movq %r14, %rdi movq %r15, %rcx callq 0x3100 testl %eax, %eax je 0x13025 leaq 0x8(%rsp), %rsi movq %rbx, %rdi callq 0x49df movl $0x1, %eax jmp 0x13027 movq %r14, %rdi callq 0x38cf xorl %eax, %eax addq $0xf0, %rsp popq %rbx popq %r14 popq %r15 retq
/tangramproject[P]secp256k1-zkp/src/modules/aggsig/main_impl.h
lest::run(std::vector<lest::test, std::allocator<lest::test>>, int, char**, std::ostream&)
inline int run( tests specification, int argc, char * argv[], std::ostream & os = std::cout ) { return run( specification, texts( argv + 1, argv + argc ), os ); }
pushq %rbp pushq %r14 pushq %rbx subq $0x60, %rsp movq %rcx, %rbx movq %rdx, %r14 movl %esi, %ebp movq %rdi, %rsi leaq 0x28(%rsp), %rdi callq 0xe948 movslq %ebp, %rax leaq (%r14,%rax,8), %rdx addq $0x8, %r14 leaq 0x10(%rsp), %rdi leaq 0xf(%rsp), %rcx movq %r14, %rsi callq 0xf16a movaps 0x10(%rsp), %xmm0 leaq 0x40(%rsp), %rsi movaps %xmm0, (%rsi) movq 0x20(%rsp), %rax movq %rax, 0x10(%rsi) xorps %xmm0, %xmm0 movaps %xmm0, 0x10(%rsp) andq $0x0, 0x20(%rsp) leaq 0x28(%rsp), %rdi movq %rbx, %rdx callq 0xec93 movl %eax, %ebx leaq 0x40(%rsp), %rdi callq 0xf19c leaq 0x10(%rsp), %rdi callq 0xf19c leaq 0x28(%rsp), %rdi callq 0xe7ca movl %ebx, %eax addq $0x60, %rsp popq %rbx popq %r14 popq %rbp retq movq %rax, %rbx leaq 0x40(%rsp), %rdi callq 0xf19c leaq 0x10(%rsp), %rdi callq 0xf19c jmp 0xe936 movq %rax, %rbx leaq 0x28(%rsp), %rdi callq 0xe7ca movq %rbx, %rdi callq 0x44a0
/martinmoene[P]expected-lite/test/lest/lest.hpp
lest::split_option(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
inline auto split_option( text arg ) -> std::tuple<text, text> { auto pos = arg.rfind( '=' ); return pos == text::npos ? std::make_tuple( arg, "" ) : std::make_tuple( arg.substr( 0, pos ), arg.substr( pos + 1 ) ); }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0xe8, %rsp movq %rsi, %r15 movq %rdi, %rbx pushq $0x3d popq %rsi pushq $-0x1 popq %rdx movq %r15, %rdi callq 0x44f0 movq %rax, %r14 cmpq $-0x1, %rax je 0x106d1 leaq 0x28(%rsp), %rdi movq %r15, %rsi xorl %edx, %edx movq %r14, %rcx callq 0x42b0 leaq 0x1(%r14), %rdx movq %rsp, %rdi pushq $-0x1 popq %rcx movq %r15, %rsi callq 0x42b0 leaq 0x68(%rsp), %r15 leaq 0x28(%rsp), %rsi movq %rsp, %rdx movq %r15, %rdi callq 0x10c89 jmp 0x10705 leaq 0xb4baf(%rip), %rdx # 0xc5287 movq %rsp, %r12 movq %r12, %rdi movq %r15, %rsi callq 0x10c50 leaq 0x28(%rsp), %rdi movq %r12, %rsi callq 0x10cd2 leaq 0x68(%rsp), %r15 leaq 0x28(%rsp), %rsi movq %r15, %rdi callq 0x10d0c leaq 0xa8(%rsp), %r12 movq %r12, %rdi movq %r15, %rsi callq 0x10d0c movq %rbx, %rdi movq %r12, %rsi callq 0x10d0c movq %r12, %rdi callq 0x107b0 leaq 0x68(%rsp), %rdi cmpq $-0x1, %r14 je 0x1074a callq 0x107b0 movq %rsp, %rdi callq 0x4140 leaq 0x28(%rsp), %rdi jmp 0x1075e callq 0x107b0 leaq 0x28(%rsp), %rdi callq 0x107b0 leaq 0x8(%rsp), %rdi callq 0x4140 movq %rbx, %rax addq $0xe8, %rsp popq %rbx popq %r12 popq %r14 popq %r15 retq movq %rax, %rbx leaq 0x8(%rsp), %rdi jmp 0x10787 movq %rax, %rbx leaq 0x28(%rsp), %rdi callq 0x4140 jmp 0x10791 movq %rax, %rbx movq %rbx, %rdi callq 0x44a0 nop
/martinmoene[P]expected-lite/test/lest/lest.hpp
lest::repeat(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 int repeat( text opt, text arg ) { const int num = lest::stoi( arg ); if ( indefinite( num ) || num >= 0 ) return num; throw std::runtime_error( "expecting '-1' or positive number with option '" + opt + "', got '" + arg + "' (try option --help)" ); }
pushq %rbp pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0xb0, %rsp movq %rsi, %r14 movq %rdi, %r15 leaq 0x90(%rsp), %r12 movq %r12, %rdi callq 0x4390 movq %r12, %rdi callq 0x10db9 movl %eax, %ebx movq %r12, %rdi callq 0x4140 cmpl $-0x1, %ebx jl 0x109db movl %ebx, %eax addq $0xb0, %rsp popq %rbx popq %r12 popq %r14 popq %r15 popq %rbp retq pushq $0x10 popq %rdi callq 0x4160 movq %rax, %rbx leaq 0xb4a5d(%rip), %rsi # 0xc544a leaq 0x10(%rsp), %rdi movq %r15, %rdx callq 0x10af4 leaq 0xb4a40(%rip), %rdx # 0xc5441 leaq 0x30(%rsp), %rdi leaq 0x10(%rsp), %rsi callq 0x10ad5 leaq 0x50(%rsp), %rdi leaq 0x30(%rsp), %rsi movq %r14, %rdx callq 0x10dc6 leaq 0xb49d0(%rip), %rdx # 0xc53f9 leaq 0x70(%rsp), %rdi leaq 0x50(%rsp), %rsi callq 0x10ad5 movq %rsp, %rdi leaq 0x70(%rsp), %rsi callq 0x4440 movq %rsp, %rsi movq %rbx, %rdi callq 0x41a0 movq 0xd6591(%rip), %rsi # 0xe6fe8 movq 0xd6542(%rip), %rdx # 0xe6fa0 movq %rbx, %rdi callq 0x4480 movq %rax, %r14 movq %rsp, %rdi callq 0x4508 xorl %ebp, %ebp jmp 0x10a7b movq %rax, %r14 movb $0x1, %bpl leaq 0x70(%rsp), %rdi callq 0x4140 jmp 0x10a8d movq %rax, %r14 movb $0x1, %bpl leaq 0x50(%rsp), %rdi callq 0x4140 jmp 0x10a9f movq %rax, %r14 movb $0x1, %bpl leaq 0x30(%rsp), %rdi callq 0x4140 jmp 0x10ab1 movq %rax, %r14 movb $0x1, %bpl leaq 0x10(%rsp), %rdi callq 0x4140 testb %bpl, %bpl jne 0x10ac5 jmp 0x10acd movq %rax, %r14 movq %rbx, %rdi callq 0x41e0 movq %r14, %rdi callq 0x44a0
/martinmoene[P]expected-lite/test/lest/lest.hpp
lest::match(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<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 match( texts whats, text line ) { for ( auto & what : whats ) { if ( search( what, line ) ) return true; } return false; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x48, %rsp movq %rsi, %rbx movq (%rdi), %rax movq 0x8(%rdi), %r13 leaq 0x28(%rsp), %r14 leaq 0x8(%rsp), %r15 movq %rax, %r12 cmpq %r13, %rax je 0x1237e movq %r14, %rdi movq %r12, %rsi callq 0x4390 movq %r15, %rdi movq %rbx, %rsi callq 0x4390 movq %r14, %rdi movq %r15, %rsi callq 0x122e8 movl %eax, %ebp movq %r15, %rdi callq 0x4140 movq %r14, %rdi callq 0x4140 leaq 0x20(%r12), %rax testb %bpl, %bpl je 0x12339 cmpq %r13, %r12 setne %al addq $0x48, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq %rax, %rbx leaq 0x8(%rsp), %rdi callq 0x4140 jmp 0x123a5 movq %rax, %rbx leaq 0x28(%rsp), %rdi callq 0x4140 movq %rbx, %rdi callq 0x44a0 nop
/martinmoene[P]expected-lite/test/lest/lest.hpp
lest::times::operator()(lest::test)
times & operator()( test testing ) { timer t; try { testing.behaviour( output( testing.name ) ); } catch( message const & ) { ++failures; } os << std::setw(3) << ( 1000 * t.elapsed_seconds() ) << " ms: " << testing.name << "\n"; return *this; }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x28, %rsp movq %rsi, %r14 movq %rdi, %rbx callq 0x4050 movq %rax, (%rsp) leaq 0x8(%rsp), %rdi movq %r14, %rsi callq 0x4390 leaq 0x8(%rbx), %rdi leaq 0x8(%rsp), %rsi callq 0x1300c leaq 0x20(%r14), %rdi movq %rax, %rsi callq 0x12ff8 leaq 0x8(%rsp), %rdi callq 0x4140 movq (%rbx), %r15 movq (%r15), %rax movq -0x18(%rax), %rax movq $0x3, 0x10(%r15,%rax) movq %rsp, %rdi callq 0x13036 mulsd 0xb2088(%rip), %xmm0 # 0xc5008 movq %r15, %rdi callq 0x4430 leaq 0xb2a90(%rip), %rsi # 0xc5a1f movq %rax, %rdi callq 0x4260 movq %rax, %rdi movq %r14, %rsi callq 0x4230 leaq 0xb22dd(%rip), %rsi # 0xc5286 movq %rax, %rdi callq 0x4260 movq %rbx, %rax addq $0x28, %rsp popq %rbx popq %r12 popq %r14 popq %r15 retq movq %rdx, %r12 movq %rax, %r15 jmp 0x12fd8 movq %rdx, %r12 movq %rax, %r15 leaq 0x8(%rsp), %rdi callq 0x4140 movq %r15, %rdi cmpl $0x1, %r12d jne 0x12ff3 callq 0x4120 incl 0x64(%rbx) callq 0x4460 jmp 0x12f5d callq 0x44a0
/martinmoene[P]expected-lite/test/lest/lest.hpp
lest::report(std::ostream&, lest::message const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
inline void report( std::ostream & os, message const & e, text test ) { os << e.where << ": " << colourise( e.kind ) << e.note << ": " << test << ": " << colourise( e.what() ) << std::endl; }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0xf8, %rsp movq %rdx, %r14 movq %rsi, %rbx movq %rdi, %r15 addq $0x30, %rsi leaq 0xd0(%rsp), %r12 movq %r12, %rdi callq 0x13696 movq %r15, %rdi movq %r12, %rsi callq 0x13672 leaq 0xb4e49(%rip), %rsi # 0xc8071 movq %rax, %rdi callq 0x4260 movq %rax, %r15 leaq 0x10(%rbx), %rsi leaq 0x50(%rsp), %rdi callq 0x4390 leaq 0xa0(%rsp), %rcx movq %rcx, -0x10(%rcx) leaq 0x60(%rsp), %rax movq -0x10(%rax), %rdx cmpq %rax, %rdx je 0x13272 movq %rdx, 0x90(%rsp) movq 0x60(%rsp), %rcx movq %rcx, 0xa0(%rsp) jmp 0x13278 movups (%rax), %xmm0 movups %xmm0, (%rcx) movq 0x58(%rsp), %rcx leaq 0x90(%rsp), %rsi movq %rcx, 0x8(%rsi) movq %rax, 0x50(%rsp) andq $0x0, 0x58(%rsp) movb $0x0, 0x60(%rsp) movq %r15, %rdi callq 0x4230 movq %rax, %r15 leaq 0x58(%rbx), %rsi leaq 0xb0(%rsp), %rdi callq 0x4390 leaq 0xb0(%rsp), %rsi movq %r15, %rdi callq 0x1350a leaq 0xb4da5(%rip), %rsi # 0xc8071 movq %rax, %rdi callq 0x4260 movq %rax, %rdi movq %r14, %rsi callq 0x4230 leaq 0xb4d8b(%rip), %rsi # 0xc8071 movq %rax, %rdi callq 0x4260 movq %rax, %r14 movq (%rbx), %rax movq %rbx, %rdi callq *0x10(%rax) leaq 0x10(%rsp), %rdi leaq 0xf(%rsp), %rdx movq %rax, %rsi callq 0x4110 leaq 0x40(%rsp), %rax leaq 0x20(%rsp), %rdx movq -0x10(%rdx), %rcx cmpq %rdx, %rcx je 0x13330 movq %rcx, 0x30(%rsp) movq 0x20(%rsp), %rsi movq %rsi, 0x40(%rsp) jmp 0x13339 movups (%rdx), %xmm0 movups %xmm0, (%rax) movq %rax, %rcx movq 0x18(%rsp), %rdi movq %rdx, 0x10(%rsp) andq $0x0, 0x18(%rsp) movb $0x0, 0x20(%rsp) leaq 0x80(%rsp), %rdx movq %rdx, -0x10(%rdx) cmpq %rax, %rcx je 0x13373 movq %rcx, 0x70(%rsp) movq 0x40(%rsp), %rcx movq %rcx, 0x80(%rsp) jmp 0x13379 movups (%rax), %xmm0 movups %xmm0, (%rdx) leaq 0x70(%rsp), %rsi movq %rdi, 0x8(%rsi) movq %rax, 0x30(%rsp) andq $0x0, 0x38(%rsp) movb $0x0, 0x40(%rsp) movq %r14, %rdi callq 0x4230 movq %rax, %rdi callq 0x4150 leaq 0x70(%rsp), %rdi callq 0x4140 leaq 0x30(%rsp), %rdi callq 0x4140 leaq 0x10(%rsp), %rdi callq 0x4140 leaq 0xb0(%rsp), %rdi callq 0x4140 leaq 0x90(%rsp), %rdi callq 0x4140 leaq 0x50(%rsp), %rdi callq 0x4140 leaq 0xd0(%rsp), %rdi callq 0x4140 addq $0xf8, %rsp popq %rbx popq %r12 popq %r14 popq %r15 retq jmp 0x13431 jmp 0x1342c movq %rax, %rbx leaq 0x70(%rsp), %rdi callq 0x4140 leaq 0x30(%rsp), %rdi callq 0x4140 leaq 0x10(%rsp), %rdi callq 0x4140 jmp 0x13434 movq %rax, %rbx jmp 0x13441 movq %rax, %rbx jmp 0x13458 movq %rax, %rbx leaq 0xb0(%rsp), %rdi callq 0x4140 leaq 0x90(%rsp), %rdi callq 0x4140 leaq 0x50(%rsp), %rdi callq 0x4140 leaq 0xd0(%rsp), %rdi callq 0x4140 movq %rbx, %rdi callq 0x44a0 nop
/martinmoene[P]expected-lite/test/lest/lest.hpp
lest::make_char_string[abi:cxx11](char)
inline std::string make_char_string( char chr ) { return "\'" + make_tran_string( std::string( 1, chr ) ) + "\'" ; }
pushq %r14 pushq %rbx subq $0x88, %rsp movl %esi, %edx movq %rdi, %rbx leaq 0x18(%rsp), %rax movq %rax, -0x10(%rax) leaq 0x8(%rsp), %r14 pushq $0x1 popq %rsi movq %r14, %rdi callq 0x4310 leaq 0x28(%rsp), %rdi movq %r14, %rsi callq 0xbc88a leaq 0x8c5c(%rip), %rsi # 0xc53f7 leaq 0x48(%rsp), %rdi leaq 0x28(%rsp), %rdx callq 0xbc866 leaq 0x8c46(%rip), %rdx # 0xc53f7 leaq 0x68(%rsp), %rdi leaq 0x48(%rsp), %rsi callq 0x10ad5 leaq 0x10(%rbx), %rcx movq %rcx, (%rbx) leaq 0x78(%rsp), %rax movq -0x10(%rax), %rdx cmpq %rax, %rdx je 0xbc7e3 movq %rdx, (%rbx) movq 0x78(%rsp), %rcx movq %rcx, 0x10(%rbx) jmp 0xbc7e9 movups (%rax), %xmm0 movups %xmm0, (%rcx) leaq 0x68(%rsp), %rdi movq 0x8(%rdi), %rcx movq %rcx, 0x8(%rbx) movq %rax, (%rdi) andq $0x0, 0x8(%rdi) movb $0x0, 0x10(%rdi) callq 0x4140 leaq 0x48(%rsp), %rdi callq 0x4140 leaq 0x28(%rsp), %rdi callq 0x4140 leaq 0x8(%rsp), %rdi callq 0x4140 movq %rbx, %rax addq $0x88, %rsp popq %rbx popq %r14 retq movq %rax, %rbx leaq 0x48(%rsp), %rdi callq 0x4140 jmp 0xbc845 movq %rax, %rbx leaq 0x28(%rsp), %rdi callq 0x4140 jmp 0xbc854 movq %rax, %rbx leaq 0x8(%rsp), %rdi callq 0x4140 movq %rbx, %rdi callq 0x44a0
/martinmoene[P]expected-lite/test/lest/lest.hpp