[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

>Be me sitting in data structures Teacher: You cant call a

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 29
Thread images: 4

File: inlineassembly2.png (43KB, 659x741px) Image search: [Google]
inlineassembly2.png
43KB, 659x741px
>Be me sitting in data structures
Teacher: You cant call a private member function from within main()

me: (pic related)
>>
>>58983173
why can't you just use a goto
>>
>you didn't even pass a this pointer to it
>thinking you're hot shit
>>
File: didnt_try.jpg (28KB, 550x550px) Image search: [Google]
didnt_try.jpg
28KB, 550x550px
you aren't calling a private function, you're calling an arbitrary pointer that happens to be where the code for your private function is located.
>>
>>58983173
I bet you're that one kid who always asks "intellectual" (read: tryhard) questions to the prof to attempt to look smart.
>>
>>58983173
try doing that in java
>>
File: mindblown.jpg (41KB, 412x516px) Image search: [Google]
mindblown.jpg
41KB, 412x516px
>>
>>58983198
bingo

getting output that seems to be a thing is not necessarily that thing
>>
now call a private function with arguments and a return value and make it work
>>
Jreeves, the wild lad at it again!
>>
>>58983391
setting registers is actually very hard
>>
>>58983173
>using namespace std;
>>
>>58983663
>freshman regurgitating baseless urgings by professor
He's not writing a library. Fuck off.
>>
>>58983173
here you go buddy
class cx {
public:
virtual void function1() {
printf("hey\n");
};

virtual void function2()
{
printf("hehe lol\n");
};
};

int main()
{
cx * a = new cx();
DWORD* a_vtbl = *(DWORD **)a;
((void(*)()) a_vtbl[1])();
}
>>
>>58983806
whoops, forgot the private, just add it above function2, and it will work
>>
>>58983173
Wait, what subroutine is at 0x400824?
>>
>>58983806
>unnecessairly declare them as virtual and decrease performance just so you can call them from the vtable instead of literally calling the function by address with a this pointer
lmaoing @ ur life
>>
>>58984459
The point was doing it without needing to know the address of the second function
>>
I wonder what Prof Huang would have to say if he knew that J. Reeves was talking shit about him online
>>
>>58983825
MyClass::Private()
>>
>>58984500

better throw this in archive.is or whatever quick
>>
>>58983173
What the fuck is a "runction"?
>>
>>58983173
>sepples
>>
>>58983173
>mfw i insert code at 0x400824
>>
Whoa, how many hacker points did he give you?

I'd probably go ahead and give you 2448 (which is 1 more than 1337 on each unit)
>>
>>58983209
>what is reflection
>>
>>58983173
seems like you are too retarded to even understand what your professor is trying to explain. well, you wont make it past the first year anyway.
>>
Mfw people pay to ''''''''''''study'''''''''' computer shit at an institution

Lol
>>
>>58985288
Worse is that they don't learn anything and instead make shitty code that's easily exploitable.
Thread posts: 29
Thread images: 4


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.