Function at 0x5980a2cc
Capabilities:
Enumerate pe sections

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffde0
push ebx
push esi
push edi
xor ebx, ebx
mov dword [ebp - 0x220], ebx
mov dword [ebp - 4], ebx
mov esi, edx
mov dword [ebp - 8], eax
xor eax, eax
push ebp
push 0x5980a5de
push dword fs:[eax]
mov dword fs:[eax], esp
mov byte [ebp - 9], 0
mov dword [esi], 0xffffffff
mov eax, dword [0x59858024]
dec eax
test eax, eax
jl 0x5980a334
inc eax
xor ebx, ebx
mov edx, ebx
add edx, edx
add edx, edx
add edx, edx
sub edx, ebx
mov ecx, dword [0x59858028]
mov edx, dword [ecx + edx*4]
cmp edx, dword [ebp - 8]
jne 0x5980a330
mov byte [ebp - 9], 1
mov dword [esi], ebx
jmp 0x5980a5bd
inc ebx
dec eax
jne 0x5980a30d
call sub.kernel32.dll_GetVersion
test eax, 0x80000000
jne 0x5980a373
push 0x104
lea eax, [ebp - 0x21a]
push eax
mov eax, dword [ebp - 8]
push eax
call sub.kernel32.dll_GetModuleFileNameW
test eax, eax
setne bl
test bl, bl
je 0x5980a3b5
lea eax, [ebp - 4]
lea edx, [ebp - 0x21a]
mov ecx, 0x105
call sub.rtl120.bpl__System__UStrFromWArray_qqrr20System_UnicodeStringpbi
jmp 0x5980a3b5
push 0x104
lea eax, [ebp - 0x21a]
push eax
mov eax, dword [ebp - 8]
push eax
call sub.kernel32.dll_GetModuleFileNameA
test eax, eax
setne bl
test bl, bl
je 0x5980a3b5
lea eax, [ebp - 0x220]
lea edx, [ebp - 0x21a]
mov ecx, 0
call sub.rtl120.bpl__System__LStrFromPChar_qqrr27System__AnsiStringT_us_i0__pcus
mov edx, dword [ebp - 0x220]
lea eax, [ebp - 4]
call sub.rtl120.bpl__System__UStrFromLStr_qqrr20System_UnicodeStringx27System__AnsiStringT_us_i0__
test bl, bl
je 0x5980a5bd
mov eax, dword [ebp - 8]
call sub.madBasic_.bpl__Madtools_GetImageNtHeaders_qqrui
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
je 0x5980a5bd
mov byte [ebp - 9], 1
mov eax, dword [0x59858028]
call sub.rtl120.bpl__System__DynArrayLength_qqrv
cmp eax, dword [0x59858024]
jne 0x5980a42d
cmp dword [0x59858024], 0
jne 0x5980a40d
push 0x10
mov eax, 0x59858028
mov ecx, 1
mov edx, dword [0x5980a25c]
call sub.rtl120.bpl__System__DynArraySetLength_qqrv
add esp, 4
jmp 0x5980a42d
mov eax, dword [0x59858024]
add eax, eax
push eax
mov eax, 0x59858028
mov ecx, 1
mov edx, dword [0x5980a25c]
call sub.rtl120.bpl__System__DynArraySetLength_qqrv
add esp, 4
mov eax, dword [0x59858024]
mov dword [esi], eax
inc dword [0x59858024]
mov eax, dword [esi]
mov edx, eax
add eax, eax
add eax, eax
add eax, eax
sub eax, edx
mov edx, dword [0x59858028]
lea eax, [edx + eax*4]
mov esi, eax
mov eax, dword [ebp - 8]
mov dword [esi], eax
lea eax, [esi + 4]
mov edx, dword [ebp - 4]
call sub.rtl120.bpl__System__UStrAsg_qqrr20System_UnicodeStringx20System_UnicodeString
mov eax, dword [esi + 4]
call sub.rtl120.bpl__System__UStrLen_qqrx20System_UnicodeString
mov ebx, eax
cmp ebx, 1
jl 0x5980a491
mov eax, dword [esi + 4]
cmp word [eax + ebx*2 - 2], 0x5c
jne 0x5980a48c
lea eax, [esi + 4]
mov ecx, ebx
mov edx, 1
call sub.rtl120.bpl__System__UStrDelete_qqrr20System_UnicodeStringii
jmp 0x5980a491
dec ebx
test ebx, ebx
jne 0x5980a470
mov eax, dword [ebp - 0x10]
movzx eax, word [eax + 0x18]
cmp ax, 0x20b
jne 0x5980a4ae
mov ecx, dword [ebp - 0x10]
add ecx, 0x18
add ecx, 0xf0
mov edx, ecx
jmp 0x5980a4bc
mov ecx, dword [ebp - 0x10]
add ecx, 0x18
add ecx, 0xe0
mov edx, ecx
test byte [edx + 0x24], 0x20
je 0x5980a4e6
mov eax, dword [esi]
add eax, dword [edx + 0xc]
mov dword [esi + 8], eax
add eax, dword [edx + 8]
mov dword [esi + 0xc], eax
add edx, 0x28
test byte [edx + 0x24], 0x20
je 0x5980a51f
mov eax, dword [esi]
add eax, dword [edx + 0xc]
add eax, dword [edx + 8]
mov dword [esi + 0xc], eax
jmp 0x5980a51f
cmp ax, 0x20b
jne 0x5980a50b
mov eax, dword [esi]
mov edx, dword [ebp - 0x10]
add edx, 0x18
add eax, dword [edx + 0x14]
mov dword [esi + 8], eax
mov eax, dword [esi + 8]
mov edx, dword [ebp - 0x10]
add edx, 0x18
add eax, dword [edx + 4]
mov dword [esi + 0xc], eax
jmp 0x5980a51f
mov eax, dword [esi]
mov edx, dword [ebp - 0x10]
add eax, dword [edx + 0x2c]
mov dword [esi + 8], eax
mov edx, dword [ebp - 0x10]
add eax, dword [edx + 0x1c]
mov dword [esi + 0xc], eax
mov eax, dword [ebp - 0x10]
cmp word [eax + 0x18], 0x20b
jne 0x5980a584
mov eax, dword [esi + 0xc]
mov dword [esi + 0x10], eax
mov eax, dword [ebp - 0x10]
add eax, 0x108
mov edx, eax
mov eax, dword [ebp - 0x10]
movzx eax, word [eax + 6]
dec eax
test eax, eax
jl 0x5980a56a
inc eax
mov edi, dword [edx + 0x24]
test edi, 0x40
jne 0x5980a55a
test edi, 0x80
je 0x5980a564
mov eax, dword [esi]
add eax, dword [edx + 0xc]
mov dword [esi + 0x10], eax
jmp 0x5980a56a
add edx, 0x28
dec eax
jne 0x5980a547
mov eax, dword [esi + 0x10]
mov edx, dword [ebp - 0x10]
add edx, 0x18
add eax, dword [edx + 8]
mov edx, dword [ebp - 0x10]
add edx, 0x18
add eax, dword [edx + 0xc]
mov dword [esi + 0x14], eax
jmp 0x5980a59e
mov eax, dword [esi]
mov edx, dword [ebp - 0x10]
add eax, dword [edx + 0x30]
mov dword [esi + 0x10], eax
mov edx, dword [ebp - 0x10]
add eax, dword [edx + 0x20]
mov edx, dword [ebp - 0x10]
add eax, dword [edx + 0x24]
mov dword [esi + 0x14], eax
mov eax, dword [ebp - 8]
call sym.madExcept_.bpl__Madmapfile_FindMapFile_qqrpv
mov ebx, eax
mov dword [esi + 0x18], ebx
cmp byte [ebx + 0x3c], 0
jne 0x5980a5bd
mov eax, ebx
call sub.rtl120.bpl__System_TObject_Free_qqrv
xor eax, eax
mov dword [esi + 0x18], eax
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x5980a5e5
lea eax, [ebp - 0x220]
call sub.rtl120.bpl__System__LStrClr_qqrpv
lea eax, [ebp - 4]
call sub.rtl120.bpl__System__UStrClr_qqrpv
ret