SlideShare ist ein Scribd-Unternehmen logo
1 von 34
C++ for
operator
How does C++ for operator
     truly look like
He doesn’t know this
She doesn’t know this either
... he doesn’t even care
He definitely does!
do you
let’s take


     x86             Microsoft
              &
  Assembler          Visual C++

                  and have a look …
_main      proc near
        push esi
        xor esi, esi

loc_401003:
                              void _tmain(int argc, _TCHAR* argv[])
        push esi
                              {
        push offset “%xquot;
                                for (int i = 0; i < 255; ++i)
        call _printf
                                {
        add esp, 8
                                  printf(“%xquot;, i);
        inc esi
                                }
        cmp esi, 0FFh
                              }
        jl short loc_401003
        xor eax, eax
        pop esi
        retn
_main       endp
_main      proc near
        push esi
        xor esi, esi

loc_401003:
                              void _tmain(int argc, _TCHAR* argv[])
        push esi
                              {
        push offset “%xquot;
                                for (int i = 0; i < 255; ++i)
        call _printf
                                {
        add esp, 8
                                  printf(“%xquot;, i);
        inc esi
                                }
        cmp esi, 0FFh
                              }
        jl short loc_401003
        xor eax, eax
        pop esi
        retn
_main       endp
_main      proc near
        push esi
        xor esi, esi

loc_401003:
                              void _tmain(int argc, _TCHAR* argv[])
        push esi
                              {
        push offset “%xquot;
                                for (int i = 0; i < 255; ++i)
        call _printf
                                {
        add esp, 8
                                  printf(“%xquot;, i);
        inc esi
                                }
        cmp esi, 0FFh
                              }
        jl short loc_401003
        xor eax, eax
        pop esi
        retn
_main       endp
_main      proc near
        push esi
        xor esi, esi

loc_401003:
                              void _tmain(int argc, _TCHAR* argv[])
        push esi
                              {
        push offset “%xquot;
                                for (int i = 0; i < 255; ++i)
        call _printf
                                {
        add esp, 8
                                  printf(“%xquot;, i);
        inc esi
                                }
        cmp esi, 0FFh
                              }
        jl short loc_401003
        xor eax, eax
        pop esi
        retn
_main       endp
_main      proc near
        push esi
        xor esi, esi

loc_401003:
                              void _tmain(int argc, _TCHAR* argv[])
        push esi
                              {
        push offset “%xquot;
                                for (int i = 0; i < 255; ++i)
        call _printf
                                {
        add esp, 8
                                  printf(“%xquot;, i);
        inc esi
                                }
        cmp esi, 0FFh
                              }
        jl short loc_401003
        xor eax, eax
        pop esi
        retn
_main       endp
_main      proc near
        push esi
        xor esi, esi

loc_401003:
                              void _tmain(int argc, _TCHAR* argv[])
        push esi
                              {
        push offset “%xquot;
                                for (int i = 0; i < 255; ++i)
        call _printf
                                {
        add esp, 8
                                  printf(“%xquot;, i);
        inc esi
                                }
        cmp esi, 0FFh
                              }
        jl short loc_401003
        xor eax, eax
        pop esi
        retn
_main       endp
How it could have been
recognized in assembly
Quite simple. Just ...
by the presence of the
   instructions of…
  Counter changing

  Counter comparison

  Jumps
by the presence of the
   instructions of…
  Counter changing

  Counter comparison

  Jumps
_main      proc near
        push esi
        xor esi, esi

loc_401003:
        push esi
        push offset “%xquot;
        call _printf
        add esp, 8
        inc esi
        cmp esi, 0FFh
        jl short loc_401003
        xor eax, eax
        pop esi
        retn
_main       endp
_main      proc near
        push esi
        xor esi, esi

loc_401003:
        push esi
        push offset “%xquot;
        call _printf
        add esp, 8
        inc esi
        cmp esi, 0FFh
        jl short loc_401003
        xor eax, eax
        pop esi
        retn
_main       endp
by the presence of the
   instructions of…
  Counter changing

  Counter comparison

  Jumps
by the presence of the
   instructions of…
  Counter changing

  Counter comparison

  Jumps
_main      proc near
        push esi
        xor esi, esi

loc_401003:
        push esi
        push offset “%xquot;
        call _printf
        add esp, 8
        inc esi
        cmp esi, 0FFh
        jl short loc_401003
        xor eax, eax
        pop esi
        retn
_main       endp
_main      proc near
        push esi
        xor esi, esi

loc_401003:
        push esi
        push offset “%xquot;
        call _printf
        add esp, 8
        inc esi
        cmp esi, 0FFh
        jl short loc_401003
        xor eax, eax
        pop esi
        retn
_main       endp
by the presence of the
   instructions of…
  Counter changing

  Counter comparison

  Jumps
by the presence of the
   instructions of…
  Counter changing

  Counter comparison

  Jumps
_main      proc near
        push esi
        xor esi, esi

loc_401003:
        push esi
        push offset “%xquot;
        call _printf
        add esp, 8
        inc esi
        cmp esi, 0FFh
        jl short loc_401003
        xor eax, eax
        pop esi
        retn
_main       endp
_main      proc near
        push esi
        xor esi, esi

loc_401003:
        push esi
        push offset “%xquot;
        call _printf
        add esp, 8
        inc esi
        cmp esi, 0FFh
        jl short loc_401003
        xor eax, eax
        pop esi
        retn
_main       endp
by the presence of the
   instructions of…
  Counter changing

  Counter comparison

  Jumps
And once again …
for contains instructions of …

     Counter changing

     Counter comparison

     Jumps
for contains instructions of …

     Counter changing

     Counter comparison

     Jumps
for contains instructions of …

     Counter changing

     Counter comparison

     Jumps
for contains instructions of …

     Counter changing

     Counter comparison

     Jumps

Weitere ähnliche Inhalte

Was ist angesagt?

Ping pong game
Ping pong  gamePing pong  game
Ping pong gameAmit Kumar
 
How the stack works(1)
How the stack works(1)How the stack works(1)
How the stack works(1)keithrozario
 
C++ Programming - 4th Study
C++ Programming - 4th StudyC++ Programming - 4th Study
C++ Programming - 4th StudyChris Ohk
 
โปรแกรมย่อยและฟังชันก์มาตรฐาน
โปรแกรมย่อยและฟังชันก์มาตรฐานโปรแกรมย่อยและฟังชันก์มาตรฐาน
โปรแกรมย่อยและฟังชันก์มาตรฐานknang
 
Data Structure - 2nd Study
Data Structure - 2nd StudyData Structure - 2nd Study
Data Structure - 2nd StudyChris Ohk
 
C++ Programming - 11th Study
C++ Programming - 11th StudyC++ Programming - 11th Study
C++ Programming - 11th StudyChris Ohk
 
C++の話(本当にあった怖い話)
C++の話(本当にあった怖い話)C++の話(本当にあった怖い話)
C++の話(本当にあった怖い話)Yuki Tamura
 
โครงงาน เครื่องคิดเลข
โครงงาน เครื่องคิดเลขโครงงาน เครื่องคิดเลข
โครงงาน เครื่องคิดเลขBung Lfkglialbmk
 
OSDC.TW - Gutscript for PHP haters
OSDC.TW - Gutscript for PHP hatersOSDC.TW - Gutscript for PHP haters
OSDC.TW - Gutscript for PHP hatersLin Yo-An
 
C++ Programming - 3rd Study
C++ Programming - 3rd StudyC++ Programming - 3rd Study
C++ Programming - 3rd StudyChris Ohk
 
ภาษาซี
ภาษาซีภาษาซี
ภาษาซีkramsri
 
第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -
第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -
第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -Wataru Kani
 
为什么 rust-lang 吸引我?
为什么 rust-lang 吸引我?为什么 rust-lang 吸引我?
为什么 rust-lang 吸引我?勇浩 赖
 
Load-time Hacking using LD_PRELOAD
Load-time Hacking using LD_PRELOADLoad-time Hacking using LD_PRELOAD
Load-time Hacking using LD_PRELOADDharmalingam Ganesan
 

Was ist angesagt? (19)

Ping pong game
Ping pong  gamePing pong  game
Ping pong game
 
week-16x
week-16xweek-16x
week-16x
 
How the stack works(1)
How the stack works(1)How the stack works(1)
How the stack works(1)
 
C++ Programming - 4th Study
C++ Programming - 4th StudyC++ Programming - 4th Study
C++ Programming - 4th Study
 
โปรแกรมย่อยและฟังชันก์มาตรฐาน
โปรแกรมย่อยและฟังชันก์มาตรฐานโปรแกรมย่อยและฟังชันก์มาตรฐาน
โปรแกรมย่อยและฟังชันก์มาตรฐาน
 
Data Structure - 2nd Study
Data Structure - 2nd StudyData Structure - 2nd Study
Data Structure - 2nd Study
 
C++ Programming - 11th Study
C++ Programming - 11th StudyC++ Programming - 11th Study
C++ Programming - 11th Study
 
C++の話(本当にあった怖い話)
C++の話(本当にあった怖い話)C++の話(本当にあった怖い話)
C++の話(本当にあった怖い話)
 
Tu1
Tu1Tu1
Tu1
 
โครงงาน เครื่องคิดเลข
โครงงาน เครื่องคิดเลขโครงงาน เครื่องคิดเลข
โครงงาน เครื่องคิดเลข
 
OSDC.TW - Gutscript for PHP haters
OSDC.TW - Gutscript for PHP hatersOSDC.TW - Gutscript for PHP haters
OSDC.TW - Gutscript for PHP haters
 
What is recursion?
What is recursion? What is recursion?
What is recursion?
 
C++ Programming - 3rd Study
C++ Programming - 3rd StudyC++ Programming - 3rd Study
C++ Programming - 3rd Study
 
Mona cheatsheet
Mona cheatsheetMona cheatsheet
Mona cheatsheet
 
ภาษาซี
ภาษาซีภาษาซี
ภาษาซี
 
第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -
第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -
第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -
 
为什么 rust-lang 吸引我?
为什么 rust-lang 吸引我?为什么 rust-lang 吸引我?
为什么 rust-lang 吸引我?
 
Functuon
FunctuonFunctuon
Functuon
 
Load-time Hacking using LD_PRELOAD
Load-time Hacking using LD_PRELOADLoad-time Hacking using LD_PRELOAD
Load-time Hacking using LD_PRELOAD
 

Ähnlich wie Reverse Engineering: C++ "for" operator

Code sources des fonctions table cp
Code sources des fonctions table cpCode sources des fonctions table cp
Code sources des fonctions table cpidhem110
 
Exploiting Memory Overflows
Exploiting Memory OverflowsExploiting Memory Overflows
Exploiting Memory OverflowsAnkur Tyagi
 
Programming ppt files (final)
Programming ppt files (final)Programming ppt files (final)
Programming ppt files (final)yap_raiza
 
Software to the slaughter
Software to the slaughterSoftware to the slaughter
Software to the slaughterQuinn Wilton
 
Unit 5 Foc
Unit 5 FocUnit 5 Foc
Unit 5 FocJAYA
 
¡Ups! código inseguro: detección, explotación y mitigación de vulnerabilidade...
¡Ups! código inseguro: detección, explotación y mitigación de vulnerabilidade...¡Ups! código inseguro: detección, explotación y mitigación de vulnerabilidade...
¡Ups! código inseguro: detección, explotación y mitigación de vulnerabilidade...Software Guru
 
ITGM #9 - Коварный CodeType, или от segfault'а к работающему коду
ITGM #9 - Коварный CodeType, или от segfault'а к работающему кодуITGM #9 - Коварный CodeType, или от segfault'а к работающему коду
ITGM #9 - Коварный CodeType, или от segfault'а к работающему кодуdelimitry
 
Anatomy of a PHP Request ( UTOSC 2010 )
Anatomy of a PHP Request ( UTOSC 2010 )Anatomy of a PHP Request ( UTOSC 2010 )
Anatomy of a PHP Request ( UTOSC 2010 )Joseph Scott
 
エンタープライズ・クラウドと 並列・分散・非同期処理
エンタープライズ・クラウドと 並列・分散・非同期処理エンタープライズ・クラウドと 並列・分散・非同期処理
エンタープライズ・クラウドと 並列・分散・非同期処理maruyama097
 
Basic ASM by @binaryheadache
Basic ASM by @binaryheadacheBasic ASM by @binaryheadache
Basic ASM by @binaryheadachecamsec
 
[FT-11][suhorng] “Poor Man's” Undergraduate Compilers
[FT-11][suhorng] “Poor Man's” Undergraduate Compilers[FT-11][suhorng] “Poor Man's” Undergraduate Compilers
[FT-11][suhorng] “Poor Man's” Undergraduate CompilersFunctional Thursday
 
When Bad Things Come In Good Packages
When Bad Things Come In Good PackagesWhen Bad Things Come In Good Packages
When Bad Things Come In Good PackagesSaumil Shah
 
Call Return Exploration
Call Return ExplorationCall Return Exploration
Call Return ExplorationPat Hawks
 

Ähnlich wie Reverse Engineering: C++ "for" operator (20)

Buffer OverFlow
Buffer OverFlowBuffer OverFlow
Buffer OverFlow
 
null Pune meet - Application Security: Code injection
null Pune meet - Application Security: Code injectionnull Pune meet - Application Security: Code injection
null Pune meet - Application Security: Code injection
 
Programming Homework Help
Programming Homework Help Programming Homework Help
Programming Homework Help
 
CompilersAndLibraries
CompilersAndLibrariesCompilersAndLibraries
CompilersAndLibraries
 
String Manipulation Function and Header File Functions
String Manipulation Function and Header File FunctionsString Manipulation Function and Header File Functions
String Manipulation Function and Header File Functions
 
Code sources des fonctions table cp
Code sources des fonctions table cpCode sources des fonctions table cp
Code sources des fonctions table cp
 
Exploiting Memory Overflows
Exploiting Memory OverflowsExploiting Memory Overflows
Exploiting Memory Overflows
 
Programming ppt files (final)
Programming ppt files (final)Programming ppt files (final)
Programming ppt files (final)
 
Software to the slaughter
Software to the slaughterSoftware to the slaughter
Software to the slaughter
 
Unit 5 Foc
Unit 5 FocUnit 5 Foc
Unit 5 Foc
 
¡Ups! código inseguro: detección, explotación y mitigación de vulnerabilidade...
¡Ups! código inseguro: detección, explotación y mitigación de vulnerabilidade...¡Ups! código inseguro: detección, explotación y mitigación de vulnerabilidade...
¡Ups! código inseguro: detección, explotación y mitigación de vulnerabilidade...
 
ITGM #9 - Коварный CodeType, или от segfault'а к работающему коду
ITGM #9 - Коварный CodeType, или от segfault'а к работающему кодуITGM #9 - Коварный CodeType, или от segfault'а к работающему коду
ITGM #9 - Коварный CodeType, или от segfault'а к работающему коду
 
Anatomy of a PHP Request ( UTOSC 2010 )
Anatomy of a PHP Request ( UTOSC 2010 )Anatomy of a PHP Request ( UTOSC 2010 )
Anatomy of a PHP Request ( UTOSC 2010 )
 
The Stack and Buffer Overflows
The Stack and Buffer OverflowsThe Stack and Buffer Overflows
The Stack and Buffer Overflows
 
エンタープライズ・クラウドと 並列・分散・非同期処理
エンタープライズ・クラウドと 並列・分散・非同期処理エンタープライズ・クラウドと 並列・分散・非同期処理
エンタープライズ・クラウドと 並列・分散・非同期処理
 
Functuon
FunctuonFunctuon
Functuon
 
Basic ASM by @binaryheadache
Basic ASM by @binaryheadacheBasic ASM by @binaryheadache
Basic ASM by @binaryheadache
 
[FT-11][suhorng] “Poor Man's” Undergraduate Compilers
[FT-11][suhorng] “Poor Man's” Undergraduate Compilers[FT-11][suhorng] “Poor Man's” Undergraduate Compilers
[FT-11][suhorng] “Poor Man's” Undergraduate Compilers
 
When Bad Things Come In Good Packages
When Bad Things Come In Good PackagesWhen Bad Things Come In Good Packages
When Bad Things Come In Good Packages
 
Call Return Exploration
Call Return ExplorationCall Return Exploration
Call Return Exploration
 

Kürzlich hochgeladen

Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxNikitaBankoti2
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 

Kürzlich hochgeladen (20)

Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 

Reverse Engineering: C++ "for" operator

  • 2. How does C++ for operator truly look like
  • 4. She doesn’t know this either
  • 5. ... he doesn’t even care
  • 8. let’s take x86 Microsoft & Assembler Visual C++ and have a look …
  • 9. _main proc near push esi xor esi, esi loc_401003: void _tmain(int argc, _TCHAR* argv[]) push esi { push offset “%xquot; for (int i = 0; i < 255; ++i) call _printf { add esp, 8 printf(“%xquot;, i); inc esi } cmp esi, 0FFh } jl short loc_401003 xor eax, eax pop esi retn _main endp
  • 10. _main proc near push esi xor esi, esi loc_401003: void _tmain(int argc, _TCHAR* argv[]) push esi { push offset “%xquot; for (int i = 0; i < 255; ++i) call _printf { add esp, 8 printf(“%xquot;, i); inc esi } cmp esi, 0FFh } jl short loc_401003 xor eax, eax pop esi retn _main endp
  • 11. _main proc near push esi xor esi, esi loc_401003: void _tmain(int argc, _TCHAR* argv[]) push esi { push offset “%xquot; for (int i = 0; i < 255; ++i) call _printf { add esp, 8 printf(“%xquot;, i); inc esi } cmp esi, 0FFh } jl short loc_401003 xor eax, eax pop esi retn _main endp
  • 12. _main proc near push esi xor esi, esi loc_401003: void _tmain(int argc, _TCHAR* argv[]) push esi { push offset “%xquot; for (int i = 0; i < 255; ++i) call _printf { add esp, 8 printf(“%xquot;, i); inc esi } cmp esi, 0FFh } jl short loc_401003 xor eax, eax pop esi retn _main endp
  • 13. _main proc near push esi xor esi, esi loc_401003: void _tmain(int argc, _TCHAR* argv[]) push esi { push offset “%xquot; for (int i = 0; i < 255; ++i) call _printf { add esp, 8 printf(“%xquot;, i); inc esi } cmp esi, 0FFh } jl short loc_401003 xor eax, eax pop esi retn _main endp
  • 14. _main proc near push esi xor esi, esi loc_401003: void _tmain(int argc, _TCHAR* argv[]) push esi { push offset “%xquot; for (int i = 0; i < 255; ++i) call _printf { add esp, 8 printf(“%xquot;, i); inc esi } cmp esi, 0FFh } jl short loc_401003 xor eax, eax pop esi retn _main endp
  • 15. How it could have been recognized in assembly
  • 17. by the presence of the instructions of… Counter changing Counter comparison Jumps
  • 18. by the presence of the instructions of… Counter changing Counter comparison Jumps
  • 19. _main proc near push esi xor esi, esi loc_401003: push esi push offset “%xquot; call _printf add esp, 8 inc esi cmp esi, 0FFh jl short loc_401003 xor eax, eax pop esi retn _main endp
  • 20. _main proc near push esi xor esi, esi loc_401003: push esi push offset “%xquot; call _printf add esp, 8 inc esi cmp esi, 0FFh jl short loc_401003 xor eax, eax pop esi retn _main endp
  • 21. by the presence of the instructions of… Counter changing Counter comparison Jumps
  • 22. by the presence of the instructions of… Counter changing Counter comparison Jumps
  • 23. _main proc near push esi xor esi, esi loc_401003: push esi push offset “%xquot; call _printf add esp, 8 inc esi cmp esi, 0FFh jl short loc_401003 xor eax, eax pop esi retn _main endp
  • 24. _main proc near push esi xor esi, esi loc_401003: push esi push offset “%xquot; call _printf add esp, 8 inc esi cmp esi, 0FFh jl short loc_401003 xor eax, eax pop esi retn _main endp
  • 25. by the presence of the instructions of… Counter changing Counter comparison Jumps
  • 26. by the presence of the instructions of… Counter changing Counter comparison Jumps
  • 27. _main proc near push esi xor esi, esi loc_401003: push esi push offset “%xquot; call _printf add esp, 8 inc esi cmp esi, 0FFh jl short loc_401003 xor eax, eax pop esi retn _main endp
  • 28. _main proc near push esi xor esi, esi loc_401003: push esi push offset “%xquot; call _printf add esp, 8 inc esi cmp esi, 0FFh jl short loc_401003 xor eax, eax pop esi retn _main endp
  • 29. by the presence of the instructions of… Counter changing Counter comparison Jumps
  • 31. for contains instructions of … Counter changing Counter comparison Jumps
  • 32. for contains instructions of … Counter changing Counter comparison Jumps
  • 33. for contains instructions of … Counter changing Counter comparison Jumps
  • 34. for contains instructions of … Counter changing Counter comparison Jumps