MᏫᎻᎯᎷᎷᎬᎠ
You can develop anything with C++
But it's not the best choice for everything
BinaryByter
Sasuke
Mihail
Mihail
So not really
BinaryByter
Mat
Mihail
BinaryByter
MᏫᎻᎯᎷᎷᎬᎠ
BinaryByter
Yeah
btw: how many bytes do you need for a "hello world"?
BinaryByter
BinaryByter
BinaryByter
Lunatic is confused
BinaryByter
give him some time
Mihail
BinaryByter
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
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)>
Carmine
Raul
Raul
That is the issue
Raul
Raul
Magnvm_Khaos
How do i create an array of objects ?
Jussi
Are there any binary reversing groups in TG?
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
Raul
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
Mat
Declaring an array
Mat
Creating an array
Mat
You answered yourself
MᏫᎻᎯᎷᎷᎬᎠ
MᏫᎻᎯᎷᎷᎬᎠ
It's better to use
std::array<contact, 10>
MᏫᎻᎯᎷᎷᎬᎠ
Unless you want a variable length
BinaryByter
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ᏫᎻᎯᎷᎷᎬᎠ
MᏫᎻᎯᎷᎷᎬᎠ
BinaryByter
why is an exception better than a segfault?
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