-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReverseme.Reversed.cpp
More file actions
78 lines (64 loc) · 1.99 KB
/
Reverseme.Reversed.cpp
File metadata and controls
78 lines (64 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
undefined8 main(void)
{
//bool is_prime = true;
bool bVar1;
// basic_ostream *pbVar2;
// long in_FS_OFFSET;
//int i, n;
int local_18; //n
int local_14; //i
// long local_10;
// GARBAGE
// local_10 = *(long *)(in_FS_OFFSET + 0x28);
//bool is_prime = true;
bVar1 = true;
//cout << "\n Enter a positive integer: ";
std::operator<<((basic_ostream *)std::cout,"Enter a positive integer: ");
//cin >> n;
std::basic_istream<char,std::char_traits<char>>::operator>>
((basic_istream<char,std::char_traits<char>> *)std::cin,&local_18);
//if (n == 0 || n == 1) {
// is_prime = false;
//}
if ((local_18 == 0) || (local_18 == 1)) {
bVar1 = false;
}
local_14 = 2;
do {
// i <= n/2 (n/2 < i)
if (local_18 / 2 < local_14) {
//Unconditional jump TAG
LAB_00101217:
//if is_prime == true
if (bVar1) {
pbVar2 = (basic_ostream *)
std::basic_ostream<char,std::char_traits<char>>::operator<<
((basic_ostream<char,std::char_traits<char>> *)std::cout,local_18);
//cout << n << ...
std::operator<<(pbVar2," is a prime number \n");
}
else {
pbVar2 = (basic_ostream *)
std::basic_ostream<char,std::char_traits<char>>::operator<<
((basic_ostream<char,std::char_traits<char>> *)std::cout,local_18);
//cout << n << ...
std::operator<<(pbVar2," is not a prime number \n");
}
//GARBAGE
// if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
// /* WARNING: Subroutine does not return */
// __stack_chk_fail();
// }
return 0;
}
//the for loop logic
// (n % i == 0)
if (local_18 % local_14 == 0) {
//is_prime = false
bVar1 = false;
goto LAB_00101217; //Unconditional Jump
}
// ++i (i=i+1)
local_14 = local_14 + 1;
} while( true );
}