Programming and Coding
Programming and coding tips, help and solutions...
1,877 topics in this forum
-
windows calculator's color-text button
by alaphate- 10 replies
- 4.5k views
I use spy++ to check the button style of Calculator's color-text buttons. They are not BS_OWNERDRAW. How does microsoft change their colors? Does any buddy know it? OWNERDRAW buttons don't dress XP-style skin.
-
Dll injection failing ... sometimes ...
by Killboy- 4 replies
- 3k views
Hi, I'm using this code to inject a dll into a process: bool InjectDll(HANDLE hProcess, char * Dll) { size_t AllocSize; void * Alloc; HANDLE hThread; DWORD dwExitCode = 0; AllocSize = strlen(Dll) + 1; Alloc = VirtualAllocEx(hProcess, 0, AllocSize, MEM_COMMIT, PAGE_READWRITE); if(Alloc) { WriteProcessMemory(hProcess, Alloc, Dll, AllocSize, 0); hThread = CreateRemoteThread(hProcess, 0, 0, (LPTHREAD_START_ROUTINE)GetProcAddress(GetModuleHandle("kernel32"), "LoadLibraryA"), Alloc, 0, 0); if(hThread) { if(WAIT_OBJECT_0 == WaitForSingleObject(hThread, 5000)) { GetExitCodeThread(hThread, &dwExitCode); } CloseHandle(hThread); } VirtualFreeEx(h…
-
Is this the best Continue in a loop of VB6
by alaphate- 4 replies
- 17k views
There's no continue directive in VB6. Is this code below is the best (shortest) solution? Dim i As Integer For i = 1 To 5 If i = 3 Then GoTo CNT End If Print i CNT: Next
-
How to play midi music from resource?
by alaphate- 4 replies
- 3.2k views
I can use mciSendCommand to play midi music from disk. I'd like to embed midi file into .rc (resource). How to play midi from resource or memory? Thank you very much in advance. // c, cpp languages are preferred. I have found a example using directX, but I don't want directX in my progam. http://www.codeguru.com/cpp/g-m/multimedia/print.php/c1573
-
(M)ASM <-> C/C++
by unix- 10 replies
- 6.5k views
Hello, i wanted to ask if someone knows something like a comparison-list of (m)asm and c/ c++ functions. I understand both languages and can write and read it, but a list which compares functions would be nice. What i mean for example: ASM mov eax, value1 cmp eax, value2 //code mov eax, 5 //code mov value3, eaxC if (value1 == value2) { value3 = 5; }Maybe the examples don't match very well but it should be something similar i guess (cant test it right now..). So what i am asking is if there is somewhere a list where i can see how common functions/ instructions look like in asm <-> c? It would be nice to see quickly when i have some asm instructions how the a…
-
Delphi Unpackers
by randy- 10 replies
- 8.4k views
Hi all , i'm looking for a Delphi Source Code for some unpackers like ( Upx ... ) , many thanks again .
-
Whats wrong with this ASM code?
by Keygen_Dr.- 7 replies
- 3.4k views
What's wrong with this ASM code... I'm using, Negatory Assembly Studio... Error; Generating Code... Linking... Link failed .486 ; creating 32bit code .model flat, stdcall ; 32 bit memory mode option casemap : none ; ;******************************************************************************* ************************** ;******************************************** INCLUDES *************************************************** ;******************************************************************************* ************************** include windows.inc include gdi32.inc include user32.inc include kernel32.inc i…
-
scanning a pe/dll (delphi)
by StreamLine- 5 replies
- 4.1k views
i was wondering how peid,die,fastscan etc implement their scanning techinques anyone got an example source code in delphi, or shed some light on it? set a few bp in peid using olly, on createfile etc but didnt break, so wondering if ive missed something. wanting to make my own tool similar to peid tia
-
[Delphi]Some Snippets
by 0xFF- 1 reply
- 3.3k views
returns a process base (CSTR) priority by a process ID, takes care of the low-level part function GetProcessPri(PID: DWORD): String; var hSnap: THandle; lppe: TProcessEntry32A; szPri: String; begin lppe.dwSize := sizeof(lppe); hSnap := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);if Process32FirstA(hSnap, lppe) <> False then With lppe Do begin if PID = lppe.th32ProcessID then case lppe.pcPriClassBase of 13:szPri := 'High'; 8,9, 11:szPri := 'Normal'; 6:szPri := 'Below Normal'; 4:szPri := 'Low'; end; while Process32NextA(hSnap, lppe) do if PID = lppe.th32ProcessID then case lppe.pcPriClassBase of 13:szPri := 'High'; 8,9, 11:szPri := 'Normal';…
-
Chm and Hlp Dumpers
by randy- 0 replies
- 2.5k views
How is it possible to dumpe or decmpile and extract the Chm and Hlp files' contenets ( if possible in Delphi please ) ? many thanks .
-
- 11 replies
- 5.1k views
Hello everybody. While trying to create my own patcher with some extended features in Delphi, I created some functions that I could easy Copy-Paste to other patchers, and to ease-up further use. The first one will Patch One byte at a specified Offset: //Patches one byte at a certain Offset. Procedure OffsetBytePatch(AppPath: string; Offset: Longint; PatchByte: byte); var PatchFile: File Of Byte; begin AssignFile(PatchFile , AppPath); Reset(PatchFile); Seek(PatchFile, Offset); Write(PatchFile, PatchByte); CloseFile(PatchFile); end; The second one will Read one byte at a certain offset, for use in eg. checking if already patched. //Reads on byte at a certa…
-
Function Pointer Member?
by high6- 6 replies
- 3.1k views
I am trying to emulate this assembly in C++ (to make it more readable then a hacky inline assembly). MOV EAX,DWORD PTR DS:[5D91B4] PUSH ESI LEA ECX,DWORD PTR DS:[EAX+89C08] CALL 0047F3F8So I have this psuedo code class MAIN { public: class FUNCLIST { public: bool (* FuncListContains)(int idx,bool) = (bool (*)(int,bool))0x0047EE03; int FuncListGetItem(int idx) { return idx*2; } }; FUNCLIST* FuncList = (FUNCLIST*)(this+0x00089C08); }; MAIN* Main = (MAIN*)0x005D91B4;Of course this doesn't work because the function pointer isn't static. Is there anyway to set the function pointer as a constant but keeping it as a member? Summary: I am injecting…
-
- 14 replies
- 6.6k views
Hey all! I am working on my first project in MASM at the moment, and it is actually going quite well. Though I ran into a small problem. I want to read a file into memory and save it to another file, with some changes (yeah, I want to encrypt a file), and for doing this I am creating a new procedure. Now, because of everbody has a different amount of memory I let the user define how much bytes they want to be loaded in memory at once for encrypting. The more bytes loaded at once, the less ReadFile has to be called, and the quicker the encrypting will be. But what if the last block of bytes is to be read? (I reach EOF) the lpNumberOfBytesRead parameter should be set t…
-
- 2 replies
- 3k views
Hello all! Some strange error has occured here. I just tried to add a Static element to my DialogBox. The Static element will be shown on a Groupbox, though it is not marked as a child of the group box. The strange thing is that the static element is not showing. I checked it's Style parameters, and everything should be ok. Probably it's something very stupid I'm overseeing right now, but I've been breaking my head for over two hours by now. Here is my Resource File: ;This Resource Script was generated by WinAsm Studio.#define DLG_CRYPTER 1001 #define GRP_CRYPTER 1003 #define GRP_STATUS 1004 #define BTN_OPTION 1005 #define BTN_ABOUT 1006 #define LBL_INPUT 1007 #defin…
-
- 2 replies
- 2.8k views
Will blocking ExitProcess() prevent the main thread from shutting down the application when it ends? I ask because I am working on a dll which is injected into a target application. And I don't want the application to be exited before the dll is finished and ready to exit.
-
Patching with threading?
by high6- 2 replies
- 2.7k views
If I patch code that a thread could be executing, should I pause the thread first? Or is it safe as long as I use "REP MOVS DWORD PTR ES:[EDI],DWORD PTR DS:[ESI]"? I know using a forloop would definitely cause problems.
-
MMORPG
by 0ron- 1 reply
- 3k views
Hey! I'm looking for source code for a 3D MMORPG. I'm planning on writting my own if I can't get a hold of source. If you guys know of any projects I could get the source from or game engines I can use let me know. Any help would be appericated. I'm looking for something similar to Perfect World, Guild Wars, Eve online. But anything is good with me. Thanks!
-
[Delphi] Extend last section problems
by steve10120- 2 replies
- 6.6k views
Hi. I'm trying to make a simple change OEP code, and I've hit a problem. The code works fine on Delphi and C++ apps - that are compiled with FileAlignment as 200h, but with a Visual Basic 6 app - which is compiled with FileAlignment as 1000h the app fails and doesn't work, PEiD also says its an invalid PE. If I manually realign the VB6 file back to 200h with CFF Explorer and LordPE the new OEP works fine. I've read the section on this in the ARTeam PE tutorial, but it didn't cover anything like this. Below is my code, and attached is the patched 1000h file and the realigned patched 200h file. program ChangeOEP_v2;uses Windows, SysUtils;type TByteArray = array of …
-
USB protector
by studioeliza- 2 replies
- 3.2k views
How I can see datas protect in my USB ?
-
[question] how to launch *.exe from DLL
by 6748222- 7 replies
- 6.1k views
Hello! i use D2009 and would like to know how can i launch *.exe from a DLL example i have 1.exe with button on click its read from dll name of file to launch 2.exe is this posible?
-
How to change VC6 DDX messagebox TITLE bar?
by alaphate- 1 reply
- 3.1k views
In VC6 MFC How to change the title bar of warning messagebox, when DDV exception is inoked? WHIOUT changing application name. e.g. int age; DDX_Text(pDX, IDC_EDIT, age); if I input "abc" in IDC_EDIT It will prompt "Please input a integer" messagebox. The title is my application name. Question is how to change the title of this warning messagebox. Thank you
-
Prevent EWX_FORCE
by M2R- 5 replies
- 3.7k views
How do I prevent EWX_FORCE shutdown? when I tried to code "prevent shutdown" apps by detect the WM_QueryEndSession and WM_EndSession, I realized that I couldn't prevent the EWX_FORCE message
-
FGIntRSA example
by JustAGuy- 2 replies
- 4.2k views
Could anyone post a simple and working delphi example of protecting and deprotecting data by this unit(RSAEncrypt, RSADecrypt)? I have not managed to make it work for me. thx
-
Delphi Applications MenuITem ID
by Departure- 0 replies
- 3.4k views
K I have small problem I want to send WM_COMMAND to a delphi application to programatically trigger a menu item. Now this is normally no problems for me to do this with a application that has been programmed in a diffrent language. Fisrt ill explain the method i use on normal apps say i want to click a menu item, I would open the application up in a resource hacker program and look for the menu item, here is normally a ID for that menu item for the sake of this explaintion will will sya the menu item has an ID of 33245, so i would do the following in my code "sendmessage(Hwnd,WM_COMMAND, 33245, 0);" which is no problems IN NON DELPHI APPS. but I want to find the ID of …
-
Running an exe from resources in VB .NET?
by Keygen_Dr.- 3 replies
- 4.4k views
Topic title says it all. Is it possible to write a code for it in VB .NET... But i don't wanna extract it to some place. I wanna run it from resources only.