MᏫᎻᎯᎷᎷᎬᎠ
You can develop anything with C++ But it's not the best choice for everything
Sasuke
Mihail
assembler is more performant than C++
Compilers optimise very well tho.
Mihail
So not really
MᏫᎻᎯᎷᎷᎬᎠ
it is (at worst) a good choice for anything
Not really Some agile softwares MUST not developed with C++!!
BinaryByter
Compilers optimise very well tho.
looket at some output already?
MᏫᎻᎯᎷᎷᎬᎠ
wat?
What!!
BinaryByter
Yeah
btw: how many bytes do you need for a "hello world"?
Mat
Not really Some agile softwares MUST not developed with C++!!
Agile softwares? They doesn't exist. Agile is not a software
BinaryByter
Lunatic is confused
BinaryByter
give him some time
Mihail
btw: how many bytes do you need for a "hello world"?
Eh that's not really a good comparasion
Mihail
It isn't
MᏫᎻᎯᎷᎷᎬᎠ
BinaryByter
Okay, then lets stop discussing htis
MᏫᎻᎯᎷᎷᎬᎠ
itsmanjeet
itsmanjeet
Use a library
Which one I found something like mmap Studying regarding this
Raul
Alright family, I feel like this is a beginner question. What does int(*)(int) mean in a std::any_cast?
Raul
Basically I have an unordered_map<string,any> and I am trying to cast any to a function pointer.
Raul
So I have a function called: int doMath(int a) return a+10;
Raul
Then I assign my map to an iterator and I do: int result = std::any_cast<int(*)(int)>(iter->second)(10);
Raul
But I have 0 clue what int(*)(int) is doing. Anyone have any answers?
Carmine
Maybe it is a stupid question, but… why are you using function pointers and not lambda functions (std::function in <functional>)?
Raul
However I'll give you the issue:
Raul
std:: unordered_map<string, std::function<void()>>;
Raul
If I have a function: void print() { std::cout << "Hi"; } Then doing map["print"] = print; Compiles happily!
Raul
However, int doMath(int a) And then: map["doMath"] = doMath; And boom! Compiler errors! Because: std::function<void()> is not std::function<int(int)>
Raul
That is the issue
Carmine
But I want 1 map. Not multiple maps.
You can use a void pointer, but casting every time in different types isn’t useful. IMHO you have to rethink your code
olli
But I have 0 clue what int(*)(int) is doing. Anyone have any answers?
int(*)(int) is the type of a function pointer taking one int argument and returning an int
olli
Isn't this C-style casting?
It's the signature of function pointers both in C and C++
Magnvm_Khaos
How do i create an array of objects ?
Jussi
Are there any binary reversing groups in TG?
olli
Are there any binary reversing groups in TG?
You can discuss Reverse Engineering here Reverse enginnering, hacking and related topics are allowed, [...].
Jussi
Hmh
Jussi
I have a binary that is packed, and I am able to breakpoint to the poibt where it is unpacked, but I get an access violation exception
Jussi
I guess this is some sort of "anti-debugging" trick, but how could I patch it?
Jussi
The code I run BEFORE the breakpoint only XORs the other part of the binary, I dont see any "traps" against debugging
Magnvm_Khaos
I have a contact class with name surname and telephone. I declare an object of contact class with the methods setSurname setName setTelephone. I create a contact using these methods
Magnvm_Khaos
If i want to create an agenda( many contacts together) how i can do it using an array?
Mat
Declaring an array
Mat
Creating an array
Mat
You answered yourself
MᏫᎻᎯᎷᎷᎬᎠ
It's better to use std::array<contact, 10>
MᏫᎻᎯᎷᎷᎬᎠ
Unless you want a variable length
MᏫᎻᎯᎷᎷᎬᎠ
why?
Lemme guess You wanna test me
BinaryByter
Pretty much yes
MᏫᎻᎯᎷᎷᎬᎠ
Well It's packed with size() member so you can pass it as a function argument without worrying too much for that
BinaryByter
yes, there's that
MᏫᎻᎯᎷᎷᎬᎠ
Second, it's handled if you get out of its bound
BinaryByter
Why is that better than a sigsev?
MᏫᎻᎯᎷᎷᎬᎠ
Exception
MᏫᎻᎯᎷᎷᎬᎠ
BinaryByter
segfault
MᏫᎻᎯᎷᎷᎬᎠ
BinaryByter
why is an exception better than a segfault?
MᏫᎻᎯᎷᎷᎬᎠ
why is an exception better than a segfault?
Exception are occured before the segfault happens
BinaryByter
what does that mean?
BinaryByter
https://stackoverflow.com/questions/2350489/how-to-catch-segmentation-fault-in-linux
BinaryByter
btw ^^
MᏫᎻᎯᎷᎷᎬᎠ
Exception doesn't allow the error to happen
BinaryByter
well in both cases the error doesnt happen