Advertisement
Guest User

Untitled

a guest
May 26th, 2018
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.50 KB | None | 0 0
  1. bool __stdcall CClientModuleManagerBase::LoadDynamicModule(DynamicModule_s *a1, char a2)
  2. {
  3. _DWORD *v4; // eax
  4. int (__stdcall *v5)(int, PVOID, size_t, PVOID, size_t *); // eax
  5. int *v6; // eax
  6. DynamicModule_s *v7; // edi
  7. DynamicModule_s *v8; // ecx
  8. HMODULE v9; // eax
  9. int (__stdcall *v10)(int, PVOID, size_t, PVOID, size_t *); // eax
  10. int *v11; // eax
  11. int *v12; // eax
  12. int v13; // [esp+8h] [ebp-28h]
  13.  
  14. if ( a1->m_pRunfuncEntrypoint )
  15. return 1;
  16. if ( a1->m_pModulePtr && a1->m_nModuleSize )
  17. {
  18. if ( a1->m_pModule )
  19. ASSERT(
  20. "Assertion Failed: pModule->m_pModule == NULL",
  21. 0,
  22. "c:\\buildslave\\steam_rel_client_win32\\build\\src\\steamserviceclient\\servicemodulemanagerbase.cpp",
  23. 349,
  24. 0);
  25. if ( a1->m_hModule )
  26. ASSERT(
  27. "Assertion Failed: pModule->m_hModule == NULL",
  28. 0,
  29. "c:\\buildslave\\steam_rel_client_win32\\build\\src\\steamserviceclient\\servicemodulemanagerbase.cpp",
  30. 350,
  31. 0);
  32. if ( VerifyValveSignature(a1->m_pModulePtr, a1->m_nModuleSize) )
  33. {
  34. CClientModuleManagerBase::UnloadModuleInternal(a1);
  35. a1->m_nLastResult = 11;
  36. return 0;
  37. }
  38. if ( a2 & 2 ) // CClientModuleManagerBase::LoadModuleHidden
  39. {
  40. v4 = sub_10023BD0(a1->m_pModulePtr, 0, 1);
  41. a1->m_pModule = v4;
  42. if ( v4 )
  43. {
  44. v5 = (int (__stdcall *)(int, PVOID, size_t, PVOID, size_t *))sub_10023B40((int)v4, (int)"_runfunc@20");
  45. a1->m_pRunfuncEntrypoint = v5;
  46. if ( !v5 )
  47. a1->m_nLastResult = 25;
  48. }
  49. else
  50. {
  51. a1->m_nLastResult = 22;
  52. }
  53. }
  54. else // CClientModuleManagerBase::LoadModuleStandard
  55. {
  56. a1 = 0;
  57. sub_10039F60(&v13, 0, 0, 0);
  58. a1->m_nLastResult = 0;
  59. if ( (unsigned __int8)sub_10045010(&a1) )
  60. {
  61. sub_1003B7E0((int)&v13, a1->m_pModulePtr, a1->m_nModuleSize, a1->m_nModuleSize, 0);
  62. v7 = (DynamicModule_s *)&Mem;
  63. v8 = (DynamicModule_s *)&Mem;
  64. if ( a1 )
  65. v8 = a1;
  66. if ( sub_10045690((int)&v13, (int)v8, 0) )
  67. {
  68. if ( a1 )
  69. v7 = a1;
  70. v9 = sub_10045C40((int)v7, 0);
  71. a1->m_hModule = v9;
  72. if ( v9 )
  73. {
  74. v10 = (int (__stdcall *)(int, PVOID, size_t, PVOID, size_t *))sub_10045C20((LPCSTR)v9, "_runfunc@20");
  75. a1->m_pRunfuncEntrypoint = v10;
  76. if ( !v10 )
  77. a1->m_nLastResult = 23;
  78. }
  79. else
  80. {
  81. a1->m_nLastResult = 22;
  82. }
  83. }
  84. else
  85. {
  86. a1->m_nLastResult = 21;
  87. }
  88. sub_100393D0(&v13);
  89. v11 = GetMemAlloc();
  90. (*(void (__thiscall **)(int *, DynamicModule_s *, _DWORD))(*v11 + 28))(v11, a1, 0);
  91. }
  92. else
  93. {
  94. a1->m_nLastResult = 19;
  95. sub_100393D0(&v13);
  96. v6 = GetMemAlloc();
  97. (*(void (__thiscall **)(int *, DynamicModule_s *, _DWORD))(*v6 + 28))(v6, a1, 0);
  98. }
  99. }
  100. if ( !a1->m_pRunfuncEntrypoint )
  101. {
  102. CClientModuleManagerBase::UnloadModuleInternal(a1);
  103. return 0;
  104. }
  105. sub_1003BDA0((int)&a1->dword20);
  106. if ( a1->m_pModulePtr )
  107. {
  108. v12 = GetMemAlloc();
  109. (*(void (__thiscall **)(int *, DWORD, _DWORD))(*v12 + 28))(v12, a1->m_pModulePtr, 0);
  110. a1->m_pModulePtr = 0;
  111. }
  112. return 1;
  113. }
  114. a1->m_nLastResult = 12;
  115. return 0;
  116. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement