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

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x7c
mov ebp, dword [esp + 0xac]
cmp dword [esp + 0x94], 0x3f
jbe 0x4056f4
mov eax, dword [esp + 0x90]
cmp word [eax], 0x5a4d
je 0x4056db
mov dword [esp], 0xc1
call dword [sym.imp.KERNEL32.dll_SetLastError]
push eax
xor ebx, ebx
jmp 0x405dea
mov eax, dword [esp + 0x90]
mov esi, dword [eax + 0x3c]
lea eax, [esi + 0xf8]
cmp dword [esp + 0x94], eax
jae 0x4056fd
mov dword [esp], 0xd
jmp 0x4056cd
add esi, dword [esp + 0x90]
cmp dword [esi], 0x4550
jne 0x4056c6
cmp word [esi + 4], 0x14c
jne 0x4056c6
mov eax, dword [esi + 0x38]
mov dword [esp + 0x24], eax
test al, 1
jne 0x4056c6
movzx eax, word [esi + 0x14]
lea eax, [esi + eax + 0x18]
movzx edi, word [esi + 6]
mov dword [esp + 0x28], edi
xor edi, edi
xor edx, edx
cmp edx, dword [esp + 0x28]
jae 0x405758
mov ebx, dword [eax + 0xc]
mov ecx, dword [eax + 0x10]
add ecx, ebx
cmp dword [eax + 0x10], 0
jne 0x40574d
mov ecx, dword [esp + 0x24]
add ecx, ebx
cmp edi, ecx
cmovb edi, ecx
inc edx
add eax, 0x28
jmp 0x405733
lea eax, [esp + 0x4c]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_GetNativeSystemInfo]
push eax
mov eax, dword [esp + 0x50]
lea edx, [eax - 1]
neg eax
mov ebx, dword [esi + 0x50]
add ebx, edx
and ebx, eax
add edx, edi
and eax, edx
cmp ebx, eax
jne 0x4056c6
mov dword [esp + 0x10], ebp
mov dword [esp + 0xc], 4
mov dword [esp + 8], 0x3000
mov dword [esp + 4], ebx
mov eax, dword [esi + 0x34]
mov dword [esp], eax
call dword [esp + 0x98]
mov dword [esp + 0x24], eax
test eax, eax
jne 0x4057e9
mov dword [esp + 0x10], ebp
mov dword [esp + 0xc], 4
mov dword [esp + 8], 0x3000
mov dword [esp + 4], ebx
mov dword [esp], 0
call dword [esp + 0x98]
mov dword [esp + 0x24], eax
test eax, eax
jne 0x4057e9
mov dword [esp], 0xe
jmp 0x4056cd
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov dword [esp + 8], 0x40
mov dword [esp + 4], 8
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
sub esp, 0xc
mov ebx, eax
test eax, eax
jne 0x405845
mov dword [esp + 0xc], ebp
mov dword [esp + 8], 0x8000
mov dword [esp + 4], 0
mov eax, dword [esp + 0x24]
mov dword [esp], eax
call dword [esp + 0x9c]
mov dword [esp], 0xe
call dword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x405ad7
mov eax, dword [esp + 0x24]
mov dword [ebx + 4], eax
mov ax, word [esi + 0x16]
shr ax, 0xd
and eax, 1
mov dword [ebx + 0x14], eax
mov eax, dword [esp + 0x98]
mov dword [ebx + 0x1c], eax
mov eax, dword [esp + 0x9c]
mov dword [ebx + 0x20], eax
mov eax, dword [esp + 0xa0]
mov dword [ebx + 0x24], eax
mov eax, dword [esp + 0xa4]
mov dword [ebx + 0x28], eax
mov eax, dword [esp + 0xa8]
mov dword [ebx + 0x2c], eax
mov dword [ebx + 0x34], ebp
mov eax, dword [esp + 0x50]
mov dword [ebx + 0x3c], eax
mov eax, dword [esi + 0x54]
cmp dword [esp + 0x94], eax
jae 0x4058ae
mov dword [esp], 0xd
jmp 0x405a94
mov dword [esp + 0x10], ebp
mov dword [esp + 0xc], 4
mov dword [esp + 8], 0x1000
mov dword [esp + 4], eax
mov eax, dword [esp + 0x24]
mov dword [esp], eax
call dword [esp + 0x98]
mov edi, eax
mov eax, dword [esi + 0x54]
mov dword [esp + 8], eax
mov eax, dword [esp + 0x90]
mov dword [esp + 4], eax
mov dword [esp], edi
call sub.msvcrt.dll_memcpy
mov edx, dword [esp + 0x90]
mov eax, dword [edx + 0x3c]
add eax, edi
mov dword [ebx], eax
mov edi, dword [esp + 0x24]
mov dword [eax + 0x34], edi
mov edi, dword [ebx + 4]
movzx edx, word [eax + 0x14]
lea ebp, [eax + edx + 0x18]
mov dword [esp + 0x28], 0
mov eax, dword [ebx]
movzx ecx, word [eax + 6]
cmp dword [esp + 0x28], ecx
jge 0x405b5a
mov eax, dword [ebp + 0x10]
test eax, eax
jne 0x40598e
mov ecx, dword [esi + 0x38]
test ecx, ecx
jle 0x4059fb
mov eax, dword [ebx + 0x34]
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 4
mov dword [esp + 8], 0x1000
mov dword [esp + 4], ecx
mov dword [esp + 0x2c], ecx
mov eax, dword [ebp + 0xc]
add eax, edi
mov dword [esp], eax
call dword [ebx + 0x1c]
test eax, eax
je 0x405b4d
mov eax, dword [ebp + 0xc]
add eax, edi
mov dword [ebp + 8], eax
mov ecx, dword [esp + 0x2c]
mov dword [esp + 8], ecx
mov dword [esp + 4], 0
mov dword [esp], eax
call sub.msvcrt.dll_memset
jmp 0x4059fb
mov ecx, dword [ebp + 0x14]
add ecx, eax
cmp dword [esp + 0x94], ecx
jb 0x4058a2
mov ecx, dword [ebx + 0x34]
mov dword [esp + 0x10], ecx
mov dword [esp + 0xc], 4
mov dword [esp + 8], 0x1000
mov dword [esp + 4], eax
mov eax, dword [ebp + 0xc]
add eax, edi
mov dword [esp], eax
call dword [ebx + 0x1c]
test eax, eax
je 0x405b4d
mov ecx, dword [ebp + 0xc]
add ecx, edi
mov eax, dword [ebp + 0x10]
mov dword [esp + 8], eax
mov eax, dword [esp + 0x90]
add eax, dword [ebp + 0x14]
mov dword [esp + 4], eax
mov dword [esp], ecx
mov dword [esp + 0x2c], ecx
call sub.msvcrt.dll_memcpy
mov ecx, dword [esp + 0x2c]
mov dword [ebp + 8], ecx
inc dword [esp + 0x28]
add ebp, 0x28
jmp 0x405918
mov edx, 1
mov dword [ebx + 0x18], edx
mov dword [esp + 0x30], 0
mov dword [esp + 0x34], 0
lea ecx, [esp + 0x34]
lea edx, [esp + 0x30]
mov eax, ebx
call fcn.00403964
test eax, eax
jne 0x405b4d
mov eax, dword [ebx]
cmp dword [eax + 0x84], 0
je 0x405add
mov edi, dword [ebx + 4]
mov dword [esp + 0x28], edi
mov esi, dword [eax + 0x80]
add esi, edi
mov dword [esp + 4], 0x14
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_IsBadReadPtr]
push ecx
push ecx
test eax, eax
jne 0x405add
mov eax, dword [esi + 0xc]
test eax, eax
je 0x405add
mov edx, dword [ebx + 0x34]
mov dword [esp + 4], edx
add eax, dword [esp + 0x28]
mov dword [esp], eax
call dword [ebx + 0x24]
mov edi, eax
test eax, eax
jne 0x405bd4
mov dword [esp], 0x7e
call dword [sym.imp.KERNEL32.dll_SetLastError]
push esi
jmp 0x405b4d
mov dword [ebx + 0x10], 1
mov esi, dword [esp + 0x30]
test esi, esi
je 0x405dea
mov eax, dword [esp + 0x34]
test eax, eax
je 0x405ace
mov dword [esp + 4], eax
mov dword [esp], 0
call dword [sym.imp.KERNEL32.dll_DeactivateActCtx]
push edx
push edx
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_ReleaseActCtx]
push eax
jmp 0x405dea
mov edx, dword [ebx]
movzx eax, word [edx + 0x14]
lea esi, [edx + eax + 0x18]
mov ecx, dword [esi + 8]
mov dword [esp + 0x38], ecx
mov eax, dword [ebx + 0x3c]
neg eax
and eax, ecx
mov dword [esp + 0x3c], eax
mov eax, dword [esi + 0x10]
mov ecx, dword [esi + 0x24]
test eax, eax
je 0x405c7a
mov dword [esp + 0x40], eax
mov dword [esp + 0x44], ecx
mov dword [esp + 0x48], 0
add esi, 0x28
mov dword [esp + 0x2c], 1
mov eax, dword [ebx]
movzx edx, word [eax + 6]
cmp dword [esp + 0x2c], edx
jl 0x405c98
mov dword [esp + 0x48], 1
lea edx, [esp + 0x38]
mov eax, ebx
call fcn.004046cc
test eax, eax
jne 0x405d3c
mov dword [esp], ebx
call fcn.00405468
jmp 0x4056d4
mov edx, dword [eax + 0x34]
sub edx, dword [esi + 0x34]
mov dword [esp + 0x2c], edx
je 0x405bc8
xor edx, edx
cmp dword [eax + 0xa4], 0
je 0x405a0c
mov ecx, dword [ebx + 4]
mov edx, dword [eax + 0xa0]
add edx, ecx
mov eax, dword [edx]
mov dword [esp + 0x28], eax
test eax, eax
je 0x405a07
lea edi, [edx + 8]
xor esi, esi
mov ebp, dword [edx + 4]
lea eax, [ebp - 8]
shr eax, 1
cmp esi, eax
jae 0x405bc4
mov ax, word [edi]
mov ebp, eax
shr bp, 0xc
cmp bp, 3
jne 0x405bbe
and eax, 0xfff
add eax, dword [esp + 0x28]
mov ebp, dword [esp + 0x2c]
add dword [ecx + eax], ebp
inc esi
add edi, 2
jmp 0x405b93
add edx, ebp
jmp 0x405b80
mov dword [ebx + 0x18], 1
jmp 0x405a0f
mov eax, dword [ebx + 0xc]
lea eax, [eax*4 + 4]
mov dword [esp + 4], eax
mov eax, dword [ebx + 8]
mov dword [esp], eax
call sub.msvcrt.dll_realloc
test eax, eax
jne 0x405c0a
mov eax, dword [ebx + 0x34]
mov dword [esp + 4], eax
mov dword [esp], edi
call dword [ebx + 0x2c]
mov dword [esp], 0xe
jmp 0x405a94
mov dword [ebx + 8], eax
mov edx, dword [ebx + 0xc]
lea ecx, [edx + 1]
mov dword [ebx + 0xc], ecx
mov dword [eax + edx*4], edi
mov eax, dword [esi]
mov ebp, dword [esp + 0x28]
add ebp, dword [esi + 0x10]
mov dword [esp + 0x2c], ebp
test eax, eax
je 0x405c61
add eax, dword [esp + 0x28]
mov dword [esp + 0x2c], eax
jmp 0x405c61
mov edx, dword [ebx + 0x28]
mov ecx, dword [ebx + 0x34]
mov dword [esp + 8], ecx
jns 0x405c70
movzx eax, ax
mov dword [esp + 4], eax
mov dword [esp], edi
call edx
mov dword [ebp], eax
cmp dword [ebp], 0
je 0x405dc9
add dword [esp + 0x2c], 4
add ebp, 4
mov eax, dword [esp + 0x2c]
mov eax, dword [eax]
test eax, eax
jne 0x405c34
jmp 0x405de2
mov ecx, dword [esp + 0x28]
lea eax, [ecx + eax + 2]
jmp 0x405c43
test cl, 0x40
je 0x405c87
mov eax, dword [edx + 0x20]
jmp 0x405b07
test cl, 0x80
je 0x405b07
mov eax, dword [edx + 0x24]
jmp 0x405b07
mov edi, dword [esi + 8]
mov dword [esp + 0x28], edi
mov edi, dword [ebx + 0x3c]
neg edi
and edi, dword [esp + 0x28]
mov ebp, dword [esi + 0x10]
test ebp, ebp
jne 0x405cc4
mov edx, dword [esi + 0x24]
test dl, 0x40
je 0x405cbc
mov ebp, dword [eax + 0x20]
jmp 0x405cc4
and dl, 0x80
je 0x405cc4
mov ebp, dword [eax + 0x24]
mov edx, dword [esp + 0x38]
cmp edi, dword [esp + 0x3c]
je 0x405cd8
mov eax, dword [esp + 0x40]
add eax, edx
cmp edi, eax
jae 0x405d06
mov edi, dword [esi + 0x24]
mov ecx, dword [esp + 0x44]
mov eax, edi
or eax, ecx
bt edi, 0x19
jae 0x405cef
bt ecx, 0x19
jb 0x405cf4
and eax, 0xfdffffff
mov dword [esp + 0x44], eax
mov eax, dword [esp + 0x28]
sub eax, edx
add ebp, eax
mov dword [esp + 0x40], ebp
jmp 0x405d30
lea edx, [esp + 0x38]
mov eax, ebx
call fcn.004046cc
test eax, eax
je 0x405b4d
mov eax, dword [esp + 0x28]
mov dword [esp + 0x38], eax
mov dword [esp + 0x3c], edi
mov dword [esp + 0x40], ebp
mov eax, dword [esi + 0x24]
mov dword [esp + 0x44], eax
inc dword [esp + 0x2c]
add esi, 0x28
jmp 0x405b22
mov eax, dword [ebx]
mov eax, dword [eax + 0xc0]
test eax, eax
jne 0x405d53
mov eax, dword [ebx]
mov eax, dword [eax + 0x28]
test eax, eax
jne 0x405d81
jmp 0x405dc0
mov edi, dword [ebx + 4]
mov esi, dword [edi + eax + 0xc]
test esi, esi
je 0x405d48
mov eax, dword [esi]
test eax, eax
je 0x405d48
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov dword [esp], edi
call eax
sub esp, 0xc
add esi, 4
jmp 0x405d5e
add eax, dword [esp + 0x24]
cmp dword [ebx + 0x14], 0
je 0x405dbb
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov esi, dword [esp + 0x24]
mov dword [esp], esi
call eax
sub esp, 0xc
test eax, eax
jne 0x405aa0
mov dword [esp], 0x45a
jmp 0x405a94
mov dword [ebx + 0x38], eax
jmp 0x405dea
mov dword [ebx + 0x38], 0
jmp 0x405dea
mov eax, dword [ebx + 0x34]
mov dword [esp + 4], eax
mov dword [esp], edi
call dword [ebx + 0x2c]
mov dword [esp], 0x7f
jmp 0x405a94
add esi, 0x14
jmp 0x405a54
mov eax, ebx
add esp, 0x7c
pop ebx
pop esi
pop edi
pop ebp
ret