Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // SerializeObjectToMemBuff()
- //
- //
- //*********************************************************************************************
- CSmartPtrRef<I_MemoryBufferExt> SerializeObjectToMemBuff(I_BaseObject &obj)
- {
- 00007FF63D14CCA0 mov qword ptr [rsp+18h],rbx
- 00007FF63D14CCA5 push rbp
- 00007FF63D14CCA6 push rsi
- 00007FF63D14CCA7 push rdi
- 00007FF63D14CCA8 push r12
- 00007FF63D14CCAA push r13
- 00007FF63D14CCAC push r14
- 00007FF63D14CCAE push r15
- 00007FF63D14CCB0 lea rbp,[rsp-27h]
- 00007FF63D14CCB5 sub rsp,0B0h
- 00007FF63D14CCBC mov rax,qword ptr [__security_cookie (07FF63F4CE748h)]
- 00007FF63D14CCC3 xor rax,rsp
- 00007FF63D14CCC6 mov qword ptr [rbp+1Fh],rax
- 00007FF63D14CCCA mov rdi,rdx
- 00007FF63D14CCCD mov r15,rcx
- 00007FF63D14CCD0 mov qword ptr [rbp-31h],rcx
- 00007FF63D14CCD4 xor r13d,r13d
- 00007FF63D14CCD7 mov dword ptr [rbp-69h],r13d
- const CHAR * classId(obj._GetRTTI()->GetClassId());
- 00007FF63D14CCDB mov rax,qword ptr [rdx]
- 00007FF63D14CCDE mov rcx,rdx
- 00007FF63D14CCE1 call qword ptr [rax+18h]
- 00007FF63D14CCE4 mov rcx,rax
- 00007FF63D14CCE7 call Nexus::CRTTI::GetClassId (07FF63A4035C7h)
- 00007FF63D14CCEC mov rbx,rax
- NX_ASSERT(classId);
- 00007FF63D14CCEF test rax,rax
- 00007FF63D14CCF2 jne Nexus::SerializeObjectToMemBuff+6Bh (07FF63D14CD0Bh)
- 00007FF63D14CCF4 lea r8d,[r13+14h]
- 00007FF63D14CCF8 lea rdx,[string "O:\\Projects\\code\\nexus\\kernel\\u@"... (07FF63EADE5B0h)]
- 00007FF63D14CCFF lea rcx,[string "(classId)" (07FF63E6468E0h)]
- 00007FF63D14CD06 call Nexus::SysAssertExpr (07FF63A4069D9h)
- CSmartPtrRef<Persistence::COutputNode> output(NX_NEW Persistence::COutputNode(4096));
- 00007FF63D14CD0B mov ecx,50h
- 00007FF63D14CD10 call Nexus::CPoolAllocatedObj<150,64,Nexus::CMTLockingPolicyNULL>::operator new (07FF63A400C46h)
- 00007FF63D14CD15 mov qword ptr [rbp-49h],rax
- 00007FF63D14CD19 test rax,rax
- 00007FF63D14CD1C je Nexus::SerializeObjectToMemBuff+8Dh (07FF63D14CD2Dh)
- 00007FF63D14CD1E mov edx,1000h
- 00007FF63D14CD23 mov rcx,rax
- 00007FF63D14CD26 call Nexus::Persistence::COutputNode::COutputNode (07FF63A42A276h)
- 00007FF63D14CD2B jmp Nexus::SerializeObjectToMemBuff+90h (07FF63D14CD30h)
- 00007FF63D14CD2D mov rax,r13
- 00007FF63D14CD30 lea rsi,[Nexus::CSmartPtrRef<Nexus::Persistence::COutputNode>::`vftable' (07FF63E64C8C8h)]
- 00007FF63D14CD37 mov qword ptr [rbp-61h],rsi
- 00007FF63D14CD3B mov qword ptr [rbp-59h],rax
- 00007FF63D14CD3F test rax,rax
- 00007FF63D14CD42 je Nexus::SerializeObjectToMemBuff+0A7h (07FF63D14CD47h)
- 00007FF63D14CD44 inc dword ptr [rax+8]
- NX_CHECK(output->Process(CToken("__classId").Get(), CStdString(classId)));
- 00007FF63D14CD47 lea rdx,[string "__classId" (07FF63EADE5F8h)]
- 00007FF63D14CD4E lea rcx,[rbp-29h]
- 00007FF63D14CD52 call Nexus::CToken::CToken (07FF63A3E7124h)
- 00007FF63D14CD57 mov ecx,dword ptr [rax]
- 00007FF63D14CD59 mov dword ptr [rbp-51h],ecx
- 00007FF63D14CD5C mov qword ptr [rbp+0Fh],r13
- 00007FF63D14CD60 mov qword ptr [rbp+17h],0Fh
- 00007FF63D14CD68 mov byte ptr [rbp-1],0
- 00007FF63D14CD6C mov r8,0FFFFFFFFFFFFFFFFh
- 00007FF63D14CD73 inc r8
- 00007FF63D14CD76 cmp byte ptr [rbx+r8],0
- 00007FF63D14CD7B jne Nexus::SerializeObjectToMemBuff+0D3h (07FF63D14CD73h)
- 00007FF63D14CD7D mov rdx,rbx
- 00007FF63D14CD80 lea rcx,[rbp-1]
- 00007FF63D14CD84 call std::basic_string<char,std::char_traits<char>,std::allocator<char> >::assign (07FF63A3FC5F1h)
- 00007FF63D14CD89 nop
- 00007FF63D14CD8A lea r8,[rbp-1]
- 00007FF63D14CD8E lea rdx,[rbp-51h]
- 00007FF63D14CD92 mov rcx,qword ptr [rbp-59h]
- 00007FF63D14CD96 call Nexus::Persistence::COutputNode::Process<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > (07FF63A3E1B7Fh)
- 00007FF63D14CD9B test al,al
- 00007FF63D14CD9D jne Nexus::SerializeObjectToMemBuff+119h (07FF63D14CDB9h)
- 00007FF63D14CD9F mov r8d,18h
- 00007FF63D14CDA5 lea rdx,[string "O:\\Projects\\code\\nexus\\kernel\\u@"... (07FF63EADE5B0h)]
- 00007FF63D14CDAC lea rcx,[string "(output->Process(CToken("__clas@"... (07FF63EADE610h)]
- 00007FF63D14CDB3 call Nexus::SysAssertExpr (07FF63A4069D9h)
- 00007FF63D14CDB8 nop
- 00007FF63D14CDB9 mov rdx,qword ptr [rbp+17h]
- 00007FF63D14CDBD cmp rdx,10h
- 00007FF63D14CDC1 jb Nexus::SerializeObjectToMemBuff+154h (07FF63D14CDF4h)
- 00007FF63D14CDC3 inc rdx
- 00007FF63D14CDC6 mov rcx,qword ptr [rbp-1]
- 00007FF63D14CDCA mov rax,rcx
- 00007FF63D14CDCD cmp rdx,1000h
- 00007FF63D14CDD4 jb Nexus::SerializeObjectToMemBuff+14Fh (07FF63D14CDEFh)
- 00007FF63D14CDD6 add rdx,27h
- 00007FF63D14CDDA mov rcx,qword ptr [rcx-8]
- 00007FF63D14CDDE sub rax,rcx
- 00007FF63D14CDE1 add rax,0FFFFFFFFFFFFFFF8h
- 00007FF63D14CDE5 cmp rax,1Fh
- 00007FF63D14CDE9 ja Nexus::DeserializeObjectFromMemBuff+9h (07FF63D14D069h)
- 00007FF63D14CDEF call operator delete (07FF63A3C1C7Bh)
- 00007FF63D14CDF4 mov qword ptr [rbp+0Fh],r13
- 00007FF63D14CDF8 mov qword ptr [rbp+17h],0Fh
- 00007FF63D14CE00 mov byte ptr [rbp-1],0
- 00007FF63D14CE04 lea rax,[Nexus::Persistence::CIOCtxBase::`vftable' (07FF63E6CA998h)]
- 00007FF63D14CE0B mov qword ptr [rbp-49h],rax
- if (!obj.SaveState(output, Persistence::CIOCtxBase()))
- 00007FF63D14CE0F mov rax,qword ptr [rdi]
- 00007FF63D14CE12 lea r8,[rbp-49h]
- 00007FF63D14CE16 lea rdx,[rbp-61h]
- 00007FF63D14CE1A mov rcx,rdi
- 00007FF63D14CE1D call qword ptr [rax+30h]
- 00007FF63D14CE20 test al,al
- 00007FF63D14CE22 jne Nexus::SerializeObjectToMemBuff+222h (07FF63D14CEC2h)
- {
- NX_TRACE_E(FS("%s: unable to serialize object of class %s", __NX_FUNC_ID, classId));
- 00007FF63D14CE28 mov r9,rbx
- 00007FF63D14CE2B lea r8,[string "Nexus::SerializeObjectToMemBuff" (07FF63EADE660h)]
- 00007FF63D14CE32 lea rdx,[string "%s: unable to serialize object @"... (07FF63EADE688h)]
- 00007FF63D14CE39 lea rcx,[rbp-1]
- 00007FF63D14CE3D call Nexus::FS (07FF63A411168h)
- 00007FF63D14CE42 nop
- 00007FF63D14CE43 mov rcx,rax
- 00007FF63D14CE46 call Nexus::NX_TRACE_E (07FF63A3FE17Bh)
- 00007FF63D14CE4B nop
- 00007FF63D14CE4C mov rdx,qword ptr [rbp+17h]
- 00007FF63D14CE50 cmp rdx,10h
- 00007FF63D14CE54 jb Nexus::SerializeObjectToMemBuff+1E7h (07FF63D14CE87h)
- 00007FF63D14CE56 inc rdx
- 00007FF63D14CE59 mov rcx,qword ptr [rbp-1]
- 00007FF63D14CE5D mov rax,rcx
- 00007FF63D14CE60 cmp rdx,1000h
- 00007FF63D14CE67 jb Nexus::SerializeObjectToMemBuff+1E2h (07FF63D14CE82h)
- 00007FF63D14CE69 add rdx,27h
- 00007FF63D14CE6D mov rcx,qword ptr [rcx-8]
- 00007FF63D14CE71 sub rax,rcx
- 00007FF63D14CE74 add rax,0FFFFFFFFFFFFFFF8h
- 00007FF63D14CE78 cmp rax,1Fh
- 00007FF63D14CE7C ja Nexus::DeserializeObjectFromMemBuff+3h (07FF63D14D063h)
- 00007FF63D14CE82 call operator delete (07FF63A3C1C7Bh)
- return false;
- 00007FF63D14CE87 lea rax,[Nexus::CSmartPtrRef<Nexus::I_MemoryBufferExt>::`vftable' (07FF63E649130h)]
- 00007FF63D14CE8E mov qword ptr [r15],rax
- 00007FF63D14CE91 mov qword ptr [r15+8],r13
- 00007FF63D14CE95 mov qword ptr [rbp-61h],rsi
- 00007FF63D14CE99 mov rcx,qword ptr [rbp-59h]
- 00007FF63D14CE9D test rcx,rcx
- 00007FF63D14CEA0 je Nexus::SerializeObjectToMemBuff+399h (07FF63D14D039h)
- 00007FF63D14CEA6 dec dword ptr [rcx+8]
- 00007FF63D14CEA9 cmp dword ptr [rcx+8],0
- 00007FF63D14CEAD jg Nexus::SerializeObjectToMemBuff+399h (07FF63D14D039h)
- 00007FF63D14CEB3 mov rax,qword ptr [rcx]
- 00007FF63D14CEB6 mov edx,1
- 00007FF63D14CEBB call qword ptr [rax]
- }
- #if 0
- const size_t streamSize(output->GetMemStream()->Size());
- return CMemoryBufferExt::CreateWithTakingDataOwnership(output->GetMemStream()->RetrieveDataOwnership(), streamSize, true);
- #else
- //
- // Codegen bug introduced Visual Studio 2019 16.4.0 causes following code to create memory buffer object of size 0
- //
- return CMemoryBufferExt::CreateWithTakingDataOwnership(output->GetMemStream()->RetrieveDataOwnership(), output->GetMemStream()->Size(), true);
- 00007FF63D14CEBD jmp Nexus::SerializeObjectToMemBuff+399h (07FF63D14D039h)
- 00007FF63D14CEC2 lea rax,[Nexus::CSmartPtrRef<Nexus::CMemoryStream>::`vftable' (07FF63E6A2220h)]
- 00007FF63D14CEC9 mov qword ptr [rbp-21h],rax
- 00007FF63D14CECD mov rdi,qword ptr [rbp-59h]
- 00007FF63D14CED1 mov rsi,qword ptr [rdi+28h]
- 00007FF63D14CED5 mov qword ptr [rbp-19h],rsi
- 00007FF63D14CED9 test rsi,rsi
- 00007FF63D14CEDC je Nexus::SerializeObjectToMemBuff+245h (07FF63D14CEE5h)
- 00007FF63D14CEDE inc dword ptr [rsi+8]
- 00007FF63D14CEE1 mov rdi,qword ptr [rbp-59h]
- 00007FF63D14CEE5 mov qword ptr [rbp-11h],rax
- 00007FF63D14CEE9 mov rdi,qword ptr [rdi+28h]
- 00007FF63D14CEED mov qword ptr [rbp-9],rdi
- 00007FF63D14CEF1 test rdi,rdi
- 00007FF63D14CEF4 je Nexus::SerializeObjectToMemBuff+259h (07FF63D14CEF9h)
- 00007FF63D14CEF6 inc dword ptr [rdi+8]
- 00007FF63D14CEF9 mov r14,qword ptr [rsi+30h]
- 00007FF63D14CEFD mov r12,qword ptr [rdi+18h]
- 00007FF63D14CF01 mov qword ptr [rdi+18h],r13
- 00007FF63D14CF05 mov qword ptr [rdi+28h],r13
- 00007FF63D14CF09 mov qword ptr [rdi+20h],r13
- 00007FF63D14CF0D mov qword ptr [rdi+30h],r13
- 00007FF63D14CF11 mov ecx,28h
- 00007FF63D14CF16 call operator new (07FF63A42AA19h)
- 00007FF63D14CF1B mov rbx,rax
- 00007FF63D14CF1E mov qword ptr [rbp-41h],rax
- 00007FF63D14CF22 test rax,rax
- 00007FF63D14CF25 je Nexus::SerializeObjectToMemBuff+2AFh (07FF63D14CF4Fh)
- 00007FF63D14CF27 lea rax,[Nexus::CRefCountedMT::`vftable' (07FF63E648E30h)]
- 00007FF63D14CF2E mov qword ptr [rbx],rax
- 00007FF63D14CF31 mov dword ptr [rbx+8],r13d
- 00007FF63D14CF35 lea rax,[Nexus::CMemoryBufferExt::`vftable' (07FF63E649038h)]
- 00007FF63D14CF3C mov qword ptr [rbx],rax
- 00007FF63D14CF3F mov qword ptr [rbx+10h],r12
- 00007FF63D14CF43 mov qword ptr [rbx+18h],r14
- 00007FF63D14CF47 mov word ptr [rbx+20h],101h
- 00007FF63D14CF4D jmp Nexus::SerializeObjectToMemBuff+2B2h (07FF63D14CF52h)
- 00007FF63D14CF4F mov rbx,r13
- 00007FF63D14CF52 lea rax,[Nexus::CSmartPtrRef<Nexus::CMemoryBufferExt>::`vftable' (07FF63E649098h)]
- 00007FF63D14CF59 mov qword ptr [rbp-41h],rax
- 00007FF63D14CF5D mov qword ptr [rbp-39h],rbx
- 00007FF63D14CF61 test rbx,rbx
- 00007FF63D14CF64 je Nexus::SerializeObjectToMemBuff+2CFh (07FF63D14CF6Fh)
- 00007FF63D14CF66 lea rcx,[rbx+8]
- 00007FF63D14CF6A call Nexus::InterlockedInc (07FF63A41D68Eh)
- 00007FF63D14CF6F mov dword ptr [rbp-69h],2
- 00007FF63D14CF76 lea rax,[Nexus::CSmartPtrRef<Nexus::I_MemoryBufferExt>::`vftable' (07FF63E649130h)]
- 00007FF63D14CF7D mov qword ptr [r15],rax
- 00007FF63D14CF80 mov qword ptr [r15+8],rbx
- 00007FF63D14CF84 test rbx,rbx
- 00007FF63D14CF87 je Nexus::SerializeObjectToMemBuff+2F2h (07FF63D14CF92h)
- 00007FF63D14CF89 lea rcx,[rbx+8]
- 00007FF63D14CF8D call Nexus::InterlockedInc (07FF63A41D68Eh)
- 00007FF63D14CF92 mov dword ptr [rbp-69h],3
- 00007FF63D14CF99 test rbx,rbx
- 00007FF63D14CF9C je Nexus::SerializeObjectToMemBuff+339h (07FF63D14CFD9h)
- 00007FF63D14CF9E lea rcx,[rbx+8]
- 00007FF63D14CFA2 call Nexus::InterlockedDec (07FF63A3CAECAh)
- 00007FF63D14CFA7 mov r14d,eax
- 00007FF63D14CFAA test eax,eax
- 00007FF63D14CFAC jns Nexus::SerializeObjectToMemBuff+327h (07FF63D14CFC7h)
- 00007FF63D14CFAE mov r8d,52h
- 00007FF63D14CFB4 lea rdx,[string "O:\\Projects\\code\\nexus\\common\\r@"... (07FF63E648E40h)]
- 00007FF63D14CFBB lea rcx,[string "(static_cast<int32>(newCnt) >= @"... (07FF63E648E78h)]
- 00007FF63D14CFC2 call Nexus::SysAssertExpr (07FF63A4069D9h)
- 00007FF63D14CFC7 test r14d,r14d
- 00007FF63D14CFCA jne Nexus::SerializeObjectToMemBuff+339h (07FF63D14CFD9h)
- 00007FF63D14CFCC mov rax,qword ptr [rbx]
- 00007FF63D14CFCF lea edx,[r14+1]
- 00007FF63D14CFD3 mov rcx,rbx
- 00007FF63D14CFD6 call qword ptr [rax]
- 00007FF63D14CFD8 nop
- 00007FF63D14CFD9 test rdi,rdi
- 00007FF63D14CFDC je Nexus::SerializeObjectToMemBuff+355h (07FF63D14CFF5h)
- 00007FF63D14CFDE dec dword ptr [rdi+8]
- 00007FF63D14CFE1 cmp dword ptr [rdi+8],0
- 00007FF63D14CFE5 jg Nexus::SerializeObjectToMemBuff+355h (07FF63D14CFF5h)
- 00007FF63D14CFE7 mov rax,qword ptr [rdi]
- 00007FF63D14CFEA mov edx,1
- 00007FF63D14CFEF mov rcx,rdi
- 00007FF63D14CFF2 call qword ptr [rax]
- 00007FF63D14CFF4 nop
- 00007FF63D14CFF5 test rsi,rsi
- 00007FF63D14CFF8 je Nexus::SerializeObjectToMemBuff+371h (07FF63D14D011h)
- 00007FF63D14CFFA dec dword ptr [rsi+8]
- 00007FF63D14CFFD cmp dword ptr [rsi+8],0
- 00007FF63D14D001 jg Nexus::SerializeObjectToMemBuff+371h (07FF63D14D011h)
- 00007FF63D14D003 mov rax,qword ptr [rsi]
- 00007FF63D14D006 mov edx,1
- 00007FF63D14D00B mov rcx,rsi
- 00007FF63D14D00E call qword ptr [rax]
- 00007FF63D14D010 nop
- 00007FF63D14D011 lea rax,[Nexus::CSmartPtrRef<Nexus::Persistence::COutputNode>::`vftable' (07FF63E64C8C8h)]
- 00007FF63D14D018 mov qword ptr [rbp-61h],rax
- 00007FF63D14D01C mov rcx,qword ptr [rbp-59h]
- 00007FF63D14D020 test rcx,rcx
- 00007FF63D14D023 je Nexus::SerializeObjectToMemBuff+399h (07FF63D14D039h)
- 00007FF63D14D025 dec dword ptr [rcx+8]
- 00007FF63D14D028 cmp dword ptr [rcx+8],0
- 00007FF63D14D02C jg Nexus::SerializeObjectToMemBuff+399h (07FF63D14D039h)
- 00007FF63D14D02E mov r8,qword ptr [rcx]
- 00007FF63D14D031 mov edx,1
- 00007FF63D14D036 call qword ptr [r8]
- 00007FF63D14D039 mov rax,r15
- 00007FF63D14D03C mov rcx,qword ptr [rbp+1Fh]
- 00007FF63D14D040 xor rcx,rsp
- 00007FF63D14D043 call __security_check_cookie (07FF63A3EA315h)
- 00007FF63D14D048 mov rbx,qword ptr [rsp+100h]
- 00007FF63D14D050 add rsp,0B0h
- 00007FF63D14D057 pop r15
- 00007FF63D14D059 pop r14
- 00007FF63D14D05B pop r13
- 00007FF63D14D05D pop r12
- 00007FF63D14D05F pop rdi
- 00007FF63D14D060 pop rsi
- 00007FF63D14D061 pop rbp
- 00007FF63D14D062 ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement