Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Do I Know x86?

Name: Anonymous 2014-10-30 20:35

Found this while reversing a program:

mov esi, ds:MessageBoxA
call esi ; MessageBoxA


Am I missing something or are these the stupidest two instructions ever emitted by a C++ compiler?

Name: Anonymous 2014-10-30 20:43

You're the stupid to bother with some crappy compiler output, instead of doing real work.

Name: Anonymous 2014-10-30 21:43

>>2
You're the stupid to learn English, binch ☭☭☭

Name: Anonymous 2014-10-30 21:51

>>3

anus

Name: Anonymous 2014-10-30 23:44

OPTIMISATION

Name: Anonymous 2014-10-31 0:22

>>3

You am dum.

Name: Anonymous 2014-10-31 0:30

Ok really though, there's no possible benefit to "mov esi, subroutine; call esi" over "call subroutine", right? I checked, it doesn't call MessageBoxA multiple times through esi.

Name: Anonymous 2014-10-31 0:34

>>7
Who knows? Maybe calling from a register changes how it is cached or something. How about you try to get your hands on some of there technical manuals and did out. Ask Cudder maybe, or try it with Intel's compiler and see what happens.

Name: Anonymous 2014-10-31 4:41

>>7
gcc at least is notorious for generating load / store code like this even if the target architecture has memory operands.

Name: Anonymous 2014-10-31 5:22

I doubt it emitted code like that. Maybe mov esi, [ds:MessageBoxA]?

Ususally code is not located in data segment (ds). Your example would jump to data segment so I doubt it's correct.

Name: Cudder !MhMRSATORI 2014-10-31 5:28

I've seen worse... far worse.

>>7
Are you sure it doesn't, sometime later in the function? Or is that call esi part of a loop? I know MSVC does the mov/call/call sequence for functions called more than once; so maybe it originally generated code for multiple calls, but some later optimisation pass decided those would never be reachable and removed them without considering the results of some earlier opts.

<rant>
This is another example of why that "separation of concerns" principle the academic dickheads like to trumpet around is pure intellectual masturbatory bullshit. One optimisation can affect another. Register allocation and instruction selection are intrinsically dependent, and also dependent on optimisation. Thinking of a compiler as a series of stages from source code to executable binary is conceptually simple and produces something that works, but is far from optimal.
</rant>

Name: Anonymous 2014-10-31 11:18

>>1
Whom are you calling ese, cabron?

Name: Anonymous 2014-10-31 14:35

Hey esi, don't you know I'm local?

Name: Anonymous 2014-10-31 15:12

、get over here!

Name: Anonymous 2014-10-31 15:53

call rel32
Displaces by a 32 bit *signed* quantity, so if you wanted to call a procedure that is greater than 2^31-1 away from current EIP you would need to use an indirect call through a register.
Also for 64 bit x86 the only way to get at the full 64 bit absolute addressing mode is the mov instruction, so to call a function at addresses > 4GB you would have to use mov reg, address + call reg

Name: Anonymous 2014-10-31 16:16

>>15
Hory shit. There are binary executables that do not fit into 2 gigabytes after loading and linking? Fuck that.

Name: Anonymous 2014-10-31 17:21

>>11
Wow, so I checked again, and found ONE PLACE where it calls MessageBoxA through esi again.
http://a.pomf.se/lmggxr.PNG
See all those blue arrows? It duplicates the "mov esi, MessageBoxA; call esi" code 10 times and mandates pushing and popping esi in several other parts of the code, just to OMG OPTIMIZE opening a fucking warning dialog. Great job, MSVC++.

>>15
This is a 32 bit program though.

Name: Anonymous 2014-10-31 19:38

>>17
This is a 32 bit program though.
PAE.

Name: Cudder !MhMRSATORI 2014-11-01 11:44

>>15
x86-64 is not true 64-bit. You can blame AMD for that...

>>16
According to http://arstechnica.com/business/2012/04/exclusive-a-behind-the-scenes-look-at-facebook-release-engineering/ Facebook is a single 1.5GB binary, so I wouldn't be surprised if there were far bigger ones being created elsewhere.

>>17
:facepalm: Lots of duplicate code there. Could've been the result of separate compilation/linking, since a rel32 relocation, especially to an import table entry, is somewhat tricky to handle... push reg/pop reg are tiny though - 1 byte each.

mov reg, [mem] is 5 bytes and a call reg is 2, while call mem is also 5, so it's smaller if you call the same function more than once - 5 + 2n vs 5n --- that is, if you don't do the mov more than once too!

>>18
VA != PA

Name: Anonymous 2014-11-01 23:36

>>19

Facebook is a single 1.5GB binary
Are they niggers? Human genome takes less.

Name: Anonymous 2014-11-02 0:12

>>20
Human genome takes about 3.2GB

Name: Anonymous 2014-11-02 0:37

>>20-21
What encoding do they use to store the human genome in?

Name: Anonymous 2014-11-02 0:38

>>17
How does a compiler know when to optimize and when to not optimize? Nigger.

Name: Anonymous 2014-11-02 0:41

>>21

You're more autistic than the OP.

Name: Anonymous 2014-11-02 1:18

>>22
███████╗██╗ ██╗███████╗███████╗████████╗ ██████╗ ██╗ ██╗██████╗ ███████╗
██╔════╝██║ ██║██╔════╝██╔════╝╚══██╔══╝ ██╔══██╗██║ ██║██╔══██╗██╔════╝
███████╗██║ █╗ ██║█████╗ █████╗ ██║ ██║ ██║██║ ██║██████╔╝███████╗
╚════██║██║███╗██║██╔══╝ ██╔══╝ ██║ ██║ ██║██║ ██║██╔══██╗╚════██║
███████║╚███╔███╔╝███████╗███████╗ ██║ ██████╔╝╚██████╔╝██████╔╝███████║
╚══════╝ ╚══╝╚══╝ ╚══════╝╚══════╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝

Name: Anonymous 2014-11-02 1:30

Fonts are for interior designer faggots. You suck dick, don't you, faggot? You
prefer HTML to C/C++? You wanna suck dick and want to wear 3 condoms with
faggot abstractions layers. You masters are gonna take control and make you do
interior design web page shit and suck dick cause they want everybody a homo
married to homos. That's what the CIA is planning for the world -- nothing but
a bunch of faggots HTML programmers in gay marriages.

Name: Anonymous 2014-11-02 1:36

optimize the niggers

Name: >>22 2014-11-02 2:47

>>25
Sweet formatting, ``faggot''

Name: Anonymous 2014-11-05 12:16

>>26

Chill out there, i think you're in the wrong thread.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List