Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //----- (018DB680) --------------------------------------------------------
- char __stdcall sub_18DB680(int a1, char *a2, int a3, unsigned int a4)
- {
- int v5; // eax@8
- unsigned int v6; // edx@10
- unsigned int v7; // edx@10
- unsigned int v8; // ebx@10
- int v9; // edi@11
- int v10; // eax@11
- unsigned int i; // esi@12
- int v12; // eax@13
- int v13; // edi@20
- int v14; // edi@22
- unsigned int v15; // esi@23
- int v16; // ebx@24
- int v17; // ebx@35
- int v18; // edx@39
- unsigned int v19; // eax@42
- unsigned int v20; // ecx@45
- unsigned int v21; // eax@47
- int v22; // esi@47
- int v23; // edi@47
- int v24; // ecx@47
- unsigned int v25; // eax@47
- void *v26; // edx@48
- int v27; // ST10_4@50
- int v28; // esi@50
- double v29; // st7@52
- int v30; // ecx@53
- int v31; // eax@53
- int v32; // eax@58
- const void *v33; // ebp@58
- unsigned int v34; // esi@58
- int v35; // ebx@58
- unsigned int v36; // edx@58
- int v37; // edi@59
- unsigned int v38; // eax@60
- size_t v39; // ST14_4@65
- void *v40; // ST0C_4@65
- int v41; // esi@65
- int v42; // eax@65
- int v43; // eax@66
- int v44; // ecx@75
- int v45; // eax@76
- signed int v46; // ecx@86
- int v47; // edi@88
- int v48; // ecx@89
- int v49; // eax@89
- int v50; // eax@89
- int v51; // ecx@89
- int v52; // eax@89
- int v53; // eax@89
- int v54; // ebx@90
- int v55; // ecx@91
- void *v56; // ecx@95
- int v57; // eax@95
- int v58; // eax@105
- int v59; // eax@106
- int v60; // eax@107
- int v61; // eax@116
- int v62; // eax@117
- void *v63; // eax@144
- int v64; // ecx@154
- int v65; // eax@154
- int v66; // eax@155
- int v67; // eax@156
- int v68; // eax@157
- int v69; // eax@166
- int v70; // eax@167
- bool v71; // zf@181
- int v72; // esi@193
- int v73; // eax@193
- int v74; // ecx@194
- char *v75; // [sp-4h] [bp-AF0h]@4
- int v76; // [sp+10h] [bp-ADCh]@44
- int v77; // [sp+10h] [bp-ADCh]@106
- int v78; // [sp+10h] [bp-ADCh]@116
- int v79; // [sp+10h] [bp-ADCh]@156
- int v80; // [sp+10h] [bp-ADCh]@166
- int v81; // [sp+14h] [bp-AD8h]@41
- int v82; // [sp+14h] [bp-AD8h]@103
- int v83; // [sp+18h] [bp-AD4h]@57
- int v84; // [sp+18h] [bp-AD4h]@105
- int v85; // [sp+18h] [bp-AD4h]@155
- unsigned int v86; // [sp+1Ch] [bp-AD0h]@56
- unsigned int v87; // [sp+1Ch] [bp-AD0h]@104
- int v88; // [sp+1Ch] [bp-AD0h]@153
- int v89; // [sp+20h] [bp-ACCh]@10
- unsigned int v90; // [sp+24h] [bp-AC8h]@10
- int v91; // [sp+28h] [bp-AC4h]@10
- int v92; // [sp+2Ch] [bp-AC0h]@13
- int v93; // [sp+30h] [bp-ABCh]@45
- int v94; // [sp+34h] [bp-AB8h]@65
- unsigned int v95; // [sp+38h] [bp-AB4h]@39
- int v96; // [sp+3Ch] [bp-AB0h]@8
- int v97; // [sp+40h] [bp-AACh]@90
- void *Memory; // [sp+44h] [bp-AA8h]@18
- int v99; // [sp+48h] [bp-AA4h]@18
- int v100; // [sp+4Ch] [bp-AA0h]@18
- int v101; // [sp+50h] [bp-A9Ch]@1
- LARGE_INTEGER PerformanceCount; // [sp+54h] [bp-A98h]@18
- int v103; // [sp+5Ch] [bp-A90h]@18
- int v104; // [sp+60h] [bp-A8Ch]@18
- char v105; // [sp+64h] [bp-A88h]@18
- int v106; // [sp+6Ch] [bp-A80h]@53
- int v107; // [sp+70h] [bp-A7Ch]@53
- int v108; // [sp+78h] [bp-A74h]@3
- unsigned int v109; // [sp+7Ch] [bp-A70h]@18
- unsigned int v110; // [sp+80h] [bp-A6Ch]@18
- unsigned int v111; // [sp+84h] [bp-A68h]@11
- int v112; // [sp+88h] [bp-A64h]@10
- unsigned int v113; // [sp+8Ch] [bp-A60h]@18
- int v114; // [sp+98h] [bp-A54h]@8
- unsigned int v115; // [sp+9Ch] [bp-A50h]@47
- unsigned int v116; // [sp+A0h] [bp-A4Ch]@47
- int v117; // [sp+A4h] [bp-A48h]@10
- int v118; // [sp+A8h] [bp-A44h]@63
- double v119; // [sp+ACh] [bp-A40h]@20
- unsigned __int64 v120; // [sp+B4h] [bp-A38h]@55
- unsigned __int64 v121; // [sp+BCh] [bp-A30h]@55
- void *Src; // [sp+C4h] [bp-A28h]@40
- char v123; // [sp+DCh] [bp-A10h]@127
- char DstBuf; // [sp+2DCh] [bp-810h]@97
- char Format; // [sp+4DCh] [bp-610h]@82
- char OutputString; // [sp+6DCh] [bp-410h]@71
- char v127; // [sp+8DCh] [bp-210h]@123
- int v128; // [sp+AE8h] [bp-4h]@10
- sub_18D9940(a1);
- sub_18E3CA0(a1);
- *(_DWORD *)(a1 + 8) = 0;
- *(_DWORD *)(a1 + 12) = 0;
- *(_DWORD *)(a1 + 16) = 15;
- *(_DWORD *)(a1 + 20) = 0;
- *(_DWORD *)(a1 + 36) = -1;
- v101 = a1 + 40;
- sub_18E3CA0(a1 + 40);
- sub_18E4040(a1 + 40, (char *)L"Image file load failed");
- if ( !a3 || a4 < 1 )
- return 0;
- v108 = 36;
- if ( !sub_8AA8B0(a3, a4, (int)&v108) )
- {
- v75 = (char *)L"crnd_get_texture_info() failed";
- LABEL_5:
- sub_18E4040(a1 + 40, v75);
- return 0;
- }
- v5 = sub_89F990(v114);
- v96 = v5;
- if ( !v5 )
- {
- v75 = (char *)L"Unsupported DXT format";
- goto LABEL_5;
- }
- v117 = sub_40CE90(v5);
- v89 = 0;
- v90 = 0;
- v91 = 0;
- sub_40F630(v6, (int)&v89, v112);
- v128 = 0;
- v7 = v112;
- v8 = 0;
- if ( (unsigned int)v112 > 0 )
- {
- v9 = v89;
- v10 = v111;
- do
- {
- sub_410E30(v7, v9, v10);
- v10 = v111;
- for ( i = 0; i < v111; ++i )
- {
- v92 = 24;
- v12 = off_1FF05B0(0, 24, &v92, 1, dword_20B8AC4);
- if ( v12 && (unsigned int)v92 >= 0x18 )
- {
- *(_DWORD *)v12 = 0;
- *(_DWORD *)(v12 + 4) = 0;
- *(_DWORD *)(v12 + 8) = 15;
- *(_DWORD *)(v12 + 12) = 0;
- *(_DWORD *)(v12 + 16) = 0;
- *(_DWORD *)(v12 + 20) = 0;
- }
- else
- {
- sub_18E4870((int)"crnlib_malloc: out of memory");
- v12 = 0;
- }
- *(_DWORD *)(*(_DWORD *)v9 + 4 * i) = v12;
- v10 = v111;
- }
- v7 = v112;
- ++v8;
- v9 += 12;
- }
- while ( v8 < v112 );
- }
- Memory = 0;
- v99 = 0;
- v100 = 0;
- LOBYTE(v128) = 1;
- sub_40E300(v7, (int)&Memory, v7 * ((v109 + 3) >> 2) * ((v110 + 3) >> 2) * v113);
- sub_18E4040(v101, (char *)L"CRN unpack failed");
- v105 &= 0xFCu;
- PerformanceCount = 0i64;
- v103 = 0;
- v104 = 0;
- if ( 0.0 == dbl_20B9570 )
- sub_18C8E50();
- QueryPerformanceCounter(&PerformanceCount);
- v105 = v105 & 0xFD | 1;
- v13 = sub_8C2450_crunch_freesmth(a3, a4);
- v92 = v13;
- v119 = sub_18C8F40((int)&PerformanceCount) + 0.0;
- if ( !v13 )
- {
- if ( v90 > 0 )
- {
- v14 = v89 + 4;
- v92 = v90;
- do
- {
- v15 = 0;
- if ( *(_DWORD *)v14 > 0u )
- {
- do
- {
- v16 = *(_DWORD *)(*(_DWORD *)(v14 - 4) + 4 * v15);
- if ( v16 )
- {
- sub_411CF0(*(void **)(v16 + 16));
- sub_411D50(*(void **)(v16 + 20));
- if ( v16 & 7 )
- sub_18E4870((int)"crnlib_free: bad ptr");
- else
- off_1FF05B0(v16, 0, 0, 1, dword_20B8AC4);
- }
- ++v15;
- }
- while ( v15 < *(_DWORD *)v14 );
- }
- v14 += 12;
- --v92;
- }
- while ( v92 );
- }
- LOBYTE(v128) = 0;
- if ( Memory )
- {
- if ( (unsigned __int8)Memory & 7 )
- sub_18E4870((int)"crnlib_free: bad ptr");
- else
- off_1FF05B0(Memory, 0, 0, 1, dword_20B8AC4);
- }
- v128 = -1;
- v17 = v89;
- if ( v89 )
- {
- sub_40FBA0(v90, v89);
- if ( v17 & 7 )
- sub_18E4870((int)"crnlib_free: bad ptr");
- else
- off_1FF05B0(v17, 0, 0, 1, dword_20B8AC4);
- }
- return 0;
- }
- v18 = v112;
- v95 = 0;
- if ( (unsigned int)v112 < 6 )
- memset(&Src + v112, 0, 4 * (6 - v112));
- v81 = 0;
- if ( v111 > 0 )
- {
- while ( 1 )
- {
- v19 = v109 >> v81;
- if ( v109 >> v81 < 1 )
- v19 = 1;
- v76 = v19;
- if ( v110 >> v81 >= 1 )
- {
- v20 = v110 >> v81;
- v93 = v110 >> v81;
- }
- else
- {
- v20 = 1;
- v93 = 1;
- }
- v21 = (v19 + 3) >> 2;
- v22 = v113 * v21;
- v115 = (v20 + 3) >> 2;
- v23 = v115 * v113 * v21;
- v95 += 16 * v18 * v21 * v115;
- v116 = v21;
- QueryPerformanceCounter(&PerformanceCount);
- v24 = v112;
- v25 = 0;
- v105 = v105 & 0xFD | 1;
- if ( v112 )
- {
- v26 = Memory;
- do
- {
- *(&Src + v25++) = v26;
- v26 = (char *)v26 + v23;
- }
- while ( v25 < v24 );
- }
- v27 = v22;
- v28 = v92;
- if ( !sub_8B02E0(v92, (int)&Src, v99, v27, v81) )
- {
- sub_8C24B0(v28);
- if ( v90 )
- {
- v82 = v89 + 4;
- v93 = v90;
- do
- {
- v87 = 0;
- if ( *(_DWORD *)v82 )
- {
- do
- {
- v58 = *(_DWORD *)(*(_DWORD *)(v82 - 4) + 4 * v87);
- v84 = v58;
- if ( v58 )
- {
- v59 = *(_DWORD *)(v58 + 16);
- v77 = v59;
- if ( v59 )
- {
- v60 = *(_DWORD *)(v59 + 24);
- if ( v60 )
- {
- if ( v60 & 7 )
- {
- sprintf_s(
- &DstBuf,
- 0x200u,
- "%s(%u): Assertion failed: \"%s\"\n",
- ".\\crn_mem.cpp",
- 130,
- "crnlib_free: bad ptr");
- OutputDebugStringA(&DstBuf);
- printf(&DstBuf);
- if ( IsDebuggerPresent() )
- DebugBreak();
- }
- else
- {
- off_1FF05B0(v60, 0, 0, 1, dword_20B8AC4);
- }
- }
- if ( v77 & 7 )
- {
- sprintf_s(
- &Format,
- 0x200u,
- "%s(%u): Assertion failed: \"%s\"\n",
- ".\\crn_mem.cpp",
- 130,
- "crnlib_free: bad ptr");
- OutputDebugStringA(&Format);
- printf(&Format);
- if ( IsDebuggerPresent() )
- DebugBreak();
- }
- else
- {
- off_1FF05B0(v77, 0, 0, 1, dword_20B8AC4);
- }
- }
- v61 = *(_DWORD *)(v84 + 20);
- v78 = v61;
- if ( v61 )
- {
- v62 = *(_DWORD *)v61;
- if ( v62 )
- {
- if ( v62 & 7 )
- {
- sprintf_s(
- &OutputString,
- 0x200u,
- "%s(%u): Assertion failed: \"%s\"\n",
- ".\\crn_mem.cpp",
- 130,
- "crnlib_free: bad ptr");
- OutputDebugStringA(&OutputString);
- printf(&OutputString);
- if ( IsDebuggerPresent() )
- DebugBreak();
- }
- else
- {
- off_1FF05B0(v62, 0, 0, 1, dword_20B8AC4);
- }
- }
- if ( v78 & 7 )
- {
- sprintf_s(
- &v127,
- 0x200u,
- "%s(%u): Assertion failed: \"%s\"\n",
- ".\\crn_mem.cpp",
- 130,
- "crnlib_free: bad ptr");
- OutputDebugStringA(&v127);
- printf(&v127);
- if ( IsDebuggerPresent() )
- DebugBreak();
- }
- else
- {
- off_1FF05B0(v78, 0, 0, 1, dword_20B8AC4);
- }
- }
- if ( v84 & 7 )
- {
- sprintf_s(
- &v123,
- 0x200u,
- "%s(%u): Assertion failed: \"%s\"\n",
- ".\\crn_mem.cpp",
- 130,
- "crnlib_free: bad ptr");
- OutputDebugStringA(&v123);
- printf(&v123);
- if ( IsDebuggerPresent() )
- DebugBreak();
- }
- else
- {
- off_1FF05B0(v84, 0, 0, 1, dword_20B8AC4);
- }
- }
- ++v87;
- }
- while ( v87 < *(_DWORD *)v82 );
- }
- v82 += 12;
- --v93;
- }
- while ( v93 );
- }
- LOBYTE(v128) = 0;
- if ( Memory )
- {
- if ( (unsigned __int8)Memory & 7 )
- {
- sprintf_s(
- &v123,
- 0x200u,
- "%s(%u): Assertion failed: \"%s\"\n",
- ".\\crn_mem.cpp",
- 130,
- "crnlib_free: bad ptr");
- OutputDebugStringA(&v123);
- printf(&v123);
- if ( IsDebuggerPresent() )
- DebugBreak();
- }
- else
- {
- off_1FF05B0(Memory, 0, 0, 1, dword_20B8AC4);
- }
- }
- v128 = -1;
- if ( v89 )
- {
- sub_40FBA0(v90, v89);
- if ( v89 & 7 )
- {
- sprintf_s(
- &v123,
- 0x200u,
- "%s(%u): Assertion failed: \"%s\"\n",
- ".\\crn_mem.cpp",
- 130,
- "crnlib_free: bad ptr");
- OutputDebugStringA(&v123);
- printf(&v123);
- if ( IsDebuggerPresent() )
- DebugBreak();
- }
- else
- {
- off_1FF05B0(v89, 0, 0, 1, dword_20B8AC4);
- }
- }
- return 0;
- }
- if ( v105 & 1 )
- {
- v30 = v103;
- v31 = v104;
- v106 = v103;
- v107 = v104;
- if ( !(v105 & 2) )
- {
- QueryPerformanceCounter((LARGE_INTEGER *)&v106);
- v31 = v107;
- v30 = v106;
- }
- v121 = (__PAIR__(v31, v30) - *(_QWORD *)&PerformanceCount) & 0x8000000000000000ui64;
- v120 = (__PAIR__(v31, v30) - *(_QWORD *)&PerformanceCount) & 0x7FFFFFFFFFFFFFFFi64;
- v29 = (double)(__PAIR__(v31, v30) - *(_QWORD *)&PerformanceCount) * dbl_20B9570;
- }
- else
- {
- v29 = 0.0;
- }
- v18 = v112;
- v86 = 0;
- v119 = v29 + v119;
- if ( v112 )
- break;
- LABEL_87:
- ++v81;
- if ( v81 >= v111 )
- goto LABEL_88;
- }
- v83 = v89;
- while ( 1 )
- {
- v32 = sub_411DB0();
- v33 = *(&Src + v86);
- v34 = v116 * v115 * (v113 >> 3);
- v35 = v32;
- if ( !sub_18D8270(v32, v117, v76, v93) )
- {
- v57 = 0;
- goto LABEL_143;
- }
- v37 = *(_DWORD *)(v35 + 36);
- if ( v34 != v37 )
- break;
- v38 = *(_DWORD *)(v35 + 4);
- if ( v37 != v38 )
- {
- if ( v37 >= v38 && (unsigned int)v37 > *(_DWORD *)(v35 + 8) )
- {
- LOBYTE(v36) = v37 == v38 + 1;
- LOBYTE(v118) = v37 == v38 + 1;
- sub_18E7930(v37, v36, 0, v35, v37 == v38 + 1, 8u, 0);
- }
- *(_DWORD *)(v35 + 4) = v37;
- }
- v39 = 8 * *(_DWORD *)(v35 + 36);
- v40 = *(void **)v35;
- *(_DWORD *)(v35 + 12) = *(_DWORD *)v35;
- memcpy(v40, v33, v39);
- v41 = *(_DWORD *)(*(_DWORD *)v83 + 4 * v81);
- v42 = *(_DWORD *)(v41 + 16);
- *(_DWORD *)v41 = 0;
- *(_DWORD *)(v41 + 4) = 0;
- *(_DWORD *)(v41 + 8) = 15;
- *(_DWORD *)(v41 + 12) = 0;
- v94 = v42;
- if ( v42 )
- {
- v43 = *(_DWORD *)(v42 + 24);
- if ( v43 )
- {
- if ( v43 & 7 )
- sub_18E4870((int)"crnlib_free: bad ptr");
- else
- off_1FF05B0(v43, 0, 0, 1, dword_20B8AC4);
- }
- if ( v94 & 7 )
- {
- sprintf_s(
- &OutputString,
- 0x200u,
- "%s(%u): Assertion failed: \"%s\"\n",
- ".\\crn_mem.cpp",
- 130,
- "crnlib_free: bad ptr");
- OutputDebugStringA(&OutputString);
- printf(&OutputString);
- if ( IsDebuggerPresent() )
- DebugBreak();
- }
- else
- {
- off_1FF05B0(v94, 0, 0, 1, dword_20B8AC4);
- }
- *(_DWORD *)(v41 + 16) = 0;
- }
- v44 = *(_DWORD *)(v41 + 20);
- v94 = v44;
- if ( v44 )
- {
- v45 = *(_DWORD *)v44;
- if ( *(_DWORD *)v44 )
- {
- if ( v45 & 7 )
- sub_18E4870((int)"crnlib_free: bad ptr");
- else
- off_1FF05B0(v45, 0, 0, 1, dword_20B8AC4);
- LOBYTE(v44) = v94;
- }
- if ( v44 & 7 )
- {
- sprintf_s(
- &Format,
- 0x200u,
- "%s(%u): Assertion failed: \"%s\"\n",
- ".\\crn_mem.cpp",
- 130,
- "crnlib_free: bad ptr");
- OutputDebugStringA(&Format);
- printf(&Format);
- if ( IsDebuggerPresent() )
- DebugBreak();
- }
- else
- {
- off_1FF05B0(v94, 0, 0, 1, dword_20B8AC4);
- }
- *(_DWORD *)(v41 + 20) = 0;
- }
- *(_DWORD *)(v41 + 20) = v35;
- *(_DWORD *)v41 = *(_DWORD *)(v35 + 16);
- v46 = v96;
- *(_DWORD *)(v41 + 4) = *(_DWORD *)(v35 + 20);
- *(_DWORD *)(v41 + 12) = v46;
- v83 += 12;
- *(_DWORD *)(v41 + 8) = sub_18E11D0(v46);
- v18 = v112;
- ++v86;
- if ( v86 >= v112 )
- goto LABEL_87;
- }
- v56 = *(void **)v35;
- v57 = 0;
- if ( *(_DWORD *)v35 )
- {
- if ( (unsigned __int8)v56 & 7 )
- {
- sprintf_s(&DstBuf, 0x200u, "%s(%u): Assertion failed: \"%s\"\n", ".\\crn_mem.cpp", 130, "crnlib_free: bad ptr");
- OutputDebugStringA(&DstBuf);
- printf(&DstBuf);
- if ( IsDebuggerPresent() )
- DebugBreak();
- }
- else
- {
- off_1FF05B0(v56, 0, 0, 1, dword_20B8AC4);
- }
- v57 = 0;
- *(_DWORD *)v35 = 0;
- *(_DWORD *)(v35 + 4) = 0;
- *(_DWORD *)(v35 + 8) = 0;
- }
- *(_DWORD *)(v35 + 16) = v57;
- *(_DWORD *)(v35 + 20) = v57;
- *(_DWORD *)(v35 + 24) = v57;
- *(_DWORD *)(v35 + 28) = v57;
- *(_DWORD *)(v35 + 40) = v57;
- *(_DWORD *)(v35 + 44) = v57;
- *(_DWORD *)(v35 + 60) = -1;
- *(_DWORD *)(v35 + 52) = v57;
- *(_DWORD *)(v35 + 56) = v57;
- *(_WORD *)(v35 + 48) = 0;
- *(_DWORD *)(v35 + 32) = v57;
- *(_DWORD *)(v35 + 36) = v57;
- *(_DWORD *)(v35 + 12) = v57;
- LABEL_143:
- if ( v35 != v57 )
- {
- v63 = *(void **)v35;
- if ( *(_DWORD *)v35 )
- {
- if ( (unsigned __int8)v63 & 7 )
- sub_18E4870((int)"crnlib_free: bad ptr");
- else
- off_1FF05B0(v63, 0, 0, 1, dword_20B8AC4);
- }
- if ( v35 & 7 )
- {
- sprintf_s(&v123, 0x200u, "%s(%u): Assertion failed: \"%s\"\n", ".\\crn_mem.cpp", 130, "crnlib_free: bad ptr");
- OutputDebugStringA(&v123);
- printf(&v123);
- if ( IsDebuggerPresent() )
- DebugBreak();
- }
- else
- {
- off_1FF05B0(v35, 0, 0, 1, dword_20B8AC4);
- }
- }
- sub_8C24B0(v92);
- if ( v90 )
- {
- v88 = v89 + 4;
- v95 = v90;
- do
- {
- v64 = v88;
- v65 = 0;
- v93 = 0;
- if ( *(_DWORD *)v88 )
- {
- do
- {
- v66 = *(_DWORD *)(*(_DWORD *)(v64 - 4) + 4 * v65);
- v85 = v66;
- if ( v66 )
- {
- v67 = *(_DWORD *)(v66 + 16);
- v79 = v67;
- if ( v67 )
- {
- v68 = *(_DWORD *)(v67 + 24);
- if ( v68 )
- {
- if ( v68 & 7 )
- {
- sprintf_s(
- &v123,
- 0x200u,
- "%s(%u): Assertion failed: \"%s\"\n",
- ".\\crn_mem.cpp",
- 130,
- "crnlib_free: bad ptr");
- OutputDebugStringA(&v123);
- printf(&v123);
- if ( IsDebuggerPresent() )
- DebugBreak();
- }
- else
- {
- off_1FF05B0(v68, 0, 0, 1, dword_20B8AC4);
- }
- }
- if ( v79 & 7 )
- {
- sprintf_s(
- &v127,
- 0x200u,
- "%s(%u): Assertion failed: \"%s\"\n",
- ".\\crn_mem.cpp",
- 130,
- "crnlib_free: bad ptr");
- OutputDebugStringA(&v127);
- printf(&v127);
- if ( IsDebuggerPresent() )
- DebugBreak();
- }
- else
- {
- off_1FF05B0(v79, 0, 0, 1, dword_20B8AC4);
- }
- }
- v69 = *(_DWORD *)(v85 + 20);
- v80 = v69;
- if ( v69 )
- {
- v70 = *(_DWORD *)v69;
- if ( v70 )
- {
- if ( v70 & 7 )
- {
- sprintf_s(
- &DstBuf,
- 0x200u,
- "%s(%u): Assertion failed: \"%s\"\n",
- ".\\crn_mem.cpp",
- 130,
- "crnlib_free: bad ptr");
- OutputDebugStringA(&DstBuf);
- printf(&DstBuf);
- if ( IsDebuggerPresent() )
- DebugBreak();
- }
- else
- {
- off_1FF05B0(v70, 0, 0, 1, dword_20B8AC4);
- }
- }
- if ( v80 & 7 )
- {
- sprintf_s(
- &Format,
- 0x200u,
- "%s(%u): Assertion failed: \"%s\"\n",
- ".\\crn_mem.cpp",
- 130,
- "crnlib_free: bad ptr");
- OutputDebugStringA(&Format);
- printf(&Format);
- if ( IsDebuggerPresent() )
- DebugBreak();
- }
- else
- {
- off_1FF05B0(v80, 0, 0, 1, dword_20B8AC4);
- }
- }
- if ( v85 & 7 )
- {
- sprintf_s(
- &OutputString,
- 0x200u,
- "%s(%u): Assertion failed: \"%s\"\n",
- ".\\crn_mem.cpp",
- 130,
- "crnlib_free: bad ptr");
- OutputDebugStringA(&OutputString);
- printf(&OutputString);
- if ( IsDebuggerPresent() )
- DebugBreak();
- }
- else
- {
- off_1FF05B0(v85, 0, 0, 1, dword_20B8AC4);
- }
- }
- v64 = v88;
- v65 = v93 + 1;
- v93 = v65;
- }
- while ( (unsigned int)v65 < *(_DWORD *)v88 );
- }
- v71 = v95-- == 1;
- v88 = v64 + 12;
- }
- while ( !v71 );
- }
- LOBYTE(v128) = 0;
- if ( Memory )
- {
- if ( (unsigned __int8)Memory & 7 )
- {
- sprintf_s(&v123, 0x200u, "%s(%u): Assertion failed: \"%s\"\n", ".\\crn_mem.cpp", 130, "crnlib_free: bad ptr");
- OutputDebugStringA(&v123);
- printf(&v123);
- if ( IsDebuggerPresent() )
- DebugBreak();
- }
- else
- {
- off_1FF05B0(Memory, 0, 0, 1, dword_20B8AC4);
- }
- }
- v128 = -1;
- if ( v89 )
- {
- sub_40FBA0(v90, v89);
- if ( v89 & 7 )
- {
- sprintf_s(&v123, 0x200u, "%s(%u): Assertion failed: \"%s\"\n", ".\\crn_mem.cpp", 130, "crnlib_free: bad ptr");
- OutputDebugStringA(&v123);
- printf(&v123);
- if ( IsDebuggerPresent() )
- DebugBreak();
- }
- else
- {
- off_1FF05B0(v89, 0, 0, 1, dword_20B8AC4);
- }
- }
- return 0;
- }
- LABEL_88:
- sub_8C24B0(v92);
- v47 = v90;
- if ( v90 )
- {
- sub_18D9940(a1);
- v48 = v89;
- v49 = **(_DWORD **)v89;
- *(_DWORD *)(a1 + 8) = *(_DWORD *)v49;
- *(_DWORD *)(a1 + 12) = *(_DWORD *)(v49 + 4);
- *(_DWORD *)(a1 + 16) = *(_DWORD *)(v49 + 8);
- *(_DWORD *)(a1 + 20) = *(_DWORD *)(v49 + 12);
- v50 = *(_DWORD *)(a1 + 24);
- *(_DWORD *)(a1 + 24) = v48;
- v51 = v91;
- v89 = v50;
- v52 = *(_DWORD *)(a1 + 28);
- *(_DWORD *)(a1 + 28) = v47;
- v47 = v52;
- v53 = *(_DWORD *)(a1 + 32);
- v90 = v47;
- *(_DWORD *)(a1 + 32) = v51;
- v91 = v53;
- }
- v54 = v89;
- v96 = 0;
- v97 = 0;
- sub_18E4040((int)&v96, a2);
- LOBYTE(v128) = 2;
- sub_18E3F90(a1, (int)&v96);
- LOBYTE(v128) = 1;
- if ( v97 )
- {
- v55 = v97 - 8;
- if ( *(_DWORD *)(v97 - 4) == ~*(_DWORD *)(v97 - 8) )
- {
- if ( v97 != 8 )
- {
- if ( v55 & 7 )
- sub_18E4870((int)"crnlib_free: bad ptr");
- else
- off_1FF05B0(v55, 0, 0, 1, dword_20B8AC4);
- }
- }
- }
- *(_DWORD *)(a1 + 36) = 13;
- v72 = v101;
- v73 = *(_DWORD *)(v101 + 4);
- if ( v73 )
- {
- v74 = v73 - 8;
- if ( *(_DWORD *)(v73 - 4) == ~*(_DWORD *)(v73 - 8) && v73 != 8 )
- {
- if ( v74 & 7 )
- sub_18E4870((int)"crnlib_free: bad ptr");
- else
- off_1FF05B0(v74, 0, 0, 1, dword_20B8AC4);
- }
- *(_DWORD *)(v72 + 4) = 0;
- *(_WORD *)(v72 + 2) = 0;
- *(_WORD *)v72 = 0;
- }
- LOBYTE(v128) = 0;
- if ( Memory )
- {
- if ( (unsigned __int8)Memory & 7 )
- sub_18E4870((int)"crnlib_free: bad ptr");
- else
- off_1FF05B0(Memory, 0, 0, 1, dword_20B8AC4);
- }
- v128 = -1;
- if ( v54 )
- {
- sub_40FBA0(v47, v54);
- if ( v54 & 7 )
- {
- sub_18E4870((int)"crnlib_free: bad ptr");
- return 1;
- }
- off_1FF05B0(v54, 0, 0, 1, dword_20B8AC4);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement