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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x144
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 0x407984
xor eax, eax
jmp 0x407e41
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 0x4079aa
xor eax, eax
jmp 0x407e41
mov eax, dword [ebp - 0x10]
xor ecx, ecx
mov cx, word [eax + 0x14]
cmp ecx, 0xe0
je 0x4079c2
xor eax, eax
jmp 0x407e41
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 0x407a0c
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 0x407a0c
xor eax, eax
jmp 0x407e41
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 0x407a40
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 0x407a90
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 0x407a37
push 5
mov eax, dword [ebp - 0x10]
push eax
call fcn.00407761
add esp, 8
mov dword [ebp - 4], eax
mov ecx, dword [ebp - 0x10]
mov edx, dword [ebp - 0x14]
cmp edx, dword [ecx + 0x34]
je 0x407ba5
cmp dword [ebp - 4], 0
je 0x407ba5
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 0x407ba5
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 0x407b9a
mov edx, dword [ebp - 0x28]
xor eax, eax
mov ax, word [edx]
and eax, 0xfff
mov word [ebp - 0x34], ax
mov ecx, dword [ebp - 0x28]
xor edx, edx
mov dx, word [ecx]
sar edx, 0xc
mov dword [ebp - 0x30], edx
mov eax, dword [ebp - 0x30]
mov dword [ebp - 0x144], eax
cmp dword [ebp - 0x144], 3
je 0x407b46
cmp dword [ebp - 0x144], 0xa
je 0x407b6a
jmp 0x407b8c
mov ecx, dword [ebp - 0x20]
mov edx, dword [ebp - 0x14]
add edx, dword [ecx]
mov eax, dword [ebp - 0x34]
and eax, 0xffff
add edx, eax
mov dword [ebp - 0x38], edx
mov ecx, dword [ebp - 0x38]
mov edx, dword [ecx]
add edx, dword [ebp - 0x24]
mov eax, dword [ebp - 0x38]
mov dword [eax], edx
jmp 0x407b8c
mov ecx, dword [ebp - 0x20]
mov edx, dword [ebp - 0x14]
add edx, dword [ecx]
mov eax, dword [ebp - 0x34]
and eax, 0xffff
add edx, eax
mov dword [ebp - 0x3c], edx
mov ecx, dword [ebp - 0x3c]
mov edx, dword [ecx]
add edx, dword [ebp - 0x24]
mov eax, dword [ebp - 0x3c]
mov dword [eax], edx
mov ecx, dword [ebp - 0x28]
add ecx, 2
mov dword [ebp - 0x28], ecx
jmp 0x407afe
mov edx, dword [ebp - 0x2c]
mov dword [ebp - 0x20], edx
jmp 0x407add
push 1
mov eax, dword [ebp - 0x10]
push eax
call fcn.00407761
add esp, 8
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
je 0x407ca2
mov ecx, dword [ebp - 4]
mov edx, dword [ebp - 0x14]
add edx, dword [ecx]
mov dword [ebp - 0x40], edx
mov eax, dword [ebp - 0x40]
cmp dword [eax], 0
je 0x407ca2
mov ecx, dword [ebp - 0x40]
mov edx, dword [ebp - 0x14]
add edx, dword [ecx + 0xc]
mov dword [ebp - 0x44], edx
mov eax, dword [ebp - 0x40]
mov ecx, dword [ebp - 0x14]
add ecx, dword [eax]
mov dword [ebp - 0x48], ecx
mov edx, dword [ebp - 0x40]
mov eax, dword [ebp - 0x14]
add eax, dword [edx + 0x10]
mov dword [ebp - 0x50], eax
mov ecx, dword [ebp + 0x10]
push ecx
mov edx, dword [ebp - 0x44]
push edx
mov eax, dword [ebp + 0xc]
push eax
mov ecx, dword [ebp + 8]
push ecx
call fcn.00407e45
add esp, 0x10
mov dword [ebp - 0x4c], eax
cmp dword [ebp - 0x4c], 0
jne 0x407c22
xor eax, eax
jmp 0x407e41
mov edx, dword [ebp - 0x48]
cmp dword [edx], 0
je 0x407c94
mov eax, dword [ebp - 0x48]
mov ecx, dword [eax]
and ecx, 0x80000000
test ecx, ecx
je 0x407c56
mov edx, dword [ebp - 0x48]
mov eax, dword [edx]
and eax, 0xffff
push eax
mov ecx, dword [ebp - 0x4c]
mov edx, dword [ecx + 8]
push edx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0x54], eax
jmp 0x407c78
mov eax, dword [ebp - 0x48]
mov ecx, dword [ebp - 0x14]
add ecx, dword [eax]
mov dword [ebp - 0x58], ecx
mov edx, dword [ebp - 0x58]
add edx, 2
push edx
mov eax, dword [ebp - 0x4c]
mov ecx, dword [eax + 8]
push ecx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0x54], eax
mov edx, dword [ebp - 0x50]
mov eax, dword [ebp - 0x54]
mov dword [edx], eax
mov ecx, dword [ebp - 0x50]
add ecx, 4
mov dword [ebp - 0x50], ecx
mov edx, dword [ebp - 0x48]
add edx, 4
mov dword [ebp - 0x48], edx
jmp 0x407c22
mov eax, dword [ebp - 0x40]
add eax, 0x14
mov dword [ebp - 0x40], eax
jmp 0x407bcb
push 0
mov ecx, dword [ebp - 0x10]
push ecx
call fcn.00407761
add esp, 8
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
je 0x407e24
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 0x14]
add eax, dword [edx]
mov dword [ebp - 0x60], eax
mov dword [ebp - 0x5c], 0
jmp 0x407cda
mov ecx, dword [ebp - 0x5c]
add ecx, 1
mov dword [ebp - 0x5c], ecx
mov edx, dword [ebp - 0x60]
mov eax, dword [ebp - 0x5c]
cmp eax, dword [edx + 0x14]
jae 0x407e24
mov ecx, dword [ebp - 0x60]
mov edx, dword [ebp - 0x14]
add edx, dword [ecx + 0x1c]
mov eax, dword [ebp - 0x5c]
lea ecx, [edx + eax*4]
mov dword [ebp - 0x140], ecx
mov edx, dword [ebp - 0x140]
mov eax, dword [ebp - 0x14]
add eax, dword [edx]
mov dword [ebp - 0x64], eax
mov ecx, dword [ebp - 0x64]
cmp ecx, dword [ebp - 0x60]
jb 0x407d22
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 0x60]
add eax, dword [edx + 4]
cmp dword [ebp - 0x64], eax
jb 0x407d24
jmp 0x407cd1
push 0x2e
mov ecx, dword [ebp - 0x64]
push ecx
call dword [sym.imp.MSVCRT.dll_strchr]
add esp, 8
mov dword [ebp - 0x138], eax
mov edx, dword [ebp - 0x138]
sub edx, dword [ebp - 0x64]
mov dword [ebp - 0x13c], edx
cmp dword [ebp - 0x138], 0
je 0x407d5d
cmp dword [ebp - 0x13c], 0xc8
jb 0x407d62
jmp 0x407cd1
mov eax, dword [ebp - 0x13c]
push eax
mov ecx, dword [ebp - 0x64]
push ecx
lea edx, [ebp - 0x12c]
push edx
call sub.MSVCRT.dll_memcpy
add esp, 0xc
mov eax, dword [ebp - 0x13c]
mov byte [ebp + eax - 0x12c], 0
mov ecx, dword [ebp + 0x10]
push ecx
lea edx, [ebp - 0x12c]
push edx
mov eax, dword [ebp + 0xc]
push eax
mov ecx, dword [ebp + 8]
push ecx
call fcn.00407e45
add esp, 0x10
mov dword [ebp - 0x130], eax
cmp dword [ebp - 0x130], 0
jne 0x407dbb
xor eax, eax
jmp 0x407e41
mov edx, dword [ebp - 0x138]
add edx, 1
mov dword [ebp - 0x134], edx
mov eax, dword [ebp - 0x134]
movsx ecx, byte [eax]
cmp ecx, 0x23
jne 0x407df1
mov edx, dword [ebp - 0x134]
add edx, 1
push edx
call dword [sym.imp.MSVCRT.dll_atoi]
add esp, 4
mov dword [ebp - 0x134], eax
mov eax, dword [ebp - 0x134]
push eax
mov ecx, dword [ebp - 0x130]
mov edx, dword [ecx + 8]
push edx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0x64], eax
cmp dword [ebp - 0x64], 0
je 0x407e1f
mov eax, dword [ebp - 0x64]
sub eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x140]
mov dword [ecx], eax
jmp 0x407cd1
mov edx, dword [ebp - 0x10]
cmp dword [edx + 0x28], 0
je 0x407e3c
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebp - 0x14]
add ecx, dword [eax + 0x28]
mov edx, dword [ebp + 0xc]
mov dword [edx + 0x14], ecx
mov eax, 1
mov esp, ebp
pop ebp
ret