Function at 0x4fd2a0
Capabilities:
Enumerate pe sections
Get system information on windows
Parse pe header

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x3c
mov edx, dword [ebp + 0xc]
push ebx
push esi
push edi
xor edi, edi
cmp edx, 0x40
jae 0x4fd2c4
push 0xd
call dword [sym.imp.KERNEL32.dll_SetLastError]
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp + 8]
cmp word [ecx], 0x5a4d
je 0x4fd2e2
push 0xc1
call dword [sym.imp.KERNEL32.dll_SetLastError]
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ecx + 0x3c]
lea esi, [eax + 0xf8]
cmp edx, esi
jae 0x4fd300
push 0xd
call dword [sym.imp.KERNEL32.dll_SetLastError]
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
lea esi, [eax + ecx]
mov dword [ebp - 4], esi
cmp dword [esi], 0x4550
je 0x4fd322
push 0xc1
call dword [sym.imp.KERNEL32.dll_SetLastError]
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
cmp word [esi + 4], 0x14c
je 0x4fd33e
push 0xc1
call dword [sym.imp.KERNEL32.dll_SetLastError]
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
mov ebx, dword [esi + 0x38]
test bl, 1
je 0x4fd35a
push 0xc1
call dword [sym.imp.KERNEL32.dll_SetLastError]
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
xor eax, eax
mov ax, word [esi + 0x14]
lea ecx, [eax + esi + 0x18]
xor eax, eax
mov ax, word [esi + 6]
test eax, eax
jbe 0x4fd38a
add ecx, 0xc
mov edx, eax
mov eax, dword [ecx + 4]
test eax, eax
jne 0x4fd37c
mov eax, ebx
add eax, dword [ecx]
cmp eax, edi
jbe 0x4fd384
mov edi, eax
add ecx, 0x28
dec edx
jne 0x4fd373
lea ecx, [ebp - 0x3c]
push ecx
call dword [sym.imp.KERNEL32.dll_GetSystemInfo]
mov ecx, dword [ebp - 0x38]
mov edx, dword [esi + 0x50]
lea eax, [ecx - 1]
lea esi, [edx + ecx - 1]
not eax
lea ecx, [ecx + edi - 1]
and esi, eax
and ecx, eax
cmp esi, ecx
je 0x4fd3c3
push 0xc1
call dword [sym.imp.KERNEL32.dll_SetLastError]
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
mov edi, dword [ebp + 0x24]
push edi
push 4
push 0x3000
push esi
push 0
call dword [ebp + 0x10]
mov ebx, eax
add esp, 0x14
test ebx, ebx
mov dword [ebp + 0x24], ebx
jne 0x4fd40a
push edi
push 4
push 0x3000
push esi
push eax
call dword [ebp + 0x10]
mov ebx, eax
add esp, 0x14
test ebx, ebx
mov dword [ebp + 0x24], ebx
jne 0x4fd40a
push 0xe
call dword [sym.imp.KERNEL32.dll_SetLastError]
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
push 0x40
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov esi, eax
test esi, esi
jne 0x4fd440
push edi
push 0x8000
push eax
push ebx
call dword [ebp + 0x14]
add esp, 0x10
push 0xe
call dword [sym.imp.KERNEL32.dll_SetLastError]
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 4]
mov ecx, dword [ebp + 0x10]
mov dword [esi + 4], ebx
mov dx, word [eax + 0x16]
mov dword [esi + 0x1c], ecx
mov ecx, dword [ebp + 0x18]
mov dword [esi + 0x34], edi
shr edx, 0xd
and edx, 1
mov dword [esi + 0x24], ecx
mov ecx, dword [ebp + 0x20]
mov dword [esi + 0x14], edx
mov edx, dword [ebp + 0x14]
mov dword [esi + 0x2c], ecx
mov ecx, dword [ebp + 0xc]
mov dword [esi + 0x20], edx
mov edx, dword [ebp + 0x1c]
mov dword [esi + 0x28], edx
mov edx, dword [ebp - 0x38]
mov dword [esi + 0x3c], edx
mov eax, dword [eax + 0x54]
cmp ecx, eax
jae 0x4fd48b
push 0xd
jmp 0x4fd91d
push edi
push 4
push 0x1000
push eax
push ebx
call dword [ebp + 0x10]
mov edx, dword [ebp + 8]
mov edi, eax
mov eax, dword [ebp - 4]
mov ecx, dword [eax + 0x54]
push ecx
push edx
push edi
call fcn.004f7780
mov eax, dword [ebp + 8]
xor edx, edx
add esp, 0x20
mov dword [ebp + 0x14], 0
mov ecx, dword [eax + 0x3c]
lea eax, [ecx + edi]
mov dword [esi], eax
mov dword [eax + 0x34], ebx
mov eax, dword [esi]
mov ebx, dword [esi + 4]
mov dx, word [eax + 0x14]
cmp word [eax + 6], 0
lea edi, [edx + eax + 0x18]
jbe 0x4fd5a1
add edi, 0x10
mov eax, dword [edi]
test eax, eax
jne 0x4fd532
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x38]
test eax, eax
mov dword [ebp + 0x10], eax
jle 0x4fd587
mov ecx, dword [esi + 0x34]
mov edx, eax
mov eax, dword [edi - 4]
push ecx
push 4
push 0x1000
add eax, ebx
push edx
push eax
call dword [esi + 0x1c]
add esp, 0x14
test eax, eax
je 0x4fd923
mov eax, dword [edi - 4]
mov ecx, dword [ebp + 0x10]
add eax, ebx
push ecx
push 0
push eax
mov dword [edi - 8], eax
call fcn.004f77b0
add esp, 0xc
jmp 0x4fd587
mov ecx, dword [edi + 4]
mov edx, eax
add edx, ecx
mov ecx, dword [ebp + 0xc]
cmp ecx, edx
jb 0x4fd484
mov ecx, dword [esi + 0x34]
mov edx, dword [edi - 4]
push ecx
push 4
push 0x1000
add edx, ebx
push eax
push edx
call dword [esi + 0x1c]
add esp, 0x14
test eax, eax
je 0x4fd923
mov ecx, dword [edi]
mov edx, dword [edi + 4]
mov eax, dword [edi - 4]
push ecx
mov ecx, dword [ebp + 8]
add eax, ebx
add edx, ecx
mov dword [ebp + 0x10], eax
push edx
push eax
call fcn.004f7780
mov eax, dword [ebp + 0x10]
add esp, 0xc
mov dword [edi - 8], eax
mov ecx, dword [esi]
mov eax, dword [ebp + 0x14]
xor edx, edx
inc eax
mov dx, word [ecx + 6]
add edi, 0x28
cmp eax, edx
mov dword [ebp + 0x14], eax
jl 0x4fd4e0
mov eax, dword [esi]
mov edx, dword [ebp - 4]
mov ecx, dword [eax + 0x34]
mov edi, dword [edx + 0x34]
sub ecx, edi
mov dword [ebp + 8], ecx
je 0x4fd63e
mov ecx, dword [eax + 0xa4]
mov ebx, dword [esi + 4]
test ecx, ecx
mov dword [ebp + 0xc], ebx
jne 0x4fd5ce
xor eax, eax
mov dword [esi + 0x18], eax
jmp 0x4fd645
mov ecx, dword [eax + 0xa0]
mov eax, dword [ecx + ebx]
add ecx, ebx
test eax, eax
jbe 0x4fd634
add eax, ebx
xor edi, edi
mov dword [ebp + 0x10], eax
mov eax, dword [ecx + 4]
sub eax, 8
lea edx, [ecx + 8]
test eax, 0xfffffffe
jbe 0x4fd62b
xor eax, eax
mov ax, word [edx]
mov ebx, eax
and ebx, 0xfffff000
cmp ebx, 0x3000
jne 0x4fd618
mov ebx, dword [ebp + 0x10]
and eax, 0xfff
add eax, ebx
mov ebx, dword [ebp + 8]
add dword [eax], ebx
mov eax, dword [ecx + 4]
inc edi
sub eax, 8
add edx, 2
shr eax, 1
cmp edi, eax
jb 0x4fd5f4
mov ebx, dword [ebp + 0xc]
add ecx, dword [ecx + 4]
mov eax, dword [ecx]
test eax, eax
ja 0x4fd5dd
mov eax, 1
mov dword [esi + 0x18], eax
jmp 0x4fd645
mov dword [esi + 0x18], 1
mov eax, dword [esi]
mov edi, dword [esi + 4]
add eax, 0x80
mov dword [ebp + 8], edi
mov ecx, dword [eax + 4]
test ecx, ecx
je 0x4fd781
mov ebx, dword [eax]
push 0x14
add ebx, edi
push ebx
mov dword [ebp + 0x10], ebx
call dword [sym.imp.KERNEL32.dll_IsBadReadPtr]
test eax, eax
jne 0x4fd781
mov eax, dword [ebx + 0xc]
test eax, eax
je 0x4fd781
mov ecx, dword [esi + 0x34]
add eax, edi
push ecx
push eax
call dword [esi + 0x24]
mov edi, eax
add esp, 8
test edi, edi
mov dword [ebp + 0xc], edi
je 0x4fd753
mov edx, dword [esi + 0xc]
mov ecx, dword [esi + 8]
lea eax, [edx*4 + 4]
push eax
push ecx
call fcn.004f7cd0
add esp, 8
test eax, eax
je 0x4fd75a
mov edx, dword [esi + 0xc]
mov dword [esi + 8], eax
mov dword [eax + edx*4], edi
mov ecx, dword [esi + 0xc]
inc ecx
mov dword [esi + 0xc], ecx
mov ebx, dword [ebx]
test ebx, ebx
je 0x4fd6de
mov ecx, dword [ebp + 0x10]
mov eax, dword [ebp + 8]
add ebx, eax
mov edi, dword [ecx + 0x10]
add edi, eax
jmp 0x4fd6ec
mov edx, dword [ebp + 0x10]
mov ecx, dword [ebp + 8]
mov eax, dword [edx + 0x10]
lea ebx, [eax + ecx]
mov edi, ebx
mov eax, dword [ebx]
test eax, eax
je 0x4fd732
test eax, 0x80000000
je 0x4fd709
mov edx, dword [esi + 0x34]
and eax, 0xffff
push edx
push eax
mov eax, dword [ebp + 0xc]
push eax
jmp 0x4fd719
mov edx, dword [ebp + 8]
mov ecx, dword [esi + 0x34]
push ecx
mov ecx, dword [ebp + 0xc]
lea eax, [eax + edx + 2]
push eax
push ecx
call dword [esi + 0x28]
add esp, 0xc
mov dword [edi], eax
test eax, eax
je 0x4fd76c
mov eax, dword [ebx + 4]
add ebx, 4
add edi, 4
test eax, eax
jne 0x4fd6f2
mov eax, dword [ebp + 0x10]
push 0x14
add eax, 0x14
push eax
mov dword [ebp + 0x10], eax
call dword [sym.imp.KERNEL32.dll_IsBadReadPtr]
test eax, eax
jne 0x4fd781
mov edi, dword [ebp + 8]
mov ebx, dword [ebp + 0x10]
jmp 0x4fd675
push 0x7e
jmp 0x4fd91d
mov edx, dword [esi + 0x34]
push edx
push edi
call dword [esi + 0x2c]
add esp, 8
push 0xe
jmp 0x4fd91d
mov eax, dword [esi + 0x34]
mov ecx, dword [ebp + 0xc]
push eax
push ecx
call dword [esi + 0x2c]
add esp, 8
push 0x7f
jmp 0x4fd91d
mov eax, dword [esi]
xor edx, edx
mov edi, dword [0x5c6c94]
mov dx, word [eax + 0x14]
lea ecx, [edx + eax + 0x18]
mov edx, dword [edx + eax + 0x20]
or edx, edi
mov edi, dword [esi + 0x3c]
dec edi
mov dword [ebp - 0x18], edx
not edi
and edi, edx
mov dword [ebp - 0x14], edi
mov edi, dword [ecx + 0x10]
test edi, edi
jne 0x4fd7c3
mov ebx, dword [ecx + 0x24]
test bl, 0x40
je 0x4fd7bb
mov edi, dword [eax + 0x20]
jmp 0x4fd7c3
test bl, 0x80
je 0x4fd7c3
mov edi, dword [eax + 0x24]
mov dword [ebp - 0x10], edi
mov edi, dword [ecx + 0x24]
mov dword [ebp - 0xc], edi
mov edi, 1
mov dword [ebp - 8], 0
add ecx, 0x28
cmp word [eax + 6], di
mov dword [ebp + 8], edi
jbe 0x4fd8b1
add ecx, 0x24
mov dword [ebp + 0x10], ecx
mov ebx, dword [ebp + 0x10]
mov edi, dword [0x5c6c94]
mov ecx, dword [ebx - 0x1c]
mov ebx, dword [ebx - 0x14]
or ecx, edi
mov edi, dword [esi + 0x3c]
dec edi
mov dword [ebp + 0xc], ecx
not edi
and edi, ecx
test ebx, ebx
jne 0x4fd828
mov edx, dword [ebp + 0x10]
mov edx, dword [edx]
test dl, 0x40
je 0x4fd81d
mov ebx, dword [eax + 0x20]
jmp 0x4fd825
test dl, 0x80
je 0x4fd825
mov ebx, dword [eax + 0x24]
mov edx, dword [ebp - 0x18]
cmp dword [ebp - 0x14], edi
je 0x4fd861
mov eax, dword [ebp - 0x10]
add eax, edx
cmp eax, edi
ja 0x4fd861
lea ecx, [ebp - 0x18]
push ecx
push esi
call fcn.004fd970
add esp, 8
test eax, eax
je 0x4fd923
mov edx, dword [ebp + 0xc]
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x18], edx
mov dword [ebp - 0x14], edi
mov dword [ebp - 0x10], ebx
mov ecx, dword [eax]
mov dword [ebp - 0xc], ecx
jmp 0x4fd891
mov eax, dword [ebp + 0x10]
mov eax, dword [eax]
test eax, 0x2000000
je 0x4fd87f
mov edi, dword [ebp - 0xc]
test edi, 0x2000000
je 0x4fd87f
or edi, eax
mov dword [ebp - 0xc], edi
jmp 0x4fd88a
or eax, dword [ebp - 0xc]
and eax, 0xfdffffff
mov dword [ebp - 0xc], eax
sub ebx, edx
add ebx, ecx
mov dword [ebp - 0x10], ebx
mov eax, dword [ebp + 0x10]
mov ecx, dword [ebp + 8]
add eax, 0x28
xor edi, edi
mov dword [ebp + 0x10], eax
mov eax, dword [esi]
inc ecx
mov di, word [eax + 6]
mov dword [ebp + 8], ecx
cmp ecx, edi
jl 0x4fd7ee
lea ecx, [ebp - 0x18]
mov dword [ebp - 8], 1
push ecx
push esi
call fcn.004fd970
add esp, 8
test eax, eax
je 0x4fd923
mov eax, dword [esi]
mov ebx, dword [esi + 4]
add eax, 0xc0
mov eax, dword [eax]
test eax, eax
je 0x4fd8f8
mov edi, dword [ebx + eax + 0xc]
test edi, edi
je 0x4fd8f8
mov eax, dword [edi]
test eax, eax
je 0x4fd8f8
push 0
push 1
push ebx
call eax
mov eax, dword [edi + 4]
add edi, 4
test eax, eax
jne 0x4fd8e7
mov edx, dword [esi]
mov eax, dword [edx + 0x28]
test eax, eax
je 0x4fd953
mov ecx, dword [esi + 0x14]
test ecx, ecx
mov ecx, dword [ebp + 0x24]
je 0x4fd945
push 0
push 1
add eax, ecx
push ecx
call eax
test eax, eax
jne 0x4fd935
push 0x45a
call dword [sym.imp.KERNEL32.dll_SetLastError]
push esi
call fcn.004fdb90
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov dword [esi + 0x10], 1
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
add eax, ecx
pop edi
mov dword [esi + 0x38], eax
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov dword [esi + 0x38], 0
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret