Jump to content
  • 0

vstudio 2005 optimize small things?


Question

Posted (edited)

i have this code set up on vsd 2005, thefore i cannot find it into IDA  the function sum, second people answer my ask in previous community, this was optimize by compiler. can there is any config for it, to don't optimize samples things?

 

#include <iostream>
extern "C" {
    int sum(unsigned char s1 = 10, int s3 = 25) {
    s3 = s1 * (s3);
 }
}

int main() {
    int y = 50;
    int x = 50;
    return 0;
}
  

 


ENCONTREI ESTE Start 
 
_int64 start()
{
  unk_407610 = 0;
  sub_401660();
  return sub_401180();
}
 
ENCONTREI ESTE MAIN
 
.text:0000000000402C10 ; int __cdecl main(int argc, const char **argv, const char **envp)
.text:0000000000402C10 main            proc near               ; CODE XREF: sub_401180+242p
.text:0000000000402C10                                         ; DATA XREF: .pdata:0000000000405258o ...
.text:0000000000402C10                 sub     rsp, 28h
.text:0000000000402C14                 call    sub_401620
.text:0000000000402C19                 xor     eax, eax
.text:0000000000402C1B                 add     rsp, 28h
.text:0000000000402C1F                 retn
.text:0000000000402C1F main            endp
.text:0000000000402C1F
 
 
.text:0000000000401620 sub_401620      proc near               ; CODE XREF: sub_401180+215p
.text:0000000000401620                                         ; main+4p
.text:0000000000401620                 mov     eax, cs:dword_407040
.text:0000000000401626                 test    eax, eax
.text:0000000000401628                 jz      short loc_401630
.text:000000000040162A                 retn

 

 

only now i am see that sum not have a return, i even not know as it  have been compiled

Edited by Naelson

2 answers to this question

Recommended Posts

  • 0
Posted

you have 2 options to control compiler optimizations

 

using pragma directive, at the top of a file you don't want anything inside optimized

#pragma optimize("", off)

 

using project configuration

right click the project, properties -> configuration properties -> c/c++ -> optimization -> set optimization to disabled

 

though tbh i'm not sure it will ever not optimize instructions that have static values at compile time, never bothered trying

  • Upvote 1
  • 0
Posted
On 1/13/2022 at 2:03 AM, Anarchy said:

you have 2 options to control compiler optimizations

 

using pragma directive, at the top of a file you don't want anything inside optimized

#pragma optimize("", off)

 

using project configuration

right click the project, properties -> configuration properties -> c/c++ -> optimization -> set optimization to disabled

 

though tbh i'm not sure it will ever not optimize instructions that have static values at compile time, never bothered trying

project, properties -> configuration properties -> c/c++ -> optimization -> set optimization to disabled 👊

 

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • You're talking complete nonsense. The source code of SphereAPI, which handles all requests, is closed and has never been published anywhere.     That return $this doesn't affect anything, PHP just ignores it. Why are you showing it?     Yes, of course I want that, and I’m asking you — go ahead and hack it, I’d even be thankful. The most you can probably do is launch a DDoS attack, but that’s not hacking. The IP you see is just a public one, used by default to handle requests. There are many other IPs involved, which aren’t disclosed for privacy reasons. So, when should I expect your hacker attack? If you fail, it means you talked big for nothing. I hope you're not all talk and can actually back up your words. UPD: To make your task easier, I have disabled limits on incorrect and failed requests, so your site/IP won't get blocked.
    • Lineage2Dex Interlude+ x50 Server launches TODAY!       The wait is over – the Lineage2Dex Interlude+ x50 Server launches TODAY! Grand Opening - April 26 at 19:00 (UTC+3) Over 10,000 registered accounts are ready to dive in! Beta with massive activity over, thx all who participate on it! It's time to begin your real Jorney! 👉 Read full roadmap 👉 Full server description 👉 Download and registration The server will be split into 3 stages, each featuring multiple content episodes. Stage 1: April 26 – May 18 Welcome to the Classic Interlude Phase. This stage is built with minimal custom content, focused on delivering that pure Interlude experience. It’s perfect for both new players unfamiliar with our project and veterans who enjoy a traditional start. Expect a smooth and nostalgic journey with familiar mechanics. Stage 2: May 19 – June 22 Time to expand the world! As most Interlude content gets completed, we gradually introduce new elements. Hellbound will open first, followed by weekly content updates. Midway through this stage, the Isle of Prayer will become available — a new zone featuring Dynasty Gear and fresh challenges. Stage 3: From June 23 Welcome to full content access! Some location become to High-level location, offering great reward! Once this phase concludes, a full merge with Union server will take place — and yes, all your characters and items will carry over safely. We wish everyone a smooth start, fair play, and tons of fun on the new x50 server! See you in-game!
    • Hello everyone! I'm offering professional L2J development services, specialized for aCis projects.   🔹 What I offer: Ready-to-implement existing systems (events, features, gameplay improvements). Custom development: I can create new systems based on your specific requests and ideas. Bug fixing, optimization, and enhancement of your server's code. Professional, clean, and organized Java coding. Support after delivery to ensure smooth integration.   🔹 Some examples of available systems: PvP and PvE Mini-Events (fully automated). Custom Raid Boss Events. Advanced Clan Utilities (regroup features, clan ranking, etc). Reward Systems (based on kills, damage, objectives, etc). Achievements Subscription system Arena Fights (1v1 tournament, scratch made). Advanced event engine (12 events, many features). multi-client aCis project, progressive gameplay C4 to C6   🔹 Why work with me? Years of experience working directly with aCis pack. Fast, reliable communication. I care about performance and long-term stability. I can adjust the systems to fit your server's style and balance.   🔹 Pricing: Flexible depending on the complexity (fixed price per project or per system). Discounts for multiple systems or long-term collaboration.   🔹 Contact: MaxCheaters PM Discord: @Luminous   Serious and passionate about your project? Let's make your server unique!
    • The hardest part for anyone is to reverse engineer your server but you're handing the code out for free. At that point, there's no real challenge.   you want facts?   public function __construct(?int $userId = null) { if ($userId == null) { return $this; } // you know that constructs does not return values in php?   🤏just 1 file bad code.   you want to be hacked? show your customers websites that run that code 167.235.*.* api.spherewe***** stop writing chatgt, and dont challenge me again i tried to help you, but if you want me i can share everything even guide users how to hack every client you have even your server
  • Topics

×
×
  • Create New...