Function at 0x406b42
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 0x406b69
xor eax, eax
jmp 0x406fe4
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 0x406b8f
xor eax, eax
jmp 0x406fe4
mov eax, dword [ebp - 0x10]
xor ecx, ecx
mov cx, word [eax + 0x14]
cmp ecx, 0xe0
je 0x406ba7
xor eax, eax
jmp 0x406fe4
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 0x406bf1
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 0x406bf1
xor eax, eax
jmp 0x406fe4
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 0x406c25
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 0x406c75
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 0x406c1c
push 5
mov eax, dword [ebp - 0x10]
push eax
call fcn.00406946
add esp, 8
mov dword [ebp - 4], eax
mov ecx, dword [ebp - 0x10]
mov edx, dword [ebp - 0x14]
cmp edx, dword [ecx + 0x34]
je 0x406d48
cmp dword [ebp - 4], 0
je 0x406d48
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 0x406d48
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 0x406d3d
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 0x406d0f
jmp 0x406d32
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 0x406cdf
mov ecx, dword [ebp - 0x2c]
mov dword [ebp - 0x20], ecx
jmp 0x406cc2
push 1
mov edx, dword [ebp - 0x10]
push edx
call fcn.00406946
add esp, 8
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
je 0x406e45
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 0x406e45
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.00406fe8
add esp, 0x10
mov dword [ebp - 0x44], eax
cmp dword [ebp - 0x44], 0
jne 0x406dc5
xor eax, eax
jmp 0x406fe4
mov ecx, dword [ebp - 0x40]
cmp dword [ecx], 0
je 0x406e37
mov edx, dword [ebp - 0x40]
mov eax, dword [edx]
and eax, 0x80000000
test eax, eax
je 0x406df9
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 0x406e1b
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 0x406dc5
mov edx, dword [ebp - 0x38]
add edx, 0x14
mov dword [ebp - 0x38], edx
jmp 0x406d6e
push 0
mov eax, dword [ebp - 0x10]
push eax
call fcn.00406946
add esp, 8
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
je 0x406fc7
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 0x406e7d
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 0x406fc7
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 0x406ec5
mov ecx, dword [ebp - 4]
mov edx, dword [ebp - 0x58]
add edx, dword [ecx + 4]
cmp dword [ebp - 0x5c], edx
jb 0x406ec7
jmp 0x406e74
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 0x406f00
cmp dword [ebp - 0x134], 0xc8
jb 0x406f05
jmp 0x406e74
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.00406fe8
add esp, 0x10
mov dword [ebp - 0x128], eax
cmp dword [ebp - 0x128], 0
jne 0x406f5e
xor eax, eax
jmp 0x406fe4
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 0x406f94
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 0x406fc2
mov edx, dword [ebp - 0x5c]
sub edx, dword [ebp - 0x14]
mov eax, dword [ebp - 0x138]
mov dword [eax], edx
jmp 0x406e74
mov ecx, dword [ebp - 0x10]
cmp dword [ecx + 0x28], 0
je 0x406fdf
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