.NET Reflector

November 19, 2009,
tags: .net windows


このエントリーをはてなブックマークに追加

20歳のときに書いたVBのソースコードガ見たくなったわけですが、exeファイルしか残っていなかったんです。
なんか良いツールないかなーと探してみたところ[.NET Reflector]ってソフトがありました。

とりあえず、ために使ってみたところ、普通にソースコードが見れました。
日本語文字表示されているところはさすがに日本語として表示してもらえませんでしたがw
それでもソースコードみれちゃったんでいいのではないでしょうか?

昔某サイトでバイトしていたころに、休みの日に個人的にこんなツールがあったらいいなぁーと思って書いてみたソースコードです。
ここまでソースコードがみれればなかなか良いツールではないでしょうか?

form1

Public Class Form1
    Inherits Form
    ' Methods
    Public Sub New()
    Private Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs)
    Private Sub Button1_Click_1(ByVal sender As Object, ByVal e As EventArgs)
    Private Sub Button2_Click(ByVal sender As Object, ByVal e As EventArgs)
    Private Sub Button3_Click(ByVal sender As Object, ByVal e As EventArgs)
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
    Private Sub Dnbt_Click(ByVal sender As Object, ByVal e As EventArgs)
    Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
    <DebuggerStepThrough> _
    Private Sub InitializeComponent()
    Private Sub Label5_Click(ByVal sender As Object, ByVal e As EventArgs)
    <STAThread> _
    Public Shared Sub Main()
    Private Sub TextBox3_TextChanged(ByVal sender As Object, ByVal e As EventArgs)

    ' Properties
    Friend Overridable Property Button1 As Button
    Friend Overridable Property Button2 As Button
    Friend Overridable Property Button3 As Button
    Friend Overridable Property Dnbt As Button
    Friend Overridable Property Label1 As Label
    Friend Overridable Property Label2 As Label
    Friend Overridable Property Label3 As Label
    Friend Overridable Property Label4 As Label
    Friend Overridable Property Label5 As Label
    Friend Overridable Property sbox1 As ComboBox
    Friend Overridable Property TextBox1 As TextBox
    Friend Overridable Property TextBox2 As TextBox
    Friend Overridable Property TextBox3 As TextBox
    Friend Overridable Property upbt As Button

    ' Fields
    <AccessedThroughProperty("Button1")> _
    Private _Button1 As Button
    <AccessedThroughProperty("Button2")> _
    Private _Button2 As Button
    <AccessedThroughProperty("Button3")> _
    Private _Button3 As Button
    <AccessedThroughProperty("Dnbt")> _
    Private _Dnbt As Button
    <AccessedThroughProperty("Label1")> _
    Private _Label1 As Label
    <AccessedThroughProperty("Label2")> _
    Private _Label2 As Label
    <AccessedThroughProperty("Label3")> _
    Private _Label3 As Label
    <AccessedThroughProperty("Label4")> _
    Private _Label4 As Label
    <AccessedThroughProperty("Label5")> _
    Private _Label5 As Label
    <AccessedThroughProperty("sbox1")> _
    Private _sbox1 As ComboBox
    <AccessedThroughProperty("TextBox1")> _
    Private _TextBox1 As TextBox
    <AccessedThroughProperty("TextBox2")> _
    Private _TextBox2 As TextBox
    <AccessedThroughProperty("TextBox3")> _
    Private _TextBox3 As TextBox
    <AccessedThroughProperty("upbt")> _
    Private _upbt As Button
    Private components As IContainer
End Class


Expand Methods

たぶんButton1が押されたときの処理。

Private Sub Button1_Click_1(ByVal sender As Object, ByVal e As EventArgs)
    Dim obj2 As Object
    If (StringType.StrCmp(Me.sbox1.get_Text, "", False) Is 0) Then
        Interaction.MsgBox(ChrW(12469) & ChrW(12540) & ChrW(12499) & ChrW(12473) & ChrW(12434) & ChrW(36984) & ChrW(25246) & ChrW(12375) & ChrW(12390) & ChrW(12367) & ChrW(12384) & ChrW(12373) & ChrW(12356), 0, ChrW(12456) & ChrW(12521) & ChrW(12540))
    End If
    Dim random As New Random
    Dim str As String = Me.sbox1.get_Text
    If (StringType.StrCmp(str, "site1", False) Is 0) Then
        If (StringType.StrCmp(Me.TextBox3.get_Text, Me.TextBox1.get_Text, False) < 0) Then
            Interaction.MsgBox(ChrW(12302) & "RANDOM" & ChrW(38480) & ChrW(12303) & ChrW(12364) & ChrW(12302) & "site1" & ChrW(25968) & ChrW(20516) & ChrW(12303) & ChrW(12424) & ChrW(12426) & ChrW(23567) & ChrW(12373) & ChrW(12356) & ChrW(12391) & ChrW(12377), 0, ChrW(12456) & ChrW(12521) & ChrW(12540))
        Else
            Dim num As Integer = random.Next(IntegerType.FromString(Me.TextBox1.get_Text), IntegerType.FromString(Me.TextBox3.get_Text))
            LateBinding.LateCall(RuntimeHelpers.GetObjectValue(Interaction.CreateObject("Wscript.Shell", "")), Nothing, "Run", New Object() { ("http://blog.site1.jp/index.nhn?cid=" & StringType.FromInteger(num)), 3 }, Nothing, Nothing)
            obj2 = Nothing
            Me.Label5.set_Text(StringType.FromDouble((DoubleType.FromString(Me.Label5.get_Text) + 1)))
        End If
    ElseIf (StringType.StrCmp(str, "site2", False) Is 0) Then
        If (StringType.StrCmp(Me.TextBox3.get_Text, Me.TextBox2.get_Text, False) < 0) Then
            Interaction.MsgBox(ChrW(12302) & "RANDOM" & ChrW(38480) & ChrW(12303) & ChrW(12364) & ChrW(12302) & "site2" & ChrW(25968) & ChrW(20516) & ChrW(12303) & ChrW(12424) & ChrW(12426) & ChrW(23567) & ChrW(12373) & ChrW(12356) & ChrW(12391) & ChrW(12377), 0, ChrW(12456) & ChrW(12521) & ChrW(12540))
        Else
            Dim num2 As Integer = random.Next(IntegerType.FromString(Me.TextBox2.get_Text), IntegerType.FromString(Me.TextBox3.get_Text))
            LateBinding.LateCall(RuntimeHelpers.GetObjectValue(Interaction.CreateObject("Wscript.Shell", "")), Nothing, "Run", New Object() { ("http://xxxx.site2.jp/" & StringType.FromInteger(num2)), 3 }, Nothing, Nothing)
            obj2 = Nothing
            Me.Label5.set_Text(StringType.FromDouble((DoubleType.FromString(Me.Label5.get_Text) + 1)))
        End If
    End If
End Sub

たぶんButton2ガ押されたときの処理

Private Sub Button2_Click(ByVal sender As Object, ByVal e As EventArgs)
    If (Not Interaction.MsgBox(ChrW(26412) & ChrW(24403) & ChrW(12395) & ChrW(38281) & ChrW(12376) & ChrW(12414) & ChrW(12377) & ChrW(12363) & ChrW(65311), 4, ChrW(30906) & ChrW(35469)) Is 7) Then
        Dim writer As New StreamWriter("log.txt", True, Encoding.get_Default)
        Dim str As String = ((((StringType.FromDate(DateAndTime.get_Now) & "  " & ChrW(24033) & ChrW(22238) & ChrW(22238) & ChrW(25968) & " " & Me.Label5.get_Text) & ChrW(22238) & ChrW(13) & ChrW(10) & "site1" & ChrW(12288) & Me.TextBox1.get_Text) & ChrW(13) & ChrW(10) & "site2" & ChrW(12288) & Me.TextBox2.get_Text) & ChrW(13) & ChrW(10) & ChrW(13) & ChrW(10))
        writer.Write(str)
        writer.Close
        Me.Close
    End If
End Sub

たぶんButton3が押されたときの処理?

Private Sub Button3_Click(ByVal sender As Object, ByVal e As EventArgs)
    If (Interaction.MsgBox("RESET" & ChrW(12375) & ChrW(12414) & ChrW(12377) & ChrW(12363) & ChrW(65311), 1, ChrW(30906) & ChrW(35469)) Is 1) Then
        Dim writer As New StreamWriter("rlog.txt", True, Encoding.get_Default)
        Dim str As String = ((((StringType.FromDate(DateAndTime.get_Now) & ChrW(13) & ChrW(10) & " site1" & Me.TextBox1.get_Text) & ChrW(13) & ChrW(10) & " site2" & Me.TextBox2.get_Text) & ChrW(13) & ChrW(10) & " RANDOM" & ChrW(25968) & ChrW(20516) & " " & Me.TextBox3.get_Text) & ChrW(13) & ChrW(10) & ChrW(13) & ChrW(10))
        writer.Write(str)
        writer.Close
        Me.TextBox1.set_Text(StringType.FromInteger(&H5F5E100))
        Me.TextBox2.set_Text(StringType.FromInteger(&H5F5E101))
        Me.TextBox3.set_Text(StringType.FromInteger(0))
    End If
End Sub

よくわからん・・・・

Private Sub Dnbt_Click(ByVal sender As Object, ByVal e As EventArgs)
    Dim num As Double
    Dim obj2 As Object
    If (StringType.StrCmp(Me.sbox1.get_Text, "", False) Is 0) Then
        Interaction.MsgBox(ChrW(12469) & ChrW(12540) & ChrW(12499) & ChrW(12473) & ChrW(12434) & ChrW(36984) & ChrW(25246) & ChrW(12375) & ChrW(12390) & ChrW(12367) & ChrW(12384) & ChrW(12373) & ChrW(12356), 0, ChrW(12456) & ChrW(12521) & ChrW(12540))
    End If
    Dim str As String = Me.sbox1.get_Text
    If (StringType.StrCmp(str, "site2", False) Is 0) Then
        num = (DoubleType.FromString(Me.TextBox2.get_Text) - 1)
        If (num < 100000001) Then
            Interaction.MsgBox("site2" & ChrW(25968) & ChrW(20516) & ChrW(12364) & ChrW(20302) & ChrW(12377) & ChrW(12366) & ChrW(12414) & ChrW(12377), 0, ChrW(12456) & ChrW(12521) & ChrW(12540))
        Else
            Me.TextBox2.set_Text(StringType.FromDouble(num))
            LateBinding.LateCall(RuntimeHelpers.GetObjectValue(Interaction.CreateObject("Wscript.Shell", "")), Nothing, "Run", New Object() { ("http://xxx. site2.jp/Friends.nhn?userno=" & StringType.FromDouble(num)), 3 }, Nothing, Nothing)
            obj2 = Nothing
            Me.Label5.set_Text(StringType.FromDouble((DoubleType.FromString(Me.Label5.get_Text) + 1)))
        End If
    ElseIf (StringType.StrCmp(str, "site1", False) Is 0) Then
        num = (DoubleType.FromString(Me.TextBox1.get_Text) - 1)
        If (num < 100000001) Then
            Interaction.MsgBox("site2" & ChrW(25968) & ChrW(20516) & ChrW(12364) & ChrW(20302) & ChrW(12377) & ChrW(12366) & ChrW(12414) & ChrW(12377), 0, ChrW(12456) & ChrW(12521) & ChrW(12540))
        Else
            Me.TextBox1.set_Text(StringType.FromDouble(num))
            LateBinding.LateCall(RuntimeHelpers.GetObjectValue(Interaction.CreateObject("Wscript.Shell", "")), Nothing, "Run", New Object() { ("http://blog. site1.jp/index.nhn?cid=" & StringType.FromDouble(num)), 3 }, Nothing, Nothing)
            obj2 = Nothing
            Me.Label5.set_Text(StringType.FromDouble((DoubleType.FromString(Me.Label5.get_Text) + 1)))
        End If
    End If
End Sub
comments powered by Disqus