• Welcome to Valhalla Legends Archive.
 
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - devcode

#1
Fun Forum™ / Re: Old Trillian Log - Updated!
November 05, 2007, 08:50 PM
Damn, I'm so hot when it comes to rollin noobs like blunts
#2
Quote from: FrostWraith on October 28, 2007, 11:21 AM
Quote from: devcode on October 28, 2007, 11:08 AM
Quote from: l2k-Shadow on October 28, 2007, 10:46 AM
try

fread(&id3v1, sizeof(char), sizeof(id3v1), fh);


His api call to fread is correct, so that's obviously not the problem (1 element of size id3v1). The only problem in his case is he needs to use strncmp( id3v1.header, "TAG", 3 ); although personally, I would use microsoft's stringsafe functions cause they're cooler.

Not that I plan to use this on any unix variants, I strive for as much portability as possible.

AFAIK, it's not windows dependent. <strsafe.h>, but I'm not completely sure since I don't do any personal development for platforms other than windope
#3
Quote from: l2k-Shadow on October 28, 2007, 10:46 AM
try

fread(&id3v1, sizeof(char), sizeof(id3v1), fh);


His api call to fread is correct, so that's obviously not the problem (1 element of size id3v1). The only problem in his case is he needs to use strncmp( id3v1.header, "TAG", 3 ); although personally, I would use microsoft's stringsafe functions cause they're cooler.
#4
C/C++ Programming / Re: Calling API from assembler?
October 27, 2007, 06:32 PM
Quote from: brew on October 27, 2007, 06:29 PM
Just wondering, why wasn't ebx listed with win32's list of volatile registers? must it be preserved or something? I've been modifying ebx just like eax or ecx and i've had no errors.

gewgelz ftw

[MSDN]
When using __asm to write assembly language in C/C++ functions, you don't need to preserve the EAX, EBX, ECX, EDX, ESI, or EDI registers. In addition, by using EBX, ESI or EDI in inline assembly code, you force the compiler to save and restore those registers in the function prologue and epilogue.
[/MSDN]
#5
General Discussion / Re: My Desktop Build...
October 26, 2007, 12:14 PM
Yogi Bear is smarter than the average bear,
Yogi Bear is always in the ranger's hair.
At a picnic table you will find him there
Stuffing down more goodies than the average bear.

He will sleep till noon but before it's dark,
He'll have every picnic basket that's in Jellystone Park.

Yogi has it better than a millionaire
That's becasue he's smarter than the average bear.
#6
C/C++ Programming / Re: Console tab stops?
October 25, 2007, 01:55 PM
Quote from: betawarz on October 25, 2007, 11:05 AM
Quote from: devcode on October 25, 2007, 08:27 AMI know you like iago and all but you can hop off cause he's still not going to give you Windows.Vista.Source.Code-2007-iago. Next.

I C WHAT U DID THAR

OMG I JUST C WHAT I DID THAR
#7
C/C++ Programming / Re: Console tab stops?
October 25, 2007, 08:27 AM
Quote from: Warrior on October 25, 2007, 05:28 AM
Quote from: devcode on October 24, 2007, 09:06 PM
Quote from: iago on October 24, 2007, 08:42 PM
Quote from: brew on October 24, 2007, 10:51 AM
Quote from: iago on October 24, 2007, 10:34 AM
The functions you need are something like:
FindWindow() to get a handle to the window
GetWindowThreadProcessId() to get the process id (I am doing the names from memory, so I could be wrong on that)
OpenProcess() to get a handle to the process

Somebody can correct me if I'm mistaken.
IIRC, OpenProcess returns a handle to the process, not the thread. Perhaps you were thinking of OpenThread? (that requires a thread ID, and GetThreadID requires a thread handle, what i wanted in the first place) I've found a good way to do this-- calling CreateToolhelp32Snapshot with flags TH32CS_THREAD (I thought at first i was going to have to use a kernel mode api for this one) then call OpenThread. Thanks anyways.
Ah, the original question was worded funny, "Hey, how would i get a handle to the thread of another process?"

I assumed you wanted to get a handle to the process. What I think you wanted to ask was how to get a handle to a thread in another process.

Question was fine and worded properly, else he would have asked "How would i get a handle to another process". You made a mistake and you're justifying it by partly blaming for their wording so, no doesnt work like that unfortunately. Nice try though, better luck next time

lolol. no

lolol. hi

Quote from: betawarz on October 25, 2007, 12:00 AM
Quote from: devcode on October 24, 2007, 09:06 PMQuestion was fine and worded properly, else he would have asked "How would i get a handle to another process". You made a mistake and you're justifying it by partly blaming for their wording so, no doesnt work like that unfortunately. Nice try though, better luck next time

Uh, nope. Read brew's question, and then hopefully you'll understand iago's thoughts. You don't get a handle to the thread  of another process. The original question just doesn't make sense. You almost had him, though.

I know you like iago and all but you can hop off cause he's still not going to give you Windows.Vista.Source.Code-2007-iago. Next.
#8
C/C++ Programming / Re: Console tab stops?
October 24, 2007, 09:06 PM
Quote from: iago on October 24, 2007, 08:42 PM
Quote from: brew on October 24, 2007, 10:51 AM
Quote from: iago on October 24, 2007, 10:34 AM
The functions you need are something like:
FindWindow() to get a handle to the window
GetWindowThreadProcessId() to get the process id (I am doing the names from memory, so I could be wrong on that)
OpenProcess() to get a handle to the process

Somebody can correct me if I'm mistaken.
IIRC, OpenProcess returns a handle to the process, not the thread. Perhaps you were thinking of OpenThread? (that requires a thread ID, and GetThreadID requires a thread handle, what i wanted in the first place) I've found a good way to do this-- calling CreateToolhelp32Snapshot with flags TH32CS_THREAD (I thought at first i was going to have to use a kernel mode api for this one) then call OpenThread. Thanks anyways.
Ah, the original question was worded funny, "Hey, how would i get a handle to the thread of another process?"

I assumed you wanted to get a handle to the process. What I think you wanted to ask was how to get a handle to a thread in another process.

Question was fine and worded properly, else he would have asked "How would i get a handle to another process". You made a mistake and you're justifying it by partly blaming for their wording so, no doesnt work like that unfortunately. Nice try though, better luck next time
#9
C/C++ Programming / Re: Console tab stops?
October 24, 2007, 11:55 AM
Quote from: MyndFyre[vL] on October 24, 2007, 11:19 AM
Out of curiousity, why do you need a handle to an already existing thread?  When hacking a program most people create a thread within the process space.

Creating a new thread in the remote process is one option but not the only one. You can get control of an existing thread using the GetThreadContext, SetThreadContext APIs and redirect execution. There are many ways to achieve the same thing..........................................
#10
C/C++ Programming / Re: Console tab stops?
October 24, 2007, 11:14 AM
Quote from: brew on October 24, 2007, 10:51 AM
Quote from: iago on October 24, 2007, 10:34 AM
The functions you need are something like:
FindWindow() to get a handle to the window
GetWindowThreadProcessId() to get the process id (I am doing the names from memory, so I could be wrong on that)
OpenProcess() to get a handle to the process

Somebody can correct me if I'm mistaken.
IIRC, OpenProcess returns a handle to the process, not the thread. Perhaps you were thinking of OpenThread? (that requires a thread ID, and GetThreadID requires a thread handle, what i wanted in the first place) I've found a good way to do this-- calling CreateToolhelp32Snapshot with flags TH32CS_THREAD (I thought at first i was going to have to use a kernel mode api for this one) then call OpenThread. Thanks anyways.

guess g00gles musta worked out for you. lol @ kernel mode api, thats a good one
#11
C/C++ Programming / Re: Console tab stops?
October 23, 2007, 04:00 PM
Quote from: brew on October 23, 2007, 03:51 PM
Quote from: iago on October 23, 2007, 03:07 PM
Plus, people might make silly mistakes like using "\n" instead of "\r\n" :P
I always use \n instead of \r\n :(

Hey, how would i get a handle to the thread of another process?
www.g00gles.com
#12
C/C++ Programming / Re: Console tab stops?
October 23, 2007, 01:01 PM
Quote from: brew on October 23, 2007, 09:59 AM
Quote from: iago on October 23, 2007, 08:52 AM
The best way is probably to use printf()-style formatting parameters (you can do it in C++ too, but I don't know how)

printf("%32s %d\n");

That'll print the string in a 32-character column. I forget whether it aligns the string left or right, but you can probably play around with it and get it right.

The other option is to manually do it:
int i;
printf("%s", str);
for(i = 0; i < 32 - strlen(str); i++)
  printf(" ");
printf("\n");

There's probably a better way to do that, but whatever. :)
You were right-- it alligns to the right, i wonder how i would get it to the left? (actually i dont think i can :/) So yeah, padding it with spaces for every char it doesn't take up is the best idea. Thanks for helping.

np looking to help anytime!
#13
C/C++ Programming / Re: Console tab stops?
October 23, 2007, 08:37 AM
Quote from: rabbit on October 23, 2007, 07:03 AM
It ain't dynamic.  Get over it.
Use CSuperBrewProcessListerTabs, shits fyre
#14
Thing-O-Rama ™ / Re: Tell us now!
October 22, 2007, 07:19 PM
Quote from: squiggly on October 22, 2007, 05:29 PM
Quote from: Joex86] link=topic=3771.msg174098#msg174098 date=1193091669]
Or, they could settle for friends. With or without benefits.

Those who haven't been romantically involved rly should not comment


I mean rly


Blind leading the blind

das mah nigguh s q u i to the double g l y
#15
Quote from: Grok on October 22, 2007, 10:12 AM
I am setting out to write a class library for use in a later project, and have not written any real OO code since Turbo Pascal 5.5 days.  I use VB.NET in mostly RAD-style development for Windows Forms and Windows Services, but it's mostly procedural within events.  (ala VB6 round peg in a VS2003 square hole)

I am looking to create a class hierarchy that is not inherited, because they don't share similar base class features.  Rather, it's an organizational hierarchy.  I suspect I need to implement generic collections of a type within each class to establish the hierarchy.  But you tell me.  Here's an example, using post office boxes.

A class library named PostalSystem
A collection of Nations
Each Nation contains Cities
Each City contains PostOffices
Each PostOffice contains POBoxes

Pretty simple, so I'm looking for the design pattern in VB.NET that one would use to establish this.  All would need to be serialized to MSSQL or XML, but that's a later problem.

Anyone have any design pattern books or themselves know how this is properly implemented?

I've briefly read through these, which are pretty known design pattern books, more C++ OO than .NET (ebooks can be found):

- Addison Wesley - Design Patterns - Elements of Reusable Object-Oriented Software

- Design Patterns Explained: A New Perspective on Object-Oriented Design
By Alan Shalloway, James R. Trott

- Modern C++ Design: Generic Programming and Design Patterns Applied
By Andrei Alexandrescu