반응형

WinDbg 메모리 윈도우에서 변수를 확인해 보자.

 

g_dwGlobal 변수는 0x00007FF6DC7FE000 번지 메모리에 0x5678 값을 가지고 있다.

 

메모리 윈도우에서 변수명으로 확인해 보자.

Address 박스에 변수명(MyApp!g_dwGlobal)을 입력하면 변수값(0x5678)이 주소로 인식된다.

 

변수명 앞에 주소 연산자(&)를 붙이자.

주소 연산자(&)를 붙이면 변수 주소가 주소로 인식된다.

 

반응형
Posted by J-sean
:
반응형

치트엔진에 주소가 표시될 때 모듈 이름과 상대 주소의 연산으로 표시되지 않고 절대 주소로 표시되도록 해 보자.

 

스캔 결과 중 static 주소는 '모듈이름+상대주소' 방식으로 표시된다. 절대 주소로 표시해 보자.

 

스캔 결과 창에서 우클릭 - Preferences 를 클릭한다.

 

'Show static addresses using their static notat' 의 체크 표시를 해제한다.

 

절대 주소로 표시된다.

 

 

Memory Viewer의 주소 표시 방법도 바꿔보자.

 

View - Show module addresses가 체크되어 있다. 체크해제 한다.

 

절대 주소로 표시된다.

 

반응형
Posted by J-sean
:
반응형

IP 주소와 호스트 네임을 확인 해 보자.

 

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
78
79
80
81
82
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
using System.Net;
 
namespace CS
{
    using static System.Console;
 
    class Program
    {
        static void Main(string[] args)
        {
            // 인터넷 url로 IP 주소 확인
            string url = "www.naver.com";
            IPHostEntry ipHostEntry = Dns.GetHostEntry(url);
            WriteLine("■ IP addresses of " + url);
            foreach (IPAddress add in ipHostEntry.AddressList)
            {
                WriteLine(add.ToString());
            }
 
            // 호스트 네임으로 IP 주소 확인
            WriteLine();
            string hostName = Dns.GetHostName();
            ipHostEntry = Dns.GetHostEntry(hostName);
            WriteLine("■ All IP addresses of " + ipHostEntry.HostName);
            // WriteLine(hostName);            
            foreach (IPAddress address in ipHostEntry.AddressList)
            {
                WriteLine(address.ToString());
            }
 
            WriteLine();
            WriteLine("■ All IP6 addresses of " + ipHostEntry.HostName);
            foreach (IPAddress address in ipHostEntry.AddressList)
            {
                if (address.AddressFamily == System.Net.Sockets.AddressFamily.InterNetworkV6)
                    WriteLine(address.ToString());
            }
 
            WriteLine();
            WriteLine("■ All IP4 addresses of " + ipHostEntry.HostName);
            foreach (IPAddress address in ipHostEntry.AddressList)
            {
                if (address.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
                    WriteLine(address.ToString());
            }
 
            WriteLine();
            WriteLine("■ All IP4 addresses of " + ipHostEntry.HostName);
            foreach (IPAddress address in ipHostEntry.AddressList)
            {
                if (address.ToString().Split('.').Count() == 4)
                    WriteLine(address.ToString());
            }
 
            // IP 주소로 호스트 네임 확인
            WriteLine();
            IPAddress ipAddress = IPAddress.Parse(ipHostEntry.AddressList[0].ToString());
            // IPAddress ipAddress = IPAddress.Parse("192.168.0.100"); // My internal IP address
            ipHostEntry = Dns.GetHostEntry(ipAddress);
            Console.WriteLine("■ Host name: " + ipHostEntry.HostName);
 
            // 웹사이트를 이용한 외부 IP 주소 확인
            WriteLine();
            try
            {
                string externalIP = new WebClient().DownloadString("http://ipinfo.io/ip").Trim();
                // or http://icanhazip.com
                WriteLine("■ External IP address: " + externalIP);
            }
            catch (Exception exc)
            {
                WriteLine(exc.Message);
            }
        }
    }
}
 

 

소스를 입력하고 빌드한다.

 

IP 주소 및 호스트 네임을 확인 할 수 있다.

 

반응형
Posted by J-sean
:
반응형

Geocoder를 사용하면 주소로 위경도를, 위경도로 주소를 확인 할 수 있다.


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
public class MainActivity extends AppCompatActivity {
 
    Geocoder geocoder;
 
    EditText editText;
    Button button;
    TextView textView;
 
    EditText editText2;
    EditText editText3;
    Button button2;
    TextView textView2;
 
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
 
        geocoder = new Geocoder(this);
 
        editText = findViewById(R.id.editText);
        textView = findViewById(R.id.textView);
        button = findViewById(R.id.button);
 
        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                List<Address> addressList;
                String search = editText.getText().toString();
 
                try {
                    addressList = geocoder.getFromLocationName(search, 10);
                    String[] split = addressList.get(0).toString().split(",");
                    String address = split[0].substring(split[0].indexOf("\""+ 1split[0].length() - 2);
                    String latitude = split[10].substring(split[10].indexOf("="+ 1);  // 위도(수평선)
                    String longitude = split[12].substring(split[12].indexOf("="+ 1); // 경도(수직선)
 
                    String data = "Address: " + address + "\n" + "Latitude: " + latitude + "\n" + "Longitude: " + longitude;
                    textView.setText(data);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        });
 
        editText2 = findViewById(R.id.editText2);
        editText3 = findViewById(R.id.editText3);
        textView2 = findViewById(R.id.textView2);
        button2 = findViewById(R.id.button2);
 
        button2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                List<Address> addressList;
                double latitude = Double.parseDouble(editText2.getText().toString());
                double longitude = Double.parseDouble(editText3.getText().toString());
 
                try {
                    addressList = geocoder.getFromLocation(latitude, longitude, 10);
                    textView2.setText("Address: " + addressList.get(0).getAddressLine(0));
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        });
    }
}




실행 화면


간단한 주소를 입력하고 SEARCH GEOGRAPHIC COORDINATE 버튼을 클릭 하면 정확한 주소와 위경도가 표시 된다.


위경도를 입력하고 SEARCH ADDRESS 버튼을 클릭 하면 주소가 표시된다.


주소로 서현역을 검색 하거나 서현역 위경도로 검색하면 addressList[0]에 입력되는 내용은 아래와 같다. (똑같은 양식으로 입력 된다)


Address[addressLines=[0:"대한민국 경기도 성남시 분당구 서현동 성남대로 지하 601 서현"],feature=서현,admin=경기도,sub-admin=null,locality=성남시,thoroughfare=null,postalCode=463-050,countryCode=KR,countryName=대한민국,hasLatitude=true,latitude=37.384938999999996,hasLongitude=true,longitude=127.12326300000001,phone=null,url=null,extras=null]


반응형
Posted by J-sean
: