Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public unsafe string GenerateServerHello(string password)
- {
- byte* numPtr = (byte*) <Module>.new[]((uint) (*(int*) ((IntPtr) this._ctx + 4) + 148));
- basic_string<char,std::char_traits<char>,std::allocator<char> > stdAllocatorChar1;
- basic_string<char,std::char_traits<char>,std::allocator<char> >* stdAllocatorCharPtr1 = <Module>.Pairing.StringConverter.String2StdString(&stdAllocatorChar1, password);
- uint length;
- // ISSUE: fault handler
- try
- {
- <Module>.SPCApi.GeneratorServerHello(this._impl, this._ctx, 16U > (uint) *(int*) ((IntPtr) stdAllocatorCharPtr1 + 20) ? (byte*) stdAllocatorCharPtr1 : (byte*) *(int*) stdAllocatorCharPtr1, (uint) password.Length, (byte*) *(int*) this._ctx, numPtr, &length);
- }
- __fault
- {
- // ISSUE: method pointer
- // ISSUE: cast to a function pointer type
- <Module>.___CxxCallUnwindDtor((__FnPtr<void (void*)>) __methodptr(std.basic_string<char,std::char_traits<char>,std::allocator<char> >.{dtor}), (void*) &stdAllocatorChar1);
- }
- <Module>.std.basic_string<char,std::char_traits<char>,std::allocator<char> >._Tidy(&stdAllocatorChar1, true, 0U);
- basic_string<char,std::char_traits<char>,std::allocator<char> > stdAllocatorChar2;
- basic_string<char,std::char_traits<char>,std::allocator<char> >* stdAllocatorCharPtr2 = &stdAllocatorChar2;
- return <Module>.Pairing.StringConverter.StdString2String(<Module>.chr2hex(&stdAllocatorChar2, numPtr, length));
- }
- internal static unsafe int SAkepApi.GeneratorServerHello([In] SAkepApi* obj0, Handle_CTX* ctx, byte* pPwd, uint nPwdLen, byte* pUserID, uint nUserIDLen, byte* pOutMsg, uint* nOutLen)
- {
- $ArrayType$$$BY0IA@E arrayTypeBy0IaE1;
- // ISSUE: explicit reference operation
- // ISSUE: cast to a reference type
- // ISSUE: explicit reference operation
- ^(sbyte&) @arrayTypeBy0IaE1 = (sbyte) 0;
- // ISSUE: cast to a reference type
- // ISSUE: initblk instruction
- __memset(($ArrayType$$$BY0IA@E&) ((IntPtr) &arrayTypeBy0IaE1 + 1), 0, (int) sbyte.MaxValue);
- $ArrayType$$$BY0IA@E arrayTypeBy0IaE2;
- // ISSUE: explicit reference operation
- // ISSUE: cast to a reference type
- // ISSUE: explicit reference operation
- ^(sbyte&) @arrayTypeBy0IaE2 = (sbyte) 0;
- // ISSUE: cast to a reference type
- // ISSUE: initblk instruction
- __memset(($ArrayType$$$BY0IA@E&) ((IntPtr) &arrayTypeBy0IaE2 + 1), 0, (int) sbyte.MaxValue);
- $ArrayType$$$BY0IA@E arrayTypeBy0IaE3;
- // ISSUE: explicit reference operation
- // ISSUE: cast to a reference type
- // ISSUE: explicit reference operation
- ^(sbyte&) @arrayTypeBy0IaE3 = (sbyte) 0;
- // ISSUE: cast to a reference type
- // ISSUE: initblk instruction
- __memset(($ArrayType$$$BY0IA@E&) ((IntPtr) &arrayTypeBy0IaE3 + 1), 0, (int) sbyte.MaxValue);
- uint num1 = 0;
- $ArrayType$$$BY0IA@E arrayTypeBy0IaE4;
- // ISSUE: explicit reference operation
- // ISSUE: cast to a reference type
- // ISSUE: explicit reference operation
- ^(sbyte&) @arrayTypeBy0IaE4 = (sbyte) 0;
- // ISSUE: cast to a reference type
- // ISSUE: initblk instruction
- __memset(($ArrayType$$$BY0IA@E&) ((IntPtr) &arrayTypeBy0IaE4 + 1), 0, (int) sbyte.MaxValue);
- <Module>.DRMLOG_Message(&<Module>.SPCLogCTX, 4, (sbyte*) &<Module>.??_C@_0BE@CPNAOIKD@?4?4?2?4?4?2Src?2SAKEP?4cpp?$AA@, 582, (sbyte*) &<Module>.??_C@_0DB@JPKHBDCI@?$CL?$CL?$CL?$CL?$CL?$CL?$CL?$CL?$CL?$CL?$CL?5GeneratorServerHello@, __arglist ());
- if ((IntPtr) ctx == IntPtr.Zero)
- {
- <Module>.DRMLOG_Message(&<Module>.SPCLogCTX, 4, (sbyte*) &<Module>.??_C@_0BE@CPNAOIKD@?4?4?2?4?4?2Src?2SAKEP?4cpp?$AA@, 586, (sbyte*) &<Module>.??_C@_0DO@IKOGCEKM@GeneratorServerHello?5Input?5param@, __arglist (-183));
- return -183;
- }
- if (*(int*) ((IntPtr) ctx + 60) >= 129)
- {
- *pOutMsg = (byte) 1;
- pOutMsg[1] = (byte) *(int*) ((IntPtr) ctx + 60);
- // ISSUE: initblk instruction
- __memset((IntPtr) (pOutMsg + 2), 0, 4);
- pOutMsg[6] = (byte) 0;
- <Module>.ConvertUint32ToUint8(0U, pOutMsg + 7);
- *nOutLen = 11U;
- *(int*) ((IntPtr) ctx + 56) = 7;
- return -182;
- }
- if ((IntPtr) pPwd != IntPtr.Zero && nPwdLen > 0U && ((IntPtr) pUserID != IntPtr.Zero && (IntPtr) pOutMsg != IntPtr.Zero))
- {
- int num2 = *(int*) ((IntPtr) ctx + 56);
- if (num2 != 3)
- {
- *(int*) ((IntPtr) ctx + 60) = 133;
- <Module>.DRMLOG_Message(&<Module>.SPCLogCTX, 4, (sbyte*) &<Module>.??_C@_0BE@CPNAOIKD@?4?4?2?4?4?2Src?2SAKEP?4cpp?$AA@, 613, (sbyte*) &<Module>.??_C@_0EA@MBCGCBIF@GeneratorServerHello?5State?5Error@, __arglist (num2, -183));
- return -191;
- }
- *pOutMsg = (byte) 1;
- pOutMsg[1] = (byte) 2;
- // ISSUE: initblk instruction
- __memset((IntPtr) (pOutMsg + 2), 0, 4);
- pOutMsg[6] = (byte) 0;
- uint uData = nUserIDLen + 132U;
- <Module>.ConvertUint32ToUint8(uData, pOutMsg + 7);
- <Module>.ConvertUint32ToUint8(nUserIDLen, pOutMsg + 11);
- // ISSUE: cpblk instruction
- __memcpy((IntPtr) (pOutMsg + 15), (IntPtr) pUserID, (int) nUserIDLen);
- uint num3 = nUserIDLen + 15U;
- int gy = <Module>.SAkepApi.GetGy(obj0, pPwd, nPwdLen, (byte*) &arrayTypeBy0IaE1, (byte*) &arrayTypeBy0IaE2);
- if (gy != 0)
- {
- <Module>.DRMLOG_Message(&<Module>.SPCLogCTX, 4, (sbyte*) &<Module>.??_C@_0BE@CPNAOIKD@?4?4?2?4?4?2Src?2SAKEP?4cpp?$AA@, 631, (sbyte*) &<Module>.??_C@_0DG@JDLAFDII@GeneratorServerHello?5GetGyWc?5Err@, __arglist (gy));
- <Module>.DRMLOG_HexaBytes(&<Module>.SPCLogCTX, 4, (sbyte*) &<Module>.??_C@_0BE@CPNAOIKD@?4?4?2?4?4?2Src?2SAKEP?4cpp?$AA@, 633, (sbyte*) &<Module>.??_C@_08NLHBPEGP@password?$AA@, pPwd, (int) nPwdLen);
- <Module>.DRMLOG_HexaBytes(&<Module>.SPCLogCTX, 4, (sbyte*) &<Module>.??_C@_0BE@CPNAOIKD@?4?4?2?4?4?2Src?2SAKEP?4cpp?$AA@, 634, (sbyte*) &<Module>.??_C@_03DOKMNJIF@pGy?$AA@, (byte*) &arrayTypeBy0IaE1, 128);
- <Module>.DRMLOG_HexaBytes(&<Module>.SPCLogCTX, 4, (sbyte*) &<Module>.??_C@_0BE@CPNAOIKD@?4?4?2?4?4?2Src?2SAKEP?4cpp?$AA@, 635, (sbyte*) &<Module>.??_C@_09NACEKEIA@pPrivateY?$AA@, (byte*) &arrayTypeBy0IaE2, 128);
- return -200;
- }
- <Module>.DRMLOG_HexaBytes(&<Module>.SPCLogCTX, 2, (sbyte*) &<Module>.??_C@_0BE@CPNAOIKD@?4?4?2?4?4?2Src?2SAKEP?4cpp?$AA@, 638, (sbyte*) &<Module>.??_C@_0P@BGNPPNFM@Input?5password?$AA@, pPwd, (int) nPwdLen);
- <Module>.DRMLOG_HexaBytes(&<Module>.SPCLogCTX, 2, (sbyte*) &<Module>.??_C@_0BE@CPNAOIKD@?4?4?2?4?4?2Src?2SAKEP?4cpp?$AA@, 639, (sbyte*) &<Module>.??_C@_0BC@NLKCFFAN@My?5public?5Key?5pGy?$AA@, (byte*) &arrayTypeBy0IaE1, 128);
- <Module>.DRMLOG_HexaBytes(&<Module>.SPCLogCTX, 2, (sbyte*) &<Module>.??_C@_0BE@CPNAOIKD@?4?4?2?4?4?2Src?2SAKEP?4cpp?$AA@, 640, (sbyte*) &<Module>.??_C@_09NACEKEIA@pPrivateY?$AA@, (byte*) &arrayTypeBy0IaE2, 128);
- // ISSUE: explicit reference operation
- // ISSUE: cpblk instruction
- __memcpy((IntPtr) obj0, @arrayTypeBy0IaE2, 128);
- // ISSUE: explicit reference operation
- // ISSUE: cpblk instruction
- __memcpy((IntPtr) obj0 + 128, @arrayTypeBy0IaE1, 128);
- <Module>.SAkepApi.SetMac(obj0, pUserID, nUserIDLen);
- int num4 = <Module>.SAkepApi.EncryptGy(obj0, pPwd, nPwdLen, (byte*) &arrayTypeBy0IaE1, 128U, (byte*) &arrayTypeBy0IaE3, &num1);
- if (num4 != 0)
- {
- <Module>.DRMLOG_Message(&<Module>.SPCLogCTX, 4, (sbyte*) &<Module>.??_C@_0BE@CPNAOIKD@?4?4?2?4?4?2Src?2SAKEP?4cpp?$AA@, 651, (sbyte*) &<Module>.??_C@_0DE@PKJEMDGG@GeneratorServerHello?5GetGy?5Error@, __arglist (num4));
- <Module>.DRMLOG_HexaBytes(&<Module>.SPCLogCTX, 4, (sbyte*) &<Module>.??_C@_0BE@CPNAOIKD@?4?4?2?4?4?2Src?2SAKEP?4cpp?$AA@, 653, (sbyte*) &<Module>.??_C@_08NLHBPEGP@password?$AA@, pPwd, (int) nPwdLen);
- <Module>.DRMLOG_HexaBytes(&<Module>.SPCLogCTX, 4, (sbyte*) &<Module>.??_C@_0BE@CPNAOIKD@?4?4?2?4?4?2Src?2SAKEP?4cpp?$AA@, 654, (sbyte*) &<Module>.??_C@_03DOKMNJIF@pGy?$AA@, (byte*) &arrayTypeBy0IaE1, 128);
- <Module>.DRMLOG_HexaBytes(&<Module>.SPCLogCTX, 4, (sbyte*) &<Module>.??_C@_0BE@CPNAOIKD@?4?4?2?4?4?2Src?2SAKEP?4cpp?$AA@, 655, (sbyte*) &<Module>.??_C@_09NACEKEIA@pPrivateY?$AA@, (byte*) &arrayTypeBy0IaE2, 128);
- return -215;
- }
- <Module>.DRMLOG_HexaBytes(&<Module>.SPCLogCTX, 4, (sbyte*) &<Module>.??_C@_0BE@CPNAOIKD@?4?4?2?4?4?2Src?2SAKEP?4cpp?$AA@, 659, (sbyte*) &<Module>.??_C@_08NLHBPEGP@password?$AA@, pPwd, (int) nPwdLen);
- <Module>.DRMLOG_HexaBytes(&<Module>.SPCLogCTX, 4, (sbyte*) &<Module>.??_C@_0BE@CPNAOIKD@?4?4?2?4?4?2Src?2SAKEP?4cpp?$AA@, 660, (sbyte*) &<Module>.??_C@_03DOKMNJIF@pGy?$AA@, (byte*) &arrayTypeBy0IaE1, 128);
- <Module>.DRMLOG_HexaBytes(&<Module>.SPCLogCTX, 4, (sbyte*) &<Module>.??_C@_0BE@CPNAOIKD@?4?4?2?4?4?2Src?2SAKEP?4cpp?$AA@, 661, (sbyte*) &<Module>.??_C@_0O@FPBBJGAB@Encrypted?5pGy?$AA@, (byte*) &arrayTypeBy0IaE3, (int) num1);
- uint num5 = 0;
- do
- {
- int num6 = (int) <Module>.SWAPv2_Process((byte*) &<Module>.pParameterDataEncTbl, 164432U, (byte*) ((int) num5 + (IntPtr) &arrayTypeBy0IaE3), (byte*) ((int) num5 + (IntPtr) &arrayTypeBy0IaE4));
- num5 += 16U;
- }
- while (num5 < 128U);
- // ISSUE: explicit reference operation
- // ISSUE: cpblk instruction
- __memcpy((int) num3 + (IntPtr) pOutMsg, @arrayTypeBy0IaE4, 128);
- uint num7 = num3 + 128U;
- *(sbyte*) ((int) num7 + (IntPtr) pOutMsg) = (sbyte) 0;
- uint num8 = num7 + 1U;
- // ISSUE: initblk instruction
- __memset((int) num8 + (IntPtr) pOutMsg, 0, 4);
- uint num9 = num8 + 4U;
- byte* pData = (byte*) <Module>.malloc(uData);
- if ((IntPtr) pData == IntPtr.Zero)
- {
- *(int*) ((IntPtr) ctx + 60) = 135;
- <Module>.DRMLOG_Message(&<Module>.SPCLogCTX, 4, (sbyte*) &<Module>.??_C@_0BE@CPNAOIKD@?4?4?2?4?4?2Src?2SAKEP?4cpp?$AA@, 675, (sbyte*) &<Module>.??_C@_0DP@DICFBOFC@GeneratorServerHello?5pTempHash?5m@, __arglist (-180));
- return -180;
- }
- <Module>.ConvertUint32ToUint8(nUserIDLen, pData);
- // ISSUE: cpblk instruction
- __memcpy((IntPtr) (pData + 4), (IntPtr) pUserID, (int) nUserIDLen);
- // ISSUE: explicit reference operation
- // ISSUE: cpblk instruction
- __memcpy((int) nUserIDLen + (IntPtr) pData + 4, @arrayTypeBy0IaE4, 128);
- <Module>.DRMLOG_HexaBytes(&<Module>.SPCLogCTX, 2, (sbyte*) &<Module>.??_C@_0BE@CPNAOIKD@?4?4?2?4?4?2Src?2SAKEP?4cpp?$AA@, 685, (sbyte*) &<Module>.??_C@_0CF@MFPJFCMH@GeneratorServerHello?5previos?5Mes@, pData, (int) nUserIDLen + 132);
- _CryptoCoreContainer* cryptoCoreContainer = <Module>.create_CryptoCoreContainer(1022U);
- if ((IntPtr) cryptoCoreContainer == IntPtr.Zero)
- {
- <Module>.free((void*) pData);
- *(int*) ((IntPtr) ctx + 60) = 137;
- <Module>.DRMLOG_Message(&<Module>.SPCLogCTX, 4, (sbyte*) &<Module>.??_C@_0BE@CPNAOIKD@?4?4?2?4?4?2Src?2SAKEP?4cpp?$AA@, 693, (sbyte*) &<Module>.??_C@_0EJ@CKGLIJLJ@GeneratorServerHello?5create_Cryp@, __arglist (-180));
- return -180;
- }
- _CryptoCoreContainer* cryptoCoreContainerPtr1 = cryptoCoreContainer;
- int num10 = 16;
- // ISSUE: cast to a function pointer type
- // ISSUE: function pointer call
- int num11 = __calli((__FnPtr<int (_CryptoCoreContainer*)>) *(int*) ((IntPtr) cryptoCoreContainerPtr1 + num10))(cryptoCoreContainerPtr1);
- _CryptoCoreContainer* cryptoCoreContainerPtr2 = cryptoCoreContainer;
- byte* numPtr = pData;
- int num12 = (int) uData;
- // ISSUE: cast to a function pointer type
- // ISSUE: function pointer call
- int num13 = __calli((__FnPtr<int (_CryptoCoreContainer*, byte*, uint)>) *(int*) ((IntPtr) cryptoCoreContainer + 20))((uint) cryptoCoreContainerPtr2, numPtr, (_CryptoCoreContainer*) num12);
- _CryptoCoreContainer* cryptoCoreContainerPtr3 = cryptoCoreContainer;
- IntPtr num14 = (IntPtr) ctx + 36;
- // ISSUE: cast to a function pointer type
- // ISSUE: function pointer call
- int num15 = __calli((__FnPtr<int (_CryptoCoreContainer*, byte*)>) *(int*) ((IntPtr) cryptoCoreContainer + 24))((byte*) cryptoCoreContainerPtr3, (_CryptoCoreContainer*) num14);
- <Module>.destroy_CryptoCoreContainer(cryptoCoreContainer);
- <Module>.DRMLOG_HexaBytes(&<Module>.SPCLogCTX, 2, (sbyte*) &<Module>.??_C@_0BE@CPNAOIKD@?4?4?2?4?4?2Src?2SAKEP?4cpp?$AA@, 702, (sbyte*) &<Module>.??_C@_0CK@GELLFKC@GeneratorServerHello?5previos?5Has@, (byte*) ((IntPtr) ctx + 36), 20);
- <Module>.free((void*) pData);
- *(int*) ((IntPtr) ctx + 56) = 2;
- *nOutLen = num9;
- return 0;
- }
- *(int*) ((IntPtr) ctx + 60) = 148;
- <Module>.DRMLOG_Message(&<Module>.SPCLogCTX, 4, (sbyte*) &<Module>.??_C@_0BE@CPNAOIKD@?4?4?2?4?4?2Src?2SAKEP?4cpp?$AA@, 605, (sbyte*) &<Module>.??_C@_0DO@IKOGCEKM@GeneratorServerHello?5Input?5param@, __arglist (-183));
- return -181;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement