Recent Posts

Pages: 1 ... 7 8 [9] 10
81
The Soap Box / Re: New 12 volt power supply.
« Last post by K_F on November 07, 2019, 07:07:18 AM »
...but from what I have seen with switch mode power supplies, you should only run them at about half of their rated amperage.
All depends on the design and price. Cheaper ones use lower grade components and then yes, you'd want to run them at half power.
They also make them so compact that they just want to 'explode' from heat.

Switching suppliers are more efficient at around 90% power rating with efficiencies running at 95%, compared to standard toroidal/bridge PSUs which max out at approx 60% efficiency.

Standard toroidal/Bridge PSU's are much noisier (electrically), and gets a lot worse as the power goes up. These supplies can cause malfunctions in other equipment connected close to the same power line.

;)

82
The Colosseum / Re: do you not approve of gotoswhy?do you instead like jumptables?
« Last post by AW on November 07, 2019, 06:31:43 AM »
For people that only program in MASM, other assemblers or no Microsoft HLL it is possible to use all the 16 XMM/YMM (or the whole 32 ZMM registers) for data move. Only programs built with MSVC need to preserve (in 64-bit) the XMM7-XMM15 (or the lower YMM7-YMM15 or ZMM7-ZMM15) registers. In 32-bit there is no need to preserve anything, but in 32-bit there is only 8 XMM/YMM registers.
83
The Campus / Re: 128 bit Comparison on 32-bit CPU
« Last post by AW on November 07, 2019, 06:07:53 AM »
Slightly off topic, but as I've previously said, I've been using WinAsm Studio and a legacy version of MASM32 (now updated), what would your recommendations be for an IDE to replace WinAsm Studio (ideally one that will support x86 and x64 using MASM32 and MASM64) and a debugger that will support x86/x64 to replace OllyDbg.

This is a matter of personal preferences. I use Notepad++ as an editor for masm and an editor for many other things, so it is always open. Sometimes I use Visual Studio as well for masm when I am doing a masm module for HLL. This is very handy because it builds everything at the same time and the VS debugger is top notch.
84
ASMC Development / @CStr producing syntax error
« Last post by Vortex on November 07, 2019, 06:05:24 AM »
Hi nidud,

This line including the @Cstr macro is producing the following error messages :

Code: [Select]
MessageBox(0,@Cstr("test"),@Cstr("test"),MB_OK)
Code: [Select]
Assembling: ColorDlgBox.asm
ColorDlgBox.asm(35) : error A2008: syntax error : addr
ColorDlgBox.asm(35) : error A2033: invalid INVOKE argument : 2
ColorDlgBox.asm(35) : error A2008: syntax error : addr
85
The Campus / Re: 128 bit Comparison on 32-bit CPU
« Last post by colinr on November 07, 2019, 05:12:38 AM »
Good grief!

I'll have to throw that one into OllyDbg as I tend not to use the if statement to figure out what's going on.

Like I said earlier, your previous example, by using jb instead of jnz appears to work just fine.

The data set has now been converted to little endian so I can get rid of all that horrible byte order swapping nonsense.

Slightly off topic, but as I've previously said, I've been using WinAsm Studio and a legacy version of MASM32 (now updated), what would your recommendations be for an IDE to replace WinAsm Studio (ideally one that will support x86 and x64 using MASM32 and MASM64) and a debugger that will support x86/x64 to replace OllyDbg.

Kind Regards
86
The Campus / Re: 128 bit Comparison on 32-bit CPU
« Last post by AW on November 07, 2019, 03:26:48 AM »
This shall work except when there is no range that fits the IP. I will not cover that case (or any other case  :biggrin:)

Code: [Select]


.model flat, stdcall

includelib \masm32\lib\msvcrt.lib
printf proto C :ptr, :vararg

IPV6Struct struct
country db 20 dup (0)
startIP OWORD (0)
endIP OWORD (0)
IPV6Struct ends

.data
COMMENT #
ipv6_1 IPV6Struct <'country1',20010df7820000000000000000000000h, 20010df78200ffffffffffffffffffffh>
ipv6_2 IPV6Struct <'country2',20020df7820000000000000000000000h, 20020df78200ffffffffffffffffffffh>
ipv6_3 IPV6Struct <'country3',20030df7820000000000000000000000h, 20030df78200ffffffffffffffffffffh>
ipv6_4 IPV6Struct <'country4',20040df7820000000000000000000000h, 20040df78200ffffffffffffffffffffh>
myIP oword 20030df7820000000000000000000001h ; passed
#
ipv6_1 IPV6Struct <"CH",02A002381E8C000000000000000000000h, 02A002381E8C0FFFFFFFFFFFFFFFFFFFFh>
ipv6_2 IPV6Struct <"GB",02A002381E8C100000000000000000000h, 02A0023FFFFFFFFFFFFFFFFFFFFFFFFFFh>
ipv6_3 IPV6Struct <"XX",02A002400000000000000000000000000h, 02A003FFFFFFFFFFFFFFFFFFFFFFFFFFFh>
ipv6_4 IPV6Struct <"IR",02A004000000000000000000000000000h, 02A004007FFFFFFFFFFFFFFFFFFFFFFFFh>
ipv6_5 IPV6Struct <"XX",02A004008000000000000000000000000h, 02A00401FFFFFFFFFFFFFFFFFFFFFFFFFh>
ipv6_6 IPV6Struct <"DK",02A004020000000000000000000000000h, 02A004020FFFFFFFFFFFFFFFFFFFFFFFFh>
ipv6_7 IPV6Struct <"XX",02A004021000000000000000000000000h, 02A00403FFFFFFFFFFFFFFFFFFFFFFFFFh>

myIP oword 02a0023a84825eda1ac528803001b9000h ; Passed
;myIP oword 02A0040200003300070000000000000eeh ;Passed
msg db "Country is: %s",10,0
msgerror db "Error", 10,0

.code

main proc
lea esi, ipv6_1
lea edi, myIP
mov eax, [edi+3*sizeof dword]
@checkStart:
.while 1
.while 1
.if eax > dword ptr (IPV6Struct ptr [esi]).startIP+12
add esi, sizeof IPV6Struct
.continue
.endif
jb @checkEnd
mov eax, [edi + 2*sizeof dword]
.if eax > dword ptr (IPV6Struct ptr [esi]).startIP+8
add esi, sizeof IPV6Struct
.continue
.endif
jb @checkEnd
mov eax, [edi + sizeof dword]
.if eax > dword ptr (IPV6Struct ptr [esi]).startIP+4
add esi, sizeof IPV6Struct
.continue
.endif
jb @checkEnd
mov eax, [edi]
.if eax > dword ptr (IPV6Struct ptr [esi]).startIP
.break
.else
jmp @error
.endif

.endw
lea edi, myIP
mov eax, [edi+3*sizeof dword]
@checkEnd:
.while 1
.if eax > dword ptr (IPV6Struct ptr [esi]).endIP+12
jmp short @preTop
.elseif eax < dword ptr (IPV6Struct ptr [esi]).endIP+12
jmp short @exit
.endif
mov eax, [edi + 2*sizeof dword]
.if eax > dword ptr (IPV6Struct ptr [esi]).endIP+8
jmp short @preTop
.elseif eax < dword ptr (IPV6Struct ptr [esi]).endIP+8
jmp short @exit
.endif
mov eax, [edi + sizeof dword]
.if eax > dword ptr (IPV6Struct ptr [esi]).endIP+4
jmp short @preTop
.elseif eax < dword ptr (IPV6Struct ptr [esi]).endIP+4
jmp short @exit
.endif
mov eax, [edi]
.if eax > dword ptr (IPV6Struct ptr [esi]).endIP
jmp short @preTop
.else
jmp @exit
.endif
@preTop:
add esi, sizeof IPV6Struct
jmp @checkStart
.endw
.endw
@error:
ret
@exit:
sub esi, sizeof IPV6Struct
invoke printf, offset msg, esi
ret
main endp



end


87
MasmBasic & the RichMasm IDE / Re: Can command lines be longer than 260 characters?
« Last post by jj2007 on November 07, 2019, 02:05:42 AM »
Thanks, Timo. I wonder what the prepending //?/ stuff is good for, apparently it's not needed for UTF-16 file names.

Here is another test: extract the files to C:\ or whatever your Masm32 drive is so that you get

C:\Masm32\MasmBasic\Res\Let's have some fun with an incredibly long folder name that clearly exceeds the official MAX_PATH limitation imposed by Windows 7 and other not so recent versions of Windows that could possibly be present on a computer\MyLongTest.asc

Then open the *.asc file in RichMasm and hit F6.
88
The Campus / Re: 128 bit Comparison on 32-bit CPU
« Last post by colinr on November 07, 2019, 01:58:09 AM »
Would that help as I'm not after equality, more of establishing if they fit within 2 ranges (start and end) x 500,000 times!
89
The Campus / Re: 128 bit Comparison on 32-bit CPU
« Last post by jj2007 on November 07, 2019, 01:53:10 AM »
Can you translate them to strings? They are easier to sort and compare.
90
The Campus / Re: 128 bit Comparison on 32-bit CPU
« Last post by colinr on November 07, 2019, 01:21:02 AM »
Just identify which country an IP address is assigned to.

I've written a tool to parse log files to identify accounts that may have been compromised.

So I'm looking up the countries (someone who logs in from the UK, should not have account access from Nigeria!).

I then use another data set that's published daily to identify proxies/VPN's and know malicious IP addresses. Everything is fine with IPv4, just IPv6 is painful.

So the tool needs to identify which range a particular IP address sits, from that I then pull out the 2 digit country ISO code.
Pages: 1 ... 7 8 [9] 10