filename
stringlengths 3
146
| content
stringlengths 25
24.6k
| from
stringclasses 1
value |
---|---|---|
_sopen_helper | __int64 __fastcall sopen_helper(const CHAR *a1, int a2, int a3, int a4, int *a5, int a6)
{
int v7; // eax
unsigned int v8; // edi
__int64 v9; // rax
int v10[6]; // [rsp+40h] [rbp-18h] BYREF
v10[0] = 0;
if ( a5 && (*a5 = -1, a1) && (!a6 || (a4 & 0xFFFFFE7F) == 0) )
{
v7 = tsopen_nolock(v10, a5, a1, a2, a3, a4);
v8 = v7;
v10[1] = v7;
if ( v10[0] )
{
if ( v7 )
{
v9 = qword_140286BA0[(__int64)*a5 >> 5];
*(_BYTE *)(v9 + 88i64 * (*a5 & 0x1F) + 8) &= ~1u;
}
unlock_fhandle((unsigned int)*a5);
}
if ( v8 )
*a5 = -1;
return v8;
}
else
{
*errno() = 22;
invalid_parameter(0i64, 0i64, 0i64, 0, 0i64);
return 22i64;
}
}
| openssl |
_sopen_helper_0 | __int64 __fastcall sopen_helper_0(const WCHAR *a1, int a2, int a3, int a4, int *a5, int a6)
{
int v7; // eax
unsigned int v8; // edi
__int64 v9; // rax
int v10[6]; // [rsp+40h] [rbp-18h] BYREF
v10[0] = 0;
if ( a5 && (*a5 = -1, a1) && (!a6 || (a4 & 0xFFFFFE7F) == 0) )
{
v7 = tsopen_nolock_0(v10, a5, a1, a2, a3, a4);
v8 = v7;
v10[1] = v7;
if ( v10[0] )
{
if ( v7 )
{
v9 = qword_140286BA0[(__int64)*a5 >> 5];
*(_BYTE *)(v9 + 88i64 * (*a5 & 0x1F) + 8) &= ~1u;
}
unlock_fhandle(*a5);
}
if ( v8 )
*a5 = -1;
return v8;
}
else
{
*errno() = 22;
invalid_parameter(0i64, 0i64, 0i64, 0, 0i64);
return 22i64;
}
}
| openssl |
_sopen_s | errno_t __cdecl sopen_s(int *FileHandle, const char *FileName, int OpenFlag, int ShareFlag, int PermissionMode)
{
return sopen_helper(FileName, OpenFlag, ShareFlag, PermissionMode, FileHandle, 1);
}
| openssl |
_sopen_s_0 | // 3
errno_t __cdecl sopen_s_0(int *FileHandle, const char *FileName, int OpenFlag, int ShareFlag, int PermissionMode)
{
return sopen_helper_0((const WCHAR *)FileName, OpenFlag, ShareFlag, PermissionMode, FileHandle, 1);
}
| openssl |
_stat64i32_0 | int __cdecl stat64i32_0(const char *Name, struct _stat64i32 *Stat)
{
int v4; // r13d
HANDLE FirstFileA; // rdi
char *v6; // rbp
int v7; // r12d
char *v8; // rdi
char v9; // al
char v10; // al
_BYTE *v11; // rax
char v12; // cl
char *v13; // rax
char v14; // cl
__time64_t v15; // rax
int v16; // ebx
__int64 st_mtime; // rax
__int64 v19; // rax
unsigned __int16 v20; // ax
DWORD nFileSizeLow; // eax
int LastError; // eax
struct _SYSTEMTIME SystemTime; // [rsp+40h] [rbp-2B8h] BYREF
struct _FILETIME LocalFileTime; // [rsp+50h] [rbp-2A8h] BYREF
struct _WIN32_FIND_DATAA FindFileData; // [rsp+60h] [rbp-298h] BYREF
char Buffer[272]; // [rsp+1A0h] [rbp-158h] BYREF
if ( Name && Stat )
{
if ( mbspbrk((const unsigned __int8 *)Name, &byte_14025955C) )
{
LABEL_5:
*errno() = 2;
*_doserrno() = 2;
return -1;
}
if ( Name[1] == 58 )
{
if ( *Name && !Name[2] )
goto LABEL_5;
v4 = mbctolower(*Name) - 96;
}
else
{
v4 = getdrive();
}
FirstFileA = FindFirstFileA(Name, &FindFileData);
if ( FirstFileA == (HANDLE)-1i64 )
{
v6 = 0i64;
if ( !mbspbrk((const unsigned __int8 *)Name, &byte_140259558) )
goto LABEL_5;
v7 = *errno();
*errno() = 0;
v8 = fullpath(Buffer, Name, 0x104ui64);
if ( v8 )
{
*errno() = v7;
}
else
{
if ( *errno() != 34 )
goto LABEL_5;
*errno() = v7;
v6 = fullpath(0i64, Name, 0i64);
v8 = v6;
}
if ( !v8 )
goto LABEL_42;
if ( strlen(v8) != 3 )
{
if ( strlen(v8) < 5 || *v8 != 92 && *v8 != 47 )
goto LABEL_42;
v9 = v8[1];
if ( v9 != 92 && v9 != 47 )
goto LABEL_42;
v10 = v8[2];
if ( v10 == 92 )
goto LABEL_42;
if ( v10 == 47 )
goto LABEL_42;
v11 = v8 + 3;
v12 = v8[3];
if ( !v12 )
goto LABEL_42;
do
{
if ( v12 == 92 )
break;
if ( v12 == 47 )
break;
v12 = *++v11;
}
while ( *v11 );
if ( !*v11 )
goto LABEL_42;
v13 = v11 + 1;
if ( !*v13 )
goto LABEL_42;
v14 = *v13;
if ( *v13 )
{
do
{
if ( v14 == 92 )
break;
if ( v14 == 47 )
break;
v14 = *++v13;
}
while ( *v13 );
if ( *v13 && v13[1] )
goto LABEL_42;
}
}
if ( GetDriveTypeA(v8) <= 1 )
{
LABEL_42:
if ( v6 )
free(v6);
goto LABEL_5;
}
if ( v6 )
free(v6);
FindFileData.dwFileAttributes = 16;
FindFileData.nFileSizeHigh = 0;
FindFileData.nFileSizeLow = 0;
FindFileData.cFileName[0] = 0;
v15 = _loctotime64_t(1980, 1, 1, 0, 0, 0, -1);
Stat->st_mtime = v15;
Stat->st_atime = v15;
Stat->st_ctime = v15;
LABEL_68:
v20 = _dtoxmode(FindFileData.dwFileAttributes, Name);
Stat->st_nlink = 1;
Stat->st_ino = 0;
Stat->st_mode = v20;
nFileSizeLow = FindFileData.nFileSizeLow;
Stat->st_gid = 0;
Stat->st_size = nFileSizeLow;
Stat->st_uid = 0;
Stat->st_dev = v4 - 1;
Stat->st_rdev = v4 - 1;
return 0;
}
if ( _bittest((const signed __int32 *)&FindFileData, 0xAu) && FindFileData.dwReserved0 == -1610612724 )
{
LocalFileTime.dwLowDateTime = -1;
if ( !sopen_s((int *)&LocalFileTime, Name, 0, 64, 0) && LocalFileTime.dwLowDateTime != -1 )
{
v16 = fstat64i32(LocalFileTime.dwLowDateTime, Stat);
close(LocalFileTime.dwLowDateTime);
return v16;
}
goto LABEL_5;
}
if ( FindFileData.ftLastWriteTime.dwLowDateTime || FindFileData.ftLastWriteTime.dwHighDateTime )
{
if ( !FileTimeToLocalFileTime(&FindFileData.ftLastWriteTime, &LocalFileTime)
|| !FileTimeToSystemTime(&LocalFileTime, &SystemTime) )
{
goto LABEL_69;
}
Stat->st_mtime = _loctotime64_t(
SystemTime.wYear,
SystemTime.wMonth,
SystemTime.wDay,
SystemTime.wHour,
SystemTime.wMinute,
SystemTime.wSecond,
-1);
}
else
{
Stat->st_mtime = 0i64;
}
if ( FindFileData.ftLastAccessTime.dwLowDateTime || FindFileData.ftLastAccessTime.dwHighDateTime )
{
if ( !FileTimeToLocalFileTime(&FindFileData.ftLastAccessTime, &LocalFileTime)
|| !FileTimeToSystemTime(&LocalFileTime, &SystemTime) )
{
goto LABEL_69;
}
st_mtime = _loctotime64_t(
SystemTime.wYear,
SystemTime.wMonth,
SystemTime.wDay,
SystemTime.wHour,
SystemTime.wMinute,
SystemTime.wSecond,
-1);
}
else
{
st_mtime = Stat->st_mtime;
}
Stat->st_atime = st_mtime;
if ( !FindFileData.ftCreationTime.dwLowDateTime && !FindFileData.ftCreationTime.dwHighDateTime )
{
v19 = Stat->st_mtime;
LABEL_67:
Stat->st_ctime = v19;
FindClose(FirstFileA);
goto LABEL_68;
}
if ( FileTimeToLocalFileTime(&FindFileData.ftCreationTime, &LocalFileTime)
&& FileTimeToSystemTime(&LocalFileTime, &SystemTime) )
{
v19 = _loctotime64_t(
SystemTime.wYear,
SystemTime.wMonth,
SystemTime.wDay,
SystemTime.wHour,
SystemTime.wMinute,
SystemTime.wSecond,
-1);
goto LABEL_67;
}
LABEL_69:
LastError = GetLastError();
dosmaperr(LastError);
FindClose(FirstFileA);
return -1;
}
*_doserrno() = 0;
*errno() = 22;
invalid_parameter(0i64, 0i64, 0i64, 0, 0i64);
return -1;
}
| openssl |
_stbuf | __int64 __fastcall stbuf(FILE *a1)
{
int v2; // eax
int v3; // eax
__int64 v4; // rdi
void *v5; // rax
char *v6; // rcx
v2 = fileno(a1);
if ( !isatty(v2) )
return 0i64;
if ( a1 == (FILE *)((char *)sub_1401A2D78() + 48) )
{
v3 = 0;
}
else
{
if ( a1 != (FILE *)((char *)sub_1401A2D78() + 96) )
return 0i64;
v3 = 1;
}
++dword_140285510;
if ( (a1->_flag & 0x10C) != 0 )
return 0i64;
v4 = v3;
if ( qword_140285ED0[v3] || (v5 = malloc_crt(0x1000ui64), (qword_140285ED0[v4] = v5) != 0i64) )
{
v6 = (char *)qword_140285ED0[v4];
a1->_bufsiz = 4096;
a1->_cnt = 4096;
a1->_base = v6;
a1->_ptr = v6;
}
else
{
a1->_base = (char *)&a1->_charbuf;
a1->_ptr = (char *)&a1->_charbuf;
a1->_bufsiz = 2;
a1->_cnt = 2;
}
a1->_flag |= 0x1102u;
return 1i64;
}
| openssl |
_strdup | char *__cdecl strdup(const char *Source)
{
size_t v2; // rsi
char *v3; // rax
char *v4; // rdi
if ( !Source )
return 0i64;
v2 = strlen(Source);
v3 = (char *)malloc(v2 + 1);
v4 = v3;
if ( !v3 )
return 0i64;
if ( strcpy_s(v3, v2 + 1, Source) )
invoke_watson(0i64, 0i64, 0i64, 0, 0i64);
return v4;
}
| openssl |
_stricmp | int __cdecl stricmp(const char *String1, const char *String2)
{
if ( dword_1402856E8 )
return stricmp_l(String1, String2, 0i64);
if ( String1 && String2 )
return _ascii_stricmp((unsigned __int8 *)String1, (unsigned __int8 *)String2);
*errno() = 22;
invalid_parameter(0i64, 0i64, 0i64, 0, 0i64);
return 0x7FFFFFFF;
}
| openssl |
_stricmp_l | int __cdecl stricmp_l(const char *String1, const char *String2, _locale_t Locale)
{
int result; // eax
int v6; // ebx
int v7; // eax
int v8; // ebx
__crt_locale_pointers Localea; // [rsp+30h] [rbp-28h] BYREF
__int64 v10; // [rsp+40h] [rbp-18h]
char v11; // [rsp+48h] [rbp-10h]
_LocaleUpdate::_LocaleUpdate((_LocaleUpdate *)&Localea, (const __m128i *)Locale);
if ( String1 && String2 )
{
if ( *((_DWORD *)Localea.locinfo + 5) )
{
do
{
v6 = tolower_l(*(unsigned __int8 *)String1++, &Localea);
v7 = tolower_l(*(unsigned __int8 *)String2++, &Localea);
}
while ( v6 && v6 == v7 );
v8 = v6 - v7;
if ( v11 )
*(_DWORD *)(v10 + 200) &= ~2u;
return v8;
}
else
{
result = _ascii_stricmp((unsigned __int8 *)String1, (unsigned __int8 *)String2);
if ( v11 )
*(_DWORD *)(v10 + 200) &= ~2u;
}
}
else
{
*errno() = 22;
invalid_parameter(0i64, 0i64, 0i64, 0, 0i64);
if ( v11 )
*(_DWORD *)(v10 + 200) &= ~2u;
return 0x7FFFFFFF;
}
return result;
}
| openssl |
_strnicmp | int __cdecl strnicmp(const char *String1, const char *String2, size_t MaxCount)
{
if ( dword_1402856E8 )
return strnicmp_l(String1, String2, MaxCount, 0i64);
if ( String1 && String2 && MaxCount <= 0x7FFFFFFF )
return _ascii_strnicmp((unsigned __int8 *)String1, (unsigned __int8 *)String2, MaxCount);
*errno() = 22;
invalid_parameter(0i64, 0i64, 0i64, 0, 0i64);
return 0x7FFFFFFF;
}
| openssl |
_strnicmp_l | int __cdecl strnicmp_l(const char *String1, const char *String2, size_t MaxCount, _locale_t Locale)
{
unsigned __int64 v4; // rdi
int result; // eax
int v8; // ebx
int v9; // eax
int v10; // ebx
__crt_locale_pointers Localea; // [rsp+30h] [rbp-28h] BYREF
__int64 v12; // [rsp+40h] [rbp-18h]
char v13; // [rsp+48h] [rbp-10h]
v4 = MaxCount;
if ( !MaxCount )
return 0;
_LocaleUpdate::_LocaleUpdate((_LocaleUpdate *)&Localea, (const __m128i *)Locale);
if ( String1 && String2 && v4 <= 0x7FFFFFFF )
{
if ( *((_DWORD *)Localea.locinfo + 5) )
{
do
{
v8 = tolower_l(*(unsigned __int8 *)String1++, &Localea);
v9 = tolower_l(*(unsigned __int8 *)String2++, &Localea);
--v4;
}
while ( v4 && v8 && v8 == v9 );
v10 = v8 - v9;
if ( v13 )
*(_DWORD *)(v12 + 200) &= ~2u;
return v10;
}
else
{
result = _ascii_strnicmp((unsigned __int8 *)String1, (unsigned __int8 *)String2, v4);
if ( v13 )
*(_DWORD *)(v12 + 200) &= ~2u;
}
}
else
{
*errno() = 22;
invalid_parameter(0i64, 0i64, 0i64, 0, 0i64);
if ( v13 )
*(_DWORD *)(v12 + 200) &= ~2u;
return 0x7FFFFFFF;
}
return result;
}
| openssl |
_strnicoll_l | int __cdecl strnicoll_l(const char *String1, const char *String2, size_t MaxCount, _locale_t Locale)
{
int result; // eax
LCID v8; // edx
int v9; // eax
__crt_locale_pointers Localea; // [rsp+40h] [rbp-28h] BYREF
__int64 v11; // [rsp+50h] [rbp-18h]
char v12; // [rsp+58h] [rbp-10h]
_LocaleUpdate::_LocaleUpdate((_LocaleUpdate *)&Localea, (const __m128i *)Locale);
if ( !MaxCount )
{
if ( v12 )
*(_DWORD *)(v11 + 200) &= ~2u;
return 0;
}
if ( String1 && String2 && MaxCount <= 0x7FFFFFFF )
{
v8 = *((_DWORD *)Localea.locinfo + 4);
if ( !v8 )
{
result = strnicmp_l(String1, String2, MaxCount, &Localea);
goto LABEL_17;
}
v9 = _crtCompareStringA(
(const __m128i *)&Localea,
v8,
0x1001u,
(char *)String1,
MaxCount,
(char *)String2,
MaxCount,
*((_DWORD *)Localea.locinfo + 2));
if ( v9 )
{
result = v9 - 2;
LABEL_17:
if ( v12 )
*(_DWORD *)(v11 + 200) &= ~2u;
return result;
}
*errno() = 22;
}
else
{
*errno() = 22;
invalid_parameter(0i64, 0i64, 0i64, 0, 0i64);
}
if ( v12 )
*(_DWORD *)(v11 + 200) &= ~2u;
return 0x7FFFFFFF;
}
| openssl |
_sub_146024C80 | __int64 __fastcall sub_146024C80(__int64 a1)
{
int v1; // edx
v1 = *(_DWORD *)(a1 + 208);
if ( (v1 & 2) != 0 && (*(_BYTE *)(a1 + 212) & 4) == 0 )
return 0i64;
if ( (v1 & 1) != 0 )
return ((unsigned __int8)v1 >> 4) & 1;
if ( (v1 & 0x2040) == 8256 )
return 3i64;
if ( (*(_DWORD *)(a1 + 208) & 2) != 0 )
return 4i64;
if ( (v1 & 8) != 0 && (*(_BYTE *)(a1 + 220) & 7) != 0 )
return 5i64;
else
return 0i64;
}
| openssl |
_sub_1460A50D0 | unsigned __int8 *__fastcall sub_1460A50D0(__int64 a1, unsigned __int8 *a2)
{
unsigned __int8 v2; // r9
__int64 v3; // r10
while ( 1 )
{
v2 = *a2;
if ( *a2 > 0x7Fu )
break;
v3 = *(_QWORD *)(a1 + 8);
if ( ((*(unsigned __int16 *)(v3 + 2i64 * v2) >> 4) & 1) == 0
|| v2 <= 0x7Fu && ((*(unsigned __int16 *)(v3 + 2i64 * v2) >> 3) & 1) != 0 )
{
break;
}
++a2;
}
return a2;
}
| openssl |
_time64 | __time64_t __cdecl time64(__time64_t *Time)
{
signed __int64 v2; // rdx
struct _FILETIME SystemTimeAsFileTime; // [rsp+30h] [rbp+8h] BYREF
GetSystemTimeAsFileTime(&SystemTimeAsFileTime);
v2 = (*(_QWORD *)&SystemTimeAsFileTime - 116444736000000000i64) / 0x989680ui64;
if ( v2 > 0x793406FFFi64 )
v2 = -1i64;
if ( Time )
*Time = v2;
return v2;
}
| openssl |
_tolower_l | int __cdecl tolower_l(int C, _locale_t Locale)
{
__int64 v2; // rdi
struct __crt_locale_data *locinfo; // rdx
int v4; // eax
int result; // eax
int v6; // edx
int *v7; // rax
int v8; // eax
bool v9; // zf
__crt_locale_pointers Localea; // [rsp+50h] [rbp-28h] BYREF
__int64 v11; // [rsp+60h] [rbp-18h]
char v12; // [rsp+68h] [rbp-10h]
char v13; // [rsp+80h] [rbp+8h] BYREF
char v14; // [rsp+81h] [rbp+9h]
char v15; // [rsp+82h] [rbp+Ah]
char v16; // [rsp+90h] [rbp+18h] BYREF
unsigned __int8 v17; // [rsp+91h] [rbp+19h]
v2 = C;
_LocaleUpdate::_LocaleUpdate((_LocaleUpdate *)&Localea, (const __m128i *)Locale);
if ( (unsigned int)v2 >= 0x100 )
{
if ( *((int *)Localea.locinfo + 67) > 1 && isleadbyte_l(BYTE1(v2), &Localea) )
{
v13 = BYTE1(v2);
v14 = v2;
v15 = 0;
v6 = 2;
}
else
{
v7 = errno();
v6 = 1;
*v7 = 42;
v13 = v2;
v14 = 0;
}
v8 = _crtLCMapStringA(
(struct localeinfo_struct *)&Localea,
*((_DWORD *)Localea.locinfo + 5),
0x100u,
&v13,
v6,
&v16,
3,
*((_DWORD *)Localea.locinfo + 1),
1);
if ( v8 )
{
v9 = v8 == 1;
result = (unsigned __int8)v16;
if ( !v9 )
result = v17 | ((unsigned __int8)v16 << 8);
goto LABEL_17;
}
}
else
{
locinfo = Localea.locinfo;
if ( *((int *)Localea.locinfo + 67) <= 1 )
{
v4 = *(_WORD *)(*((_QWORD *)Localea.locinfo + 40) + 2 * v2) & 1;
}
else
{
v4 = isctype_l(v2, 1, &Localea);
locinfo = Localea.locinfo;
}
if ( v4 )
{
result = *(unsigned __int8 *)(*((_QWORD *)locinfo + 41) + v2);
LABEL_17:
if ( v12 )
*(_DWORD *)(v11 + 200) &= ~2u;
return result;
}
}
if ( v12 )
*(_DWORD *)(v11 + 200) &= ~2u;
return v2;
}
| openssl |
_toupper_l | int __cdecl toupper_l(int C, _locale_t Locale)
{
__int64 v2; // rdi
struct __crt_locale_data *locinfo; // r8
int v4; // eax
int result; // eax
int v6; // edx
int *v7; // rax
int v8; // eax
bool v9; // zf
__crt_locale_pointers Localea; // [rsp+50h] [rbp-28h] BYREF
__int64 v11; // [rsp+60h] [rbp-18h]
char v12; // [rsp+68h] [rbp-10h]
char v13; // [rsp+80h] [rbp+8h] BYREF
char v14; // [rsp+81h] [rbp+9h]
char v15; // [rsp+82h] [rbp+Ah]
char v16; // [rsp+90h] [rbp+18h] BYREF
unsigned __int8 v17; // [rsp+91h] [rbp+19h]
v2 = C;
_LocaleUpdate::_LocaleUpdate((_LocaleUpdate *)&Localea, (const __m128i *)Locale);
if ( (unsigned int)v2 >= 0x100 )
{
if ( *((int *)Localea.locinfo + 67) > 1 && isleadbyte_l(BYTE1(v2), &Localea) )
{
v13 = BYTE1(v2);
v14 = v2;
v15 = 0;
v6 = 2;
}
else
{
v7 = errno();
v6 = 1;
*v7 = 42;
v13 = v2;
v14 = 0;
}
v8 = _crtLCMapStringA(
(struct localeinfo_struct *)&Localea,
*((_DWORD *)Localea.locinfo + 5),
0x200u,
&v13,
v6,
&v16,
3,
*((_DWORD *)Localea.locinfo + 1),
1);
if ( v8 )
{
v9 = v8 == 1;
result = (unsigned __int8)v16;
if ( !v9 )
result = v17 | ((unsigned __int8)v16 << 8);
goto LABEL_17;
}
}
else
{
locinfo = Localea.locinfo;
if ( *((int *)Localea.locinfo + 67) <= 1 )
{
v4 = *(_WORD *)(*((_QWORD *)Localea.locinfo + 40) + 2 * v2) & 2;
}
else
{
v4 = isctype_l(v2, 2, &Localea);
locinfo = Localea.locinfo;
}
if ( v4 )
{
result = *(unsigned __int8 *)(*((_QWORD *)locinfo + 42) + v2);
LABEL_17:
if ( v12 )
*(_DWORD *)(v11 + 200) &= ~2u;
return result;
}
}
if ( v12 )
*(_DWORD *)(v11 + 200) &= ~2u;
return v2;
}
| openssl |
_towlower_l | wint_t __cdecl towlower_l(wint_t C, _locale_t Locale)
{
wint_t result; // ax
LCID v3; // edx
WCHAR v4; // dx
bool v5; // zf
__crt_locale_pointers Localea; // [rsp+40h] [rbp-28h] BYREF
__int64 v7; // [rsp+50h] [rbp-18h]
char v8; // [rsp+58h] [rbp-10h]
WCHAR SrcStr; // [rsp+70h] [rbp+8h] BYREF
WCHAR v10; // [rsp+80h] [rbp+18h] BYREF
SrcStr = C;
result = -1;
if ( C != 0xFFFF )
{
_LocaleUpdate::_LocaleUpdate((_LocaleUpdate *)&Localea, (const __m128i *)Locale);
v3 = *((_DWORD *)Localea.locinfo + 5);
if ( v3 )
{
if ( SrcStr >= 0x100u )
{
v5 = (unsigned int)_crtLCMapStringW((struct localeinfo_struct *)&Localea, v3, 0x100u, &SrcStr, 1, &v10, 1) == 0;
result = SrcStr;
if ( !v5 )
result = v10;
}
else if ( iswctype_l(SrcStr, 1u, &Localea) )
{
result = *(unsigned __int8 *)(*((_QWORD *)Localea.locinfo + 41) + SrcStr);
}
else
{
result = SrcStr;
}
if ( v8 )
*(_DWORD *)(v7 + 200) &= ~2u;
}
else
{
v4 = SrcStr;
if ( (unsigned __int16)(SrcStr - 65) <= 0x19u )
v4 = SrcStr + 32;
if ( v8 )
*(_DWORD *)(v7 + 200) &= ~2u;
return v4;
}
}
return result;
}
| openssl |
_tsopen_nolock | __int64 __fastcall tsopen_nolock(_DWORD *a1, int *a2, const CHAR *a3, int a4, int a5, char a6)
{
unsigned int v6; // edi
int v7; // esi
DWORD dwCreationDisposition; // ebp
char v10; // r14
DWORD v12; // r15d
int v13; // r12d
DWORD v14; // ecx
int v15; // eax
DWORD dwFlagsAndAttributes; // r13d
int v17; // eax
DWORD v18; // r8d
HANDLE v19; // rax
int v20; // eax
DWORD FileType; // eax
int LastError; // ebx
char v23; // r14
__int64 v24; // rcx
int v25; // eax
unsigned int v26; // eax
int v27; // ebp
int v28; // eax
bool v29; // zf
int v30; // eax
__int64 v31; // rax
__int64 v32; // rcx
__int64 v33; // rax
__int64 v34; // rax
__int64 v35; // rdx
__int64 v36; // rcx
HANDLE v37; // rax
int v38; // eax
char v39[4]; // [rsp+40h] [rbp-78h] BYREF
int Buf; // [rsp+44h] [rbp-74h] BYREF
DWORD dwShareMode; // [rsp+48h] [rbp-70h]
char v42; // [rsp+4Ch] [rbp-6Ch]
DWORD v43; // [rsp+50h] [rbp-68h]
int Daylight; // [rsp+54h] [rbp-64h] BYREF
HANDLE hObject; // [rsp+58h] [rbp-60h]
struct _SECURITY_ATTRIBUTES SecurityAttributes; // [rsp+60h] [rbp-58h] BYREF
char v49; // [rsp+D8h] [rbp+20h]
v6 = 0;
v7 = a4;
SecurityAttributes.nLength = 24;
dwCreationDisposition = 1;
Daylight = 0;
v49 = 0;
SecurityAttributes.lpSecurityDescriptor = 0i64;
if ( (a4 & 0x80u) == 0 )
{
SecurityAttributes.bInheritHandle = 1;
v10 = 0;
}
else
{
SecurityAttributes.bInheritHandle = 0;
v10 = 16;
}
if ( get_daylight(&Daylight) )
invoke_watson(0i64, 0i64, 0i64, 0, 0i64);
if ( (v7 & 0x8000) == 0 && ((v7 & 0x74000) != 0 || Daylight != 0x8000) )
v10 |= 0x80u;
switch ( v7 & 3 )
{
case 0:
v12 = 0x80000000;
goto LABEL_19;
case 1:
if ( (v7 & 8) == 0 || (v7 & 0x70000) == 0 )
{
v12 = 0x40000000;
goto LABEL_19;
}
break;
case 2:
break;
default:
LABEL_13:
*_doserrno() = 0;
*a2 = -1;
*errno() = 22;
invalid_parameter(0i64, 0i64, 0i64, 0, 0i64);
return 22i64;
}
v12 = -1073741824;
LABEL_19:
v13 = 2;
switch ( a5 )
{
case 16:
v14 = 0;
break;
case 32:
v14 = 1;
break;
case 48:
v14 = 2;
break;
case 64:
v14 = 3;
break;
case 128:
v14 = v12 == 0x80000000;
break;
default:
goto LABEL_13;
}
dwShareMode = v14;
v15 = v7 & 0x700;
if ( (v7 & 0x700) == 0 )
goto LABEL_41;
switch ( v15 )
{
case 256:
dwCreationDisposition = 4;
goto LABEL_42;
case 512:
LABEL_39:
dwCreationDisposition = 5;
goto LABEL_42;
case 768:
dwCreationDisposition = 2;
goto LABEL_42;
case 1024:
LABEL_41:
dwCreationDisposition = 3;
goto LABEL_42;
case 1280:
goto LABEL_42;
case 1536:
goto LABEL_39;
}
if ( v15 != 1792 )
goto LABEL_13;
LABEL_42:
dwFlagsAndAttributes = 128;
v43 = 128;
if ( (v7 & 0x100) != 0 )
{
if ( (a6 & ~byte_140285520 & 0x80u) == 0 )
dwFlagsAndAttributes = 1;
v43 = dwFlagsAndAttributes;
}
if ( (v7 & 0x40) != 0 )
{
dwFlagsAndAttributes |= 0x4000000u;
v12 |= 0x10000u;
v43 = dwFlagsAndAttributes;
dwShareMode = v14 | 4;
}
if ( (v7 & 0x1000) != 0 )
{
dwFlagsAndAttributes |= 0x100u;
v43 = dwFlagsAndAttributes;
}
if ( (v7 & 0x20) != 0 )
{
dwFlagsAndAttributes |= 0x8000000u;
}
else
{
if ( (v7 & 0x10) == 0 )
goto LABEL_55;
dwFlagsAndAttributes |= 0x10000000u;
}
v43 = dwFlagsAndAttributes;
LABEL_55:
v17 = alloc_osfhnd();
*a2 = v17;
if ( v17 == -1 )
{
*_doserrno() = 0;
*a2 = -1;
*errno() = 24;
return (unsigned int)*errno();
}
v18 = dwShareMode;
*a1 = 1;
v19 = CreateFileA(a3, v12, v18, &SecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, 0i64);
hObject = v19;
if ( v19 != (HANDLE)-1i64
|| (v12 & 0xC0000000) == -1073741824
&& (v7 & 1) != 0
&& (v12 &= ~0x80000000,
v19 = CreateFileA(a3, v12, dwShareMode, &SecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, 0i64),
hObject = v19,
v19 != (HANDLE)-1i64) )
{
FileType = GetFileType(v19);
switch ( FileType )
{
case 0u:
*(_BYTE *)(qword_140286BA0[(__int64)*a2 >> 5] + 88i64 * (*a2 & 0x1F) + 8) &= ~1u;
LastError = GetLastError();
dosmaperr(LastError);
CloseHandle(hObject);
if ( !LastError )
*errno() = 13;
return (unsigned int)*errno();
case 2u:
v10 |= 0x40u;
break;
case 3u:
v10 |= 8u;
break;
}
set_osfhnd((unsigned int)*a2, hObject);
v23 = v10 | 1;
*(_BYTE *)(qword_140286BA0[(__int64)*a2 >> 5] + 88i64 * (*a2 & 0x1F) + 8) = v23;
*(_BYTE *)(qword_140286BA0[(__int64)*a2 >> 5] + 88i64 * (*a2 & 0x1F) + 56) &= 0x80u;
v42 = v23 & 0x48;
if ( (v23 & 0x48) == 0 )
{
if ( v23 >= 0 )
goto LABEL_128;
if ( (v7 & 2) != 0 )
{
Buf = lseek_nolock((unsigned int)*a2, 0xFFFFFFFFi64, 2i64);
if ( Buf == -1 )
{
if ( *_doserrno() != 131 )
{
LABEL_75:
close_nolock(*a2);
return (unsigned int)*errno();
}
}
else
{
v24 = (unsigned int)*a2;
v39[0] = 0;
if ( !(unsigned int)read_nolock(v24, v39, 1i64) && v39[0] == 26 && (unsigned int)chsize_nolock(*a2) == -1
|| (unsigned int)lseek_nolock((unsigned int)*a2, 0i64, 0i64) == -1 )
{
goto LABEL_75;
}
}
}
}
if ( v23 >= 0 )
{
LABEL_128:
v31 = *a2;
v32 = 88 * (v31 & 0x1F);
v33 = qword_140286BA0[v31 >> 5];
*(_BYTE *)(v33 + v32 + 56) &= 0x80u;
*(_BYTE *)(v33 + v32 + 56) |= v49 & 0x7F;
v34 = *a2;
v35 = 88 * (v34 & 0x1F);
v36 = qword_140286BA0[v34 >> 5];
*(_BYTE *)(v36 + v35 + 56) &= ~0x80u;
*(_BYTE *)(v36 + v35 + 56) |= BYTE2(v7) << 7;
if ( !v42 && (v7 & 8) != 0 )
*(_BYTE *)(qword_140286BA0[(__int64)*a2 >> 5] + 88i64 * (*a2 & 0x1F) + 8) |= 0x20u;
if ( (v12 & 0xC0000000) != -1073741824 || (v7 & 1) == 0 )
return v6;
CloseHandle(hObject);
v37 = CreateFileA(a3, v12 & 0x7FFFFFFF, dwShareMode, &SecurityAttributes, 3u, v43, 0i64);
if ( v37 != (HANDLE)-1i64 )
{
*(_QWORD *)(88i64 * (*a2 & 0x1F) + qword_140286BA0[(__int64)*a2 >> 5]) = v37;
return v6;
}
v38 = GetLastError();
dosmaperr(v38);
*(_BYTE *)(qword_140286BA0[(__int64)*a2 >> 5] + 88i64 * (*a2 & 0x1F) + 8) &= ~1u;
free_osfhnd((unsigned int)*a2);
return (unsigned int)*errno();
}
if ( (v7 & 0x74000) == 0 )
{
if ( (Daylight & 0x74000) != 0 )
v7 |= Daylight & 0x74000;
else
v7 |= 0x4000u;
}
v25 = v7 & 0x74000;
if ( (v7 & 0x74000) == 0x4000 )
{
v49 = 0;
goto LABEL_96;
}
if ( v25 == 0x10000 || v25 == 81920 )
{
if ( (v7 & 0x301) != 769 )
goto LABEL_96;
}
else if ( v25 != 0x20000 && v25 != 147456 )
{
if ( v25 == 0x40000 || v25 == 278528 )
v49 = 1;
LABEL_96:
if ( (v7 & 0x70000) == 0 )
goto LABEL_128;
Buf = 0;
if ( (v23 & 0x40) != 0 )
goto LABEL_128;
v26 = v12 & 0xC0000000;
if ( (v12 & 0xC0000000) == 0x40000000 )
{
if ( dwCreationDisposition > 2 && dwCreationDisposition <= 4 && lseeki64_nolock((unsigned int)*a2, 0i64, 2i64) )
{
v29 = lseeki64_nolock((unsigned int)*a2, 0i64, 0i64) == -1;
LABEL_123:
if ( v29 )
goto LABEL_75;
goto LABEL_128;
}
}
else
{
if ( v26 == 0x80000000 )
goto LABEL_108;
if ( v26 != -1073741824 )
goto LABEL_128;
if ( dwCreationDisposition > 2 && dwCreationDisposition <= 4 && lseeki64_nolock((unsigned int)*a2, 0i64, 2i64) )
{
if ( lseeki64_nolock((unsigned int)*a2, 0i64, 0i64) == -1 )
goto LABEL_75;
LABEL_108:
v28 = read_nolock((unsigned int)*a2, &Buf, 3i64);
if ( v28 == -1 )
goto LABEL_75;
if ( v28 != 2 )
{
if ( v28 != 3 )
{
LABEL_118:
v29 = (unsigned int)lseek_nolock((unsigned int)*a2, 0i64, 0i64) == -1;
goto LABEL_123;
}
if ( Buf == 12565487 )
{
v49 = 1;
goto LABEL_128;
}
}
if ( (unsigned __int16)Buf == 65534 )
{
close_nolock(*a2);
*errno() = 22;
return 22;
}
if ( (unsigned __int16)Buf == 65279 )
{
if ( (unsigned int)lseek_nolock((unsigned int)*a2, 2i64, 0i64) == -1 )
goto LABEL_75;
v49 = 2;
goto LABEL_128;
}
goto LABEL_118;
}
}
v27 = 0;
if ( v49 == 1 )
{
Buf = 12565487;
v13 = 3;
LABEL_126:
while ( 1 )
{
v30 = write(*a2, (char *)&Buf + v27, v13 - v27);
if ( v30 == -1 )
goto LABEL_75;
v27 += v30;
if ( v13 <= v27 )
goto LABEL_128;
}
}
if ( v49 == 2 )
{
Buf = 65279;
goto LABEL_126;
}
goto LABEL_128;
}
v49 = 2;
goto LABEL_96;
}
*(_BYTE *)(qword_140286BA0[(__int64)*a2 >> 5] + 88i64 * (*a2 & 0x1F) + 8) &= ~1u;
v20 = GetLastError();
dosmaperr(v20);
return (unsigned int)*errno();
}
| openssl |
_tsopen_nolock_0 | __int64 __fastcall tsopen_nolock_0(_DWORD *a1, int *a2, const WCHAR *a3, int a4, int a5, char a6)
{
unsigned int v6; // edi
int v7; // esi
DWORD dwCreationDisposition; // ebp
char v10; // r14
DWORD v12; // r15d
int v13; // r12d
DWORD v14; // ecx
int v15; // eax
DWORD dwFlagsAndAttributes; // r13d
int v17; // eax
DWORD v18; // r8d
HANDLE v19; // rax
int v20; // eax
DWORD FileType; // eax
int LastError; // ebx
char v23; // r14
int v24; // ecx
int v25; // eax
unsigned int v26; // eax
int v27; // ebp
int nolock; // eax
bool v29; // zf
int v30; // eax
__int64 v31; // rax
__int64 v32; // rcx
__int64 v33; // rax
__int64 v34; // rax
__int64 v35; // rdx
__int64 v36; // rcx
HANDLE v37; // rax
int v38; // eax
int Buf; // [rsp+40h] [rbp-78h] BYREF
DWORD dwShareMode; // [rsp+44h] [rbp-74h]
char v41; // [rsp+48h] [rbp-70h]
DWORD v42; // [rsp+4Ch] [rbp-6Ch]
WCHAR v43[2]; // [rsp+50h] [rbp-68h] BYREF
int Daylight; // [rsp+54h] [rbp-64h] BYREF
HANDLE hObject; // [rsp+58h] [rbp-60h]
struct _SECURITY_ATTRIBUTES SecurityAttributes; // [rsp+60h] [rbp-58h] BYREF
char v49; // [rsp+D8h] [rbp+20h]
v6 = 0;
v7 = a4;
SecurityAttributes.nLength = 24;
dwCreationDisposition = 1;
Daylight = 0;
v49 = 0;
SecurityAttributes.lpSecurityDescriptor = 0i64;
if ( (a4 & 0x80u) == 0 )
{
SecurityAttributes.bInheritHandle = 1;
v10 = 0;
}
else
{
SecurityAttributes.bInheritHandle = 0;
v10 = 16;
}
if ( get_daylight(&Daylight) )
invoke_watson(0i64, 0i64, 0i64, 0, 0i64);
if ( (v7 & 0x8000) == 0 && ((v7 & 0x74000) != 0 || Daylight != 0x8000) )
v10 |= 0x80u;
switch ( v7 & 3 )
{
case 0:
v12 = 0x80000000;
goto LABEL_19;
case 1:
if ( (v7 & 8) == 0 || (v7 & 0x70000) == 0 )
{
v12 = 0x40000000;
goto LABEL_19;
}
break;
case 2:
break;
default:
LABEL_13:
*_doserrno() = 0;
*a2 = -1;
*errno() = 22;
invalid_parameter(0i64, 0i64, 0i64, 0, 0i64);
return 22i64;
}
v12 = -1073741824;
LABEL_19:
v13 = 2;
switch ( a5 )
{
case 16:
v14 = 0;
break;
case 32:
v14 = 1;
break;
case 48:
v14 = 2;
break;
case 64:
v14 = 3;
break;
case 128:
v14 = v12 == 0x80000000;
break;
default:
goto LABEL_13;
}
dwShareMode = v14;
v15 = v7 & 0x700;
if ( (v7 & 0x700) == 0 )
goto LABEL_41;
switch ( v15 )
{
case 256:
dwCreationDisposition = 4;
goto LABEL_42;
case 512:
LABEL_39:
dwCreationDisposition = 5;
goto LABEL_42;
case 768:
dwCreationDisposition = 2;
goto LABEL_42;
case 1024:
LABEL_41:
dwCreationDisposition = 3;
goto LABEL_42;
case 1280:
goto LABEL_42;
case 1536:
goto LABEL_39;
}
if ( v15 != 1792 )
goto LABEL_13;
LABEL_42:
dwFlagsAndAttributes = 128;
v42 = 128;
if ( (v7 & 0x100) != 0 )
{
if ( (a6 & ~byte_140285520 & 0x80u) == 0 )
dwFlagsAndAttributes = 1;
v42 = dwFlagsAndAttributes;
}
if ( (v7 & 0x40) != 0 )
{
dwFlagsAndAttributes |= 0x4000000u;
v12 |= 0x10000u;
v42 = dwFlagsAndAttributes;
dwShareMode = v14 | 4;
}
if ( (v7 & 0x1000) != 0 )
{
dwFlagsAndAttributes |= 0x100u;
v42 = dwFlagsAndAttributes;
}
if ( (v7 & 0x20) != 0 )
{
dwFlagsAndAttributes |= 0x8000000u;
}
else
{
if ( (v7 & 0x10) == 0 )
goto LABEL_55;
dwFlagsAndAttributes |= 0x10000000u;
}
v42 = dwFlagsAndAttributes;
LABEL_55:
v17 = alloc_osfhnd();
*a2 = v17;
if ( v17 == -1 )
{
*_doserrno() = 0;
*a2 = -1;
*errno() = 24;
return (unsigned int)*errno();
}
v18 = dwShareMode;
*a1 = 1;
v19 = CreateFileW(a3, v12, v18, &SecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, 0i64);
hObject = v19;
if ( v19 != (HANDLE)-1i64
|| (v12 & 0xC0000000) == -1073741824
&& (v7 & 1) != 0
&& (v12 &= ~0x80000000,
v19 = CreateFileW(a3, v12, dwShareMode, &SecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, 0i64),
hObject = v19,
v19 != (HANDLE)-1i64) )
{
FileType = GetFileType(v19);
switch ( FileType )
{
case 0u:
*(_BYTE *)(qword_140286BA0[(__int64)*a2 >> 5] + 88i64 * (*a2 & 0x1F) + 8) &= ~1u;
LastError = GetLastError();
dosmaperr(LastError);
CloseHandle(hObject);
if ( !LastError )
*errno() = 13;
return (unsigned int)*errno();
case 2u:
v10 |= 0x40u;
break;
case 3u:
v10 |= 8u;
break;
}
set_osfhnd(*a2, hObject);
v23 = v10 | 1;
*(_BYTE *)(qword_140286BA0[(__int64)*a2 >> 5] + 88i64 * (*a2 & 0x1F) + 8) = v23;
*(_BYTE *)(qword_140286BA0[(__int64)*a2 >> 5] + 88i64 * (*a2 & 0x1F) + 56) &= 0x80u;
v41 = v23 & 0x48;
if ( (v23 & 0x48) == 0 )
{
if ( v23 >= 0 )
goto LABEL_128;
if ( (v7 & 2) != 0 )
{
Buf = lseek_nolock(*a2, -1, 2u);
if ( Buf == -1 )
{
if ( *_doserrno() != 131 )
{
LABEL_75:
close_nolock(*a2);
return (unsigned int)*errno();
}
}
else
{
v24 = *a2;
v43[0] = 0;
if ( !(unsigned int)read_nolock(v24, v43, 1u) && v43[0] == 26 && (unsigned int)chsize_nolock(*a2, Buf) == -1
|| (unsigned int)lseek_nolock(*a2, 0, 0) == -1 )
{
goto LABEL_75;
}
}
}
}
if ( v23 >= 0 )
{
LABEL_128:
v31 = *a2;
v32 = 88 * (v31 & 0x1F);
v33 = qword_140286BA0[v31 >> 5];
*(_BYTE *)(v33 + v32 + 56) &= 0x80u;
*(_BYTE *)(v33 + v32 + 56) |= v49 & 0x7F;
v34 = *a2;
v35 = 88 * (v34 & 0x1F);
v36 = qword_140286BA0[v34 >> 5];
*(_BYTE *)(v36 + v35 + 56) &= ~0x80u;
*(_BYTE *)(v36 + v35 + 56) |= BYTE2(v7) << 7;
if ( !v41 && (v7 & 8) != 0 )
*(_BYTE *)(qword_140286BA0[(__int64)*a2 >> 5] + 88i64 * (*a2 & 0x1F) + 8) |= 0x20u;
if ( (v12 & 0xC0000000) != -1073741824 || (v7 & 1) == 0 )
return v6;
CloseHandle(hObject);
v37 = CreateFileW(a3, v12 & 0x7FFFFFFF, dwShareMode, &SecurityAttributes, 3u, v42, 0i64);
if ( v37 != (HANDLE)-1i64 )
{
*(_QWORD *)(88i64 * (*a2 & 0x1F) + qword_140286BA0[(__int64)*a2 >> 5]) = v37;
return v6;
}
v38 = GetLastError();
dosmaperr(v38);
*(_BYTE *)(qword_140286BA0[(__int64)*a2 >> 5] + 88i64 * (*a2 & 0x1F) + 8) &= ~1u;
free_osfhnd(*a2);
return (unsigned int)*errno();
}
if ( (v7 & 0x74000) == 0 )
{
if ( (Daylight & 0x74000) != 0 )
v7 |= Daylight & 0x74000;
else
v7 |= 0x4000u;
}
v25 = v7 & 0x74000;
if ( (v7 & 0x74000) == 0x4000 )
{
v49 = 0;
goto LABEL_96;
}
if ( v25 == 0x10000 || v25 == 81920 )
{
if ( (v7 & 0x301) != 769 )
goto LABEL_96;
}
else if ( v25 != 0x20000 && v25 != 147456 )
{
if ( v25 == 0x40000 || v25 == 278528 )
v49 = 1;
LABEL_96:
if ( (v7 & 0x70000) == 0 )
goto LABEL_128;
Buf = 0;
if ( (v23 & 0x40) != 0 )
goto LABEL_128;
v26 = v12 & 0xC0000000;
if ( (v12 & 0xC0000000) == 0x40000000 )
{
if ( dwCreationDisposition > 2 && dwCreationDisposition <= 4 && lseeki64_nolock(*a2, 0i64, 2u) )
{
v29 = lseeki64_nolock(*a2, 0i64, 0) == -1;
LABEL_123:
if ( v29 )
goto LABEL_75;
goto LABEL_128;
}
}
else
{
if ( v26 == 0x80000000 )
goto LABEL_108;
if ( v26 != -1073741824 )
goto LABEL_128;
if ( dwCreationDisposition > 2 && dwCreationDisposition <= 4 && lseeki64_nolock(*a2, 0i64, 2u) )
{
if ( lseeki64_nolock(*a2, 0i64, 0) == -1 )
goto LABEL_75;
LABEL_108:
nolock = read_nolock(*a2, (WCHAR *)&Buf, 3u);
if ( nolock == -1 )
goto LABEL_75;
if ( nolock != 2 )
{
if ( nolock != 3 )
{
LABEL_118:
v29 = (unsigned int)lseek_nolock(*a2, 0, 0) == -1;
goto LABEL_123;
}
if ( Buf == 12565487 )
{
v49 = 1;
goto LABEL_128;
}
}
if ( (unsigned __int16)Buf == 65534 )
{
close_nolock(*a2);
*errno() = 22;
return 22;
}
if ( (unsigned __int16)Buf == 65279 )
{
if ( (unsigned int)lseek_nolock(*a2, 2, 0) == -1 )
goto LABEL_75;
v49 = 2;
goto LABEL_128;
}
goto LABEL_118;
}
}
v27 = 0;
if ( v49 == 1 )
{
Buf = 12565487;
v13 = 3;
LABEL_126:
while ( 1 )
{
v30 = write(*a2, (char *)&Buf + v27, v13 - v27);
if ( v30 == -1 )
goto LABEL_75;
v27 += v30;
if ( v13 <= v27 )
goto LABEL_128;
}
}
if ( v49 == 2 )
{
Buf = 65279;
goto LABEL_126;
}
goto LABEL_128;
}
v49 = 2;
goto LABEL_96;
}
*(_BYTE *)(qword_140286BA0[(__int64)*a2 >> 5] + 88i64 * (*a2 & 0x1F) + 8) &= ~1u;
v20 = GetLastError();
dosmaperr(v20);
return (unsigned int)*errno();
}
| openssl |
_tzset_nolock | void tzset_nolock()
{
int v0; // r13d
int v1; // esi
LPSTR *v2; // r12
unsigned int v3; // ebx
const char *v4; // rax
const char *v5; // rdi
char *v6; // rcx
size_t v7; // rax
size_t v8; // rax
int v9; // ebx
int v10; // ebx
int v11; // ebx
const char *v12; // rdi
int v13; // r11d
char v14; // al
int v15; // eax
char i; // al
int v17; // eax
char j; // al
int v19; // ebx
int v20; // ebx
int Daylight; // [rsp+90h] [rbp+8h] BYREF
int v22; // [rsp+98h] [rbp+10h] BYREF
int v23; // [rsp+A0h] [rbp+18h] BYREF
BOOL UsedDefaultChar; // [rsp+A8h] [rbp+20h] BYREF
v0 = 0;
v1 = 0;
Daylight = 0;
v22 = 0;
v23 = 0;
lock(7);
v2 = (LPSTR *)sub_1401B6754();
if ( get_daylight_2(&Daylight) )
invoke_watson(0i64, 0i64, 0i64, 0, 0i64);
if ( get_daylight_0(&v22) )
invoke_watson(0i64, 0i64, 0i64, 0, 0i64);
if ( get_daylight_1(&v23) )
invoke_watson(0i64, 0i64, 0i64, 0, 0i64);
v3 = __lc_codepage_func();
dword_14028635C = 0;
dword_140280478 = -1;
dword_140280468 = -1;
v4 = getenv_helper_nolock("TZ");
v5 = v4;
if ( v4 && *v4 )
{
v6 = qword_140286360;
if ( qword_140286360 )
{
if ( !strcmp(v4, qword_140286360) )
{
v1 = 1;
goto LABEL_37;
}
v6 = qword_140286360;
}
if ( v6 )
free(v6);
v7 = strlen(v5);
qword_140286360 = (char *)malloc_crt(v7 + 1);
if ( qword_140286360 )
{
v8 = strlen(v5);
if ( strcpy_s(qword_140286360, v8 + 1, v5) )
invoke_watson(0i64, 0i64, 0i64, 0, 0i64);
}
else
{
v1 = 1;
}
}
else
{
if ( qword_140286360 )
{
free(qword_140286360);
qword_140286360 = 0i64;
}
if ( GetTimeZoneInformation(&TimeZoneInformation) != -1 )
{
dword_14028635C = 1;
Daylight = 60 * TimeZoneInformation.Bias;
if ( TimeZoneInformation.StandardDate.wMonth )
Daylight = 60 * TimeZoneInformation.StandardBias + 60 * TimeZoneInformation.Bias;
if ( TimeZoneInformation.DaylightDate.wMonth && TimeZoneInformation.DaylightBias )
{
v22 = 1;
v23 = 60 * (TimeZoneInformation.DaylightBias - TimeZoneInformation.StandardBias);
}
else
{
v22 = 0;
v23 = 0;
}
if ( !WideCharToMultiByte(v3, 0, TimeZoneInformation.StandardName, -1, *v2, 63, 0i64, &UsedDefaultChar)
|| UsedDefaultChar )
{
**v2 = 0;
}
else
{
(*v2)[63] = 0;
}
if ( !WideCharToMultiByte(v3, 0, TimeZoneInformation.DaylightName, -1, v2[1], 63, 0i64, &UsedDefaultChar)
|| UsedDefaultChar )
{
*v2[1] = 0;
}
else
{
v2[1][63] = 0;
}
}
v1 = 1;
}
LABEL_37:
v9 = Daylight;
*(_DWORD *)sub_1401B674C() = v9;
v10 = v22;
*(_DWORD *)sub_1401B673C() = v10;
v11 = v23;
*(_DWORD *)sub_1401B6744() = v11;
unlock(7);
if ( !v1 )
{
if ( strncpy_s(*v2, 0x40ui64, v5, 3ui64) )
invoke_watson(0i64, 0i64, 0i64, 0, 0i64);
v12 = v5 + 3;
if ( *v12 == 45 )
{
v0 = 1;
++v12;
}
v13 = 3600 * atoi(v12);
Daylight = v13;
while ( 1 )
{
v14 = *v12;
if ( *v12 != 43 && (v14 < 48 || v14 > 57) )
break;
++v12;
}
if ( *v12 == 58 )
{
v15 = 60 * atoi(++v12);
v13 = v15 + Daylight;
Daylight += v15;
for ( i = *v12; *v12 >= 48; i = *++v12 )
{
if ( i > 57 )
break;
}
if ( *v12 == 58 )
{
v17 = atoi(++v12);
v13 = v17 + Daylight;
Daylight += v17;
for ( j = *v12; *v12 >= 48; j = *++v12 )
{
if ( j > 57 )
break;
}
}
}
if ( v0 )
Daylight = -v13;
v22 = *v12;
if ( v22 )
{
if ( strncpy_s(v2[1], 0x40ui64, v12, 3ui64) )
invoke_watson(0i64, 0i64, 0i64, 0, 0i64);
}
else
{
*v2[1] = 0;
}
v19 = Daylight;
*(_DWORD *)sub_1401B674C() = v19;
v20 = v22;
*(_DWORD *)sub_1401B673C() = v20;
}
}
| openssl |
_ungetc_nolock | int __cdecl ungetc_nolock(int Character, FILE *Stream)
{
int v4; // eax
char *v5; // rdx
_BYTE *v6; // rcx
char *v8; // rax
if ( (Stream->_flag & 0x40) == 0 )
{
v4 = fileno(Stream);
v5 = (char *)&unk_14027FAE0;
if ( v4 == -1 || v4 == -2 )
v6 = &unk_14027FAE0;
else
v6 = (_BYTE *)(qword_140286BA0[(__int64)v4 >> 5] + 88i64 * (v4 & 0x1F));
if ( (v6[56] & 0x7F) != 0 )
goto LABEL_11;
if ( v4 != -1 && v4 != -2 )
v5 = (char *)(qword_140286BA0[(__int64)v4 >> 5] + 88i64 * (v4 & 0x1F));
if ( v5[56] < 0 )
{
LABEL_11:
*errno() = 22;
invalid_parameter(0i64, 0i64, 0i64, 0, 0i64);
return -1;
}
}
if ( Character == -1 || (Stream->_flag & 1) == 0 && (SLOBYTE(Stream->_flag) >= 0 || (Stream->_flag & 2) != 0) )
return -1;
if ( !Stream->_base )
getbuf((__int64)Stream);
if ( Stream->_ptr == Stream->_base )
{
if ( Stream->_cnt )
return -1;
++Stream->_ptr;
}
v8 = --Stream->_ptr;
if ( (Stream->_flag & 0x40) != 0 )
{
if ( *v8 != (_BYTE)Character )
{
Stream->_ptr = v8 + 1;
return -1;
}
}
else
{
*v8 = Character;
}
++Stream->_cnt;
Stream->_flag &= ~0x10u;
Stream->_flag |= 1u;
return (unsigned __int8)Character;
}
| openssl |
_unlock | void __fastcall unlock(int a1)
{
LeaveCriticalSection((LPCRITICAL_SECTION)qword_14027FB40[2 * a1]);
}
| openssl |
_unlockexit | __int64 unlockexit()
{
return unlock(8i64);
}
| openssl |
_unlock_fhandle | void __fastcall unlock_fhandle(int a1)
{
LeaveCriticalSection((LPCRITICAL_SECTION)(qword_140286BA0[(__int64)a1 >> 5] + 88i64 * (a1 & 0x1F) + 16));
}
| openssl |
_unlock_file | void __cdecl unlock_file(FILE *Stream)
{
if ( Stream < (FILE *)&unk_14027EEB0 || Stream > &stru_14027F240 )
{
LeaveCriticalSection((LPCRITICAL_SECTION)&Stream[1]);
}
else
{
Stream->_flag &= ~0x8000u;
unlock((unsigned int)((int)((char *)Stream - (char *)&unk_14027EEB0) / 48 + 16));
}
}
| openssl |
_unlock_file2 | void __fastcall unlock_file2(int a1, __int64 a2)
{
if ( a1 >= 20 )
{
LeaveCriticalSection((LPCRITICAL_SECTION)(a2 + 48));
}
else
{
*(_DWORD *)(a2 + 24) &= ~0x8000u;
unlock((unsigned int)(a1 + 16));
}
}
| openssl |
_updatetlocinfoEx_nolock | __int64 __fastcall updatetlocinfoEx_nolock(__int64 *a1, __int64 a2)
{
__int64 v3; // r10
char *v4; // rcx
_DWORD *v5; // r10
if ( !a2 || !a1 )
return 0i64;
if ( *a1 != a2 )
{
*a1 = a2;
_addlocaleref(a2);
if ( v3 )
{
_removelocaleref(v3);
if ( !*v5 && v5 != (_DWORD *)&unk_14027F950 )
_freetlocinfo(v4);
}
}
return a2;
}
| openssl |
_ValidateImageBase | bool __fastcall ValidateImageBase(__int64 a1)
{
bool result; // al
__int64 v2; // rcx
if ( *(_WORD *)a1 != 23117 )
return 0;
v2 = a1 + *(int *)(a1 + 60);
result = 0;
if ( *(_DWORD *)v2 == 17744 )
return *(_WORD *)(v2 + 24) == 523;
return result;
}
| openssl |
_validdrive | _BOOL8 __fastcall validdrive(int a1)
{
_BOOL8 result; // rax
CHAR RootPathName; // [rsp+30h] [rbp+8h] BYREF
char v3[8]; // [rsp+31h] [rbp+9h] BYREF
result = 1;
if ( a1 )
{
strcpy(v3, ":\\");
RootPathName = a1 + 64;
if ( GetDriveTypeA(&RootPathName) <= 1 )
return 0;
}
return result;
}
| openssl |
_vsnprintf | int __cdecl vsnprintf(char *const Buffer, const size_t BufferCount, const char *const Format, va_list ArgList)
{
return vsnprintf_l(Buffer, BufferCount, Format, 0i64, ArgList);
}
| openssl |
_vsnprintf_l | int __cdecl vsnprintf_l(
char *const Buffer,
const size_t BufferCount,
const char *const Format,
const _locale_t Locale,
va_list ArgList)
{
int result; // eax
int v7; // ebx
FILE File; // [rsp+30h] [rbp-38h] BYREF
if ( Format && (!BufferCount || Buffer) )
{
File._flag = 66;
File._base = Buffer;
if ( BufferCount > 0x7FFFFFFF )
LODWORD(BufferCount) = 0x7FFFFFFF;
File._ptr = Buffer;
File._cnt = BufferCount;
result = output_l(&File);
v7 = result;
if ( Buffer )
{
if ( --File._cnt < 0 )
flsbuf(0, &File);
else
*File._ptr = 0;
return v7;
}
}
else
{
*errno() = 22;
invalid_parameter(0i64, 0i64, 0i64, 0, 0i64);
return -1;
}
return result;
}
| openssl |
_vsnwprintf | int __cdecl vsnwprintf(wchar_t *Buffer, size_t BufferCount, const wchar_t *Format, va_list Args)
{
return vsnwprintf_l(Buffer, BufferCount, Format, 0i64, Args);
}
| openssl |
_vsnwprintf_l | int __cdecl vsnwprintf_l(
wchar_t *const Buffer,
const size_t BufferCount,
const wchar_t *const Format,
const _locale_t Locale,
va_list ArgList)
{
int result; // eax
int v7; // edi
char *ptr; // rax
FILE File; // [rsp+30h] [rbp-38h] BYREF
if ( Format && (!BufferCount || Buffer) )
{
File._flag = 66;
File._base = (char *)Buffer;
File._ptr = (char *)Buffer;
if ( BufferCount <= 0x3FFFFFFF )
File._cnt = 2 * BufferCount;
else
File._cnt = 0x7FFFFFFF;
result = woutput_l(&File, Format, Locale, ArgList);
v7 = result;
if ( Buffer )
{
if ( --File._cnt < 0 )
{
flsbuf(0, &File);
ptr = File._ptr;
}
else
{
*File._ptr = 0;
ptr = ++File._ptr;
}
if ( --File._cnt < 0 )
flsbuf(0, &File);
else
*ptr = 0;
return v7;
}
}
else
{
*errno() = 22;
invalid_parameter(0i64, 0i64, 0i64, 0, 0i64);
return -1;
}
return result;
}
| openssl |
_wcsnicmp | int __cdecl wcsnicmp(const wchar_t *String1, const wchar_t *String2, size_t MaxCount)
{
int v3; // ebx
const wchar_t *v4; // r10
wchar_t v6; // cx
wchar_t v7; // ax
v3 = 0;
v4 = String1;
if ( dword_1402856E8 )
return wcsnicmp_l(String1, String2, MaxCount, 0i64);
if ( MaxCount )
{
if ( !String1 || !String2 )
{
*errno() = 22;
invalid_parameter(0i64, 0i64, 0i64, 0, 0i64);
return 0x7FFFFFFF;
}
do
{
v6 = *v4;
if ( *v4 >= 0x41u && v6 <= 0x5Au )
v6 += 32;
v7 = *String2;
if ( *String2 >= 0x41u && v7 <= 0x5Au )
v7 += 32;
++v4;
++String2;
--MaxCount;
}
while ( MaxCount && v6 && v6 == v7 );
return v6 - v7;
}
return v3;
}
| openssl |
_wcsnicmp_l | int __cdecl wcsnicmp_l(const wchar_t *String1, const wchar_t *String2, size_t MaxCount, _locale_t Locale)
{
size_t v4; // rbp
wint_t *v5; // rsi
wint_t *v6; // rdi
int result; // eax
wint_t v8; // bx
wint_t v9; // ax
__crt_locale_pointers Localea; // [rsp+30h] [rbp-28h] BYREF
__int64 v11; // [rsp+40h] [rbp-18h]
char v12; // [rsp+48h] [rbp-10h]
v4 = MaxCount;
v5 = (wint_t *)String2;
v6 = (wint_t *)String1;
result = 0;
if ( MaxCount )
{
if ( String1 && String2 )
{
_LocaleUpdate::_LocaleUpdate((_LocaleUpdate *)&Localea, (const __m128i *)Locale);
if ( *((_DWORD *)Localea.locinfo + 5) )
{
do
{
v8 = towlower_l(*v6, &Localea);
v9 = towlower_l(*v5, &Localea);
++v6;
++v5;
--v4;
}
while ( v4 && v8 && v8 == v9 );
}
else
{
do
{
v8 = *v6;
if ( *v6 >= 0x41u && v8 <= 0x5Au )
v8 += 32;
v9 = *v5;
if ( *v5 >= 0x41u && v9 <= 0x5Au )
v9 += 32;
++v6;
++v5;
--v4;
}
while ( v4 && v8 && v8 == v9 );
}
result = v8 - v9;
if ( v12 )
*(_DWORD *)(v11 + 200) &= ~2u;
}
else
{
*errno() = 22;
invalid_parameter(0i64, 0i64, 0i64, 0, 0i64);
return 0x7FFFFFFF;
}
}
return result;
}
| openssl |
_wctomb_s_l | errno_t __cdecl wctomb_s_l(int *SizeConverted, char *MbCh, size_t SizeInBytes, wchar_t WCh, _locale_t Locale)
{
errno_t result; // eax
errno_t v9; // ebx
int v10; // eax
__int64 v11; // [rsp+40h] [rbp-38h] BYREF
__int64 v12; // [rsp+50h] [rbp-28h]
char v13; // [rsp+58h] [rbp-20h]
BOOL UsedDefaultChar; // [rsp+88h] [rbp+10h] BYREF
WCHAR WideCharStr; // [rsp+98h] [rbp+20h] BYREF
WideCharStr = WCh;
if ( !MbCh && SizeInBytes )
{
if ( SizeConverted )
*SizeConverted = 0;
return 0;
}
if ( SizeConverted )
*SizeConverted = -1;
if ( SizeInBytes > 0x7FFFFFFF )
{
v9 = 22;
*errno() = 22;
invalid_parameter(0i64, 0i64, 0i64, 0, 0i64);
return v9;
}
_LocaleUpdate::_LocaleUpdate((_LocaleUpdate *)&v11, (const __m128i *)Locale);
if ( !*(_DWORD *)(v11 + 20) )
{
if ( WideCharStr > 0xFFu )
{
if ( MbCh && SizeInBytes )
memset(MbCh, 0, SizeInBytes);
goto LABEL_16;
}
if ( MbCh )
{
if ( !SizeInBytes )
{
v9 = 34;
*errno() = 34;
invalid_parameter(0i64, 0i64, 0i64, 0, 0i64);
if ( v13 )
*(_DWORD *)(v12 + 200) &= ~2u;
return v9;
}
*MbCh = WideCharStr;
}
if ( SizeConverted )
*SizeConverted = 1;
LABEL_26:
if ( v13 )
*(_DWORD *)(v12 + 200) &= ~2u;
return 0;
}
UsedDefaultChar = 0;
v10 = WideCharToMultiByte(*(_DWORD *)(v11 + 4), 0, &WideCharStr, 1, MbCh, SizeInBytes, 0i64, &UsedDefaultChar);
if ( v10 )
{
if ( !UsedDefaultChar )
{
if ( SizeConverted )
*SizeConverted = v10;
goto LABEL_26;
}
}
else if ( GetLastError() == 122 )
{
if ( MbCh && SizeInBytes )
memset(MbCh, 0, SizeInBytes);
v9 = 34;
*errno() = 34;
invalid_parameter(0i64, 0i64, 0i64, 0, 0i64);
if ( v13 )
*(_DWORD *)(v12 + 200) &= ~2u;
return v9;
}
LABEL_16:
*errno() = 42;
result = *errno();
if ( v13 )
*(_DWORD *)(v12 + 200) &= ~2u;
return result;
}
| openssl |
_wfopen | FILE *__cdecl wfopen(const wchar_t *FileName, const wchar_t *Mode)
{
return wfsopen(FileName, Mode, 64);
}
| openssl |
_wfsopen | FILE *__cdecl wfsopen(const wchar_t *FileName, const wchar_t *Mode, int ShFlag)
{
FILE *v5; // rbx
FILE *v6; // rdi
__int64 v7; // [rsp+0h] [rbp-58h] BYREF
__int64 *v8; // [rsp+30h] [rbp-28h]
v8 = &v7;
if ( FileName && Mode && *Mode )
{
v5 = (FILE *)getstream(FileName, Mode, ShFlag);
if ( v5 )
{
if ( *FileName )
{
v6 = (FILE *)wopenfile((char *)FileName);
unlock_file(v5);
return v6;
}
else
{
*errno() = 22;
local_unwind(v8, &loc_1401A901B);
return 0i64;
}
}
else
{
*errno() = 24;
return 0i64;
}
}
else
{
*errno() = 22;
invalid_parameter(0i64, 0i64, 0i64, 0, 0i64);
return 0i64;
}
}
| openssl |
_wopenfile | __int64 __fastcall wopenfile(char *FileName, _WORD *a2, int a3, __int64 a4)
{
_WORD *v6; // rbx
int v8; // r9d
int v9; // r10d
int i; // r11d
int v11; // eax
__int64 result; // rax
int v13; // edi
unsigned int v14; // ebp
const wchar_t *v15; // rbx
int v16; // edx
wchar_t v17; // ax
const wchar_t *j; // rbx
int v19; // eax
int FileHandle; // [rsp+68h] [rbp+10h] BYREF
v6 = a2;
v8 = 0;
v9 = 0;
for ( i = 0; *v6 == 32; ++v6 )
;
v11 = (unsigned __int16)*v6;
switch ( v11 )
{
case 'a':
v13 = 265;
break;
case 'r':
v13 = 0;
v14 = dword_140286260 | 1;
goto LABEL_12;
case 'w':
v13 = 769;
break;
default:
LABEL_6:
*errno() = 22;
invalid_parameter(0i64, 0i64, 0i64, 0, 0i64);
return 0i64;
}
v14 = dword_140286260 | 2;
LABEL_12:
v15 = v6 + 1;
v16 = 1;
v17 = *v15;
if ( !*v15 )
goto LABEL_66;
while ( v16 )
{
if ( v17 > 0x53u )
{
switch ( v17 )
{
case 'T':
if ( (v13 & 0x1000) == 0 )
{
v13 |= 0x1000u;
break;
}
goto LABEL_46;
case 'b':
if ( (v13 & 0xC000) != 0 )
goto LABEL_46;
v13 |= 0x8000u;
break;
case 'c':
if ( v8 )
goto LABEL_46;
v8 = 1;
v14 |= 0x4000u;
break;
case 'n':
if ( v8 )
goto LABEL_46;
v8 = 1;
v14 &= ~0x4000u;
break;
case 't':
if ( (v13 & 0xC000) != 0 )
goto LABEL_46;
v13 |= 0x4000u;
break;
default:
goto LABEL_6;
}
}
else if ( v17 == 83 )
{
if ( v9 )
goto LABEL_46;
v9 = 1;
v13 |= 0x20u;
}
else if ( v17 != 32 )
{
switch ( v17 )
{
case '+':
if ( (v13 & 2) != 0 )
goto LABEL_46;
v13 = v13 & 0xFFFFFFFC | 2;
v14 = v14 & 0xFFFFFF7C | 0x80;
break;
case ',':
i = 1;
LABEL_46:
v16 = 0;
break;
case 'D':
if ( (v13 & 0x40) != 0 )
goto LABEL_46;
v13 |= 0x40u;
break;
case 'N':
v13 |= 0x80u;
break;
case 'R':
if ( v9 )
goto LABEL_46;
v9 = 1;
v13 |= 0x10u;
break;
default:
goto LABEL_6;
}
}
v17 = *++v15;
if ( !*v15 )
break;
}
if ( !i )
goto LABEL_66;
while ( *v15 == 32 )
++v15;
if ( wcsncmp(L"ccs", v15, 3ui64) )
goto LABEL_6;
for ( j = v15 + 3; *j == 32; ++j )
;
if ( *j != 61 )
goto LABEL_6;
do
++j;
while ( *j == 32 );
if ( !wcsnicmp(j, L"UTF-8", 5ui64) )
{
v15 = j + 5;
v13 |= 0x40000u;
goto LABEL_66;
}
if ( !wcsnicmp(j, L"UTF-16LE", 8ui64) )
{
v15 = j + 8;
v13 |= 0x20000u;
goto LABEL_66;
}
if ( wcsnicmp(j, L"UNICODE", 7ui64) )
goto LABEL_6;
v15 = j + 7;
v13 |= 0x10000u;
LABEL_66:
while ( *v15 == 32 )
++v15;
if ( *v15 )
goto LABEL_6;
if ( sopen_s_0(&FileHandle, FileName, v13, a3, 384) )
return 0i64;
++dword_140285510;
v19 = FileHandle;
*(_DWORD *)(a4 + 24) = v14;
*(_DWORD *)(a4 + 28) = v19;
*(_DWORD *)(a4 + 8) = 0;
*(_QWORD *)a4 = 0i64;
result = a4;
*(_QWORD *)(a4 + 16) = 0i64;
*(_QWORD *)(a4 + 40) = 0i64;
return result;
}
| openssl |
_woutput_l | __int64 __fastcall woutput_l(__int64 a1, wchar_t *a2, const __m128i *a3, int *a4)
{
int v7; // ebp
int v8; // r13d
wchar_t v10; // r12
int v11; // esi
int v12; // r14d
int v13; // edx
char *v14; // rbx
int v15; // ecx
__int16 *v16; // rax
int v17; // r12d
__int64 v18; // kr00_8
int v19; // edi
char *v20; // rsi
int v21; // edi
wchar_t v22; // ax
int v23; // r14d
int v24; // eax
char *i; // rax
int v26; // r9d
int v27; // edx
__int16 *v28; // rdi
__int64 v29; // r8
char v30; // si
char *v31; // rbx
int v32; // ecx
unsigned __int64 v33; // rdx
char v34; // al
int v35; // esp
int v36; // eax
int v37; // esi
void *v38; // rax
__int64 v39; // rax
PVOID v40; // rax
void (__fastcall *v41)(char *, __crt_locale_pointers *); // rax
void (__fastcall *v42)(char *, __crt_locale_pointers *); // rax
__int64 v43; // rsi
int v44; // r13d
__int64 v45; // rdi
const char *v46; // rdi
int v47; // esi
int v48; // eax
__int64 v49; // r12
int v50; // eax
int v51; // [rsp+40h] [rbp-4B8h] BYREF
int v52; // [rsp+44h] [rbp-4B4h]
int v53; // [rsp+48h] [rbp-4B0h]
int v54; // [rsp+4Ch] [rbp-4ACh]
int v55; // [rsp+50h] [rbp-4A8h]
char SrcCh[4]; // [rsp+54h] [rbp-4A4h] BYREF
wchar_t DstCh[2]; // [rsp+58h] [rbp-4A0h] BYREF
wchar_t v58[2]; // [rsp+5Ch] [rbp-49Ch] BYREF
int v59; // [rsp+60h] [rbp-498h]
int v60; // [rsp+64h] [rbp-494h]
__int64 v61; // [rsp+68h] [rbp-490h]
int v62; // [rsp+70h] [rbp-488h]
int v63; // [rsp+74h] [rbp-484h]
__crt_locale_pointers Locale; // [rsp+78h] [rbp-480h] BYREF
__int64 v65; // [rsp+88h] [rbp-470h]
char v66; // [rsp+90h] [rbp-468h]
void *Block; // [rsp+98h] [rbp-460h]
wchar_t *v68; // [rsp+A0h] [rbp-458h]
char *v69; // [rsp+A8h] [rbp-450h] BYREF
wchar_t Str[255]; // [rsp+B0h] [rbp-448h] BYREF
char v71; // [rsp+2AFh] [rbp-249h] BYREF
v61 = a1;
v63 = 0;
v7 = 0;
v55 = 0;
v8 = 0;
v53 = 0;
v54 = 0;
v59 = 0;
v52 = 0;
_LocaleUpdate::_LocaleUpdate((_LocaleUpdate *)&Locale, a3);
if ( a1 && a2 )
{
v10 = *a2;
v11 = 0;
v51 = 0;
v12 = 0;
v13 = 0;
Block = 0i64;
if ( v10 )
{
v14 = v69;
do
{
v68 = ++a2;
if ( v11 < 0 )
break;
if ( (unsigned __int16)(v10 - 32) > 0x58u )
v15 = 0;
else
v15 = byte_140259980[v10 - 32] & 0xF;
v13 = byte_140259980[8 * v15 + v13] >> 4;
v60 = v13;
switch ( v13 )
{
case 0:
goto $NORMAL_STATE$30046;
case 1:
v8 = -1;
v62 = 0;
v59 = 0;
v55 = 0;
v54 = 0;
v7 = 0;
v53 = -1;
v52 = 0;
break;
case 2:
switch ( v10 )
{
case ' ':
v7 |= 2u;
break;
case '#':
v7 |= 0x80u;
break;
case '+':
v7 |= 1u;
break;
case '-':
v7 |= 4u;
break;
case '0':
v7 |= 8u;
break;
}
break;
case 3:
if ( v10 == 42 )
{
v50 = *a4;
a4 += 2;
v55 = v50;
if ( v50 < 0 )
{
v7 |= 4u;
v55 = -v50;
}
}
else
{
v55 = v10 + 10 * v55 - 48;
}
break;
case 4:
v8 = 0;
v53 = 0;
break;
case 5:
if ( v10 == 42 )
{
v8 = *a4;
a4 += 2;
v53 = v8;
if ( v8 < 0 )
{
v8 = -1;
v53 = -1;
}
}
else
{
v8 = v10 + 10 * v8 - 48;
v53 = v8;
}
break;
case 6:
if ( v10 != 73 )
{
switch ( v10 )
{
case 'h':
v7 |= 0x20u;
break;
case 'l':
if ( *a2 == 108 )
{
++a2;
v7 |= 0x1000u;
}
else
{
v7 |= 0x10u;
}
break;
case 'w':
v7 |= 0x800u;
break;
}
break;
}
v7 |= 0x8000u;
if ( *a2 == 54 && a2[1] == 52 )
{
a2 += 2;
v7 |= 0x8000u;
}
else
{
if ( *a2 != 51 || a2[1] != 50 )
{
if ( *a2 == 100 || *a2 == 105 || *a2 == 111 || *a2 == 117 || *a2 == 120 || *a2 == 88 )
break;
v60 = 0;
$NORMAL_STATE$30046:
v52 = 1;
write_char_0(v10, v61, &v51);
v11 = v51;
LABEL_218:
v13 = v60;
break;
}
a2 += 2;
v7 &= ~0x8000u;
}
break;
case 7:
if ( v10 > 0x64u )
{
if ( v10 < 0x65u )
goto LABEL_51;
if ( v10 <= 0x67u )
{
v23 = v62;
goto LABEL_128;
}
switch ( v10 )
{
case 'i':
goto LABEL_93;
case 'n':
v28 = *(__int16 **)a4;
a4 += 2;
if ( !get_printf_count_output() )
goto LABEL_2;
if ( (v7 & 0x20) != 0 )
*v28 = v11;
else
*(_DWORD *)v28 = v11;
v59 = 1;
goto LABEL_172;
case 'o':
v26 = 8;
if ( (v7 & 0x80u) != 0 )
v7 |= 0x200u;
goto LABEL_95;
case 'p':
v8 = 16;
v7 |= 0x8000u;
goto LABEL_83;
case 's':
goto LABEL_40;
}
if ( v10 != 117 )
{
if ( v10 != 120 )
goto LABEL_51;
v24 = 39;
goto LABEL_84;
}
}
else
{
if ( v10 != 100 )
{
switch ( v10 )
{
case 'A':
goto LABEL_64;
case 'C':
if ( (v7 & 0x830) == 0 )
v7 |= 0x20u;
goto LABEL_59;
case 'E':
case 'G':
LABEL_64:
v23 = 1;
v10 += 32;
v62 = 1;
goto LABEL_128;
}
if ( v10 != 83 )
{
if ( v10 != 88 )
{
if ( v10 == 90 )
{
v16 = *(__int16 **)a4;
a4 += 2;
if ( !v16 || (v14 = (char *)*((_QWORD *)v16 + 1)) == 0i64 )
{
v14 = off_14027FEF0;
v12 = strlen(off_14027FEF0);
goto LABEL_51;
}
if ( (v7 & 0x800) != 0 )
{
v17 = 1;
v18 = *v16;
v52 = 1;
v12 = ((int)v18 - HIDWORD(v18)) >> 1;
}
else
{
v12 = *v16;
v17 = 0;
v52 = 0;
}
goto LABEL_52;
}
if ( v10 != 97 )
{
if ( v10 != 99 )
goto LABEL_51;
LABEL_59:
v22 = *(_WORD *)a4;
a4 += 2;
v17 = 1;
DstCh[0] = v22;
v52 = 1;
if ( (v7 & 0x20) != 0 )
{
SrcCh[0] = v22;
SrcCh[1] = 0;
if ( mbtowc_l(Str, SrcCh, *((int *)Locale.locinfo + 67), &Locale) < 0 )
v59 = 1;
}
else
{
Str[0] = v22;
}
v14 = (char *)Str;
v12 = 1;
LABEL_52:
if ( v59 )
goto LABEL_172;
if ( (v7 & 0x40) != 0 )
{
if ( (v7 & 0x100) != 0 )
{
v58[0] = 45;
goto LABEL_56;
}
if ( (v7 & 1) != 0 )
{
v58[0] = 43;
LABEL_56:
v21 = 1;
v54 = 1;
LABEL_154:
v43 = v61;
v44 = v55 - v12 - v21;
if ( (v7 & 0xC) == 0 )
write_multi_char_0(0x20u, v44, v61, &v51);
write_string_0(v58, v21, v43, &v51);
v45 = v61;
if ( (v7 & 8) != 0 && (v7 & 4) == 0 )
write_multi_char_0(0x30u, v44, v61, &v51);
if ( v17 || v12 <= 0 )
{
write_string_0((wchar_t *)v14, v12, v45, &v51);
LABEL_167:
v11 = v51;
}
else
{
v46 = v14;
v47 = v12;
while ( 1 )
{
--v47;
v48 = mbtowc_l(DstCh, v46, *((int *)Locale.locinfo + 67), &Locale);
v49 = v48;
if ( v48 <= 0 )
break;
write_char_0(DstCh[0], v61, &v51);
v46 += v49;
if ( v47 <= 0 )
{
v45 = v61;
goto LABEL_167;
}
}
v45 = v61;
v11 = -1;
v51 = -1;
}
if ( v11 >= 0 && (v7 & 4) != 0 )
{
write_multi_char_0(0x20u, v44, v45, &v51);
v11 = v51;
}
v8 = v53;
LABEL_172:
if ( Block )
{
free(Block);
a2 = v68;
Block = 0i64;
}
else
{
a2 = v68;
}
goto LABEL_218;
}
if ( (v7 & 2) != 0 )
{
v58[0] = 32;
v21 = 1;
v54 = 1;
goto LABEL_154;
}
}
v21 = v54;
goto LABEL_154;
}
v23 = v62;
LABEL_128:
v7 |= 0x40u;
v14 = (char *)Str;
v37 = 512;
if ( v8 < 0 )
{
v8 = 6;
goto LABEL_139;
}
if ( v8 )
{
if ( v8 > 512 )
v8 = 512;
v53 = v8;
if ( v8 > 163 )
{
v38 = malloc_crt(v8 + 349);
Block = v38;
if ( v38 )
{
v14 = (char *)v38;
v37 = v8 + 349;
}
else
{
v8 = 163;
LABEL_139:
v53 = v8;
}
}
}
else if ( v10 == 103 )
{
v8 = 1;
goto LABEL_139;
}
v39 = *(_QWORD *)a4;
a4 += 2;
v69 = (char *)v39;
v40 = DecodePointer(off_1402800A0);
((void (__fastcall *)(char **, char *, _QWORD, _QWORD, int, int, __crt_locale_pointers *))v40)(
&v69,
v14,
v37,
(unsigned int)(char)v10,
v8,
v23,
&Locale);
if ( (v7 & 0x80) != 0 && !v8 )
{
v41 = (void (__fastcall *)(char *, __crt_locale_pointers *))DecodePointer(off_1402800B8);
v41(v14, &Locale);
}
if ( v10 == 103 && (v7 & 0x80) == 0 )
{
v42 = (void (__fastcall *)(char *, __crt_locale_pointers *))DecodePointer(off_1402800B0);
v42(v14, &Locale);
}
if ( *v14 == 45 )
{
v7 |= 0x100u;
++v14;
}
v11 = v51;
v17 = v52;
v12 = strlen(v14);
goto LABEL_52;
}
LABEL_83:
v24 = 7;
LABEL_84:
v63 = v24;
v26 = 16;
if ( (v7 & 0x80u) != 0 )
{
v58[0] = 48;
v27 = 2;
v58[1] = v24 + 81;
$COMMON_INT$30190:
if ( (v7 & 0x8000) != 0 || (v7 & 0x1000) != 0 )
{
v29 = *(_QWORD *)a4;
a4 += 2;
}
else
{
a4 += 2;
if ( (v7 & 0x20) != 0 )
{
if ( (v7 & 0x40) != 0 )
v29 = *((__int16 *)a4 - 4);
else
v29 = *((unsigned __int16 *)a4 - 4);
}
else if ( (v7 & 0x40) != 0 )
{
v29 = *(a4 - 2);
}
else
{
v29 = (unsigned int)*(a4 - 2);
}
}
if ( (v7 & 0x40) != 0 && v29 < 0 )
{
v29 = -v29;
v7 |= 0x100u;
}
if ( (v7 & 0x8000) == 0 && (v7 & 0x1000) == 0 )
v29 = (unsigned int)v29;
if ( v8 >= 0 )
{
v7 &= ~8u;
if ( v8 > 512 )
v8 = 512;
}
else
{
v8 = 1;
}
v30 = v63;
v31 = &v71;
v54 = v29 != 0 ? v27 : 0;
while ( 1 )
{
v32 = v8--;
if ( v32 <= 0 && !v29 )
break;
v33 = v29 % (unsigned __int64)v26;
v29 /= (unsigned __int64)v26;
v34 = v33 + 48;
if ( (int)v33 + 48 > 57 )
v34 += v30;
*v31-- = v34;
}
v11 = v51;
v53 = v8;
v36 = v35 + 687 - (_DWORD)v31;
v14 = v31 + 1;
v12 = v36;
if ( (v7 & 0x200) != 0 && (!v36 || *v14 != 48) )
{
--v14;
v12 = v36 + 1;
*v14 = 48;
}
LABEL_51:
v17 = v52;
goto LABEL_52;
}
LABEL_95:
v27 = v54;
goto $COMMON_INT$30190;
}
if ( (v7 & 0x830) == 0 )
v7 |= 0x20u;
LABEL_40:
v14 = *(char **)a4;
v19 = v8;
if ( v8 == -1 )
v19 = 0x7FFFFFFF;
a4 += 2;
if ( (v7 & 0x20) == 0 )
{
v17 = 1;
if ( !v14 )
v14 = (char *)off_14027FEF8;
v52 = 1;
for ( i = v14; v19; i += 2 )
{
--v19;
if ( !*(_WORD *)i )
break;
}
v12 = (i - v14) >> 1;
goto LABEL_52;
}
v12 = 0;
if ( !v14 )
v14 = off_14027FEF0;
v20 = v14;
if ( v19 > 0 )
{
do
{
if ( !*v20 )
break;
if ( isleadbyte_l((unsigned __int8)*v20, &Locale) )
++v20;
++v12;
++v20;
}
while ( v12 < v19 );
}
v11 = v51;
goto LABEL_51;
}
LABEL_93:
v7 |= 0x40u;
}
v26 = 10;
goto LABEL_95;
}
v10 = *a2;
}
while ( *a2 );
}
if ( v66 )
*(_DWORD *)(v65 + 200) &= ~2u;
return (unsigned int)v11;
}
else
{
LABEL_2:
*errno() = 22;
invalid_parameter(0i64, 0i64, 0i64, 0, 0i64);
if ( v66 )
*(_DWORD *)(v65 + 200) &= ~2u;
return 0xFFFFFFFFi64;
}
}
| openssl |
_write | int __cdecl write(int FileHandle, const void *Buf, unsigned int MaxCharCount)
{
__int64 v7; // r14
__int64 v8; // rsi
int v9; // edi
if ( FileHandle == -2 )
{
*_doserrno() = 0;
*errno() = 9;
return -1;
}
else if ( FileHandle >= 0
&& FileHandle < uNumber
&& (v7 = (__int64)FileHandle >> 5,
v8 = 88i64 * (FileHandle & 0x1F),
(*(_BYTE *)(qword_140286BA0[v7] + v8 + 8) & 1) != 0) )
{
_lock_fhandle(FileHandle);
if ( (*(_BYTE *)(qword_140286BA0[v7] + v8 + 8) & 1) != 0 )
{
v9 = write_nolock(FileHandle, (const char *)Buf, MaxCharCount);
}
else
{
*errno() = 9;
*_doserrno() = 0;
v9 = -1;
}
unlock_fhandle(FileHandle);
return v9;
}
else
{
*_doserrno() = 0;
*errno() = 9;
invalid_parameter(0i64, 0i64, 0i64, 0, 0i64);
return -1;
}
}
| openssl |
_write_nolock | __int64 __fastcall write_nolock(int a1, const char *a2, unsigned int a3)
{
int v3; // ebp
DWORD v4; // edi
__int64 v5; // r13
__int64 v7; // rbx
__int64 v9; // r14
__int64 v10; // rcx
__int64 v11; // r15
char v12; // si
BOOL v13; // ebx
const char *v14; // rbx
DWORD v15; // r14d
__int64 v16; // rdx
CHAR v17; // al
size_t v18; // r8
CHAR *v19; // rdx
int v20; // ebp
int LastError; // ebx
__int64 v22; // rcx
const char *v23; // rbp
int v24; // r14d
CHAR *v25; // rsi
unsigned __int64 k; // rcx
CHAR v27; // al
int v28; // esp
DWORD v29; // r8d
int v30; // r14d
CHAR *v31; // rsi
unsigned __int64 j; // rcx
WCHAR v33; // ax
int v34; // esp
DWORD v35; // r8d
WCHAR *v36; // rcx
unsigned __int64 i; // rdx
WCHAR v38; // ax
int v39; // esp
int v40; // kr00_4
int v41; // r14d
int v42; // esi
int v43; // [rsp+40h] [rbp-1B28h]
WCHAR WideCharStr[2]; // [rsp+44h] [rbp-1B24h] BYREF
DWORD v45; // [rsp+48h] [rbp-1B20h] BYREF
DWORD NumberOfBytesWritten; // [rsp+4Ch] [rbp-1B1Ch] BYREF
__int64 v47; // [rsp+50h] [rbp-1B18h]
DWORD Mode; // [rsp+58h] [rbp-1B10h] BYREF
CHAR MultiByteStr[20]; // [rsp+5Ch] [rbp-1B0Ch] BYREF
WCHAR v50[856]; // [rsp+70h] [rbp-1AF8h] BYREF
CHAR Buffer[5120]; // [rsp+720h] [rbp-1448h] BYREF
v3 = 0;
v4 = 0;
v5 = a3;
v7 = a1;
v43 = 0;
if ( !a3 )
return 0i64;
if ( !a2
|| ((v9 = (__int64)a1 >> 5,
v10 = qword_140286BA0[v9],
v47 = v7 >> 5,
v11 = 88 * (v7 & 0x1F),
v12 = (char)(2 * *(_BYTE *)(v11 + v10 + 56)) >> 1,
v12 == 2)
|| v12 == 1)
&& (a3 & 1) != 0 )
{
*_doserrno() = 0;
*errno() = 22;
invalid_parameter(0i64, 0i64, 0i64, 0, 0i64);
return 0xFFFFFFFFi64;
}
if ( (*(_BYTE *)(v11 + v10 + 8) & 0x20) != 0 )
lseeki64_nolock((unsigned int)v7, 0i64, 2i64);
if ( isatty(v7) )
{
if ( *(char *)(v11 + qword_140286BA0[v9] + 8) < 0 )
{
v13 = *(_DWORD *)(getptd()[24] + 20i64) == 0;
if ( GetConsoleMode(*(HANDLE *)(v11 + qword_140286BA0[v9]), &Mode) )
{
if ( !v13 || v12 )
{
NumberOfBytesWritten = 0;
v14 = a2;
Mode = GetConsoleCP();
if ( (_DWORD)v5 )
{
v15 = Mode;
while ( 1 )
{
if ( v12 )
{
if ( v12 == 1 || v12 == 2 )
{
WideCharStr[0] = *(_WORD *)v14;
v15 = WideCharStr[0] == 10;
v14 += 2;
}
if ( v12 == 1 || v12 == 2 )
{
if ( putwch_nolock(WideCharStr[0]) != WideCharStr[0] )
goto LABEL_52;
v4 += 2;
if ( v15 )
{
WideCharStr[0] = 13;
if ( putwch_nolock(0xDu) != 13 )
goto LABEL_52;
++v4;
++v43;
}
}
goto LABEL_43;
}
v16 = qword_140286BA0[v47];
v15 = *v14 == 10;
if ( *(_DWORD *)(v11 + v16 + 80) )
{
v17 = *(_BYTE *)(v11 + v16 + 76);
MultiByteStr[1] = *v14;
v18 = 2i64;
MultiByteStr[0] = v17;
*(_DWORD *)(v11 + v16 + 80) = 0;
v19 = MultiByteStr;
}
else
{
if ( isleadbyte(*v14) )
{
if ( (__int64)&a2[v5 - (_QWORD)v14] <= 1 )
{
v9 = v47;
++v4;
*(_BYTE *)(v11 + qword_140286BA0[v47] + 76) = *v14;
*(_DWORD *)(v11 + qword_140286BA0[v9] + 80) = 1;
LastError = NumberOfBytesWritten;
goto LABEL_46;
}
if ( mbtowc(WideCharStr, v14, 2ui64) == -1 )
goto LABEL_44;
++v14;
goto LABEL_27;
}
v18 = 1i64;
v19 = (CHAR *)v14;
}
if ( mbtowc(WideCharStr, v19, v18) == -1 )
goto LABEL_44;
LABEL_27:
++v14;
v20 = WideCharToMultiByte(Mode, 0, WideCharStr, 1, MultiByteStr, 5, 0i64, 0i64);
if ( !v20 )
goto LABEL_44;
if ( !WriteFile(*(HANDLE *)(v11 + qword_140286BA0[v47]), MultiByteStr, v20, &NumberOfBytesWritten, 0i64) )
goto LABEL_52;
v4 = v43 + (_DWORD)v14 - (_DWORD)a2;
if ( (int)NumberOfBytesWritten < v20 )
goto LABEL_44;
if ( v15 )
{
MultiByteStr[0] = 13;
if ( !WriteFile(*(HANDLE *)(v11 + qword_140286BA0[v47]), MultiByteStr, 1u, &NumberOfBytesWritten, 0i64) )
goto LABEL_52;
if ( (int)NumberOfBytesWritten < 1 )
{
LABEL_44:
LastError = NumberOfBytesWritten;
goto LABEL_45;
}
++v43;
++v4;
}
LABEL_43:
if ( (int)v14 - (int)a2 >= (unsigned int)v5 )
goto LABEL_44;
}
}
LastError = NumberOfBytesWritten;
goto LABEL_48;
}
}
}
}
v22 = qword_140286BA0[v9];
if ( *(char *)(v11 + v22 + 8) >= 0 )
{
if ( WriteFile(*(HANDLE *)(v11 + v22), a2, v5, &v45, 0i64) )
{
v4 = v45;
LastError = 0;
}
else
{
LastError = GetLastError();
}
}
else
{
LastError = 0;
v23 = a2;
if ( v12 )
{
if ( v12 != 2 )
{
if ( (_DWORD)v5 )
{
while ( 1 )
{
v36 = v50;
for ( i = 0i64; i < 0x6A8; i += 2i64 )
{
if ( (int)v23 - (int)a2 >= (unsigned int)v5 )
break;
v38 = *(_WORD *)v23;
v23 += 2;
if ( v38 == 10 )
{
*v36++ = 13;
i += 2i64;
}
*v36++ = v38;
}
v40 = (_DWORD)v36 - (v39 + 112);
v41 = WideCharToMultiByte(0xFDE9u, 0, v50, v40 / 2, Buffer, 3413, 0i64, 0i64);
if ( !v41 )
break;
v42 = 0;
while ( WriteFile(*(HANDLE *)(v11 + qword_140286BA0[v47]), &Buffer[v42], v41 - v42, &v45, 0i64) )
{
v42 += v45;
if ( v41 <= v42 )
goto LABEL_90;
}
LastError = GetLastError();
LABEL_90:
if ( v41 <= v42 )
{
v4 = (_DWORD)v23 - (_DWORD)a2;
if ( (int)v23 - (int)a2 < (unsigned int)v5 )
continue;
}
goto LABEL_45;
}
LABEL_52:
LastError = GetLastError();
LABEL_45:
v9 = v47;
goto LABEL_46;
}
goto LABEL_97;
}
if ( !(_DWORD)v5 )
{
LABEL_97:
if ( (*(_BYTE *)(v11 + qword_140286BA0[v9] + 8) & 0x40) != 0 && *a2 == 26 )
return 0i64;
*errno() = 28;
*_doserrno() = 0;
return 0xFFFFFFFFi64;
}
while ( 1 )
{
v30 = v43;
v31 = Buffer;
for ( j = 0i64; j < 0x13FE; j += 2i64 )
{
if ( (int)v23 - (int)a2 >= (unsigned int)v5 )
break;
v33 = *(_WORD *)v23;
v23 += 2;
if ( v33 == 10 )
{
*(_WORD *)v31 = 13;
v30 += 2;
v31 += 2;
j += 2i64;
}
*(_WORD *)v31 = v33;
v31 += 2;
}
v35 = (_DWORD)v31 - (v34 + 1824);
v43 = v30;
v9 = v47;
if ( !WriteFile(*(HANDLE *)(v11 + qword_140286BA0[v47]), Buffer, v35, &v45, 0i64) )
break;
v4 += v45;
if ( (int)v45 < v31 - Buffer || (int)v23 - (int)a2 >= (unsigned int)v5 )
goto LABEL_46;
}
}
else
{
if ( !(_DWORD)v5 )
goto LABEL_97;
while ( 1 )
{
v24 = v43;
v25 = Buffer;
for ( k = 0i64; k < 0x13FF; ++k )
{
if ( (int)v23 - (int)a2 >= (unsigned int)v5 )
break;
v27 = *v23++;
if ( v27 == 10 )
{
*v25 = 13;
++v24;
++v25;
++k;
}
*v25++ = v27;
}
v29 = (_DWORD)v25 - (v28 + 1824);
v43 = v24;
v9 = v47;
if ( !WriteFile(*(HANDLE *)(v11 + qword_140286BA0[v47]), Buffer, v29, &v45, 0i64) )
break;
v4 += v45;
if ( (int)v45 < v25 - Buffer || (int)v23 - (int)a2 >= (unsigned int)v5 )
goto LABEL_46;
}
}
LastError = GetLastError();
LABEL_46:
v3 = v43;
}
if ( !v4 )
{
LABEL_48:
if ( LastError )
{
if ( LastError == 5 )
{
*errno() = 9;
*_doserrno() = 5;
}
else
{
dosmaperr(LastError);
}
return 0xFFFFFFFFi64;
}
goto LABEL_97;
}
return v4 - v3;
}
| openssl |
_XcptFilter | __int64 __fastcall XcptFilter(int a1, __int64 a2)
{
_QWORD *v4; // rax
_QWORD *v5; // rbx
unsigned __int64 v6; // rcx
unsigned __int64 v7; // rdx
void (*v8)(void); // r8
__int64 v10; // rbp
int v11; // r10d
__int64 v12; // r9
int v13; // edi
v4 = getptd_noexit();
v5 = v4;
if ( !v4 )
return 0i64;
v6 = v4[20];
v7 = v6;
do
{
if ( *(_DWORD *)v7 == a1 )
break;
v7 += 16i64;
}
while ( v7 < v6 + 16i64 * dword_1402800CC );
if ( v7 >= v6 + 16i64 * dword_1402800CC || *(_DWORD *)v7 != a1 )
v7 = 0i64;
if ( !v7 )
return 0i64;
v8 = *(void (**)(void))(v7 + 8);
if ( !v8 )
return 0i64;
if ( v8 == (void (*)(void))5 )
{
*(_QWORD *)(v7 + 8) = 0i64;
return 1i64;
}
else
{
if ( v8 != (void (*)(void))1 )
{
v10 = v4[21];
v4[21] = a2;
if ( *(_DWORD *)(v7 + 4) == 8 )
{
v11 = dword_1402800C0;
v12 = dword_1402800C0;
if ( dword_1402800C0 < dword_1402800C0 + dword_1402800C4 )
{
v12 = 16i64 * dword_1402800C0;
do
{
++v11;
v12 += 16i64;
*(_QWORD *)(v12 + v4[20] - 8) = 0i64;
}
while ( v11 < dword_1402800C4 + dword_1402800C0 );
}
v13 = *((_DWORD *)v4 + 44);
switch ( *(_DWORD *)v7 )
{
case 0xC000008E:
*((_DWORD *)v4 + 44) = 131;
break;
case 0xC0000090:
*((_DWORD *)v4 + 44) = 129;
break;
case 0xC0000091:
*((_DWORD *)v4 + 44) = 132;
break;
case 0xC0000093:
*((_DWORD *)v4 + 44) = 133;
break;
case 0xC000008D:
*((_DWORD *)v4 + 44) = 130;
break;
case 0xC000008F:
*((_DWORD *)v4 + 44) = 134;
break;
case 0xC0000092:
*((_DWORD *)v4 + 44) = 138;
break;
}
((void (__fastcall *)(__int64, _QWORD, void (*)(void), __int64))v8)(8i64, *((unsigned int *)v4 + 44), v8, v12);
*((_DWORD *)v5 + 44) = v13;
}
else
{
*(_QWORD *)(v7 + 8) = 0i64;
v8();
}
v5[21] = v10;
}
return 0xFFFFFFFFi64;
}
}
| openssl |
_ZN6System16GetMemoryManagerERNS_14TMemoryManagerE | __int64 (__fastcall *__fastcall System::GetMemoryManager(
_QWORD *a1,
__int64 a2,
__int64 a3,
_QWORD *a4))(_QWORD, _QWORD, _QWORD, _QWORD)
{
__int64 (__fastcall *result)(_QWORD, _QWORD, _QWORD, _QWORD); // rax
*a1 = qword_1402823B0;
a1[1] = qword_1402823B8;
result = (__int64 (__fastcall *)(_QWORD, _QWORD, _QWORD, _QWORD))qword_1402823C0;
a1[2] = qword_1402823C0;
return result;
}
| openssl |
__addlocaleref | __int64 __fastcall _addlocaleref(__int64 a1)
{
volatile signed __int32 *v1; // rax
volatile signed __int32 *v2; // rax
volatile signed __int32 *v3; // rax
volatile signed __int32 *v4; // rax
volatile signed __int32 **v5; // rax
__int64 v6; // r8
volatile signed __int32 *v7; // rdx
__int64 result; // rax
_InterlockedAdd((volatile signed __int32 *)a1, 1u);
v1 = *(volatile signed __int32 **)(a1 + 272);
if ( v1 )
_InterlockedAdd(v1, 1u);
v2 = *(volatile signed __int32 **)(a1 + 288);
if ( v2 )
_InterlockedAdd(v2, 1u);
v3 = *(volatile signed __int32 **)(a1 + 280);
if ( v3 )
_InterlockedAdd(v3, 1u);
v4 = *(volatile signed __int32 **)(a1 + 304);
if ( v4 )
_InterlockedAdd(v4, 1u);
v5 = (volatile signed __int32 **)(a1 + 88);
v6 = 6i64;
do
{
if ( *(v5 - 2) != (volatile signed __int32 *)&unk_14027F940 && *v5 )
_InterlockedAdd(*v5, 1u);
if ( *(v5 - 1) )
{
v7 = v5[1];
if ( v7 )
_InterlockedAdd(v7, 1u);
}
v5 += 4;
--v6;
}
while ( v6 );
result = *(_QWORD *)(a1 + 344);
_InterlockedAdd((volatile signed __int32 *)(result + 352), 1u);
return result;
}
| openssl |
__alloca_probe | unsigned __int64 __fastcall _alloca_probe()
{
unsigned __int64 result; // rax
char *v1; // r10
char *StackLimit; // r11
char v3; // [rsp+18h] [rbp+8h] BYREF
v1 = &v3 - result;
if ( (unsigned __int64)&v3 < result )
v1 = 0i64;
StackLimit = (char *)NtCurrentTeb()->NtTib.StackLimit;
if ( v1 < StackLimit )
{
LOWORD(v1) = (unsigned __int16)v1 & 0xF000;
do
{
StackLimit -= 4096;
*StackLimit = 0;
}
while ( v1 != StackLimit );
}
return result;
}
| openssl |
__ansicp | int __fastcall _ansicp(LCID a1)
{
CHAR LCData[8]; // [rsp+20h] [rbp-18h] BYREF
LCData[6] = 0;
if ( GetLocaleInfoA(a1, 0x1004u, LCData, 6) )
return atoi(LCData);
else
return -1;
}
| openssl |
__ascii_stricmp | __int64 __fastcall _ascii_stricmp(unsigned __int8 *a1, unsigned __int8 *a2)
{
int v3; // r8d
int v4; // ecx
do
{
v3 = *a1++;
if ( (unsigned int)(v3 - 65) <= 0x19 )
v3 += 32;
v4 = *a2++;
if ( (unsigned int)(v4 - 65) <= 0x19 )
v4 += 32;
}
while ( v3 && v3 == v4 );
return (unsigned int)(v3 - v4);
}
| openssl |
__ascii_strnicmp | __int64 __fastcall _ascii_strnicmp(unsigned __int8 *a1, unsigned __int8 *a2, __int64 a3)
{
int v4; // r9d
int v5; // ecx
if ( !a3 )
return 0i64;
do
{
v4 = *a1++;
if ( (unsigned int)(v4 - 65) <= 0x19 )
v4 += 32;
v5 = *a2++;
if ( (unsigned int)(v5 - 65) <= 0x19 )
v5 += 32;
--a3;
}
while ( a3 && v4 && v4 == v5 );
return (unsigned int)(v4 - v5);
}
| openssl |
__check_float_string | __int64 __fastcall _check_float_string(__int64 a1, __int64 *a2, void **a3, void *a4, _DWORD *a5)
{
__int64 v8; // rax
void *v10; // rax
if ( a1 == *a2 )
{
if ( *a3 == a4 )
{
v8 = calloc_crt(*a2, 2i64);
*a3 = (void *)v8;
if ( !v8 )
return 0i64;
*a5 = 1;
memmove(*a3, a4, *a2);
*a2 *= 2i64;
}
else
{
v10 = recalloc_crt(*a3, *a2, 2ui64);
if ( !v10 )
return 0i64;
*a3 = v10;
*a2 *= 2i64;
}
}
return 1i64;
}
| openssl |
__convertcp | LPSTR __fastcall _convertcp(UINT CodePage, UINT a2, char *Str, int *a4, LPSTR a5, int cbMultiByte)
{
int v6; // r12d
LPSTR v8; // rsi
int cchWideChar; // edi
size_t v12; // rcx
unsigned __int64 v13; // rax
void *v14; // rsp
int *lpWideCharStr; // rbx
int *v17; // rax
CHAR *v18; // rax
int v19; // eax
__int64 v20; // [rsp+0h] [rbp-40h] BYREF
int v21; // [rsp+40h] [rbp+0h] BYREF
LPCCH lpMultiByteStr; // [rsp+48h] [rbp+8h]
int *v23; // [rsp+50h] [rbp+10h]
struct _cpinfo CPInfo; // [rsp+58h] [rbp+18h] BYREF
v6 = *a4;
v8 = 0i64;
v21 = 0;
v23 = a4;
lpMultiByteStr = Str;
if ( CodePage != a2 )
{
if ( GetCPInfo(CodePage, &CPInfo) && CPInfo.MaxCharSize == 1 && GetCPInfo(a2, &CPInfo) && CPInfo.MaxCharSize == 1 )
{
v21 = 1;
if ( v6 == -1 )
cchWideChar = strlen(Str) + 1;
else
cchWideChar = v6;
}
else
{
cchWideChar = MultiByteToWideChar(CodePage, 1u, Str, v6, 0i64, 0);
if ( !cchWideChar )
return 0i64;
}
if ( cchWideChar <= 0 || (unsigned __int64)cchWideChar > 0x7FFFFFFFFFFFFFF0i64 )
{
lpWideCharStr = 0i64;
}
else
{
v12 = 2i64 * cchWideChar + 16;
if ( v12 > 0x400 )
{
v17 = (int *)malloc(v12);
lpWideCharStr = v17;
if ( !v17 )
goto LABEL_22;
*v17 = 56797;
}
else
{
v13 = 2i64 * cchWideChar + 31;
if ( v13 <= 2i64 * cchWideChar + 16 )
v13 = 0xFFFFFFFFFFFFFF0i64;
v14 = alloca(v13 & 0xFFFFFFFFFFFFFFF0ui64);
lpWideCharStr = &v21;
if ( &v20 == (__int64 *)-64i64 )
return 0i64;
v21 = 52428;
}
lpWideCharStr += 4;
}
LABEL_22:
if ( lpWideCharStr )
{
memset(lpWideCharStr, 0, 2i64 * cchWideChar);
if ( MultiByteToWideChar(CodePage, 1u, lpMultiByteStr, v6, (LPWSTR)lpWideCharStr, cchWideChar) )
{
if ( a5 )
{
if ( WideCharToMultiByte(a2, 0, (LPCWCH)lpWideCharStr, cchWideChar, a5, cbMultiByte, 0i64, 0i64) )
v8 = a5;
}
else if ( v21
|| (cchWideChar = WideCharToMultiByte(a2, 0, (LPCWCH)lpWideCharStr, cchWideChar, 0i64, 0, 0i64, 0i64)) != 0 )
{
v18 = (CHAR *)calloc_crt(1i64, cchWideChar);
v8 = v18;
if ( v18 )
{
v19 = WideCharToMultiByte(a2, 0, (LPCWCH)lpWideCharStr, cchWideChar, v18, cchWideChar, 0i64, 0i64);
if ( v19 )
{
if ( v6 != -1 )
*v23 = v19;
}
else
{
free(v8);
v8 = 0i64;
}
}
}
}
if ( *(lpWideCharStr - 4) == 56797 )
free(lpWideCharStr - 4);
return v8;
}
return 0i64;
}
return v8;
}
| openssl |
__crtCompareStringA | __int64 __fastcall _crtCompareStringA(const __m128i *a1, LCID a2, DWORD a3, char *a4, int a5, char *a6, int a7, int a8)
{
__int64 result; // rax
char v12[16]; // [rsp+40h] [rbp-28h] BYREF
__int64 v13; // [rsp+50h] [rbp-18h]
char v14; // [rsp+58h] [rbp-10h]
_LocaleUpdate::_LocaleUpdate((_LocaleUpdate *)v12, a1);
result = __crtCompareStringA_stat((struct localeinfo_struct *)v12, a2, a3, a4, a5, a6, a7, a8);
if ( v14 )
*(_DWORD *)(v13 + 200) &= ~2u;
return result;
}
| openssl |
__crtCorExitProcess | HMODULE __fastcall _crtCorExitProcess(unsigned int a1)
{
HMODULE result; // rax
result = GetModuleHandleW(L"mscoree.dll");
if ( result )
{
result = (HMODULE)GetProcAddress(result, "CorExitProcess");
if ( result )
return (HMODULE)((__int64 (__fastcall *)(_QWORD))result)(a1);
}
return result;
}
| openssl |
__crtExitProcess | void __fastcall __noreturn _crtExitProcess(UINT uExitCode)
{
_crtCorExitProcess(uExitCode);
ExitProcess(uExitCode);
}
| openssl |
__crtGetEnvironmentStringsA | CHAR *_crtGetEnvironmentStringsA()
{
int v0; // ecx
WCHAR *EnvironmentStringsW; // rbx
DWORD LastError; // eax
WCHAR *i; // rdi
__int64 v5; // rdi
int v6; // eax
int cbMultiByte; // ebp
CHAR *lpMultiByteStr; // rax
CHAR *v9; // rsi
LPCH EnvironmentStrings; // rax
CHAR *v11; // rbx
size_t v12; // rsi
void *v13; // rax
void *v14; // rdi
v0 = dword_140286248;
EnvironmentStringsW = 0i64;
if ( !dword_140286248 )
{
EnvironmentStringsW = GetEnvironmentStringsW();
if ( EnvironmentStringsW )
{
dword_140286248 = 1;
LABEL_8:
if ( !EnvironmentStringsW )
{
EnvironmentStringsW = GetEnvironmentStringsW();
if ( !EnvironmentStringsW )
return 0i64;
}
for ( i = EnvironmentStringsW; *i; ++i )
{
do
++i;
while ( *i );
}
v5 = i - EnvironmentStringsW;
v6 = WideCharToMultiByte(0, 0, EnvironmentStringsW, v5 + 1, 0i64, 0, 0i64, 0i64);
cbMultiByte = v6;
if ( v6 )
{
lpMultiByteStr = (CHAR *)malloc_crt(v6);
v9 = lpMultiByteStr;
if ( lpMultiByteStr )
{
if ( WideCharToMultiByte(0, 0, EnvironmentStringsW, v5 + 1, lpMultiByteStr, cbMultiByte, 0i64, 0i64) )
{
LABEL_19:
FreeEnvironmentStringsW(EnvironmentStringsW);
return v9;
}
free(v9);
}
}
v9 = 0i64;
goto LABEL_19;
}
LastError = GetLastError();
v0 = dword_140286248;
if ( LastError == 120 )
v0 = 2;
dword_140286248 = v0;
}
if ( v0 == 1 )
goto LABEL_8;
if ( v0 != 2 && v0 )
return 0i64;
EnvironmentStrings = GetEnvironmentStrings();
v11 = EnvironmentStrings;
if ( !EnvironmentStrings )
return 0i64;
for ( ; *EnvironmentStrings; ++EnvironmentStrings )
{
do
++EnvironmentStrings;
while ( *EnvironmentStrings );
}
v12 = (int)EnvironmentStrings - (int)v11 + 1;
v13 = malloc_crt(v12);
v14 = v13;
if ( !v13 )
{
FreeEnvironmentStringsA(v11);
return 0i64;
}
memmove(v13, v11, v12);
FreeEnvironmentStringsA(v11);
return (CHAR *)v14;
}
| openssl |
__crtGetStringTypeA | __int64 __fastcall _crtGetStringTypeA(
const __m128i *a1,
DWORD a2,
char *a3,
int a4,
unsigned __int16 *a5,
int a6,
int a7,
int a8)
{
__int64 result; // rax
char v12[16]; // [rsp+40h] [rbp-28h] BYREF
__int64 v13; // [rsp+50h] [rbp-18h]
char v14; // [rsp+58h] [rbp-10h]
_LocaleUpdate::_LocaleUpdate((_LocaleUpdate *)v12, a1);
result = __crtGetStringTypeA_stat((struct localeinfo_struct *)v12, a2, a3, a4, a5, a6, a7, a8);
if ( v14 )
*(_DWORD *)(v13 + 200) &= ~2u;
return result;
}
| openssl |
__crtGetStringTypeW | BOOL __fastcall _crtGetStringTypeW(const __m128i *a1, DWORD dwInfoType, LPCWCH lpSrcStr, int cchSrc, LPWORD lpCharType)
{
BOOL result; // eax
char v9[16]; // [rsp+20h] [rbp-28h] BYREF
__int64 v10; // [rsp+30h] [rbp-18h]
char v11; // [rsp+38h] [rbp-10h]
_LocaleUpdate::_LocaleUpdate((_LocaleUpdate *)v9, a1);
result = cchSrc >= -1 && GetStringTypeW(dwInfoType, lpSrcStr, cchSrc, lpCharType);
if ( v11 )
*(_DWORD *)(v10 + 200) &= ~2u;
return result;
}
| openssl |
__crtInitCritSecAndSpinCount | BOOL __fastcall _crtInitCritSecAndSpinCount(_RTL_CRITICAL_SECTION *lpCriticalSection, DWORD dwSpinCount)
{
return InitializeCriticalSectionAndSpinCount(lpCriticalSection, dwSpinCount);
}
| openssl |
__crtLCMapStringA | __int64 __fastcall _crtLCMapStringA(
const __m128i *a1,
LCID a2,
DWORD a3,
char *a4,
int a5,
char *a6,
int a7,
int a8,
int a9)
{
__int64 result; // rax
char v13[16]; // [rsp+50h] [rbp-28h] BYREF
__int64 v14; // [rsp+60h] [rbp-18h]
char v15; // [rsp+68h] [rbp-10h]
_LocaleUpdate::_LocaleUpdate((_LocaleUpdate *)v13, a1);
result = __crtLCMapStringA_stat((struct localeinfo_struct *)v13, a2, a3, a4, a5, (WCHAR *)a6, a7, a8, a9);
if ( v15 )
*(_DWORD *)(v14 + 200) &= ~2u;
return result;
}
| openssl |
__crtLCMapStringW | int __fastcall _crtLCMapStringW(
const __m128i *a1,
LCID Locale,
DWORD dwMapFlags,
LPCWSTR lpSrcStr,
int a5,
LPWSTR lpDestStr,
int cchDest)
{
int v10; // r9d
int v11; // eax
LPCWSTR v12; // rcx
int result; // eax
__int64 v14; // [rsp+30h] [rbp-28h] BYREF
__int64 v15; // [rsp+40h] [rbp-18h]
char v16; // [rsp+48h] [rbp-10h]
_LocaleUpdate::_LocaleUpdate((_LocaleUpdate *)&v14, a1);
v10 = a5;
if ( a5 > 0 )
{
v11 = a5;
v12 = lpSrcStr;
while ( 1 )
{
--v11;
if ( !*v12 )
break;
++v12;
if ( !v11 )
{
v11 = -1;
break;
}
}
v10 = a5 - v11 - 1;
}
result = LCMapStringW(Locale, dwMapFlags, lpSrcStr, v10, lpDestStr, cchDest);
if ( v16 )
*(_DWORD *)(v15 + 200) &= ~2u;
return result;
}
| openssl |
__crtMessageBoxA | // #STR: "MessageBoxA", "GetActiveWindow", "GetLastActivePopup", "GetUserObjectInformationA", "GetProcessWindowStation", "USER32.DLL"
__int64 __fastcall _crtMessageBoxA(const char *lpText, const char *lpCaption, unsigned int uType)
{
__int64 v6; // rbx
PVOID v7; // rdi
HMODULE LibraryA; // rax
HMODULE v9; // rsi
int (__stdcall *MessageBoxA)(HWND, LPCSTR, LPCSTR, UINT); // rax
HWND (__stdcall *GetActiveWindow)(); // rax
HWND (__stdcall *GetLastActivePopup)(HWND); // rax
BOOL (__stdcall *GetUserObjectInformationA)(HANDLE, int, PVOID, DWORD, LPDWORD); // rax
PVOID v14; // r11
HWINSTA (__stdcall *GetProcessWindowStation)(); // rax
PVOID v16; // rax
__int64 (*v17)(void); // rsi
unsigned int (__fastcall *v18)(__int64, __int64, char *); // rax
unsigned int (__fastcall *v19)(__int64, __int64, char *); // r12
__int64 v20; // rax
__int64 (*v21)(void); // rax
__int64 (__fastcall *v22)(__int64); // rax
__int64 (__fastcall *v23)(__int64, const char *, const char *, _QWORD); // rax
char v25[56]; // [rsp+30h] [rbp-38h] BYREF
v6 = 0i64;
v7 = unknown_libname_5();
if ( qword_140286278 )
{
v16 = qword_140286290;
goto LABEL_8;
}
LibraryA = LoadLibraryA("USER32.DLL");
v9 = LibraryA;
if ( !LibraryA )
return 0i64;
MessageBoxA = (int (__stdcall *)(HWND, LPCSTR, LPCSTR, UINT))GetProcAddress(LibraryA, "MessageBoxA");
if ( !MessageBoxA )
return 0i64;
qword_140286278 = EncodePointer(MessageBoxA);
GetActiveWindow = (HWND (__stdcall *)())GetProcAddress(v9, "GetActiveWindow");
qword_140286280 = EncodePointer(GetActiveWindow);
GetLastActivePopup = (HWND (__stdcall *)(HWND))GetProcAddress(v9, "GetLastActivePopup");
qword_140286288 = EncodePointer(GetLastActivePopup);
GetUserObjectInformationA = (BOOL (__stdcall *)(HANDLE, int, PVOID, DWORD, LPDWORD))GetProcAddress(
v9,
"GetUserObjectInformationA");
v14 = EncodePointer(GetUserObjectInformationA);
qword_140286298 = v14;
if ( v14 )
{
GetProcessWindowStation = (HWINSTA (__stdcall *)())GetProcAddress(v9, "GetProcessWindowStation");
v16 = EncodePointer(GetProcessWindowStation);
qword_140286290 = v16;
LABEL_8:
v14 = qword_140286298;
goto LABEL_9;
}
v16 = qword_140286290;
LABEL_9:
if ( v16 == v7
|| v14 == v7
|| (v17 = (__int64 (*)(void))DecodePointer(v16),
v18 = (unsigned int (__fastcall *)(__int64, __int64, char *))DecodePointer(qword_140286298),
v19 = v18,
!v17)
|| !v18
|| (v20 = v17()) != 0 && v19(v20, 1i64, v25) && (v25[8] & 1) != 0 )
{
if ( qword_140286280 != v7 )
{
v21 = (__int64 (*)(void))DecodePointer(qword_140286280);
if ( v21 )
{
v6 = v21();
if ( v6 )
{
if ( qword_140286288 != v7 )
{
v22 = (__int64 (__fastcall *)(__int64))DecodePointer(qword_140286288);
if ( v22 )
v6 = v22(v6);
}
}
}
}
}
else
{
uType |= 0x200000u;
}
v23 = (__int64 (__fastcall *)(__int64, const char *, const char *, _QWORD))DecodePointer(qword_140286278);
if ( v23 )
return v23(v6, lpText, lpCaption, uType);
return 0i64;
}
| openssl |
__crtsetenv | __int64 __fastcall _crtsetenv(const unsigned __int8 **a1, int a2)
{
int v2; // ebp
unsigned int v4; // ebx
unsigned __int8 *v5; // r12
unsigned __int8 *v6; // rax
int v7; // edi
char **v8; // rsi
BOOL v9; // r15d
const char **v10; // rbp
int v11; // eax
char **v12; // rdi
char **v14; // rax
_QWORD *v15; // rax
char **v16; // rbp
char *v17; // rcx
int v18; // eax
__int64 v19; // rdi
size_t v20; // r13
__int64 v21; // rsi
char **v22; // rcx
char *v23; // rax
char **v24; // rax
int v25; // eax
size_t v26; // rax
char *v27; // rdi
size_t v28; // rax
unsigned __int8 *v29; // rdx
const CHAR *v30; // rdx
unsigned __int8 *v31; // [rsp+70h] [rbp+8h]
v2 = a2;
v4 = 0;
if ( !a1 )
{
*errno() = 22;
invalid_parameter(0i64, 0i64, 0i64, 0, 0i64);
return 0xFFFFFFFFi64;
}
v5 = (unsigned __int8 *)*a1;
if ( !*a1 || (v6 = mbschr(*a1, 0x3Du), v7 = (int)v6, (v31 = v6) == 0i64) || v5 == v6 )
{
LABEL_21:
*errno() = 22;
return 0xFFFFFFFFi64;
}
v8 = envp;
v9 = v6[1] == 0;
if ( envp == (char **)qword_140285540 )
{
v10 = (const char **)envp;
v11 = 0;
if ( envp )
{
while ( *v8 )
{
++v8;
++v11;
}
v12 = (char **)calloc_crt(v11 + 1, 8i64);
v8 = v12;
if ( !v12 )
amsg_exit(9u);
while ( *v10 )
*v12++ = strdup(*v10++);
*v12 = 0i64;
v7 = (int)v31;
}
else
{
v8 = 0i64;
}
v2 = a2;
envp = v8;
}
if ( !v8 )
{
if ( v2 && qword_140285548 )
{
if ( (unsigned int)_wtomb_environ() )
goto LABEL_21;
}
else
{
if ( v9 )
return 0i64;
v14 = (char **)malloc_crt(8ui64);
envp = v14;
if ( !v14 )
return 0xFFFFFFFFi64;
*v14 = 0i64;
if ( !qword_140285548 )
{
v15 = malloc_crt(8ui64);
qword_140285548 = (__int64)v15;
if ( !v15 )
return 0xFFFFFFFFi64;
*v15 = 0i64;
}
}
v8 = envp;
}
v16 = v8;
if ( !v8 )
return 0xFFFFFFFFi64;
v17 = *v8;
v18 = v7;
v19 = (__int64)v8;
v20 = v18 - (int)v5;
if ( *v8 )
{
while ( mbsnbicoll(v5, (const unsigned __int8 *)v17, v20)
|| *(_BYTE *)(v20 + *(_QWORD *)v19) != 61 && *(_BYTE *)(v20 + *(_QWORD *)v19) )
{
v19 += 8i64;
v17 = *(char **)v19;
if ( !*(_QWORD *)v19 )
{
v8 = envp;
goto LABEL_37;
}
}
v8 = envp;
v19 = (v19 - (__int64)envp) >> 3;
}
else
{
LABEL_37:
LODWORD(v19) = -(int)((v19 - (__int64)v8) >> 3);
}
if ( (int)v19 < 0 || !*v16 )
{
if ( !v9 )
{
if ( (int)v19 < 0 )
LODWORD(v19) = -(int)v19;
v25 = v19 + 2;
if ( (int)v19 + 2 <= (int)v19 )
return 0xFFFFFFFFi64;
if ( (unsigned __int64)v25 >= 0x1FFFFFFFFFFFFFFFi64 )
return 0xFFFFFFFFi64;
v24 = (char **)recalloc_crt(v8, 8ui64, v25);
if ( !v24 )
return 0xFFFFFFFFi64;
v24[(int)v19] = (char *)v5;
v24[(int)v19 + 1] = 0i64;
*a1 = 0i64;
goto LABEL_56;
}
free(v5);
*a1 = 0i64;
return 0i64;
}
v21 = (int)v19;
free(v16[(int)v19]);
if ( !v9 )
{
v16[(int)v19] = (char *)v5;
*a1 = 0i64;
goto LABEL_57;
}
if ( v16[(int)v19] )
{
v22 = &v16[(int)v19 + 1];
do
{
v23 = *v22;
LODWORD(v19) = v19 + 1;
++v22;
v16[v21++] = v23;
}
while ( v16[v21] );
}
if ( (unsigned __int64)(int)v19 >= 0x1FFFFFFFFFFFFFFFi64 )
goto LABEL_57;
v24 = (char **)recalloc_crt(envp, (int)v19, 8ui64);
if ( !v24 )
goto LABEL_57;
LABEL_56:
envp = v24;
LABEL_57:
if ( a2 )
{
v26 = strlen((const char *)v5);
v27 = (char *)calloc_crt(v26 + 2, 1i64);
if ( v27 )
{
v28 = strlen((const char *)v5);
if ( strcpy_s(v27, v28 + 2, (const char *)v5) )
invoke_watson(0i64, 0i64, 0i64, 0, 0i64);
v29 = &v31[v27 - (char *)v5];
*v29 = 0;
v30 = (const CHAR *)(v29 + 1);
if ( v9 )
v30 = 0i64;
if ( !SetEnvironmentVariableA(v27, v30) )
{
v4 = -1;
*errno() = 42;
}
free(v27);
}
}
if ( v9 )
{
free(v5);
*a1 = 0i64;
}
return v4;
}
| openssl |
__cudaUnregisterFatBinary | __int64 __fastcall _cudaUnregisterFatBinary(__int64 a1)
{
__int64 v2; // rax
v2 = sub_1400DFDC0();
return sub_1401367E0(v2, a1);
}
| openssl |
__CxxSetUnhandledExceptionFilter | __int64 _CxxSetUnhandledExceptionFilter()
{
SetUnhandledExceptionFilter((LPTOP_LEVEL_EXCEPTION_FILTER)__CxxUnhandledExceptionFilter);
return 0i64;
}
| openssl |
__C_specific_handler | EXCEPTION_DISPOSITION __cdecl _C_specific_handler(
struct _EXCEPTION_RECORD *ExceptionRecord,
void *EstablisherFrame,
struct _CONTEXT *ContextRecord,
struct _DISPATCHER_CONTEXT *DispatcherContext)
{
DWORD64 ImageBase; // r15
unsigned int *HandlerData; // rsi
unsigned __int64 v6; // r12
unsigned int v10; // edi
unsigned int *v11; // rbx
int v12; // eax
unsigned int v14; // ebp
DWORD64 v15; // rdi
_DWORD *v16; // rbx
unsigned __int64 v17; // rcx
unsigned __int64 v18; // rax
_QWORD v19[2]; // [rsp+30h] [rbp-38h] BYREF
ImageBase = DispatcherContext->ImageBase;
HandlerData = (unsigned int *)DispatcherContext->HandlerData;
v6 = DispatcherContext->ControlPc - ImageBase;
if ( (ExceptionRecord->ExceptionFlags & 0x66) != 0 )
{
v14 = 0;
v15 = DispatcherContext->TargetIp - ImageBase;
if ( *HandlerData )
{
v16 = HandlerData + 4;
do
{
v17 = (unsigned int)*(v16 - 3);
if ( v6 >= v17 )
{
v18 = (unsigned int)*(v16 - 2);
if ( v6 < v18 )
{
if ( v15 >= v17 && v15 < v18 && (ExceptionRecord->ExceptionFlags & 0x20) != 0 )
return 1;
if ( *v16 )
{
if ( v15 == *v16 )
return 1;
}
else
{
LOBYTE(v17) = 1;
DispatcherContext->ControlPc = ImageBase + v18;
((void (__fastcall *)(unsigned __int64, void *))(ImageBase + (unsigned int)*(v16 - 1)))(
v17,
EstablisherFrame);
}
}
}
++v14;
v16 += 4;
}
while ( v14 < *HandlerData );
}
}
else
{
v10 = 0;
v19[0] = ExceptionRecord;
v19[1] = ContextRecord;
if ( *HandlerData )
{
v11 = HandlerData + 3;
do
{
if ( v6 >= *(v11 - 2) && v6 < *(v11 - 1) && v11[1] )
{
if ( *v11 == 1 )
goto LABEL_11;
v12 = ((__int64 (__fastcall *)(_QWORD *, void *))(ImageBase + *v11))(v19, EstablisherFrame);
if ( v12 < 0 )
return 0;
if ( v12 > 0 )
{
LABEL_11:
if ( ExceptionRecord->ExceptionCode == -529697949 && qword_140286DA0 )
{
if ( (unsigned int)IsNonwritableInCurrentImage(&qword_140286DA0) )
qword_140286DA0(ExceptionRecord, 1i64);
}
NLG_Notify(ImageBase + v11[1], EstablisherFrame, 1i64);
RtlUnwindEx(
EstablisherFrame,
(PVOID)(ImageBase + v11[1]),
ExceptionRecord,
(PVOID)(int)ExceptionRecord->ExceptionCode,
DispatcherContext->ContextRecord,
DispatcherContext->HistoryTable);
_NLG_Return2();
}
}
++v10;
v11 += 4;
}
while ( v10 < *HandlerData );
}
}
return 1;
}
| openssl |
__doserrno | unsigned int *__cdecl _doserrno()
{
__int64 v0; // rax
v0 = getptd_noexit();
if ( v0 )
return (unsigned int *)(v0 + 20);
else
return (unsigned int *)&unk_14027F3EC;
}
| openssl |
__dtold | __int64 __fastcall _dtold(__int64 a1, int *a2)
{
unsigned __int16 v2; // r8
__int16 v3; // r10
int v4; // r11d
unsigned int v6; // ecx
unsigned __int16 v7; // r8
unsigned int v8; // ebx
__int64 result; // rax
__int16 v10; // r8
int v11; // edx
v2 = *((_WORD *)a2 + 3);
v3 = v2 & 0x8000;
v4 = a2[1] & 0xFFFFF;
v6 = *a2;
v7 = (v2 >> 4) & 0x7FF;
v8 = 0x80000000;
result = v7;
if ( v7 )
{
if ( v7 == 2047 )
v10 = 0x7FFF;
else
v10 = v7 + 15360;
}
else
{
if ( !v4 && !v6 )
{
*(_DWORD *)(a1 + 4) = 0;
*(_DWORD *)a1 = 0;
goto LABEL_12;
}
v10 = 15361;
v8 = 0;
}
*(_DWORD *)a1 = v6 << 11;
result = v8 | (v4 << 11) | (v6 >> 21);
*(_DWORD *)(a1 + 4) = result;
if ( (int)result >= 0 )
{
do
{
v11 = *(__int64 *)a1 >> 31;
*(_DWORD *)a1 *= 2;
result = 0xFFFFi64;
*(_DWORD *)(a1 + 4) = v11;
--v10;
}
while ( v11 >= 0 );
}
v3 |= v10;
LABEL_12:
*(_WORD *)(a1 + 8) = v3;
return result;
}
| openssl |
__dtoxmode | __int16 __fastcall _dtoxmode(unsigned __int8 a1, char *a2)
{
__int16 v3; // dx
char *v4; // rcx
char v5; // al
__int16 v6; // bx
unsigned __int16 v7; // bx
unsigned __int8 *v8; // rax
const unsigned __int8 *v9; // rdi
v3 = a1;
v4 = a2;
if ( a2[1] == 58 )
v4 = a2 + 2;
v5 = *v4;
if ( (*v4 == 92 || v5 == 47) && !v4[1] || (v3 & 0x10) != 0 || (v6 = 0x8000, !v5) )
v6 = 16448;
v7 = ~(v3 << 7) & 0x80 | 0x100 | v6;
v8 = mbsrchr((const unsigned __int8 *)a2, 0x2Eu);
v9 = v8;
if ( v8 && (!mbsicmp(v8, ".exe") || !mbsicmp(v9, ".cmd") || !mbsicmp(v9, ".bat") || !mbsicmp(v9, ".com")) )
v7 |= 0x40u;
return (v7 >> 3) & 0x38 | v7 | ((unsigned __int16)((v7 >> 3) & 0x38 | v7) >> 6) & 7;
}
| openssl |
__endstdio | void _endstdio()
{
flushall();
if ( byte_140285568 )
fcloseall();
free(qword_140286DD8);
}
| openssl |
__freetlocinfo | void __fastcall _freetlocinfo(char *Block)
{
void **v1; // rax
_DWORD *v3; // rax
_DWORD *v4; // rcx
_DWORD *v5; // rcx
_DWORD *v6; // rax
__int64 v7; // rcx
char *v8; // rdi
__int64 v9; // rsi
_DWORD *v10; // rcx
_DWORD *v11; // rcx
v1 = (void **)*((_QWORD *)Block + 37);
if ( v1 )
{
if ( v1 != &off_1402803F0 )
{
v3 = (_DWORD *)*((_QWORD *)Block + 34);
if ( v3 )
{
if ( !*v3 )
{
v4 = (_DWORD *)*((_QWORD *)Block + 36);
if ( v4 && !*v4 )
{
free(v4);
_free_lconv_mon(*((_QWORD *)Block + 37));
}
v5 = (_DWORD *)*((_QWORD *)Block + 35);
if ( v5 && !*v5 )
{
free(v5);
_free_lconv_num(*((_QWORD *)Block + 37));
}
free(*((void **)Block + 34));
free(*((void **)Block + 37));
}
}
}
}
v6 = (_DWORD *)*((_QWORD *)Block + 38);
if ( v6 && !*v6 )
{
free((void *)(*((_QWORD *)Block + 39) - 254i64));
free((void *)(*((_QWORD *)Block + 41) - 128i64));
free((void *)(*((_QWORD *)Block + 42) - 128i64));
free(*((void **)Block + 38));
}
v7 = *((_QWORD *)Block + 43);
if ( (_UNKNOWN *)v7 != &unk_140280270 && !*(_DWORD *)(v7 + 352) )
{
_free_lc_time();
free(*((void **)Block + 43));
}
v8 = Block + 88;
v9 = 6i64;
do
{
if ( *((_UNKNOWN **)v8 - 2) != &unk_14027F940 )
{
v10 = *(_DWORD **)v8;
if ( *(_QWORD *)v8 )
{
if ( !*v10 )
free(v10);
}
}
if ( *((_QWORD *)v8 - 1) )
{
v11 = (_DWORD *)*((_QWORD *)v8 + 1);
if ( v11 )
{
if ( !*v11 )
free(v11);
}
}
v8 += 32;
--v9;
}
while ( v9 );
free(Block);
}
| openssl |
__free_lconv_mon | void __fastcall _free_lconv_mon(_QWORD *a1)
{
void *v2; // rcx
void *v3; // rcx
void *v4; // rcx
void *v5; // rcx
void *v6; // rcx
void *v7; // rcx
void *v8; // rcx
if ( a1 )
{
v2 = (void *)a1[3];
if ( v2 != off_140280408 )
free(v2);
v3 = (void *)a1[4];
if ( v3 != off_140280410 )
free(v3);
v4 = (void *)a1[5];
if ( v4 != off_140280418 )
free(v4);
v5 = (void *)a1[6];
if ( v5 != off_140280420 )
free(v5);
v6 = (void *)a1[7];
if ( v6 != off_140280428 )
free(v6);
v7 = (void *)a1[8];
if ( v7 != off_140280430 )
free(v7);
v8 = (void *)a1[9];
if ( v8 != off_140280438 )
free(v8);
}
}
| openssl |
__free_lconv_num | void __fastcall _free_lconv_num(__int64 a1)
{
void *v2; // rcx
void *v3; // rcx
void *v4; // rcx
if ( a1 )
{
v2 = *(void **)a1;
if ( v2 != off_1402803F0 )
free(v2);
v3 = *(void **)(a1 + 8);
if ( v3 != off_1402803F8 )
free(v3);
v4 = *(void **)(a1 + 16);
if ( v4 != off_140280400 )
free(v4);
}
}
| openssl |
__free_lc_time | void __fastcall _free_lc_time(void **a1)
{
if ( a1 )
{
free(a1[1]);
free(a1[2]);
free(a1[3]);
free(a1[4]);
free(a1[5]);
free(a1[6]);
free(*a1);
free(a1[8]);
free(a1[9]);
free(a1[10]);
free(a1[11]);
free(a1[12]);
free(a1[13]);
free(a1[7]);
free(a1[14]);
free(a1[15]);
free(a1[16]);
free(a1[17]);
free(a1[18]);
free(a1[19]);
free(a1[20]);
free(a1[21]);
free(a1[22]);
free(a1[23]);
free(a1[24]);
free(a1[25]);
free(a1[26]);
free(a1[27]);
free(a1[28]);
free(a1[29]);
free(a1[30]);
free(a1[31]);
free(a1[32]);
free(a1[33]);
free(a1[34]);
free(a1[35]);
free(a1[36]);
free(a1[37]);
free(a1[38]);
free(a1[39]);
free(a1[40]);
free(a1[41]);
free(a1[42]);
}
}
| openssl |
__GSHandlerCheck | __int64 __fastcall _GSHandlerCheck(__int64 a1, __int64 a2, __int64 a3, __int64 a4)
{
_GSHandlerCheckCommon(a2, a4);
return 1i64;
}
| openssl |
__GSHandlerCheckCommon | __int64 __fastcall _GSHandlerCheckCommon(__int64 a1, __int64 a2)
{
__int64 result; // rax
__int64 v3; // rcx
result = *(_QWORD *)(a2 + 16);
v3 = *(_QWORD *)(a2 + 8) + *(unsigned int *)(result + 8);
if ( (*(_BYTE *)(v3 + 3) & 0xF) != 0 )
return *(_BYTE *)(v3 + 3) & 0xF0;
return result;
}
| openssl |
__initconin | HANDLE _initconin()
{
HANDLE result; // rax
result = CreateFileA("CONIN$", 0xC0000000, 3u, 0i64, 3u, 0, 0i64);
hConsoleInput = result;
return result;
}
| openssl |
__initconout | HANDLE _initconout()
{
HANDLE result; // rax
result = CreateFileA("CONOUT$", 0x40000000u, 3u, 0i64, 3u, 0, 0i64);
hConsoleOutput = result;
return result;
}
| openssl |
__initmbctable | __int64 _initmbctable()
{
if ( !dword_140286DC8 )
{
setmbcp(-3);
dword_140286DC8 = 1;
}
return 0i64;
}
| openssl |
__initstdio | __int64 _initstdio()
{
int v0; // eax
__int64 v1; // rbx
char *v2; // rax
__int64 v4; // rcx
char *v5; // rdx
__int64 v6; // r8
_DWORD *v7; // rdx
__int64 v8; // r9
__int64 v9; // r10
v0 = dword_140287DE0;
v1 = 20i64;
if ( dword_140287DE0 )
{
if ( dword_140287DE0 < 20 )
v0 = 20;
}
else
{
v0 = 512;
}
dword_140287DE0 = v0;
v2 = (char *)calloc_crt(v0, 8i64);
qword_140286DD8 = v2;
if ( !v2 )
{
dword_140287DE0 = 20;
v2 = (char *)calloc_crt(20i64, 8i64);
qword_140286DD8 = v2;
if ( !v2 )
return 26i64;
}
v4 = 0i64;
v5 = (char *)&unk_14027EEB0;
while ( 1 )
{
*(_QWORD *)&v2[v4] = v5;
v5 += 48;
v4 += 8i64;
if ( !--v1 )
break;
v2 = (char *)qword_140286DD8;
}
v6 = 0i64;
v7 = &unk_14027EECC;
v8 = 3i64;
do
{
v9 = *(_QWORD *)(88 * (v6 & 0x1F) + qword_140286BA0[v6 >> 5]);
if ( v9 == -1 || v9 == -2 || !v9 )
*v7 = -2;
++v6;
v7 += 12;
--v8;
}
while ( v8 );
return 0i64;
}
| openssl |
__lock_fhandle | _BOOL8 __fastcall _lock_fhandle(int a1)
{
__int64 v1; // r12
__int64 v2; // rbx
__int64 v3; // rsi
BOOL v4; // edi
v1 = (__int64)a1 >> 5;
v2 = 88i64 * (a1 & 0x1F);
v3 = qword_140286BA0[v1];
v4 = 1;
if ( !*(_DWORD *)(v2 + v3 + 12) )
{
lock(10);
if ( !*(_DWORD *)(v2 + v3 + 12) )
{
v4 = _crtInitCritSecAndSpinCount((_RTL_CRITICAL_SECTION *)(v2 + v3 + 16), 0xFA0u) != 0;
++*(_DWORD *)(v2 + v3 + 12);
}
unlock(10);
}
if ( v4 )
EnterCriticalSection((LPCRITICAL_SECTION)(qword_140286BA0[v1] + v2 + 16));
return v4;
}
| openssl |
__loctotime64_t | __int64 __fastcall _loctotime64_t(int a1, int a2, int a3, unsigned int a4, unsigned int a5, unsigned int a6, int a7)
{
int v7; // ebx
__int64 v8; // r14
int v10; // r12d
int v11; // r13d
int v12; // r9d
int v13; // ebp
__int64 v14; // rdi
__int64 v15; // rdi
int Daylight; // [rsp+30h] [rbp-58h] BYREF
int v18; // [rsp+34h] [rbp-54h] BYREF
int v19[10]; // [rsp+38h] [rbp-50h] BYREF
int v20; // [rsp+90h] [rbp+8h] BYREF
Daylight = 0;
v18 = 0;
v20 = 0;
v7 = a1 - 1900;
v8 = (int)a4;
if ( a1 - 1900 >= 70
&& v7 <= 1100
&& (unsigned int)(a2 - 1) <= 0xB
&& a4 <= 0x17
&& (v10 = a5, a5 <= 0x3B)
&& (v11 = a6, a6 <= 0x3B)
&& a3 >= 1
&& ((v12 = dword_140280228[a2 - 1], dword_140280228[a2] - v12 >= a3)
|| (((((v7 >> 31) & 3) + (_BYTE)v7) & 3) == ((v7 >> 31) & 3) && v7 != 100 * (v7 / 100) || a1 == 400 * (a1 / 400))
&& a2 == 2
&& a3 <= 29) )
{
v13 = v12 + a3;
if ( (((((v7 >> 31) & 3) + (_BYTE)v7) & 3) == ((v7 >> 31) & 3) && v7 != 100 * (v7 / 100) || a1 == 400 * (a1 / 400))
&& a2 > 2 )
{
++v13;
}
v14 = (int)a6
+ 60
* ((int)a5
+ 60
* (v8
+ 24 * (v13 + 365 * (a1 - 1900 - 70i64) + (a1 - 1900 + 299) / 400 - (a1 - 1901) / 100 + (a1 - 1901) / 4 - 17)));
_tzset();
if ( get_daylight_0(&Daylight) )
invoke_watson(0i64, 0i64, 0i64, 0, 0i64);
if ( get_daylight_1(&v18) )
invoke_watson(0i64, 0i64, 0i64, 0, 0i64);
if ( get_daylight_2(&v20) )
invoke_watson(0i64, 0i64, 0i64, 0, 0i64);
v19[7] = v13;
v19[5] = v7;
v15 = v20 + v14;
v19[2] = v8;
v19[1] = v10;
v19[0] = v11;
v19[4] = a2 - 1;
if ( a7 == 1 || a7 == -1 && Daylight && (unsigned int)isindst(v19) )
v15 += v18;
return v15;
}
else
{
*errno() = 22;
return -1i64;
}
}
| openssl |
__mtold12 | void __fastcall _mtold12(char *a1, int a2, unsigned int *a3)
{
int v4; // esi
__int16 i; // di
unsigned int v7; // edx
unsigned int v8; // r11d
unsigned int v9; // ecx
unsigned int v10; // r10d
unsigned int v11; // r8d
int v12; // eax
int v13; // ecx
unsigned int v14; // eax
int v15; // edx
unsigned int v16; // r9d
unsigned int v17; // eax
unsigned int v18; // r8d
int v19; // edx
unsigned int v20; // r9d
int v21; // r10d
unsigned int v22; // ecx
unsigned int v23; // eax
int v24; // ecx
unsigned int v25; // r8d
unsigned int v26; // edx
unsigned int v27; // ecx
unsigned __int64 v28; // kr00_8
unsigned int v29; // edx
unsigned int v30; // r8d
int v31; // eax
__int64 v32; // [rsp+0h] [rbp-38h]
unsigned int v33; // [rsp+8h] [rbp-30h]
*a3 = 0;
a3[1] = 0;
a3[2] = 0;
v4 = a2;
for ( i = 16462; v4; --v4 )
{
v32 = *(_QWORD *)a3;
v33 = a3[2];
v7 = 4 * *a3;
v8 = ((unsigned int)(*(__int64 *)a3 >> 31) >> 31) | (2 * (*(__int64 *)(a3 + 1) >> 31));
v9 = *(_QWORD *)a3;
v10 = (2i64 * *(_QWORD *)a3) >> 31;
v11 = v7 + v9;
v12 = 0;
*(_QWORD *)a3 *= 4i64;
a3[2] = v8;
if ( v7 + v9 < v7 || v11 < v9 )
v12 = 1;
*a3 = v11;
if ( v12 )
{
v13 = 0;
if ( v10 + 1 < v10 || v10 == -1 )
v13 = 1;
a3[1] = v10 + 1;
if ( v13 )
a3[2] = v8 + 1;
}
v14 = a3[1];
v15 = 0;
v16 = v14 + HIDWORD(v32);
if ( v14 + HIDWORD(v32) < v14 || v16 < HIDWORD(v32) )
v15 = 1;
a3[1] = v16;
if ( v15 )
++a3[2];
a3[2] += v33;
v17 = v11;
v18 = 2 * v11;
v19 = (v16 >> 31) | (2 * a3[2]);
*a3 = v18;
v20 = (v17 >> 31) | (2 * v16);
a3[2] = v19;
v21 = 0;
a3[1] = v20;
v22 = *a1;
v23 = v18 + v22;
if ( v18 + v22 < v18 || v23 < v22 )
v21 = 1;
*a3 = v23;
if ( v21 )
{
v24 = 0;
if ( v20 + 1 < v20 || v20 == -1 )
v24 = 1;
a3[1] = v20 + 1;
if ( v24 )
a3[2] = v19 + 1;
}
++a1;
}
if ( !a3[2] )
{
do
{
v25 = a3[1];
v26 = v25 << 16;
v25 >>= 16;
v28 = (unsigned __int64)*a3 << 16;
v27 = *a3 << 16;
a3[2] = v25;
i -= 16;
a3[1] = HIDWORD(v28) | v26;
*a3 = v27;
}
while ( !v25 );
}
if ( !_bittest((const signed __int32 *)a3 + 2, 0xFu) )
{
do
{
v29 = *a3;
v30 = a3[1];
*a3 *= 2;
a3[1] = (v29 >> 31) | (2 * v30);
--i;
v31 = (v30 >> 31) | (2 * a3[2]);
a3[2] = v31;
}
while ( (v31 & 0x8000) == 0 );
}
*((_WORD *)a3 + 5) = i;
}
| openssl |
__NLG_Return2 | void _NLG_Return2()
{
;
}
| openssl |
__onexitinit | __int64 _onexitinit()
{
_QWORD *v0; // rbx
v0 = (_QWORD *)calloc_crt(32i64, 8i64);
qword_140286DC0 = EncodePointer(v0);
qword_140286DB8 = qword_140286DC0;
if ( !v0 )
return 24i64;
*v0 = 0i64;
return 0i64;
}
| openssl |
__removelocaleref | __int64 __fastcall _removelocaleref(__int64 a1)
{
volatile signed __int32 *v1; // rax
volatile signed __int32 *v2; // rax
volatile signed __int32 *v3; // rax
volatile signed __int32 *v4; // rax
volatile signed __int32 **v5; // rax
__int64 v6; // r8
volatile signed __int32 *v7; // rdx
if ( a1 )
{
_InterlockedAdd((volatile signed __int32 *)a1, 0xFFFFFFFF);
v1 = *(volatile signed __int32 **)(a1 + 272);
if ( v1 )
_InterlockedAdd(v1, 0xFFFFFFFF);
v2 = *(volatile signed __int32 **)(a1 + 288);
if ( v2 )
_InterlockedAdd(v2, 0xFFFFFFFF);
v3 = *(volatile signed __int32 **)(a1 + 280);
if ( v3 )
_InterlockedAdd(v3, 0xFFFFFFFF);
v4 = *(volatile signed __int32 **)(a1 + 304);
if ( v4 )
_InterlockedAdd(v4, 0xFFFFFFFF);
v5 = (volatile signed __int32 **)(a1 + 88);
v6 = 6i64;
do
{
if ( *(v5 - 2) != (volatile signed __int32 *)&unk_14027F940 && *v5 )
_InterlockedAdd(*v5, 0xFFFFFFFF);
if ( *(v5 - 1) )
{
v7 = v5[1];
if ( v7 )
_InterlockedAdd(v7, 0xFFFFFFFF);
}
v5 += 4;
--v6;
}
while ( v6 );
_InterlockedAdd((volatile signed __int32 *)(*(_QWORD *)(a1 + 344) + 352i64), 0xFFFFFFFF);
}
return a1;
}
| openssl |
__report_gsfailure | void __cdecl __noreturn _report_gsfailure(uintptr_t StackCookie)
{
HANDLE CurrentProcess; // rax
PVOID HandlerData; // [rsp+40h] [rbp-48h] BYREF
unsigned __int64 EstablisherFrame; // [rsp+48h] [rbp-40h] BYREF
PRUNTIME_FUNCTION FunctionEntry; // [rsp+50h] [rbp-38h]
ULONG64 ControlPc; // [rsp+58h] [rbp-30h]
unsigned __int64 ImageBase[5]; // [rsp+60h] [rbp-28h] BYREF
DWORD64 retaddr; // [rsp+88h] [rbp+0h]
DWORD64 v8; // [rsp+90h] [rbp+8h] BYREF
v8 = StackCookie;
RtlCaptureContext(&ContextRecord);
ControlPc = ContextRecord.Rip;
FunctionEntry = RtlLookupFunctionEntry(ContextRecord.Rip, ImageBase, 0i64);
if ( FunctionEntry )
{
RtlVirtualUnwind(0, ImageBase[0], ControlPc, FunctionEntry, &ContextRecord, &HandlerData, &EstablisherFrame, 0i64);
}
else
{
ContextRecord.Rip = retaddr;
ContextRecord.Rsp = (DWORD64)&v8;
}
qword_140285730 = ContextRecord.Rip;
ContextRecord.Rcx = v8;
dword_140285720 = -1073740791;
dword_140285724 = 1;
ImageBase[1] = qword_14027EEA0;
ImageBase[2] = qword_14027EEA8;
dword_1402857B8 = IsDebuggerPresent();
sub_1401B3AA4(1i64);
SetUnhandledExceptionFilter(0i64);
UnhandledExceptionFilter((struct _EXCEPTION_POINTERS *)&ExceptionInfo);
if ( !dword_1402857B8 )
sub_1401B3AA4(1i64);
CurrentProcess = GetCurrentProcess();
TerminateProcess(CurrentProcess, 0xC0000409);
}
| openssl |
__security_check_cookie | void __cdecl _security_check_cookie(uintptr_t StackCookie)
{
__int64 v1; // rcx
if ( StackCookie != qword_14027EEA0 )
ReportFailure:
_report_gsfailure(StackCookie);
v1 = __ROL8__(StackCookie, 16);
if ( (_WORD)v1 )
{
StackCookie = __ROR8__(v1, 16);
goto ReportFailure;
}
}
| openssl |
__security_init_cookie | void __cdecl _security_init_cookie()
{
struct _FILETIME v0; // rbx
unsigned __int64 v1; // rbx
unsigned __int64 v2; // rbx
unsigned __int64 v3; // rbx
LONGLONG v4; // r11
struct _FILETIME SystemTimeAsFileTime; // [rsp+30h] [rbp+8h] BYREF
LARGE_INTEGER PerformanceCount; // [rsp+38h] [rbp+10h] BYREF
SystemTimeAsFileTime = 0i64;
if ( qword_14027EEA0 == 0x2B992DDFA232i64 )
{
GetSystemTimeAsFileTime(&SystemTimeAsFileTime);
v0 = SystemTimeAsFileTime;
v1 = GetCurrentProcessId() ^ *(unsigned __int64 *)&v0;
v2 = GetCurrentThreadId() ^ v1;
v3 = GetTickCount() ^ v2;
QueryPerformanceCounter(&PerformanceCount);
v4 = (v3 ^ PerformanceCount.QuadPart) & 0xFFFFFFFFFFFFi64;
if ( v4 == 0x2B992DDFA232i64 )
v4 = 0x2B992DDFA233i64;
qword_14027EEA0 = v4;
qword_14027EEA8 = ~v4;
}
else
{
qword_14027EEA8 = ~qword_14027EEA0;
}
}
| openssl |
__setargv | __int64 _setargv()
{
char *v0; // rbx
__int64 v1; // rsi
char **v2; // rax
char **v3; // rdi
int v5; // [rsp+40h] [rbp+8h] BYREF
int v6; // [rsp+48h] [rbp+10h] BYREF
if ( !dword_140286DC8 )
_initmbctable();
byte_140285684 = 0;
GetModuleFileNameA(0i64, Filename, 0x104u);
v0 = (char *)qword_140286DA8;
qword_140285558 = (__int64)Filename;
if ( !qword_140286DA8 || !*(_BYTE *)qword_140286DA8 )
v0 = Filename;
parse_cmdline(v0, 0i64, 0i64, &v5, &v6);
v1 = v5;
if ( (unsigned __int64)v5 >= 0x1FFFFFFFFFFFFFFFi64 )
return 0xFFFFFFFFi64;
if ( v6 == -1i64 )
return 0xFFFFFFFFi64;
if ( v6 + 8i64 * v5 < (unsigned __int64)v6 )
return 0xFFFFFFFFi64;
v2 = (char **)malloc_crt(v6 + 8i64 * v5);
v3 = v2;
if ( !v2 )
return 0xFFFFFFFFi64;
parse_cmdline(v0, v2, (char *)&v2[v1], &v5, &v6);
argv = v3;
argc = v5 - 1;
return (unsigned int)-((unsigned int)cwild() != 0);
}
| openssl |
__strgtold12_l | __int64 __fastcall _strgtold12_l(__int64 a1, char **a2, char *a3, int a4, int a5, int a6, int a7, __int64 a8)
{
unsigned int v8; // ebx
char *v10; // r10
unsigned int v11; // edi
int v12; // r13d
int v13; // r14d
int v14; // ebp
int v15; // esi
int v16; // ecx
__int64 result; // rax
char *v18; // r11
char v19; // al
char v20; // dl
char *v21; // r8
char *i; // r10
int v23; // ebp
char *v24; // rsi
char v25; // al
int v26; // eax
unsigned __int64 *v27; // rdx
int v28; // eax
__int16 v29; // r13
unsigned __int16 v30; // cx
__int16 v31; // r13
unsigned __int16 v32; // r8
int v33; // r12d
int *v34; // rcx
int j; // r10d
unsigned __int16 *v36; // r14
unsigned __int16 *v37; // r15
int v38; // r11d
unsigned int v39; // r9d
unsigned int v40; // eax
unsigned int v41; // ebp
signed int v42; // r10d
unsigned int v43; // r9d
__int16 v44; // r8
int v45; // edx
unsigned __int64 v46; // kr00_8
__int64 v47; // rdx
signed int v48; // eax
unsigned __int16 v49; // ax
__int16 v50; // dx
int v51; // ecx
unsigned int v52; // edi
int v53; // eax
int v54; // [rsp+30h] [rbp-B8h]
unsigned int v55; // [rsp+30h] [rbp-B8h]
int v56; // [rsp+34h] [rbp-B4h]
int v57; // [rsp+34h] [rbp-B4h]
int v59; // [rsp+38h] [rbp-B0h]
__int16 v60; // [rsp+3Ch] [rbp-ACh]
int v62[4]; // [rsp+50h] [rbp-98h] BYREF
_BYTE v63[12]; // [rsp+60h] [rbp-88h] BYREF
unsigned __int64 v64; // [rsp+70h] [rbp-78h] BYREF
int v65; // [rsp+78h] [rbp-70h]
char v66[23]; // [rsp+80h] [rbp-68h] BYREF
char v67; // [rsp+97h] [rbp-51h]
v8 = 0;
v10 = v66;
v60 = 0;
v11 = 0;
v56 = 1;
v12 = 0;
v54 = 0;
v13 = 0;
v14 = 0;
v15 = 0;
v16 = 0;
if ( !a8 )
{
*errno() = 22;
invalid_parameter(0i64, 0i64, 0i64, 0, 0i64);
return 0i64;
}
v18 = a3;
while ( 1 )
{
v19 = *a3;
if ( *a3 != 32 && v19 != 9 && v19 != 10 && v19 != 13 )
break;
++a3;
}
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
v20 = *a3++;
if ( v16 > 5 )
break;
if ( v16 == 5 )
{
v54 = 1;
if ( (unsigned __int8)(v20 - 48) > 9u )
{
v21 = v18;
goto LABEL_104;
}
v16 = 4;
LABEL_44:
--a3;
}
else if ( v16 )
{
switch ( v16 )
{
case 1:
v12 = 1;
if ( (unsigned __int8)(v20 - 49) <= 8u )
{
v16 = 3;
goto LABEL_44;
}
if ( v20 == ***(_BYTE ***)(*(_QWORD *)a8 + 296i64) )
goto LABEL_41;
if ( v20 != 43 && v20 != 45 )
{
if ( v20 != 48 )
goto LABEL_27;
goto LABEL_48;
}
LABEL_32:
--a3;
v16 = 11;
break;
case 2:
if ( (unsigned __int8)(v20 - 49) <= 8u )
goto LABEL_43;
if ( v20 == ***(_BYTE ***)(*(_QWORD *)a8 + 296i64) )
goto LABEL_46;
if ( v20 != 48 )
goto LABEL_103;
LABEL_48:
v16 = 1;
break;
case 3:
v12 = 1;
while ( v20 >= 48 && v20 <= 57 )
{
if ( v11 >= 0x19 )
{
++v15;
}
else
{
++v11;
*v10++ = v20 - 48;
}
v20 = *a3++;
}
if ( v20 != ***(_BYTE ***)(*(_QWORD *)a8 + 296i64) )
goto LABEL_25;
LABEL_41:
v16 = 4;
break;
default:
v12 = 1;
v54 = 1;
if ( !v11 )
{
while ( v20 == 48 )
{
v20 = *a3;
--v15;
++a3;
}
}
while ( v20 >= 48 && v20 <= 57 )
{
if ( v11 < 0x19 )
{
++v11;
*v10++ = v20 - 48;
--v15;
}
v20 = *a3++;
}
LABEL_25:
if ( v20 == 43 || v20 == 45 )
goto LABEL_32;
LABEL_27:
if ( v20 <= 67 || v20 > 69 && (v20 <= 99 || v20 > 101) )
goto LABEL_61;
v16 = 6;
break;
}
}
else
{
if ( (unsigned __int8)(v20 - 49) <= 8u )
{
LABEL_43:
v16 = 3;
goto LABEL_44;
}
if ( v20 == ***(_BYTE ***)(*(_QWORD *)a8 + 296i64) )
{
LABEL_46:
v16 = 5;
}
else
{
switch ( v20 )
{
case '+':
v16 = 2;
v60 = 0;
break;
case '-':
v16 = 2;
v60 = 0x8000;
break;
case '0':
goto LABEL_48;
default:
goto LABEL_61;
}
}
}
}
if ( v16 != 6 )
break;
v18 = a3 - 2;
if ( (unsigned __int8)(v20 - 49) <= 8u )
{
LABEL_81:
v16 = 9;
goto LABEL_44;
}
if ( v20 == 43 )
{
v16 = 7;
}
else
{
if ( v20 != 45 )
goto LABEL_82;
v56 = -1;
v16 = 7;
}
}
if ( v16 == 7 )
break;
if ( v16 == 8 )
{
v13 = 1;
while ( v20 == 48 )
v20 = *a3++;
if ( (unsigned __int8)(v20 - 49) > 8u )
goto LABEL_61;
v16 = 9;
goto LABEL_44;
}
if ( v16 == 9 )
{
v13 = 1;
while ( v20 >= 48 && v20 <= 57 )
{
v14 = v20 + 10 * v14 - 48;
if ( v14 > 5200 )
{
v14 = 5201;
break;
}
v20 = *a3++;
}
while ( v20 >= 48 && v20 <= 57 )
v20 = *a3++;
LABEL_61:
v21 = a3 - 1;
goto LABEL_104;
}
if ( !a7 )
goto LABEL_61;
v18 = a3 - 1;
if ( v20 != 43 )
{
if ( v20 != 45 )
{
v21 = a3 - 1;
goto LABEL_104;
}
v56 = -1;
}
v16 = 7;
}
if ( (unsigned __int8)(v20 - 49) <= 8u )
goto LABEL_81;
LABEL_82:
if ( v20 != 48 )
break;
v16 = 8;
}
LABEL_103:
v21 = v18;
LABEL_104:
*a2 = v21;
if ( v12 )
{
if ( v11 > 0x18 )
{
if ( v67 >= 5 )
++v67;
--v10;
v11 = 24;
++v15;
}
if ( v11 )
{
for ( i = v10 - 1; !*i; --i )
{
--v11;
++v15;
}
_mtold12(v66, v11, v63);
if ( v56 < 0 )
v14 = -v14;
v23 = v15 + v14;
if ( !v13 )
v23 += a5;
if ( !v54 )
v23 -= a6;
if ( v23 > 5200 )
{
v51 = 0;
v50 = 0;
LOWORD(v53) = 0x7FFF;
v8 = 2;
v52 = 0x80000000;
}
else if ( v23 < -5200 )
{
v50 = 0;
LOWORD(v53) = 0;
v52 = 0;
v51 = 0;
v8 = 1;
}
else
{
v24 = (char *)&unk_140280560 - 96;
if ( v23 )
{
if ( v23 < 0 )
{
v23 = -v23;
v24 = (char *)&unk_1402806C0 - 96;
}
if ( !a4 )
*(_WORD *)v63 = 0;
while ( v23 )
{
v25 = v23;
v24 += 84;
v23 >>= 3;
v26 = v25 & 7;
v59 = v23;
if ( v26 )
{
v27 = (unsigned __int64 *)&v24[12 * v26];
if ( *(_WORD *)v27 >= 0x8000u )
{
v64 = *v27;
v28 = *((_DWORD *)v27 + 2);
v27 = &v64;
v65 = v28;
*(_DWORD *)((char *)&v64 + 2) = (v64 >> 16) - 1;
}
v29 = *((_WORD *)v27 + 5);
v30 = v29 & 0x7FFF;
memset(v62, 0, 12);
v31 = (*(_WORD *)&v63[10] ^ v29) & 0x8000;
v32 = (*(_WORD *)&v63[10] & 0x7FFF) + v30;
if ( (*(_WORD *)&v63[10] & 0x7FFF) == 0x7FFF || v30 >= 0x7FFFu || v32 > 0xBFFDu )
{
LABEL_177:
*(_DWORD *)&v63[8] = v31 != 0 ? -32768 : 2147450880;
goto LABEL_178;
}
if ( v32 <= 0x3FBFu )
goto LABEL_134;
if ( (*(_WORD *)&v63[10] & 0x7FFF) != 0
|| (++v32, (*(_DWORD *)&v63[8] & 0x7FFFFFFF) != 0)
|| *(_DWORD *)&v63[4]
|| *(_DWORD *)v63 )
{
if ( !v30 )
{
++v32;
if ( (v27[1] & 0x7FFFFFFF) == 0 && !*((_DWORD *)v27 + 1) && !*(_DWORD *)v27 )
{
LABEL_134:
*(_DWORD *)&v63[8] = 0;
LABEL_178:
*(_DWORD *)v63 = 0;
*(_DWORD *)&v63[4] = 0;
continue;
}
}
v33 = 0;
v34 = &v62[1];
for ( j = 5; j > 0; --j )
{
v57 = j;
v36 = (unsigned __int16 *)&v63[2 * v33];
v37 = (unsigned __int16 *)(v27 + 1);
do
{
v38 = 0;
v39 = *v36 * *v37;
v40 = *(v34 - 1);
v41 = v40 + v39;
if ( v40 + v39 < v40 || v41 < v39 )
v38 = 1;
*(v34 - 1) = v41;
if ( v38 )
++*(_WORD *)v34;
++v36;
--v37;
--v57;
}
while ( v57 > 0 );
v34 = (int *)((char *)v34 + 2);
++v33;
}
v42 = v62[2];
v43 = v62[0];
v44 = v32 - 16382;
if ( v44 > 0 )
{
do
{
if ( v42 < 0 )
break;
v46 = 2i64 * v43;
v45 = HIDWORD(v46);
v43 = v46;
--v44;
v42 = ((unsigned int)v62[1] >> 31) | (2 * v42);
v62[1] = v45 | (2 * v62[1]);
v62[2] = v42;
v62[0] = v43;
}
while ( v44 > 0 );
if ( v44 > 0 )
goto LABEL_164;
}
if ( --v44 >= 0 )
goto LABEL_164;
v47 = (unsigned __int16)-v44;
v44 = 0;
do
{
if ( (v62[0] & 1) != 0 )
++v8;
v48 = v42 << 31;
v42 = (unsigned int)v42 >> 1;
v43 = (v62[1] << 31) | (v43 >> 1);
--v47;
v62[1] = v48 | ((unsigned int)v62[1] >> 1);
v62[0] = v43;
}
while ( v47 );
v55 = v8;
v8 = 0;
v62[2] = v42;
if ( v55 )
{
v49 = v43 | 1;
LOWORD(v62[0]) = v43 | 1;
v43 = v62[0];
}
else
{
LABEL_164:
v49 = v62[0];
}
if ( v49 > 0x8000u || (v43 & 0x1FFFF) == 98304 )
{
if ( *(int *)((char *)v62 + 2) == -1 )
{
*(int *)((char *)v62 + 2) = 0;
if ( *(int *)((char *)&v62[1] + 2) == -1 )
{
*(int *)((char *)&v62[1] + 2) = 0;
if ( HIWORD(v62[2]) == 0xFFFF )
{
HIWORD(v62[2]) = 0x8000;
++v44;
}
else
{
++HIWORD(v62[2]);
}
}
else
{
++*(int *)((char *)&v62[1] + 2);
}
v42 = v62[2];
}
else
{
++*(int *)((char *)v62 + 2);
}
}
v23 = v59;
if ( (unsigned __int16)v44 >= 0x7FFFu )
goto LABEL_177;
*(_DWORD *)&v63[6] = v42;
*(_WORD *)v63 = HIWORD(v62[0]);
*(_WORD *)&v63[10] = v31 | v44;
*(_DWORD *)&v63[2] = v62[1];
}
else
{
*(_WORD *)&v63[10] = 0;
}
}
}
}
v50 = *(_WORD *)v63;
v51 = *(_DWORD *)&v63[2];
v52 = *(_DWORD *)&v63[6];
v53 = HIWORD(*(_DWORD *)&v63[8]);
}
}
else
{
v50 = 0;
LOWORD(v53) = 0;
v52 = 0;
v51 = 0;
}
}
else
{
v50 = 0;
LOWORD(v53) = 0;
v52 = 0;
v51 = 0;
v8 = 4;
}
*(_WORD *)(a1 + 10) = v60 | v53;
result = v8;
*(_WORD *)a1 = v50;
*(_DWORD *)(a1 + 2) = v51;
*(_DWORD *)(a1 + 6) = v52;
return result;
}
| openssl |
__termcon | BOOL _termcon()
{
BOOL result; // eax
if ( hConsoleOutput != (HANDLE)-1i64 && hConsoleOutput != (HANDLE)-2i64 )
result = CloseHandle(hConsoleOutput);
if ( hConsoleInput != (HANDLE)-1i64 && hConsoleInput != (HANDLE)-2i64 )
return CloseHandle(hConsoleInput);
return result;
}
| openssl |
__tmainCRTStartup | __int64 _tmainCRTStartup()
{
BOOL v0; // ebx
int v1; // eax
int v2; // eax
unsigned int v3; // edi
if ( MEMORY[0x140000000] == 23117 )
{
if ( *(_DWORD *)(0x140000000i64 + MEMORY[0x14000003C]) == 17744 )
{
if ( *(_WORD *)(0x140000018i64 + MEMORY[0x14000003C]) == 523 )
v0 = *(_DWORD *)(0x140000084i64 + MEMORY[0x14000003C]) > 0xEu
&& *(_DWORD *)(0x1400000F8i64 + MEMORY[0x14000003C]) != 0;
else
v0 = 0;
}
else
{
v0 = 0;
}
}
else
{
v0 = 0;
}
if ( !(unsigned int)heap_init(1i64) )
{
if ( dword_140285698 != 2 )
FF_MSGBANNER();
NMSG_WRITE(28i64);
_crtExitProcess(0xFFu);
}
if ( !(unsigned int)mtinit() )
{
if ( dword_140285698 != 2 )
FF_MSGBANNER();
NMSG_WRITE(16i64);
_crtExitProcess(0xFFu);
}
RTC_Initialize_1_1();
if ( (int)ioinit() < 0 )
amsg_exit(0x1Bu);
qword_140286DA8 = (__int64)GetCommandLineA();
qword_140285688 = (char *)_crtGetEnvironmentStringsA();
if ( (int)j___setargv() < 0 )
amsg_exit(8u);
if ( (int)setenvp() < 0 )
amsg_exit(9u);
v1 = cinit(1u);
if ( v1 )
amsg_exit(v1);
qword_140285540 = (__int64)envp;
v2 = main(argc, (const char **)argv, (const char **)envp);
v3 = v2;
if ( !v0 )
exit(v2);
cexit();
return v3;
}
| openssl |
__tzset | void _tzset()
{
if ( !dword_140286368 )
{
lock(6);
if ( !dword_140286368 )
{
tzset_nolock();
++dword_140286368;
}
unlock(6);
}
}
| openssl |
__updatetlocinfo | __int64 _updatetlocinfo()
{
__int64 v0; // rax
__int64 v1; // rbx
__int64 v2; // rbx
v0 = getptd();
v1 = v0;
if ( (*(_DWORD *)(v0 + 200) & dword_14027F938) != 0 && *(_QWORD *)(v0 + 192) )
{
v2 = *(_QWORD *)(getptd() + 192);
}
else
{
lock(12i64);
v2 = updatetlocinfoEx_nolock((__int64 *)(v1 + 192), (__int64)off_14027FAB0);
unlock(12i64);
}
if ( !v2 )
amsg_exit(0x20u);
return v2;
}
| openssl |
__updatetmbcinfo | void *_updatetmbcinfo()
{
__int64 v0; // rax
__int64 v1; // rdi
void *v2; // rbx
void *Block; // [rsp+30h] [rbp+8h]
v0 = getptd();
v1 = v0;
if ( (*(_DWORD *)(v0 + 200) & dword_14027F938) != 0 && *(_QWORD *)(v0 + 192) )
{
v2 = *(void **)(v0 + 184);
}
else
{
lock(13i64);
v2 = *(void **)(v1 + 184);
if ( v2 != off_14027F830 )
{
if ( v2 && !_InterlockedAdd((volatile signed __int32 *)v2, 0xFFFFFFFF) && v2 != &unk_14027F400 )
free(v2);
*(_QWORD *)(v1 + 184) = off_14027F830;
Block = off_14027F830;
_InterlockedAdd((volatile signed __int32 *)off_14027F830, 1u);
v2 = Block;
}
unlock(13i64);
}
if ( !v2 )
amsg_exit(0x20u);
return v2;
}
| openssl |
__WSAFDIsSet | // attributes: thunk
int __stdcall _WSAFDIsSet(SOCKET fd, fd_set *a2)
{
return __WSAFDIsSet(fd, a2);
}
| openssl |
__wtomb_environ | __int64 _wtomb_environ()
{
LPCWCH *v0; // rbx
const WCHAR *v1; // rax
int v2; // eax
int cbMultiByte; // edi
void *lpMultiByteStr; // rax
void *Block; // [rsp+50h] [rbp+8h] BYREF
Block = 0i64;
v0 = (LPCWCH *)qword_140285548;
v1 = *(const WCHAR **)qword_140285548;
if ( !*(_QWORD *)qword_140285548 )
return 0i64;
while ( 1 )
{
v2 = WideCharToMultiByte(0, 0, v1, -1, 0i64, 0, 0i64, 0i64);
cbMultiByte = v2;
if ( !v2 )
break;
lpMultiByteStr = (void *)calloc_crt(v2, 1i64);
Block = lpMultiByteStr;
if ( !lpMultiByteStr )
break;
if ( !WideCharToMultiByte(0, 0, *v0, -1, (LPSTR)lpMultiByteStr, cbMultiByte, 0i64, 0i64) )
{
free(Block);
return 0xFFFFFFFFi64;
}
if ( (int)_crtsetenv(&Block, 0i64) < 0 )
{
if ( Block )
{
free(Block);
Block = 0i64;
}
}
v1 = *++v0;
if ( !*v0 )
return 0i64;
}
return 0xFFFFFFFFi64;
}
| openssl |
___lc_codepage_func | unsigned int __cdecl __lc_codepage_func()
{
_QWORD *v0; // rax
unsigned int *v1; // rcx
v0 = getptd();
v1 = (unsigned int *)v0[24];
if ( v1 != off_14027FAB0 && ((_DWORD)v0[25] & dword_14027F938) == 0 )
v1 = (unsigned int *)_updatetlocinfo();
return v1[1];
}
| openssl |