Sunday, June 28, 2015

JSP, J2EE/JEE, Servlets and Tomcat

Tomcat is an application server from the Apache Software Foundation that executes Java servlets and renders Web pages that include Java Server Page coding. Tomcat can a standalone product with its own internal Web server or together with other Web servers, including Apache & Microsoft Internet Information Server (IIS). Tomcat requires a Java Runtime Enterprise Environment (JRE 1.1+)

Java 2 Platform Enterprise Edition (J2EE) is for developing, building and deploying Web-based enterprise applications online.consists of a set of services, APIs and protocols that provide the functionality for developing multi-tiered Web-based applications.

Java Server Page (JSP) is a technology for controlling the content or appearance of Web pages through the use of servlets,

A servlet is a small program that runs on a server. Servlets receive and respond to requests from Web clients. (modify the Web page before it is sent to the user who requested it)

Although servlets can respond to any types of requests, they most commonly implement applications hosted on Web servers. Such Web servlets are the Java counterpart to other dynamic Web content technologies such as PHP and ASP.NET.

Some programs, often those that access databases based on user input, need to be on the server. Typically, these have been implemented using a Common Gateway Interface (CGI) application.

However, with a Java running in the server, such programs can be implemented with the Java programming language. The advantage of a Java servlet on servers with lots of traffic is that they can execute more quickly than CGI applications.

Rather than causing a separate program process to be created, each user request is invoked as a thread in a single daemon process, meaning that the amount of system overhead for each request is slight.

Instead of a URL that designates the name of a CGI application (in a "cgi-bin" subdirectory), a request in a form on a Web HTML page that results in a Java servlet getting called would call a URL that looks like this:

http://www.foo.com:8080/servletx/gotoUrl?http://www.bar.com

The "8080" port number in the URL means the request is intended directly for the Web server itself. The "servletx" would indicate to the Web server that a servlet was being requested.

Java Container Servers

  • GlassFish
  • IBM WebSphere Application Server
  • Jetty (web server)
  • Apache Tomcat
  • Caucho Resin http://www.caucho.com/ - A commercial servlet container.
  • Caudium (web server)
  • Oracle iPlanet Web Server
  • WildFly
  • Undertow

Sources:
https://www.wikipedia.org/
http://www.apache.org/
http://tomcat.apache.org/
http://www.oracle.com/technetwork/java/index.html
http://www.tutorialspoint.com/jsp/jsp_architecture.htm
http://www.tutorialspoint.com/jsp/jsp_overview.htm

Tuesday, June 23, 2015

Finding The View Matrix Address for Counter-Strike: Global Offensive

The idea is to set the view angle to values we can easily search for by using matrix transformations. I will show you how to do this below for CSGO (I will not baby you and I expect that you know basic assembly and what the use of the vMatrix is for). Please see my disclaimer below before continuing any further.

DISCLAIMER: I DO NOT TAKE RESPONSIBILITY FOR ANY ACTIONS OR CONSEQUENCES THAT MAY OCCUR DUE TO WHAT YOU HAVE LEARNED OR HOW YOU HAVE UTILIZED THE INFORMATION PROVIDED HERE. THIS IS FOR EDUCATIONAL PURPOSES ONLY. I ALSO DO NOT TAKE RESPONSIBILITY FOR ANYTHING THAT MAY HAPPEN TO YOUR ACCOUNT FOR FOLLOWING THESE INSTRUCTIONS. IF YOU DO NOT AGREE WITH THESE STATEMENTS, DO NOT READ ANY FURTHER AND IMMEDIATELY EXIT MY BLOG/WEBSITE. 

BY CLICKING AGREE YOU ARE AGREEING TO THESE TERMS AND CONDITIONS STATED ABOVE.

Monday, June 15, 2015

Pointers 101 [Refresher C++]

The address of a variable can be obtained by preceding the varable name with ampersand (&).

x = 25;
foo = &x;
bar = x;

Let the address of x = 123;
then the value of foo = 123  and bar = 25.

We can dereference a variable using Asterisk (*)

bas = *foo; 

This can be said "bas equal to value pointed by foo."

The reference and dereference operators are complementary.

bas = foo;   // bas equal to foo (123)
bas = *foo;  // bas equal to value pointed to by foo (25)

Here is a quick script I wrote that gives a quick demonstration of pointers, how they relate with one another and the double pointers concept.
#include <stdlib.h>

int main() {
        int* foo;
        int* (*bar);
        int val = 25;

        foo = &val;
        bar = &foo;
        printf("Adr of val: %p\n", &val);
        printf("Val of val: %p\n", val);

        printf("Adr of foo: %p\n", &foo);
        printf("Val of foo: %p\n", foo);
        printf("Drf of foo: %p\n", *foo);

        printf("Adr of *bar: %p\n", &bar);
        printf("Val of *bar: %p\n", bar);
        printf("Drf of *bar: %p\n", *bar);
        return 0;
}
Output:
Adr of val: 0x7fff735c829c
Val of val: 0x19
Adr of foo: 0x7fff735c82a8
Val of foo: 0x7fff735c829c
Drf of foo: 0x19
Adr of *bar: 0x7fff735c82a0
Val of *bar: 0x7fff735c82a8
Drf of *bar: 0x7fff735c829c

Pointers to functions C++ allows operations with pointers to functions. The use of this is for passing a function as an argument to another function.
Pointers to functions are declared with the same syntax as a regular function declaration, except that the name of the function is enclosed between parentheses () and an asterisk (*) is inserted before the name:

// pointer to functions
#include <iostream>
using namespace std;

int addition (int a, int b)
{ return (a+b); }

int subtraction (int a, int b)
{ return (a-b); }

int operation (int x, int y, int (*functocall)(int,int))
{
  int g;
  g = (*functocall)(x,y);
  return (g);
}

int main ()
{
  int m,n;
  int (*minus)(int,int) = subtraction;

  m = operation (7, 5, addition);
  n = operation (20, m, minus);
  cout <<n;
  return 0;
}

In the example above, minus is a pointer to a function that has two parameters of type int. It is directly initialized to point to the function subtraction.

Yet Another Example


typedef int (*t_somefunc)(int,int);
int product(int u, int v) {
  return u*v;
}

t_somefunc afunc = &product;
...
int x2 = (*afunc)(123, 456); // call product() to calculate 123*456

Sources:
http://www.cplusplus.com/
http://www.stackoverflow.com/

1st p0st

Hey all,

This is my first post. Wondering what I will do with this blog.. might make it infomercial style or just random snippets of loot. Either way it should be fun :P Here goes nothing!