Mouad
what is the most hard concept to learn in C++?
Danya🔥
Danya🔥
Everything is hard
Tanish
VD
what is the most hard concept to learn in C++?
Templates is usually hard for most people especially the compile time rules, concepts and also the use of constexpr, consteval and constinit and the usecases around them. The other things like ranges are pretty easy to understand unless you are into extending them for your own data structures which requires a lot of effort on your side. Modules are an entirely different beast that no one understands completely yet
Tanish
VD
tHANX
You are in a way lucky that the woman who drafted the rules is no longer in this group. She was a hothead who instantly banned anyone who didn't follow the rules. So Danya was just being polite
Tanish
Bro , dont go for offchat , so please shut up
Saqo
Hi guys
Saqo
What is different between constexpr consteval and constinit
Danya🔥
sajad
Hi guys
first sry for my bad english
why this code work ?
uintptr_t ModuleBase = (uintptr_t)GetModuleHandle(L"server.dll");
uintptr_t EntList = *(uintptr_t*)(ModuleBase + 0x4A1670);
👇
uintptr_t cssBot_1 = *(uintptr_t*)(cssBot + 0x24);
but this ? not
for (int i = 1; i < 12; i++)
{
uintptr_t ent = *(uintptr_t*)(EntList + 0x14 + (i * 10));
}
borealis
multiply by 0x10 not 10
sajad
Leovan
Everything is hard
Everything is easy, as for me hard to don't forget what you learned 😁
Pavel
Brian
/start@MissRose_bot
Pavel
Undefined behavior may be platform specific today, and explode something when you update your compiler tomorrow (but technically it is already "exploded" today)
D
yep, that's what i'm talking about.
For example, update interfaces by appending new virtual functions and don't recompile everything related - you get UB. But according to COM interfaces everything will still work
That's my favorite PS behaviour
Skarn
Skarn
E.g. type punning is allowed in GCC through a union, while being UB in the standard. And it is stated so in their documentation.
Pavel
Skarn
GCC however did
D
I just can't imagine how else union can be implemented so that you aren't able to use type punning.
The whole point of it is using the same memory space, so why not?
欣婷
Excuse me, I have a function int readLine(char **args, uint size), I call readLine(buf, MAXARG) this way, how can I change the value of buf by args
欣婷
harmony5 🇺🇳 ⌤
What do you mean? Cc the compiler?
klimi
What's cpanel? Are you talking about PHP?
Rose
Reported د/ عبدالرحمن الوجيه [6100627655] to admins.
Never Spam Bot
Setting requested by Ighor July set to true
Rose
Reported د/ عبدالرحمن الوجيه [6100627655] to admins.
We1Kin
guys, does anyone know the environmentVariables in cmake-kits.json will appear in the compile-command.json or not?
We1Kin
I set some environmentVariables in cmake-kit.json like this:
{
"name": "Clang 17.0.6 arm64-apple-darwin23.4.0",
"compilers": {
"C": "/opt/homebrew/opt/llvm/bin/clang",
"CXX": "/opt/homebrew/opt/llvm/bin/clang++"
},
"environmentVariables": {
"LDFLAGS": "-L/opt/homebrew/opt/llvm/lib",
"CPPFLAGS": "-I/opt/homebrew/opt/llvm/include"
},
"isTrusted": true
},
Danya🔥
Lol wtf
Danya🔥
Fuck this bot is stupid
We1Kin
i just copy the compile-command.json context.....
Ighor
Danya🔥
Danya🔥
What are you trying to do?
harmony5 🇺🇳 ⌤
Rose
User Brian has 1/2 warnings; be careful!
Reason:
assignment
Danya🔥
Rose
User Teja has 1/2 warnings; be careful!
Reason:
spam
Rose
Purge complete.
At
i projects to practice on it
At
want*
Laopigo
Am I understanding correctly that the value of c is implementation defined?
uintptr_t a = some_value;
char *b = a;
uintptr_t c = b;
Cesar
https://www.phoronix.com/news/x86-simd-sort-5.0
\Device\NUL
Laopigo
Manav
so in that case it's not implementation defined but it can have undefined behaviour if it's not aligned
Manav
uintptr_t c = b; this one that is
Manav
char has alignment of 1, defined by C++ standard because of it's size, so the first cast is fine
Laopigo
Thanks
Never Spam Bot
Eli Gagnon sent multiple messages that looks like a spam. If they send more spam - like messages, they will be muted. Only admins can unmute them.
Spam deleted in this group: 405
See spam? Quote it and send /spam
VD
uintptr_t c = b; this one that is
Is it really Undefined Behavior though? I checked the standards and the standards clearly mention that any void* pointer can be converted to uintptr_t and back. So if that applies to a void* pointer to a double then it should apply directly to the double* pointer as well. So I don't know what the compiler would do underneath that would make
b = (uintptr_t(void*(&a)));
c = double*(void*(b));
legal but
b = uintptr_t(&a);
c = double*(b);
illegal where a is a double say.
I am not sure about it though
VD
AFAIK, conversions to and from void*, intptr_t and uintptr_t don't care about alignment. That is why the standard specifically says that you must convert back to the same original type after casting to one of these types.
Manav
Ya deway
guys absolutely have to help me. The assembler code of the RtlInitUTF8String function contains only a jmp instruction at another address. The total size of the function is 5 bytes. I got from my kernel code a pointer to the RtlInitUTF8String function and checking it is correct. But once I parse the 4 bytes after the function pointer I don't find any jmp instruction or associated value (I also tried parsing the first byte of the address, which should be the jmp instruction)
borealis
Ya deway
borealis
.text:00000001405A5150 public RtlInitUTF8String
.text:00000001405A5150 RtlInitUTF8String proc near ; CODE XREF: PiGetDefaultMessageString+E55A3↓p
.text:00000001405A5150 ; DATA XREF: .pdata:0000000140102E0C↑o
.text:00000001405A5150 48 83 EC 28 sub rsp, 28h
.text:00000001405A5154 E8 F7 E6 D4 FF call RtlInitAnsiString
.text:00000001405A5159 48 83 C4 28 add rsp, 28h
.text:00000001405A515D C3 retn
.text:00000001405A515D ; ---------------------------------------------------------------------------
.text:00000001405A515E CC db 0CCh
borealis
you are in kernel mode thus you should look at ntoskrnl.exe, not ntdll.dll
Ya deway
Damn, thanks sir
borealis
if you must work with the instance of ntdll.dll loaded to the address space of a user mode program, then you should traverse the memory of that user space program and find ntdll.dll there.
with your current approach you were looking at the kernel mode memory space
Ya deway
I thought ntdll was kernel mode, im developing using wdk and ntddk.h library
borealis
no, ntdll is used to interface with the kernel mode from user mode. it's only loaded to user mode programs