Programming and Coding
Programming and coding tips, help and solutions...
1,882 topics in this forum
-
Looking for PreciseTimer.zip - Visual C++
by CodeExplorer- 4 replies
- 4.1k views
Looking for PreciseTimer.zip - Visual C++ https://www.codeguru.com/cpp/w-p/system/timers/article.php/c5759/Creating-a-HighPrecision-HighResolution-and-Highly-Reliable-Timer-Utilising-Minimal-CPU-Resources.htm Download links: (can't download if from any of them) http://en.pudn.com/Download/item/id/1109294.html http://www.codeforge.com/article/136174#introduction https://download.csdn.net/download/gddsky/267438 It would be great if someone would share PreciseTimer.zip!
-
- 4 replies
- 4.2k views
i was testing quads using multiple colors (gouraud-shade) and for some reason virtual machines either inverts the quad colors or vertex order here's a screenshot i did a test using the same exe in my host and guest virtual machine, at the left of their screen they are all three triangles, both quads at the right also enumerated the vertex order in which they are drawn in the image, you can notice the quads color or vertex are inverted on the virtual machine i tested on VMware and a friend also tested on VirtualBox, the result is the same on both, may i ask why this happens? attached the exe and source, the assembly source is here if that's better …
-
- 1 reply
- 3.9k views
While looking at Nehe's tutorial for opengl i noticed that they had a masm32 conversion for these examples, the tutorials start here: http://nehe.gamedev.net/tutorial/lessons_01__05/22004/ then quickly realized the links were offline, but fortunately someone made a backup of most examples on github, including masm-converted ones, you can download them from here: https://github.com/gamedev-net/nehe-opengl/ they used some definitions files that weren't included, luckily i found these .def files in the sources of a Northern Dragons' demogroup 4k intro named Trees, it was the only place to get them so i spread them here so you can compile and follow the gr…
-
Attaching Olly to a process created on suspend mode:
by CodeExplorer- 6 replies
- 4.6k views
Visual C++ code: int processflags = 0|CREATE_SUSPENDED; // Create a child process. if (strlen(environmentstr)>2) { fSuccess = CreateProcess(processname, NULL, NULL, NULL, TRUE, processflags, (LPVOID) chNewEnv, // environment NULL, &siStartInfo, &piProcInfo); } else { fSuccess = CreateProcess(processname, NULL, NULL, NULL, TRUE, processflags, NULL, // No environment NULL, &siStartInfo, &piProcInfo); } If I attach with Olly to the new created process I get this: 02980000 CC INT3 02980001 68 7F23BF77 PUSH 0x77BF237F 02980006 C3 RETN INT3 should be there but shouldn't be actually executed…
-
Timer Replacer (Visual C++)
by CodeExplorer- 18 replies
- 7.7k views
Time in milliseconds of a timer: time1 = when timer started time1 = when timer proc ended time1=9182437 time2=9182437 time1=9182452 The difference is big: 15 ms! I know that 1 millisecond is much for computer performance! I've tested some code and the time in ms was not even 1 ms. uElapse [in] Type: UINT The time-out value, in milliseconds. If uElapse is less than USER_TIMER_MINIMUM (0x0000000A), the timeout is set to USER_TIMER_MINIMUM. If uElapse is greater than USER_TIMER_MAXIMUM (0x7FFFFFFF), the timeout is set to USER_TIMER_MAXIMUM. I need something much better then a timer!
-
- 1 reply
- 4.6k views
Hello! i've been looking for a way to add a menu using WinAPI within the same .asm file, without using resource (.rc) files It can be done in C, like explained in this tutorial http://zetcode.com/gui/winapi/menus/ MASM32's User.lib has the same function prototypes in there (CreateMenu, AppendMenuW, SetMenu) This is for two reasons, one is because i'd like them not to be edited/spoted using Resource Editors, the other is that i want to keep everything on one .asm source file (as what i want to do is small enough) I've not seen anyone documenting how to do this before in MASM32 (or even other Win32-targeted compilers) and ran out of ideas trying, any kin…
-
- 2 replies
- 3.8k views
hii! i've looked for a way to manually set the libraries that link.exe includes, by default, when i link using: C:\masm32\bin\link.exe /verbose /nologo /subsystem:windows /opt:noref main.obj it says: Start Pass1 Processed /DEFAULTLIB:C:\masm32\lib\user32.lib Processed /DEFAULTLIB:C:\masm32\lib\kernel32.lib Processed /DEFAULTLIB:C:\masm32\lib\gdi32.lib Processed /DEFAULTLIB:C:\masm32\lib\opengl32.lib Processed /DEFAULTLIB:C:\masm32\lib\glu32.lib so i tried setting the /DEFAULTLIB's parameters myself to override them C:\masm32\bin\link.exe /verbose /nologo /subsystem:windows /defaultlib:C:\masm32\lib\user32.lib /opt:noref main.obj (i was intending to j…
-
Bootkit/Replacing the Bootloader on Windows 10
by null_endian- 1 reply
- 4.3k views
Does anyone know of a way to edit the bootloader on a Win10 machine to force it to execute arbitrary code when Windows starts up? I'm not sure if this is possible on a new WIn10 box because I know that there are much stricter checks at bootup now. I don't care if it is a one-off as I'm trying to do a specific experiment on MY machine, it doesn't need to apply to all machines. Thanks. PS: Actually, I don't necessarily need to replace the bootloader - this code accomplishes something similar to what I need (I just need code execution control prior to everything else on the system when the OS loads) but it doesn't work for Win10. Looking for something similar.
-
Remove listbox content Visual C++ ???
by CodeExplorer- 4 replies
- 9.7k views
Remove listbox content Visual C++ ??? I wanna remove all items from listbox, Already tried ResetContent but it doesn't work: CWnd *pWnd = GetDlgItem(IDC_LIST1); CListBox* listbox = static_cast<CListBox*>(pWnd); //dynamic_cast does not work listbox->ResetContent();
-
Simple x64 Loader[Delphi SRC]
by h4sh3m- 7 replies
- 8.1k views
Hi Maybe help someone to create custom loaders ! BR, h4sh3m x64_Simple_Loader_Delphi.rar
-
Visual C++ 6 maximum textbox len? (improvements?)
by CodeExplorer- 13 replies
- 6.4k views
Visual C++ 6 maximum textbox len? (improvements?) I have a Visual C++ 6 project which will log all memory allocation of a process to textbox, here is the problem: the log text will be truncated to 5 KB (which is way to small!) Is there any way to improve maximum key length or should I log everything to a text file?
-
Explain struct in assembly?
by James Taylor- 2 replies
- 6.7k views
I am having trouble understanding struct in assembly from disassembly. can you please explain the code below. Disassembly pseudo code. Thanks
-
Quick TLS Info question
by LCF-AT- 14 replies
- 6.9k views
Hi guy, I have a small question about TLS so I dont remember anymore and just asking now and I dont find any example file using TLSCallback + relocation to load file with dynamic base addresses. So in the TLS info table I can see direct VA addresses and no RVA addresses.My question is just whether the VA addresses gets updated like this... TLS info table VAs etc - Imagebase from PE Header = TLS RVAs + New loaded targetbase = New TLS VAs.Should be so right? As I said I am just quickly asking about it so I dont find a dynamic file I can checkout now to see it. Thanks
-
- 18 replies
- 6k views
How does one know which Dll and Functions to include in the program ?
-
How to assemble text to binary code for MASM? 1 2 3
by LCF-AT- 54 replies
- 21.3k views
Hi guys, I am looking for a lib which can assemble text commands to binary code.Something like the Multiline Ultimate Assembler plugin by RaMMicHaeL.I do enter my code as text and wanna assemble it. Ok,normaly I can use Disam lib from OllyDBG site using function Assemble to assemble text commands one by one.Problem is I wanna work also with labels and API names etc alomst same as the MUA plugin can do.Has anyone some ideas what I could use for that? Thank you
-
Prime numbers solution
by CodeExplorer- 13 replies
- 9.6k views
Prime numbers Solution: https://text-share.com/view/03a0d1ed
-
Difference between #~ and #-
by CodeExplorer- 3 replies
- 25.3k views
To .NET experts: What's the difference between #~ and #- ??? #~ seems to be the good and default one! #- is used by dnlib #~ is used by Mono.Cecil
-
- 3 replies
- 4.9k views
Hi all, I wanted to execute a fonction on a loaded assembly, my code run well on a normal assembly, but it's failed when i try it on a obfuscated one (rdg packer says .net crypter) I list the string inside the binary like this: try { Assembly asm = Assembly.LoadFrom(executable); foreach (Type type in asm.GetTypes()) { foreach (MethodInfo method in type.GetMethods()) { if (method.MetadataToken == testToken) { Type t = asm.GetType(type.FullName); var methodInfoStatic = t.GetMethod(method.Name); if (methodInfoStatic == null) { throw new Exception("No such static method exists."); } object[] constructorParameters =…
-
- 5 replies
- 4.8k views
Hi guys, I am playing around with that functions & struct to get a dialog same as in notepad to find / repleace etc.I get the new dialog to see where I can enter stuff etc.My problem now is how to catch the messages if I press OK / chancel etc to get the entered data and where?Can anyone post a example code of this? Thank you
-
Pascal's Triangle
by CodeExplorer- 0 replies
- 6.9k views
Pascal's Triangle: solution solved, Pelles C compiler. Attached. PascalsTriangle.zip
-
- 2 replies
- 4.6k views
Hello all, I am trying to build one form auto filler application to book tickets from one indian website. The site is https://irctc.co.in I need to build the auto filler application using either c# or vb .net. The main issue with this site is its too much loaded at the time of booking so need solution for getting the fast response from loaded website in order to book tickets fast.
-
Help using uFMOD in Delphi!
by Nextasy2k- 3 replies
- 5.4k views
I using uFMOD to Play .xm chiptunes in my Project. It works already finde! When i start the program it plays the music and when i close the program it stop playing. But i like to have one Button where i can start and stop the music. Like.... If music is playing then Stop music else Play music ... I'm a newbie in Delphi. I Hope anybody can Help me!
-
Comparing code
by CloneWa- 0 replies
- 4.7k views
Hi. I am trying to find the best way to programatically "map" and compare code. Basically I have different versions of an application which is partly obfuscated and thus the names are different in every version and I'd like to find certain changes. For example, there could be a class like this: namespace ns1 { public class SomeClass1 { public string MyProperty1 { get; set } public void Method1() { // Code } public void Method2() { // Code } } } Then, in another version of the source code, it could look like this: namespace ns183 { public class AnotherClass112 { public string someProperty1 { ge…
-
[DNLib] write a string desobfucator
by Futex- 3 replies
- 6k views
Hi all, I start to use dnlib for the first time, and i wanted to made a string desofucator for an unknown malware packer. I list the string inside the binary like this: public static void DecryptStrings(ModuleDef module) { int count = 0; //List module Types foreach (TypeDef type in module.Types) { //List methods foreach (MethodDef method in type.Methods) { //Remove empty method if (!method.HasBody) break; //Check instructions for (int i = 0; i …
-
- 3 replies
- 6.6k views
How to execute embedded exe into memory without extracting ? I can extract file from resources but I want to execute without extracting. I hope this is not duplicate posts.