Function at 0x424c7a
Capabilities:
Enumerate pe sections
Parse pe header
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
and esp, 0xfffffff0
sub esp, 0x30
mov esi, esp
cmp byte [0x431090], 0
jne 0x424b5b
mov byte [0x431090], 1
mov edx, dword [0x428040]
movzx ecx, word [edx]
xor eax, eax
cmp ecx, 0x5a4d
jne 0x424a73
mov ecx, dword [edx + 0x3c]
cmp dword [edx + ecx], 0x4550
jne 0x424a73
movzx edx, word [edx + ecx + 0x18]
cmp edx, 0x10b
mov edx, dword [0x428040]
jne 0x424a73
movzx eax, word [edx + ecx + 6]
shl eax, 2
lea eax, [eax + eax*4]
add eax, 3
and eax, 0xfffffffc
call fcn.00401589
mov eax, esp
and eax, 0xfffffff0
mov esp, eax
mov dword [0x4310c8], eax
mov dword [0x4310a8], 0
mov ebx, 0x42f568
mov eax, 0x42f568
sub eax, ebx
cmp eax, 7
jle 0x424b5b
cmp eax, 0xc
jl 0x424ad4
cmp dword [0x42f568], 0
jne 0x424ae3
cmp dword [0x42f56c], 0
jne 0x424ae3
cmp dword [0x42f570], 0
mov eax, 0x42f568
mov ebx, 0x42f574
cmovne ebx, eax
cmp dword [ebx], 0
jne 0x424ae3
cmp dword [ebx + 4], 0
je 0x424b63
cmp ebx, 0x42f568
jae 0x424b18
lea edi, [esi + 0x14]
mov eax, dword [ebx]
mov ecx, dword [ebx + 4]
add eax, dword [ecx + edx]
add ecx, edx
mov dword [esi + 0x14], eax
mov edx, edi
push 4
call 0x424c7a
mov edx, dword [0x428040]
add esp, 4
add ebx, 8
cmp ebx, 0x42f568
jb 0x424aee
mov eax, dword [0x4310a8]
test eax, eax
jle 0x424b5b
xor edi, edi
mov ebx, 8
mov ecx, dword [0x4310c8]
mov edx, dword [ecx + ebx - 8]
test edx, edx
je 0x424b53
lea eax, [esi + 0x1c]
push eax
push edx
push dword [ecx + ebx]
push dword [ecx + ebx - 4]
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
mov ecx, dword [0x4310c8]
mov eax, dword [0x4310a8]
inc edi
add ebx, 0x14
cmp edi, eax
jl 0x424b2e
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret
mov eax, dword [ebx + 8]
cmp eax, 1
jne 0x424c6f
add ebx, 0xc
cmp ebx, 0x42f568
jae 0x424b18
mov eax, dword [ebx + 4]
add eax, edx
mov edi, dword [ebx]
mov ecx, dword [ebx + 8]
mov dword [esi + 0x10], edi
mov edx, dword [edi + edx]
mov dword [esi + 8], edx
cmp cl, 0x20
mov dword [esi + 0xc], ecx
movzx edx, cl
mov dword [esi + 4], eax
je 0x424bb6
cmp edx, 0x10
je 0x424bba
cmp edx, 8
jne 0x424c64
movzx eax, byte [eax]
lea edi, [eax - 0x100]
test al, al
jmp 0x424bc6
mov edi, dword [eax]
jmp 0x424bc9
movzx eax, word [eax]
lea edi, [eax - 0x10000]
test ax, ax
cmovns edi, eax
mov eax, dword [esi + 0x10]
add eax, dword [0x428040]
sub edi, eax
add edi, dword [esi + 8]
mov dword [esi + 0x18], edi
cmp edx, 0x1f
ja 0x424c04
xor eax, eax
dec eax
mov ecx, edx
shl eax, cl
test dl, 0x20
mov ecx, 0
cmovne eax, ecx
not eax
cmp edi, eax
jg 0x424c52
mov ecx, edx
dec cl
xor eax, eax
dec eax
shl eax, cl
cmp edi, eax
jl 0x424c52
mov eax, dword [esi + 0xc]
cmp al, 8
mov edi, 1
je 0x424c29
movzx eax, al
cmp eax, 0x20
je 0x424c24
cmp eax, 0x10
jne 0x424c38
mov edi, 2
jmp 0x424c29
mov edi, 4
mov ecx, dword [esi + 4]
lea edx, [esi + 0x18]
push edi
call 0x424c7a
add esp, 4
add ebx, 0xc
cmp ebx, 0x42f568
mov edx, dword [0x428040]
jb 0x424b7a
jmp 0x424b18
push edi
push dword [esi + 8]
push dword [esi + 4]
push edx
push str._d_bit_pseudo_relocation_at__p_out_of_range__targeting__p__yielding_the_value__p._n
call 0x424dec
push edx
push str.__Unknown_pseudo_relocation_bit_size__d._n
call 0x424dec
push eax
push str.__Unknown_pseudo_relocation_protocol_version__d._n
call 0x424dec
push ebp
push ebx
push edi
push esi
sub esp, 0x20
mov ebp, edx
mov esi, ecx
mov eax, dword [0x4310a8]
test eax, eax
jle 0x424cb8
mov ecx, dword [0x4310c8]
add ecx, 0x10
mov edx, eax
mov edi, dword [ecx - 4]
cmp edi, esi
ja 0x424cad
mov ebx, dword [ecx]
add edi, dword [ebx + 8]
cmp edi, esi
ja 0x424db2
add ecx, 0x14
dec edx
jne 0x424c99
mov dword [esp], ebp
jmp 0x424cbd
mov dword [esp], ebp
xor eax, eax
mov ebx, dword [0x428040]
movzx ecx, word [ebx]
cmp ecx, 0x5a4d
jne 0x424d16
mov ecx, dword [ebx + 0x3c]
cmp dword [ebx + ecx], 0x4550
jne 0x424d16
add ebx, ecx
movzx ecx, word [ebx + 0x18]
cmp ecx, 0x10b
jne 0x424d16
movzx ecx, word [ebx + 6]
test ecx, ecx
je 0x424d16
mov edx, esi
sub edx, dword [0x428040]
movzx edi, word [ebx + 0x14]
lea ebp, [ebx + edi + 0x18]
mov edi, dword [ebp + 0xc]
cmp edi, edx
ja 0x424d10
mov ebx, dword [ebp + 8]
add ebx, edi
cmp ebx, edx
ja 0x424d21
add ebp, 0x28
dec ecx
jne 0x424d00
push esi
push str.Address__p_has_no_image_section
call 0x424dec
mov ecx, dword [0x4310c8]
lea ebx, [eax + eax*4]
mov dword [ecx + ebx*4 + 0x10], ebp
mov dword [ecx + ebx*4], 0
add edi, dword [0x428040]
mov dword [ecx + ebx*4 + 0xc], edi
lea eax, [esp + 4]
push 0x1c
push eax
push edi
call dword [sym.imp.KERNEL32.dll_VirtualQuery]
test eax, eax
je 0x424dc5
mov eax, dword [esp + 0x18]
cmp eax, 7
jle 0x424d70
cmp eax, 8
mov ebp, dword [esp]
je 0x424dac
cmp eax, 0x40
je 0x424dac
cmp eax, 0x80
je 0x424dac
jmp 0x424d82
mov ecx, 4
cmp eax, 2
mov ebp, dword [esp]
je 0x424d87
cmp eax, 4
je 0x424dac
mov ecx, 0x40
mov eax, dword [esp + 4]
mov edx, dword [0x4310c8]
lea edx, [edx + ebx*4]
mov dword [edx + 4], eax
mov edi, dword [esp + 0x10]
mov dword [edx + 8], edi
push edx
push ecx
push edi
push eax
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
je 0x424ddb
inc dword [0x4310a8]
push dword [esp + 0x34]
push ebp
push esi
call fcn.0040307b
add esp, 0x2c
pop esi
pop edi
pop ebx
pop ebp
ret
mov eax, dword [0x4310c8]
push dword [eax + ebx*4 + 0xc]
push dword [ebp + 8]
push str.__VirtualQuery_failed_for__d_bytes_at_address__p
call 0x424dec
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.__VirtualProtect_failed_with_code_0x_x
call 0x424dec
push edi
push esi
push eax
mov esi, dword [esp + 0x10]
lea eax, [esp + 0x14]
mov dword [esp], eax
mov edi, dword [sym.imp.msvcrt.dll__iob]
mov eax, dword [edi]
add eax, 0x40
push eax
push 1
push 0x1b
push str.Mingw_w64_runtime_failure:_n
call sub.msvcrt.dll_fwrite
add esp, 0x10
mov eax, dword [edi]
add eax, 0x40
push dword [esp]
push esi
push eax
call sub.msvcrt.dll_vfprintf
add esp, 0xc
call sub.msvcrt.dll_abort
push ebx
mov eax, dword [esp + 8]
mov eax, dword [eax]
mov eax, dword [eax]
lea ecx, [eax + 0x3fffff73]
cmp ecx, 9
ja case.default.0x424e44
mov bl, 1
jmp dword [ecx*4 + 0x42f540]
xor ebx, ebx
push 0
push 8
call sub.msvcrt.dll_signal
add esp, 8
test eax, eax
je case.0x424e44.1073741678
cmp eax, 1
jne 0x424ea2
push 1
push 8
call sub.msvcrt.dll_signal
add esp, 8
xor eax, eax
dec eax
test bl, bl
jne 0x424ee7
fninit
jmp 0x424ee7
cmp eax, 0xc000001d
je case.0x424e44.1073741674
cmp eax, 0xc0000005
jne case.0x424e44.1073741678
push 0
push 0xb
call sub.msvcrt.dll_signal
add esp, 8
test eax, eax
je case.0x424e44.1073741678
cmp eax, 1
jne 0x424edd
push 1
push 0xb
jmp 0x424ebf
push 8
jmp 0x424edf
push 0
push 4
call sub.msvcrt.dll_signal
add esp, 8
test eax, eax
je case.0x424e44.1073741678
cmp eax, 1
jne 0x424ed9
push 1
push 4
call sub.msvcrt.dll_signal
add esp, 8
jmp 0x424ee4
mov eax, dword [0x431058]
test eax, eax
je 0x424ed5
pop ebx
jmp eax
xor eax, eax
jmp 0x424ee7
push 4
jmp 0x424edf
push 0xb
call eax
add esp, 4
xor eax, eax
dec eax
pop ebx
ret 4