SlideShare a Scribd company logo
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

More Related Content

What's hot

Ping pong game
Ping pong  gamePing pong  game
Ping pong game
Amit Kumar
 
week-16x
week-16xweek-16x
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 Study
Chris Ohk
 
โปรแกรมย่อยและฟังชันก์มาตรฐาน
โปรแกรมย่อยและฟังชันก์มาตรฐานโปรแกรมย่อยและฟังชันก์มาตรฐาน
โปรแกรมย่อยและฟังชันก์มาตรฐาน
knang
 
Data Structure - 2nd Study
Data Structure - 2nd StudyData Structure - 2nd Study
Data Structure - 2nd Study
Chris Ohk
 
C++ Programming - 11th Study
C++ Programming - 11th StudyC++ Programming - 11th Study
C++ Programming - 11th Study
Chris Ohk
 
C++の話(本当にあった怖い話)
C++の話(本当にあった怖い話)C++の話(本当にあった怖い話)
C++の話(本当にあった怖い話)
Yuki Tamura
 
Tu1
Tu1Tu1
โครงงาน เครื่องคิดเลข
โครงงาน เครื่องคิดเลขโครงงาน เครื่องคิดเลข
โครงงาน เครื่องคิดเลข
Bung Lfkglialbmk
 
OSDC.TW - Gutscript for PHP haters
OSDC.TW - Gutscript for PHP hatersOSDC.TW - Gutscript for PHP haters
OSDC.TW - Gutscript for PHP haters
Lin Yo-An
 
What is recursion?
What is recursion? What is recursion?
What is recursion?
AnuragSrivastava272
 
C++ Programming - 3rd Study
C++ Programming - 3rd StudyC++ Programming - 3rd Study
C++ Programming - 3rd Study
Chris Ohk
 
Mona cheatsheet
Mona cheatsheetMona cheatsheet
Mona cheatsheet
Ce.Se.N.A. Security
 
ภาษาซี
ภาษาซีภาษาซี
ภาษาซี
kramsri
 
第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -
第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -
第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -
Wataru Kani
 
为什么 rust-lang 吸引我?
为什么 rust-lang 吸引我?为什么 rust-lang 吸引我?
为什么 rust-lang 吸引我?
勇浩 赖
 
Functuon
FunctuonFunctuon
Functuon
NithyaNithyav
 
Load-time Hacking using LD_PRELOAD
Load-time Hacking using LD_PRELOADLoad-time Hacking using LD_PRELOAD
Load-time Hacking using LD_PRELOAD
Dharmalingam Ganesan
 

What's hot (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
 

Similar to Reverse Engineering: C++ "for" operator

Buffer OverFlow
Buffer OverFlowBuffer OverFlow
Buffer OverFlow
Rambabu Duddukuri
 
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
n|u - The Open Security Community
 
Programming Homework Help
Programming Homework Help Programming Homework Help
Programming Homework Help
Programming Homework Help
 
CompilersAndLibraries
CompilersAndLibrariesCompilersAndLibraries
CompilersAndLibraries
Staffan Tjernström
 
String Manipulation Function and Header File Functions
String Manipulation Function and Header File FunctionsString 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
idhem110
 
Exploiting Memory Overflows
Exploiting Memory OverflowsExploiting Memory Overflows
Exploiting Memory Overflows
Ankur 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 slaughter
Quinn Wilton
 
Unit 5 Foc
Unit 5 FocUnit 5 Foc
Unit 5 Foc
JAYA
 
¡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
 
The Stack and Buffer Overflows
The Stack and Buffer OverflowsThe Stack and Buffer Overflows
The Stack and Buffer Overflows
UTD Computer Security Group
 
エンタープライズ・クラウドと 並列・分散・非同期処理
エンタープライズ・クラウドと 並列・分散・非同期処理エンタープライズ・クラウドと 並列・分散・非同期処理
エンタープライズ・クラウドと 並列・分散・非同期処理
maruyama097
 
Functuon
FunctuonFunctuon
Functuon
NithyaNithyav
 
Basic ASM by @binaryheadache
Basic ASM by @binaryheadacheBasic ASM by @binaryheadache
Basic ASM by @binaryheadache
camsec
 
[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
Functional 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 Packages
Saumil Shah
 
Call Return Exploration
Call Return ExplorationCall Return Exploration
Call Return Exploration
Pat Hawks
 

Similar to 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
 

Recently uploaded

Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
WaniBasim
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
Nguyen Thanh Tu Collection
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
PECB
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
imrankhan141184
 
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
สมใจ จันสุกสี
 
Cognitive Development Adolescence Psychology
Cognitive Development Adolescence PsychologyCognitive Development Adolescence Psychology
Cognitive Development Adolescence Psychology
paigestewart1632
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
siemaillard
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
Celine George
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
Celine George
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 
How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience
Wahiba Chair Training & Consulting
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Fajar Baskoro
 

Recently uploaded (20)

Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
 
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
 
Cognitive Development Adolescence Psychology
Cognitive Development Adolescence PsychologyCognitive Development Adolescence Psychology
Cognitive Development Adolescence Psychology
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 
How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
 

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