« first day (3254 days earlier)      last day (1616 days later) » 

5:52 AM
@J.J Thanks, but I got my answer here reverseengineering.stackexchange.com/a/22526/30159 :)
 
6:09 AM
@daya Is your comment on the accepted answer why you cannot access 0x41414141 ?
 
6:54 AM
@MechMK1 Yeah, he replied with a satisfactory comment
 
Yup, probably not a memory location you can access
 
I guess so
Actually the whole point of my confusion was that leave instruction
 
Just pops the return address off the stack and jumps to it, no?
No wait, that's ret
 
the point I was missing is that after popping the saved ebp it also copies it into the current ebp and not just pop the saved ebp
@MechMK1 Yes, that is ret
 
Yeah, not much of an assembler guy myself
 
7:00 AM
I am neither
 
I honestly didn't even know enter and leave existed :D
Oh so literally just stack frame setups...
I didn't know there was ASM code that did that
 
@MechMK1 lol, actually I have saw leave but didn't knew enter existed before reading this post stackoverflow.com/questions/29790175/…
It cleared many doubts
 
Well, leave pops off the stack, so there must be a corresponding put on the stack
Just like how call and ret work together
I mean, you could do it manually, but you'd be a maniac to do so
 
yeah, but enter is not really used, gdb don't use it
It use, push ebp
 
Dunno, first time I've heard of it
 
7:05 AM
mov ebp, esp
Which makes more sense that enter
Understanding the whole memory layout, stack frames. etc., was the most complex part and especially assembly
Primarily I know more about websec than RE and BinExp
 
No, because there's more to it than the mov
You also have to pop and subtract something
The number of variables from ESP
And if you get freaky with large return types, you have to allocate space for that as well
 
Nah, that's just compliler optimisation thing AFAIK and depends on your actual source code
 
Yes, you might think, right? Let me ask you a question: How do you return a 2 MB large struct in C?
 
Well I don't know how to return a struct
@MechMK1 I was talking about the part which is common in all programs which is creating the stack frame, the enter instruction
 
@MechMK1 or if your shitty corporate build only allows IE. The machine I just got replaced last month had IE7 on Win7
Sadly new IE and Edge on Win 10 suck almost as much
 
7:13 AM
@daya Yes, but you still need to put the variables somewhere. As I said, enter does more than mov ebp, esp.
And you might think to just put the struct on the heap and return the pointer, like any sane person would do it, because then you don't need to memcpy() 2MB every time and can just return a pointer via register.
 
@MechMK1 enter is push ebp and then mov ebp, esp and not just mov ebp, esp
See that SO post I linked above
 
enter 0,0 is just mov and pop, yes
But you also need sub $n, %esp for enter n,0
 
Does enter take operands?
I didn't knew that before
 
It does, but I guess enter is shorthand for enter 0,0
ASM is so fucking weird anyways. Nothing does what it looks like it does. Trick question: What does xor eax, eax do on a modern Intel CPU?
 
@MechMK1 Of course it is!
I mean I still can't understand the whole program by just looking at it's assembly
 
7:25 AM
Well, then the question should be easy to answer, right?
 
@MechMK1 https://chat.stackexchange.com/transcript/message/52532399#52532399
This msg was the reply of weirdness of ASM
 
Ah, I see
 
@MechMK1 I don't know what xor does on modern CPU
Maybe just simple logical XOR
 
Yes, one might think. But xor eax, eax would always result in the EAX register being 0
And on a modern intel CPU, it just replaces the current EAX register with another one of it's 168 registers that is zero'd out at the moment
ASM, these days, is actually quite a high level language
@RoryAlsop I'm so glad I can use Chrome at work.
 
@MechMK1 Yeah, There exists a high level assembly called HLA
 
7:35 AM
I know, but I am not talking about HLA
I'm talking about bog-standard x86
 
Ah I see
 
It has to do with how modern CPUs interpret assembler
basically, they act like a C compiler enacting the "as-if" rule
As long as xor eax, eax results in the EAX register being zero (and not any other observable side effects happening), the CPU operates "correctly"
 
gotta go
cya
 
See ya
 
8:32 AM
PHP 7.4 is nearing release... a few weeks to (at most) a couple of months... New feature is Foreign Function Interface, which gives PHP direct access to .so (.dll) files... I foresee a lot of segfault questions on SO... but I also see the potential for exploiting buffer overflows and underruns in PHP code; something that hasn't been much of an issue yet.
I know my peers who write PHP code haven't been known for being security conscious... I'm honestly hoping that FFI will prove to be so newbie unfriendly that it never really catches on.
 
8:46 AM
@Ghedipunk I forsee a future where exploiting PHP applications will be a lot easier. I'm glad they make that change
You know, I have been known to rant on and on about how much I dislike PHP, but at the end of the day, I love it for just how much of a false sense of security it gives you. As a pentester, I love nothing more than for some company to tell me that their code is sooooo secure, and it breaks apart as soon as I do ?foo[]=a&foo[]=b everything breaks apart and their server commits sudoku.
 
@MechMK1 Yeah... red teams are going to have a lot more fun for a few years; that's for sure.
 
Just imagine, broken PHP code directly calling some weird .so file because someone needed to keep legacy code alive
It's like Frankenstein's Monster, just infinitely more exploitable.
 
Personally terrifies me... but honestly, it makes me glad that python has never reached the level of usage for networked applications that PHP has, since python has had FFI for several years...
 
You know what I truly think is the reason why so much PHP code is so broken?
Because the official PHP docs are an absolute nightmare
So everyone just goes do some random blog, written by people who also barely know PHP
It's like the blind leading the blind, but instead of banging their toes against the cupboard repeatedly, they build terrible webapplications.
And if you look at it from a security perspective...well...there is none
The few times you actually see anyone talk about security you get copy/pastes with code that was considered broken 2005, where people tried to manually escape SQL code
 
Good point. I've been railing against those random blogs that use mysql_* and "INSERT INTO $_POST['foo']"... but if php.net actually taught the language AND web development... well...
 
8:55 AM
Even right now, someone, somewhere, is googling "php regex escape sql"
 
That is both true and very disheartening.
 
PHP.net needs a radical overhaul.
Documentation needs to be split, both into hands-on documentation and related high-level usage guides.
But the way it is now is that function X tells you "My return types are either false or a string", and then function Y states that some other function may return NULL in case of something weird happening
People love saying that PHP is so weird because it developed over time. Well, the same happened to their docs, and it's time to fix it
And all this talk about how some information is technically available on some other page doesn't mean shit if the developers who actually read the docs don't know this!
 
(Not to mention, any comment that is critical of PHP's documentation style on the docs pages gets downvoted out of existence.)
 
It feels so weird to me. The comments are all...weird.
Some are like "Hello what's wrong with my code it don't work" and then have 700 lines of god-awful code attached.
Other comments point out absolutely weird behaviour of a function that can't be found anywhere in the documentation
 
I'm about 4 hours past when I should be unconscious... Honestly, realizing that it isn't the random ad-laden blogs teaching obvious security vulnerabilities are the symptoms of the problem, rather than the root, is a revelation that in my sleep deprived state, I feel I need to address, but know I'm not capable of doing right now.
 
9:10 AM
i wish to continue to talk about this when you had more unconsciousness time
But to be fair...it's just as much a revelation to me as it is to you
 
I look forward to it.
 
likewise. Have a good unconsciousness time
 
 
2 hours later…
11:06 AM
I am sometimes overcome with incredible sadness that I will probably not be part of the generation that has permanent habitation outside of earth, but none of this outweighs the tragedy of not being able to be in the moon pool.
 
 
5 hours later…
4:09 PM
I suppose the first step to updating PHP.net's documentation would be to subscribe to the developer mailing lists, then lurk for a while to figure out how to get changes in place. In the meantime, start a wiki or git repo to write articles.
Even if the articles are never adopted by The PHP Group, it'll still be good to have a collaborative effort to document PHP in a sane way, where people can be pointed to first.
 
 
3 hours later…

« first day (3254 days earlier)      last day (1616 days later) »