Function at 0x406b52
Capabilities:
Allocate or change rwx memory
Enumerate pe sections

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x13c
mov eax, dword [ebp + 8]
mov ecx, dword [eax]
mov dword [ebp - 0xc], ecx
mov edx, dword [ebp - 0xc]
xor eax, eax
mov ax, word [edx]
cmp eax, 0x5a4d
je 0x406b79
xor eax, eax
jmp 0x406ff4
mov ecx, dword [ebp + 8]
mov edx, dword [ecx]
mov eax, dword [ebp - 0xc]
add edx, dword [eax + 0x3c]
mov dword [ebp - 0x10], edx
mov ecx, dword [ebp - 0x10]
xor edx, edx
mov dx, word [ecx + 0x18]
cmp edx, 0x10b
je 0x406b9f
xor eax, eax
jmp 0x406ff4
mov eax, dword [ebp - 0x10]
xor ecx, ecx
mov cx, word [eax + 0x14]
cmp ecx, 0xe0
je 0x406bb7
xor eax, eax
jmp 0x406ff4
push 0x40
push 0x3000
mov edx, dword [ebp - 0x10]
mov eax, dword [edx + 0x50]
push eax
mov ecx, dword [ebp - 0x10]
mov edx, dword [ecx + 0x34]
push edx
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
jne 0x406c01
push 0x40
push 0x3000
mov eax, dword [ebp - 0x10]
mov ecx, dword [eax + 0x50]
push ecx
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
jne 0x406c01
xor eax, eax
jmp 0x406ff4
mov edx, dword [ebp + 0xc]
mov eax, dword [ebp - 0x14]
mov dword [edx + 0x10], eax
mov ecx, dword [ebp - 0x10]
mov edx, dword [ecx + 0x54]
push edx
mov eax, dword [ebp + 8]
mov ecx, dword [eax]
push ecx
mov edx, dword [ebp - 0x14]
push edx
call sub.MSVCRT.dll_memcpy
add esp, 0xc
mov dword [ebp - 8], 0
jmp 0x406c35
mov eax, dword [ebp - 8]
add eax, 1
mov dword [ebp - 8], eax
mov ecx, dword [ebp - 0x10]
xor edx, edx
mov dx, word [ecx + 6]
cmp dword [ebp - 8], edx
jae 0x406c85
mov eax, dword [ebp - 0x10]
xor ecx, ecx
mov cx, word [eax + 0x14]
mov edx, dword [ebp - 0x10]
lea eax, [edx + ecx + 0x18]
mov ecx, dword [ebp - 8]
imul ecx, ecx, 0x28
add eax, ecx
mov dword [ebp - 0x18], eax
mov edx, dword [ebp - 0x18]
mov eax, dword [edx + 0x10]
push eax
mov ecx, dword [ebp + 8]
mov edx, dword [ecx]
mov eax, dword [ebp - 0x18]
add edx, dword [eax + 0x14]
push edx
mov ecx, dword [ebp - 0x18]
mov edx, dword [ebp - 0x14]
add edx, dword [ecx + 0xc]
push edx
call sub.MSVCRT.dll_memcpy
add esp, 0xc
jmp 0x406c2c
push 5
mov eax, dword [ebp - 0x10]
push eax
call fcn.00406956
add esp, 8
mov dword [ebp - 4], eax
mov ecx, dword [ebp - 0x10]
mov edx, dword [ebp - 0x14]
cmp edx, dword [ecx + 0x34]
je 0x406d58
cmp dword [ebp - 4], 0
je 0x406d58
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebp - 0x14]
sub ecx, dword [eax + 0x34]
mov dword [ebp - 0x24], ecx
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 0x14]
add eax, dword [edx]
mov dword [ebp - 0x20], eax
mov ecx, dword [ebp - 4]
mov edx, dword [ebp - 0x20]
add edx, dword [ecx + 4]
mov dword [ebp - 0x1c], edx
mov eax, dword [ebp - 0x20]
cmp eax, dword [ebp - 0x1c]
jae 0x406d58
mov ecx, dword [ebp - 0x20]
mov edx, dword [ebp - 0x20]
add edx, dword [ecx + 4]
mov dword [ebp - 0x2c], edx
mov eax, dword [ebp - 0x20]
add eax, 8
mov dword [ebp - 0x28], eax
mov ecx, dword [ebp - 0x28]
cmp ecx, dword [ebp - 0x2c]
jae 0x406d4d
mov edx, dword [ebp - 0x28]
xor eax, eax
mov ax, word [edx]
mov dword [ebp - 0x34], eax
mov ecx, dword [ebp - 0x34]
shr ecx, 0xc
mov dword [ebp - 0x30], ecx
mov edx, dword [ebp - 0x30]
mov dword [ebp - 0x13c], edx
cmp dword [ebp - 0x13c], 3
je 0x406d1f
jmp 0x406d42
mov eax, dword [ebp - 0x20]
mov ecx, dword [ebp - 0x14]
add ecx, dword [eax]
mov edx, dword [ebp - 0x34]
and edx, 0xfff
add ecx, edx
mov dword [ebp - 0x34], ecx
mov eax, dword [ebp - 0x34]
mov ecx, dword [eax]
add ecx, dword [ebp - 0x24]
mov edx, dword [ebp - 0x34]
mov dword [edx], ecx
mov eax, dword [ebp - 0x28]
add eax, 2
mov dword [ebp - 0x28], eax
jmp 0x406cef
mov ecx, dword [ebp - 0x2c]
mov dword [ebp - 0x20], ecx
jmp 0x406cd2
push 1
mov edx, dword [ebp - 0x10]
push edx
call fcn.00406956
add esp, 8
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
je 0x406e55
mov eax, dword [ebp - 4]
mov ecx, dword [ebp - 0x14]
add ecx, dword [eax]
mov dword [ebp - 0x38], ecx
mov edx, dword [ebp - 0x38]
cmp dword [edx], 0
je 0x406e55
mov eax, dword [ebp - 0x38]
mov ecx, dword [ebp - 0x14]
add ecx, dword [eax + 0xc]
mov dword [ebp - 0x3c], ecx
mov edx, dword [ebp - 0x38]
mov eax, dword [ebp - 0x14]
add eax, dword [edx]
mov dword [ebp - 0x40], eax
mov ecx, dword [ebp - 0x38]
mov edx, dword [ebp - 0x14]
add edx, dword [ecx + 0x10]
mov dword [ebp - 0x48], edx
mov eax, dword [ebp + 0x10]
push eax
mov ecx, dword [ebp - 0x3c]
push ecx
mov edx, dword [ebp + 0xc]
push edx
mov eax, dword [ebp + 8]
push eax
call fcn.00406ff8
add esp, 0x10
mov dword [ebp - 0x44], eax
cmp dword [ebp - 0x44], 0
jne 0x406dd5
xor eax, eax
jmp 0x406ff4
mov ecx, dword [ebp - 0x40]
cmp dword [ecx], 0
je 0x406e47
mov edx, dword [ebp - 0x40]
mov eax, dword [edx]
and eax, 0x80000000
test eax, eax
je 0x406e09
mov ecx, dword [ebp - 0x40]
mov edx, dword [ecx]
and edx, 0xffff
push edx
mov eax, dword [ebp - 0x44]
mov ecx, dword [eax + 8]
push ecx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0x4c], eax
jmp 0x406e2b
mov edx, dword [ebp - 0x40]
mov eax, dword [ebp - 0x14]
add eax, dword [edx]
mov dword [ebp - 0x50], eax
mov ecx, dword [ebp - 0x50]
add ecx, 2
push ecx
mov edx, dword [ebp - 0x44]
mov eax, dword [edx + 8]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0x4c], eax
mov ecx, dword [ebp - 0x48]
mov edx, dword [ebp - 0x4c]
mov dword [ecx], edx
mov eax, dword [ebp - 0x48]
add eax, 4
mov dword [ebp - 0x48], eax
mov ecx, dword [ebp - 0x40]
add ecx, 4
mov dword [ebp - 0x40], ecx
jmp 0x406dd5
mov edx, dword [ebp - 0x38]
add edx, 0x14
mov dword [ebp - 0x38], edx
jmp 0x406d7e
push 0
mov eax, dword [ebp - 0x10]
push eax
call fcn.00406956
add esp, 8
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
je 0x406fd7
mov ecx, dword [ebp - 4]
mov edx, dword [ebp - 0x14]
add edx, dword [ecx]
mov dword [ebp - 0x58], edx
mov dword [ebp - 0x54], 0
jmp 0x406e8d
mov eax, dword [ebp - 0x54]
add eax, 1
mov dword [ebp - 0x54], eax
mov ecx, dword [ebp - 0x58]
mov edx, dword [ebp - 0x54]
cmp edx, dword [ecx + 0x14]
jae 0x406fd7
mov eax, dword [ebp - 0x58]
mov ecx, dword [ebp - 0x14]
add ecx, dword [eax + 0x1c]
mov edx, dword [ebp - 0x54]
lea eax, [ecx + edx*4]
mov dword [ebp - 0x138], eax
mov ecx, dword [ebp - 0x138]
mov edx, dword [ebp - 0x14]
add edx, dword [ecx]
mov dword [ebp - 0x5c], edx
mov eax, dword [ebp - 0x5c]
cmp eax, dword [ebp - 0x58]
jb 0x406ed5
mov ecx, dword [ebp - 4]
mov edx, dword [ebp - 0x58]
add edx, dword [ecx + 4]
cmp dword [ebp - 0x5c], edx
jb 0x406ed7
jmp 0x406e84
push 0x2e
mov eax, dword [ebp - 0x5c]
push eax
call dword [sym.imp.MSVCRT.dll_strchr]
add esp, 8
mov dword [ebp - 0x130], eax
mov ecx, dword [ebp - 0x130]
sub ecx, dword [ebp - 0x5c]
mov dword [ebp - 0x134], ecx
cmp dword [ebp - 0x130], 0
je 0x406f10
cmp dword [ebp - 0x134], 0xc8
jb 0x406f15
jmp 0x406e84
mov edx, dword [ebp - 0x134]
push edx
mov eax, dword [ebp - 0x5c]
push eax
lea ecx, [ebp - 0x124]
push ecx
call sub.MSVCRT.dll_memcpy
add esp, 0xc
mov edx, dword [ebp - 0x134]
mov byte [ebp + edx - 0x124], 0
mov eax, dword [ebp + 0x10]
push eax
lea ecx, [ebp - 0x124]
push ecx
mov edx, dword [ebp + 0xc]
push edx
mov eax, dword [ebp + 8]
push eax
call fcn.00406ff8
add esp, 0x10
mov dword [ebp - 0x128], eax
cmp dword [ebp - 0x128], 0
jne 0x406f6e
xor eax, eax
jmp 0x406ff4
mov ecx, dword [ebp - 0x130]
add ecx, 1
mov dword [ebp - 0x12c], ecx
mov edx, dword [ebp - 0x12c]
movsx eax, byte [edx]
cmp eax, 0x23
jne 0x406fa4
mov ecx, dword [ebp - 0x12c]
add ecx, 1
push ecx
call dword [sym.imp.MSVCRT.dll_atoi]
add esp, 4
mov dword [ebp - 0x12c], eax
mov edx, dword [ebp - 0x12c]
push edx
mov eax, dword [ebp - 0x128]
mov ecx, dword [eax + 8]
push ecx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0x5c], eax
cmp dword [ebp - 0x5c], 0
je 0x406fd2
mov edx, dword [ebp - 0x5c]
sub edx, dword [ebp - 0x14]
mov eax, dword [ebp - 0x138]
mov dword [eax], edx
jmp 0x406e84
mov ecx, dword [ebp - 0x10]
cmp dword [ecx + 0x28], 0
je 0x406fef
mov edx, dword [ebp - 0x10]
mov eax, dword [ebp - 0x14]
add eax, dword [edx + 0x28]
mov ecx, dword [ebp + 0xc]
mov dword [ecx + 0x14], eax
mov eax, 1
mov esp, ebp
pop ebp
ret