473,808 Members | 2,807 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dealing with illegal instruction

Hello friends,

I'm writing a program in C with some bits in inline asm for efficiency.
I'd like to be able to handle illegal instructions from within asm.

Here's an example of a standalone asm program,

..data

..text

..globl _start
_start:

..byte 0xff
..byte 0xff
..byte 0xff

movl $1,%eax
movl $0,%ebx
int $0x80

This generates an illegal instruction but I'd like to be able to ignore
that.

Thanks.
Apr 11 '08 #1
8 4801
On 11 Apr 2008 at 12:20, jacob navia wrote:
Just another C hacker wrote:
>Hello friends,

I'm writing a program in C with some bits in inline asm for efficiency.
I'd like to be able to handle illegal instructions from within asm.
[snip]
>This generates an illegal instruction but I'd like to be able to ignore
that.

You have 3 illegal instructions, not one.
And why you add them in the first place?

Wouldn't it be better to delete the 3
.byte ff
???????
Jacob is right that what you're asking doesn't seem to make much sense -
maybe if you explain what you're ultimately trying to achieve then that
would help.

If you just want to catch illegal instructions, then you can use the C
signal function to install a handler for SIGILL (which has numerical
value 4).

Apr 11 '08 #2
Look I don't think it's any of your business what I'm doing, either
answer the question or don't bother.

Yeah signal is ok, but it doesn't let me know which was the address of
the illegal operation that was attempted.
Antoninus Twink wrote:
On 11 Apr 2008 at 12:20, jacob navia wrote:
>>Just another C hacker wrote:
>>>Hello friends,

I'm writing a program in C with some bits in inline asm for efficiency.
I'd like to be able to handle illegal instructions from within asm.

[snip]
>>>This generates an illegal instruction but I'd like to be able to ignore
that.

You have 3 illegal instructions, not one.
And why you add them in the first place?

Wouldn't it be better to delete the 3
.byte ff
???????


Jacob is right that what you're asking doesn't seem to make much sense -
maybe if you explain what you're ultimately trying to achieve then that
would help.

If you just want to catch illegal instructions, then you can use the C
signal function to install a handler for SIGILL (which has numerical
value 4).
Apr 11 '08 #3
In article <ft**********@a ioe.org>, Just another C hacker <no@spam.comwro te:
>Look I don't think it's any of your business what I'm doing, either
answer the question or don't bother.
What's in it for us?

-- Richard
--
:wq
Apr 11 '08 #4
Just another C hacker wrote:
Look I don't think it's any of your business what I'm doing, either
answer the question or don't bother.
Look Mr "hacker"
You add illegal instructions and then you want to ignore it...
Fine, you want to screw some program, build some virus,
crash some stuff.

OK.

But do not expect help from me in this forum.
--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
Apr 11 '08 #5
Richard Tobin wrote:
In article <ft**********@a ioe.org>, Just another C hacker <no@spam.comwro te:
>Look I don't think it's any of your business what I'm doing, either
answer the question or don't bother.

What's in it for us?

-- Richard
Well, if the virus works you will get one!

:-)

The only thing we gain here is YASV!
YET ANOTHER STUPID VIRUS!
--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
Apr 11 '08 #6
In article <ft**********@a ioe.org>, jacob navia <ja***@nospam.o rgwrote:
>Richard Tobin wrote:
>>Look I don't think it's any of your business what I'm doing, either
answer the question or don't bother.
>What's in it for us?
>Well, if the virus works you will get one!
Ah yes, that does look quite possible. If he wants help writing
viruses, my rates are double, plus indemnity.

-- Richard
--
:wq
Apr 11 '08 #7
Just another C hacker wrote:
>
Look I don't think it's any of your business what I'm doing, either
answer the question or don't bother.

Yeah signal is ok, but it doesn't let me know which was the address
of the illegal operation that was attempted.
Please do not top-post. Your answer belongs after (or intermixed
with) the quoted material to which you reply, after snipping all
irrelevant material. See the following links:

--
<http://www.catb.org/~esr/faqs/smart-questions.html>
<http://www.caliburn.nl/topposting.html >
<http://www.netmeister. org/news/learn2quote.htm l>
<http://cfaj.freeshell. org/google/ (taming google)
<http://members.fortune city.com/nnqweb/ (newusers)

** Posted from http://www.teranews.com **
Jun 27 '08 #8
"CBFalconer " <cb********@yah oo.comwrote in message
news:48******** *******@yahoo.c om...
Just another C hacker wrote:
>>
Look I don't think it's any of your business what I'm doing, either
answer the question or don't bother.
....
>
Please do not top-post. Your answer belongs after (or intermixed
with) the quoted material to which you reply, after snipping all
irrelevant material. See the following links:
You make it sound like Just's reply would have been been perfectly
acceptable otherwise.

Sometimes it's necessary to ask additional questions of posters and a rebuke
like the above would put some people off.

Or are your posts generated automatically so that the actual content you
reply to is irrelevant?

--
Bart

Jun 27 '08 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1766
by: Ajay Bakhshi | last post by:
Hi, I am getting the following problem on AIX. I create a small shared library. And tried to load it in python. It core dumps with the following message: Segmentation fault (core dumped) At other time with another shared lib I got: Illegal instruction: core dump
0
1478
by: Paul Mahon | last post by:
Hello, I recently managed to corrupt a table pretty badly. I read the sections in the documentation about recovering after a crash. None of the methods worked. All give output similar to the following: % bin/myisamchk -t ~/tmp -f -o BROKE/EventsBROKE - recovering (with keycache) MyISAM-table 'BROKE/EventsBROKE.MYI' Data records: 101333504 bin/myisamchk: error: 127 for record at pos 0 MyISAM-table 'BROKE/EventsBROKE' is not fixed because...
1
1856
by: Chandra | last post by:
Hi, I developed a Visual C++ 6.0 MFC Application on Windows 2000 5.00.2195 Service Pack 4. THe Application runs fine on my machine. But when a customer who also has Windows 2000 is trying to execute this application, they are getting the following error. "the NTVDM encountered an illegal instruction" What is causing this error and what do i need to do to fix it?. Thanks
9
7085
by: Roshni | last post by:
Hi, I wanted to know how do function pointers sometime access illegal memory access ? Could any one give me an example ? Thanks, Roshni
4
4027
by: Mathias Waack | last post by:
Hi, I've embedded python into a legacy application. It works - most of the time. In some special situations the app crashes executing the "import random". There are two different situations: 1. the sources compiled with gcc 4.1.2 crash with illegal instruction error: (running my application)
3
3026
by: =?Utf-8?B?SG9seXNtb2tl?= | last post by:
Hi there, I am having a problem im my webservices method when trying to save a file with latin characters to disk passed through WSE. I have noticed that when trying to read the file name from all the latin characters are converted ? character which is a illegal character for file name. If my file name is N° documento per Romà
3
2655
by: somebody | last post by:
Hi all, I have been working on a php script lately that merges results from a db and an xml source and then populates a PDF through FDF. I have gotten nearly everything to work except multi line javascript. I have tried both of the following attacks on the problem to no avail. First I tried setting the set_on_import directly... then I tried to set all the javascript in a function and then call the function on load... both of them...
2
17197
by: murali026 | last post by:
Hi All, Here I have an Application which will be running on Power PC Processor. After some time i have receiving the following error. Program received a SIGILL, Illegal Instruction. I am debugging the application remotely from a Linux Machine(RHEL-4). Could you please help in proceeding further to analyse this problem.
1
2400
by: justduick | last post by:
I have developed a visual c# application which executes properly on my computer and others that have visual studio installed. however when attempting to run it on a computer without visual studio i receive the error message "the NTVDM CPU has encountered an illegal instruction" in a window titled "16-bit MS-DOS Subsystem". Does anyone know why this is happening or what i can do to get my application to execute? thanks.
0
9721
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10373
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10374
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10113
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9195
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7651
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6880
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5547
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5685
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.