Follow us on Twitter!
Capitalism is an Island of wealth in a sea of poverty
Friday, April 25, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 24
Guests Online: 21
Members Online: 3

Registered Members: 82906
Newest Member: ilija
Latest Articles
View Thread

HellBound Hackers | Computer General | Programming

Author

How to Program directly in hex


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 17-05-10 13:16
I wish to learn assembly mainly for cracking and editing programs.


However, I do not wish to get caught up in assemblers (since I do not wish to make large(or even medium sized) programs,this should not trouble me much).

While browsing through the net,I came across a few tutorials showing the procedure to change programs using Hex editors.

I searched for tutorials and info showing how to make programs using only a hex-editor but found little material about this.

(I really liked http://www.sudowudo.com/index.php?page=1012)

Any help would be greatly appreciated.

Edited by on 17-05-10 13:18
Author

RE: How to Program directly in hex


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 17-05-10 13:55
Code

EB 0E 48 65 6C 6C 6F 57 6F 72 6C 64 21 0A 0D 24
B4 09 BA 02 01 CD 21 CD 20 CD 10





Try that as hex in a file with a .com extension. If it works then I fucking rawk!

here's a break down.
EB 0E (jmp 14 - we are about to define the string next which can't be executed!)
48 65 6C 6C 6F 57 6F 72 6C 64 21 0A 0D 24 (HelloWorld!\n\r$, $ is liek a null it ends the string)
B4 09 (the service for string=>STDOUT)
BA 02 01 (The location of the string. 100=EB, 101=0E, 102 is the start of the string.)
CD 21 (cd is int 21 is the dos interupt we want)
CD 20 (I think this returns to loader)
CD 10 (kills program?)

I may have the last two interupts the wrong way around (they are dos specific and I last used dos interupts nearly 5 years ago) as well as the \r\n

it just occured to me that I don't need \r since this is for DOS but it was force of habit!


Best way to learn? Sit down with a x86 opcode book. Then practice without being able to define locations you need to memorise them or predict them I have to make sure my string was 14 characters long so the jmp would work. then I had to guess the location of the string was 102 then break it up to little endiand 20 01 too much work. stick with an assembler.




Edited by on 17-05-10 20:36
Author

RE: How to Program directly in hex


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 17-05-10 14:05
http://en.wikiped. . .ex_editors - choose one.

But you should learn about debuggers, like OllyDbg ( http://www.ollydb. . . )...
Author

RE: THANKS!!!


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 18-05-10 14:55
@wolfmankurd: Thanks,but using a hex editor reduces the work load a lot,you don't have to guess the location of the string or convert it(it shows you both)...however,I shall also try out an assembler(It is more comfortableSmile).
And it doesn't work(I may have committed some mistake...it executes,but there's no hello world...)


@986: I have several hex editors and know how to use a debugger(basics),as with any other beginner,my fav. is Olly Dbg.,but thanks anyway.
Author

RE: How to Program directly in hex


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 18-05-10 16:15
Are you on windows? DEBUG is built in and lets you code in asm dissemble edit and run.

In your hex editor make a new file paste that in as hex (not ascii) then save it as "test.com"
It should work, I've just tested it.

It needs to be a com file not an exe as a com file is pure code, an exe has a header etc.
It's possible com files are no longer supported in new versions of windows especially 64bit versions.

A quick check bought up over 330 (there are probably quiet a few more including the add on sets) instructions. There is many more opcodes (some instructions have different op codes).

Memorising these will allow you to code using only a hex editor but you skill will be useless outside of your architecture even if you overcome the problem with labels.




Edited by on 18-05-10 16:20
Author

RE: How to Program directly in hex


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 21-05-10 07:58
@wolfmankurd:
YAY!!!It works and you RawkSmile.lI think I should stick to an assembler while learning after all...
Author

RE: How to Program directly in hex


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 21-05-10 12:54
onejerlo wrote:
@wolfmankurd:
YAY!!!It works and you RawkSmile.lI think I should stick to an assembler while learning after all...


=D yay! I always suspected I rawk lmao.