#pragma once
#include <stdio.h>
#define RET 0xC3 // Опкод инструкции ret
typedef unsigned char byte;
byte* AF_address(byte* f) {
byte* real_address = NULL;
#ifdef _MSC_VER // MSVC
//printf("MSVC Compiler Detected\n");
#ifdef NDEBUG // MSVC release mode
real_address = f;
//printf("FUNCTION ADDRESS: %p\n", real_address);
#else // MSVC debug mode
byte* f_p = f;
byte* offset = (byte*)(*((int*)f_p) >> 8);
real_address = f_p + (int)offset + 5;
//printf("TABLE ADDRESS: %p\n", f_p);
//printf("OFFSET: %p\n", offset);
//printf("REAL ADDRESS: %p\n", real_address);
#endif
#elif defined(__GNUC__) // GCC
//printf("GCC Compiler Detected\n");
real_address = f;
//printf("FUNCTION ADDRESS: %p\n", real_address);
#endif
return real_address;
}
// Печатает байты от некоторого address до address+size
int AF_print_bytes(byte* a, int size) {
for (int i = 0; i < size; ++i) printf("%02X ", *(a + i));
}
// Возвращает размер произвольной функции в байтах
int AF_size(byte* f) {
byte* p = f;
for (; *p != RET; ++p);
return p - f + 1;
}
#include <stdio.h>
#include <tchar.h>
#include <io.h>
#include <fcntl.h>
#define SZ 256
int main(void)
{
int _ = _setmode(_fileno(stdin), _O_U16TEXT);
_ = _setmode(_fileno(stdout), _O_U16TEXT);
TCHAR input[SZ] = { 0 };
_tprintf(L"Введите текст: ");
fgetws(input, SZ, stdin); input[wcslen(input) - 1] = 0;
_tprintf(L"Введенны текст: %s", input);
return 0;
}
int passVerif( // crc = 4002471382
int (*_strcmp) (const char*, const char*),
int (*_printf) (const char*, ...),
void (*_exit) (int),
char* (*_cryptStr) (char*),
char* ppw,
char* pw,
char* err
) {
char* begin_ptr;
char* end_ptr;
__asm {
lea eax, begin
mov begin_ptr, eax
lea eax, end
mov end_ptr, eax
}
int size = (int)(end_ptr - begin_ptr);
begin:;
if (_strcmp(ppw, _cryptStr(pw)) != 0) {
_printf(_cryptStr(err));
_exit(-96);
}
end:;
uint32_t crc = 0xFFFFFFFF;
for (int i = 0; i < size; i++) {
unsigned char byte = *(begin_ptr + i);
crc ^= byte;
for (size_t j = 0; j < 8; j++) {
if (crc & 1) {
crc = (crc >> 1) ^ POLYNOMIAL;
}
else {
crc >>= 1;
}
}
// printf("%02X ", byte);
}
//printf("\n");
printf("CRC = %u\n", ~crc); //crc = 4002471382
return size;
}
<script>
function setFixedBackgroundHeight() {
const vh = window.innerHeight * 0.01;
document.documentElement.style.setProperty('--vh', `${vh}px`);
}
window.addEventListener('resize', setFixedBackgroundHeight);
setFixedBackgroundHeight();
</script>
body {
font-size: 1.3vw;
margin: 0;
font-family: montserrat;
display: flex;
flex-direction: column;
color: #C1BFBF;
position: relative;
overflow-y: auto;
overflow-x: hidden;
}
body::before {
content: '';
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100vh;
z-index: -1;
background-image: url("../images/background.jpg");
background-size: cover;
}
/* Использование переменной --vh для расчета высоты */
body {
--vh: 1vh;
min-height: calc(100 * var(--vh));
}