Rasool Ahmed Newbie Poster

My problem is when I open new activity when pressing button an error accoutred "Unfortunately, ISPcheck has stopped".
Here is my MainActivity.java button click event code:

public void btnLogin_OnClick(View view) {
        startActivity(new Intent(MainActivity.this, PersonInfo.class));
    }

Here is button xml code in activity_main.xml:

<Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="تسجيل الدخول"
            android:id="@+id/btnLogin"
            android:layout_marginTop="72dp"
            android:textColor="#ffffff"
            android:layout_below="@+id/txtPassword"
            android:layout_centerHorizontal="true"
            android: önClick="btnLogin_OnClick" /
>

Here is AndroidManifest.xml code:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.hsa.ispcheck"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="18" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.hsa.ispcheck.MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.hsa.ispcheck.PersonInfo"
            android:label="@string/title_activity_person_info" >
        </activity>
    </application>

</manifest>

So, What's wrong with what I did?

Note: I'm using Android Studio v0.3.2

Rasool Ahmed Newbie Poster

Hi guys,
first of all: I don't want code to make virtual network adapter.
Only I want is: Which should I do to make virtual network adapter??
I know to make simple drivers in driver development using DDK, but I don't know virtual network adapter been developed.
The reason of my developing of this driver is to make an HTTPtunnel, which it will make virtual network between two computers cross the Internet.

Rasool Ahmed Newbie Poster

Hi guys,
I had developed a server control which acts as a container (user can add any control inside the server control).

[DefaultProperty("Text")]
    [Designer(typeof(ContainerControlDesigner))]
    [ParseChildren(false)]
    [ControlBuilderAttribute(typeof(SampleControlBuilder))]
    [ToolboxData("<{0}:Sample  runat="server"></{0}:Sample>")]
    public class Sample: WebControl, INamingContainer
    {
protected override void CreateChildControls()
        {
            System.Collections.IEnumerator myEnumerator = items.GetEnumerator();
            while (myEnumerator.MoveNext())
                this.Controls.Add((TextBox)myEnumerator.Current);
        }

        protected override void AddParsedSubObject(Object obj)
        {
            if (obj is TextBox)
            {
                items.Add(obj);
            }
        }
    }
public class SampleControlBuilder : ControlBuilder
    {
        public override Type GetChildControlType(String tagName,
                                            IDictionary attributes)
        {
            if (String.Compare(tagName, "myitem", true) == 0)
            {
                return typeof(TextBox);
            }
            return null;
        }
    }

    public class SampleContainerControlDesigner : ContainerControlDesigner
    {
        public override bool AllowResize
        {
            get { return false; }
        }

        private Style _style = null;
ublic override string FrameCaption
        {
            get
            {
                return "Dynamic Page Loader";
            }
        }

        public override Style FrameStyle
        {
            get
            {
                if (_style == null)
                {
                    _style = new Style();
                    _style.Font.Name = "Verdana";
                    _style.Font.Size = new FontUnit("XSmall");
                    _style.BackColor = Color.LightBlue;
                    _style.ForeColor = Color.Black;
                }

                return _style;
            }
        }
    }

When the server control droped:

<cc1:Sample ID="Sample"  runat="server" />

When the user add some control to the server control:

<cc1:Sample ID="Sample"  runat="server" >
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</cc1:Sample>

Now, what I want is to add some controls (without user add anything) within the server control tags just after the user had dropped the server control from toolbox into the webform asp.

How can I do this?????

Best regards :)

OK. But it seems scripted in AJAX technology, is there another way to done this in JQUERY?

This code snippet is poor, it dosn't show how to get data in the server sent from the client.
Do you have some links in w3school?? or some thing else?

Rasool Ahmed Newbie Poster

Hello guys, I would like to know how client browser send data to server whithout refreshing the page (just like chat in facebook)?
I have searched in google but I found alot of tutorials but non of them told me what is the basic idea about web server client synchronization? what is the basic functions in javascript used to do this?
I just want to know what is the functions used to send and reseive data between client browser and server.

Thanx, I will try it.

Rasool Ahmed Newbie Poster

Hello guys,
I'm using MapViewOfFile to map a file and try to edit its data and save it on the file.
The problem I have extra data to the file required to expand its size.
So, how to append data to the end of memory mapped file using CreateFileMapping and MapViewOfFile?

Rasool Ahmed Newbie Poster

Hello guys,
can someone show me how to add new section to PE header in masm32?

I finally found the problem, the problem was me :)
The problem is when I call WriteFile or ReadFile the function will write on BytesRead or BytesWritten which means that I must give the effective address of the variable.
In MASM32:

        PUSH    0           ; /pOverlapped = NULL
        PUSH    pBytesRead      ; |pBytesRead = ? //I gave the value of pBytesRead which is NULL
    PUSH    BytesToRead     ; |BytesToRead
    PUSH    OFFSET Buffer       ; |Buffer
    PUSH    hFile           ; |hFile
    CALL    ReadFile        ; \ReadFile

The correct code is:
        PUSH    0           ; /pOverlapped = NULL
        LEA EAX, pBytesRead
        PUSH    EAX             ;|pBytesRead = ?
        PUSH    BytesToRead     ; |BytesToRead
    PUSH    OFFSET Buffer       ; |Buffer
    PUSH    hFile           ; |hFile
    CALL    ReadFile        ; \ReadFile

In C code:

HANDLE  hFile;
    LPCVOID Buffer = &quot;Hello&quot;;
    DWORD   BytesWritten = 0;

    hFile = CreateFile(&quot;rw.txt&quot;,FILE_APPEND_DATA, FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);

    if(!WriteFile(hFile, Buffer, 5, &amp;BytesWritten, NULL))
        MessageBox(NULL, &quot;Can not write!&quot;, &quot;Error&quot;, MB_OK);

    CloseHandle(hFile)
Rasool Ahmed Newbie Poster

Hello guys,
I have problem with reading or writing files in C++ and MASM32. The problem is when calling the ReadFile or WriteFile the program give an exception saying "Access violation at address 0000".

This is the code in MASM32:

    LOCAL   Kernel32:DWORD
    LOCAL   CreateFileA:DWORD
    LOCAL   GetFileSize:DWORD
    LOCAL   ReadFile:DWORD
    LOCAL   pBytesRead:DWORD
    LOCAL   BytesToRead:DWORD
    LOCAL   hFile:DWORD

    ;-----------------------------------------
    ;Getting Kernel Imagebase
    ;-----------------------------------------
    ;kernel32.dll = 2511EF2C
    PUSH    02511EF2Ch
    CALL    find_dll

    MOV Kernel32, EAX

    ;-----------------------------------------
    ;Find required APIs
    ;-----------------------------------------
    ;CreateFileA = 0CF2006EAh, GetFileSize = 06D61AB47h, ReadFile = 024EF6F37h, WriteFile = 0317EB0D7h

    PUSH    0CF2006EAh
    PUSH    Kernel32
    CALL    find_api

    MOV CreateFileA, EAX

    PUSH    06D61AB47h
    PUSH    Kernel32
    CALL    find_api

    MOV GetFileSize, EAX

    PUSH    024EF6F37h
    PUSH    Kernel32
    CALL    find_api

    MOV     ReadFile, EAX

    PUSH    NULL                                ; /hTemplateFile = NULL
    PUSH    FILE_ATTRIBUTE_NORMAL               ; |Attributes = FILE_ATTRIBUTE_NORMAL
    PUSH    OPEN_EXISTING                       ; |Mode = OPEN_EXISTING
    PUSH    0                                   ; |pSecurity = NULL
    PUSH    FILE_SHARE_READ + FILE_SHARE_WRITE  ; |ShareMode = FILE_SHARE_READ|FILE_SHARE_WRITE
    PUSH    GENERIC_ALL             ; |Access = GENERIC_ALL
    PUSH    FileName                ; |FileName = "*.exe"
    CALL    CreateFileA     ; \CreateFileA

    MOV hFile,EAX

    PUSH    0                       ; /pFileSizeHigh = NULL
    PUSH    hFile                   ; |hFile
    CALL    GetFileSize     ; \GetFileSize

    CMP EAX, 0h
    JZ  Exit

    MOV BytesToRead, 10h

    PUSH    0           ; /pOverlapped = NULL
        PUSH    pBytesRead      ; |pBytesRead = ?
    PUSH    BytesToRead     ; |BytesToRead
    PUSH    OFFSET Buffer       ; |Buffer
    PUSH    hFile           ; |hFile
    CALL    ReadFile        ; \ReadFile
Exit:

When debug it in Ollydbg it stops right here:

757F85EA   8907             MOV DWORD PTR DS:[EDI],EAX
EDI = 00000000
EAX = 00000055

And give me the error (described above) because EDI is 000000.

Why this error ...

Is there any one to help me?
I sware to god I don't attend to make viruses to harm people. Is just for education only.

This is just for education purpose only, I'm using it for research becuase of my Professor request from me that.

Rasool Ahmed Newbie Poster

Hi all,
I'm programming a shell code for stack buffer overflow vulnerabilities, I have learned about it and read alot of this vulnerability and finally I have the ability to exploit it and make the shells.
This is my code:

;+-+-+-+-+[ FileName: shellcode.asm ]+-+-+-+-+-+
.386
.model flat, stdcall
option casemap:none

;+-+-+-+-+ Include Files +-+-+-+-+-+
include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
include \masm32\include\user32.inc

;+-+-+-+-+ Include Libraries +-+-+-+-+
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\user32.lib

.code
main:

;|=--------------=[ shell code section ]=---------------=|
    push 0 ; OK button
    jmp _caption
_rCaption:
    jmp _msg
_rMsg:
    push 0 ; hWnd
    call DWORD PTR DS:[402034h] ; &lt;=&gt; call MessageBox

    push 0
    call DWORD PTR DS:[402014h] ; &lt;=&gt; call ExitProcess

;|=--------------=[ shell data section ]=---------------=|
_caption:
    call _rCaption ; &lt;=&gt; push offset caption
    caption db "ha ha",0
_msg:
    call _rMsg ; &lt;=&gt; push offset msg
    msg db "You have been hacked!",0

end main

Now as you can see the routines above (messagebox, and exitprocess) are static, so I must know the address of the procedures inside the target program and put it into the shell and assemble it again!! :(

Is there any way to make the shell dynamically, my point is how to include the dll procedures inside the body of programs?

The reason of my question is to make the shell works in any program that have the stack buffer overflow vulnerability and maybe to make virus do the same way.

Note: I don't accept the solution that make the shell takes the addresses from import data section of the ...

Alright, thanx Ketsuekiame for your replies.

What you think about yahoo?
Yahoo messanger was before (now yahoo depends only on server-client) make direct connections between clients in order to chat. And many hackers were use this to know the IP address of their vectims.
This operation similiar to what I want to do, isn't it?
What you say about that?

So, you say there are no way to change the connection server-client to client-client!!!!

come on help me out, there must be a way to acheive this.

Thanx Ketsuekiame for your reply, but I don't want to do all of these, my inside work of my program must work like the way I said before. So, none of you said can apply to my program.
It must be some how to switch between connections of clients that attached to the server.
Is there any way to acheive this?

Rasool Ahmed Newbie Poster

Hi guys,
As you know the Internet divided into private network and public network, the public IP which include to public network is accessible and private IP which include to private network is inaccessible due to Internet network.
So, I decided to use one of public servers have windows servers as an access point server.

I guess you wonder what I'm trying to do?

One of computers outside the world have server program which receives incoming clients and establish multi-connections with them. And this computer include to private network and you know that I can't access it from another private network because of NAT technology which resolves private IP to public IP. And I can't use port forwarding for that purpose.

So, I decided to use a server include to public network and is accessible and make it to route messages to that computer which is connected always with it.

In summary, I will explain it in following by supposing PC1 is my computer and PC2 is the server which routes messages and PC3 the server destination:

1- PC3 connect with PC2.
2- PC1 connect with PC2.
3- PC1 asks PC3 about the IP address and the port that PC3 connected with PC2.
4- PC3 establish PC1 with PC2 in new standalone connection with same ports that PC1 use it with PC2 and PC3 as well.

The following image shows what I want to do:

<img src="http://im39.gulfup.com/TcI9R.png" border="0"/>

My question is: "**How can I make the server program establish connection ...

I had solved by these two lines:

        mysqli_free_result($result);

        mysqli_next_result($con);

I replace it with $result->free();

pritaeas, none of those solution in this thread help.

Squidge, the problem still.

Rasool Ahmed Newbie Poster

Hi fellows,
I have problem in php code and I had searched in days but I didn't found something good.
The problem is when execute the following code and error occured:

$sql = "CALL categoriesSelectByParent($CategId)";
if(!($result = $con->query($sql)))
    echo "Failed: (" . $con->errno . ") " . $con->error;
else {
//Do something with the result.
}

$result->free();

$sql = "CALL booksSelectByCategoryId($CategId)";
if(!($result = $con->query($sql)))
    echo "Failed: (" . $con->errno . ") " . $con->error;
else {
//Do something with the result.
}

the error is:

"Failed: (2014) Commands out of sync; you can't run this command now"

I know the error because of the second call. But how can I solve this.

I hope somebody have the solution.

My program set the value in registry successfully but it dosen't works on windows startup.

Well, this solution is not required for my program. Is there another solution to make my proogram works on windows startup using system registry.

Mr. M.Waqas Aslam. your solution is not required for my application. I want to start my program in windows startup programmically not setup file or whatever you say.....
Do you have another solution?
I told you my program works at windows startup on windows xp only. But not on windows seven....?????!!!!!!

Rasool Ahmed Newbie Poster

I have problem with making my program works on windows startup. Here's the code:

    Sub RunAtStartup(ByVal PutAtStartup As Boolean, ByVal Name As String, ByVal Path As String)
        Dim StartupPath As String = "Software\Microsoft\Windows\CurrentVersion\Run"
        Dim myKey As Microsoft.Win32.RegistryKey
        myKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(StartupPath, True)
        If PutAtStartup = True Then
            Try
                myKey.SetValue(Name, Path)
            Catch ex As Exception
                ErrLog &= ex.ToString & vbNewLine
            End Try
        Else
            Try
                myKey.DeleteValue(Name, False)
            Catch ex As Exception
                ErrLog &= ex.ToString & vbNewLine
            End Try
        End If
    End Sub

As you see above my program edit the registry on path "Software\Microsoft\Windows\CurrentVersion\Run" and the value it succefully inserted in the path. But the problem is my program dosen't works on windows startup what's the wrong?????

Note: my OS is windows 7 32bit.

Rasool Ahmed Newbie Poster

Hi guys,

I am programming a page that test the speed of customer's typing in the page. So what I did is to save the current time in page loading event and in the another page it will subtract the time that came from the previous page and display it.So, when the customer pressed at the button when finished it will lead to another page that display the time spent in typing so he know his speed in typing.

The code of the first page:

Public Partial Class WebForm1
    Inherits System.Web.UI.Page
    Dim H As String
    Dim M As String
    Dim S As String
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        H = Date.Now.Hour.ToString
        M = Date.Now.Minute.ToString
        S = Date.Now.Second.ToString
    End Sub
    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
        Response.Redirect("Check.aspx?H=" & H & "&M=" & M & "&S=" & S)
    End Sub
End Class

The code of the second page:

Public Partial Class Check
    Inherits System.Web.UI.Page
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim H As String = Request.QueryString("H")
        Dim M As String = Request.QueryString("M")
        Dim S As String = Request.QueryString("S")
        Dim H2 As String = TimeOfDay.Hour
        Dim M2 As String = TimeOfDay.Minute
        Dim S2 As String = TimeOfDay.Second
        Label1.Text = Str(Int32.Parse(S2)) & "-" & Str(Int32.Parse(S)) & "=" & Str(Int32.Parse(S2) - Int32.Parse(S))
    End Sub
End Class

The output after 10 seconds (for example) of typing and pressing the finish button:
0
that's it.....

The problem is ...

Rasool Ahmed Newbie Poster

Hi guys,

I am programming a page that test the speed of customer's typing in the page. So what I did is to save the current time in page loading event and in the another page it will subtract the time that came from the previous page and display it.So, when the customer pressed at the button when finished it will lead to another page that display the time spent in typing so he know his speed in typing.

The code of the first page:

Public Partial Class WebForm1
    Inherits System.Web.UI.Page
    Dim H As String
    Dim M As String
    Dim S As String
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        H = Date.Now.Hour.ToString
        M = Date.Now.Minute.ToString
        S = Date.Now.Second.ToString
    End Sub

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
        Response.Redirect("Check.aspx?H=" & H & "&M=" & M & "&S=" & S)
    End Sub
End Class

The code of the second page:

Public Partial Class Check
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim H As String = Request.QueryString("H")
        Dim M As String = Request.QueryString("M")
        Dim S As String = Request.QueryString("S")
        Dim H2 As String = TimeOfDay.Hour
        Dim M2 As String = TimeOfDay.Minute
        Dim S2 As String = TimeOfDay.Second
        Label1.Text = Str(Int32.Parse(S2)) & "-" & Str(Int32.Parse(S)) & "=" & Str(Int32.Parse(S2) - Int32.Parse(S))
    End Sub
End Class

The output after 10 seconds (for example) of typing and pressing the finish button:
0
that's it.....

The problem is ...

Thanx sfuo you have solved my problemm :)