low-level

I want to create a simple assembler in C. Where should I begin? [duplicate]

半世苍凉 提交于 2019-12-02 19:38:28
This question already has an answer here: Building an assembler 4 answers How Do You Make An Assembler? [closed] 4 answers I've recently been trying to immerse myself in the world of assembly programming with the eventual goal of creating my own programming language. I want my first real project to be a simple assembler written in C that will be able to assemble a very small portion of the x86 machine language and create a Windows executable. No macros, no linkers. Just assembly. On paper, it seems simple enough. Assembly code comes in, machine code comes out. But as soon as I thinking about

How does a memory map of a Windows process look like?

你说的曾经没有我的故事 提交于 2019-12-02 19:24:50
This might be a duplicate question. I wish to know how the memory map of a windows process look like? I am looking for details. Kindly provide links to blogs, articles and other relevant literature. I always like to actually be able to see things, rather than just read theory. It turns out, according to this blog post , that if you open a program using windbg even when it isn't running it still gets mapped to an address space as if it were. Thus, your disassembly window figuratively (not guaranteed to load your code at these exact addresses) shows you what is at those addresses in terms of

iPhone iOS4 low-level camera control?

半世苍凉 提交于 2019-12-02 17:44:56
Is there a way to manually set low-level still-camera settings like shutter speed, aperture, or ISO in iOS4 on the iPhone 4? I don't think it exists in the official SDK but perhaps someone has found some private APIs to allow this? I find my iPhone 4 camera to be unusable because even in fairly decent lighting, it always insists on shooting at the slowest 1/15th a second shutter speed causing motion blur if the subject is moving at all. Thanks! Not directly. Please file a bug report. Yes, there may be private APIs available, but that's of limited use. anshika Try this, I could be useful for

Assembly - .data, .code, and registers…?

北城以北 提交于 2019-12-02 15:50:48
So this morning I posted a confused question about assembly and I received some great genuine help, which I really appreciate. And now I'm starting to get into assembly and am beginning to understand how it works. Things I feel I understand alright include the stack, interrupts, binary/hex, and in general what most of the basic operations do (jmp, push, mov, etc). Concepts that I'm struggling to understand and would like help with are below - it would be a huge help if you could address any of the following: What exactly is happening in the .data section? Are those variables we're declaring?

Problems with running an application under controlled environment (Win32)

帅比萌擦擦* 提交于 2019-12-02 08:54:01
I'm not exactly sure how to tag this question or how to write the title, so if anyone has a better idea, please edit it Here's the deal: Some time ago I had written a little but cruicial part of a computing olympiad management system . The system's job is to get submissions from participants (code files), compile them, run them against predefined test cases, and return results. Plus all the rest of the stuff you can imagine it should do. The part I had written was called Limiter . It was a little program whose job was to take another program and run it in a controlled environment. Controlled

C low-level standard-in to accept filename then printing file contents to stdout

瘦欲@ 提交于 2019-12-02 02:25:45
问题 I want to get a file name from a user via stdin, open the file with open() and assign it to a file descriptor, then print the contents of that file to stdout. This is my code, and it's not working properly. Problems: the printf("enter filename"); statement is never showing up it never opens the file; instead whatever the user inputs is printed to the screen and then the "no such file or directory" error message is printed and the program exits after the program exists i see "enter filename"

Using a low-level keyboard hook to change keyboard characters

老子叫甜甜 提交于 2019-12-02 01:45:47
问题 I'm creating a custom keyboard layout. As the beginning step, I want to have the user press a key, have my keyboard hook intercept it, and output a different key of my choosing. I found this keyboard hook code, which I'm trying to slightly modify for my purposes: http://blogs.msdn.com/toub/archive/2006/05/03/589423.aspx I've changed the relevant method to this: private static IntPtr HookCallback(int nCode, IntPtr wParam, IntPtr lParam) { if (nCode >= 0 && wParam == (IntPtr)WM_KEYDOWN) {

C low-level standard-in to accept filename then printing file contents to stdout

Deadly 提交于 2019-12-02 00:21:56
I want to get a file name from a user via stdin, open the file with open() and assign it to a file descriptor, then print the contents of that file to stdout. This is my code, and it's not working properly. Problems: the printf("enter filename"); statement is never showing up it never opens the file; instead whatever the user inputs is printed to the screen and then the "no such file or directory" error message is printed and the program exits after the program exists i see "enter filename" printed before the prompt in terminal CODE: { printf("Enter the filename: "); read(STDIN_FILENO,

Why is my masm32 program crashing whenever I try using interrupts?

孤街浪徒 提交于 2019-12-01 17:54:14
问题 Here's the code: .386 ;target for maximum compatibility .model small,stdcall ;model .code main: int 20h END main Result: http://img705.imageshack.us/img705/3738/resultom.png "test.exe has stopped working" - always right when it reaches the interrupt. This is the interrupt I'm trying to use. It should simply exit the program. Others I've tried include character input/output, etc.. Nothing works. I'm on windows 7, using masm32 with the WinAsm IDE. There are so many cool things it seems I should

How to find text segment range in iOS

蓝咒 提交于 2019-12-01 14:05:06
How can I find the text segment (AKA code segment) range in iOS? Meaning, what is the start address and the end address of the text segment? I found this interesting post but it works for me on Android but not on iOS. After some digging and expert help (thanks Moshe Kravchik) I got to the desired solution - getting the text segment range by parsing the mach header and retrieving the load commands, segments and sections. #include <mach-o/dyld.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <dlfcn.h> #import <Foundation/Foundation.h> #define PRINT_STR "Found __text Section