Function at 0x40507a
Capabilities:
Get file size
Parse pe header
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
mov eax, dword [0x44f124]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push 4
push 0x3000
push dword [0x44f0c4]
xor ebx, ebx
mov dword [ebp - 0x18], eax
push ebx
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov dword [0x4515d8], eax
test eax, eax
jne 0x4050c9
push str.VirtualAlloc_Error_DetermineArmSections
call fcn.0040d967
push ebx
call fcn.0040d967
pop ecx
pop ecx
xor eax, eax
jmp 0x405b7f
push esi
push edi
push 0x5c
mov esi, 0x44f850
push esi
call fcn.00414dac
pop ecx
pop ecx
mov ecx, eax
mov edi, 0x45d778
mov dword [0x44f84c], ecx
test ecx, ecx
je 0x4050fe
inc ecx
mov edx, edi
mov dword [0x44f84c], ecx
mov al, byte [ecx]
inc ecx
mov byte [edx], al
inc edx
test al, al
jne 0x4050f4
push ebx
push 0x80
push 3
push ebx
xor ebx, ebx
inc ebx
push ebx
push SysReAllocStringLen
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [0x44f460], eax
cmp eax, 0xffffffff
jne 0x40513b
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push edi
push str.CreateFile_error__s__d
call fcn.0040d967
add esp, 0xc
jmp 0x40521e
xor esi, esi
push esi
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
push esi
push 0x451570
push dword [0x44f0c4]
mov dword [0x45157c], eax
push dword [0x4515d8]
push dword [0x44f460]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x405183
push str.VirtualAlloc_Error_CreateDump
call fcn.0040d967
push esi
call fcn.0040d967
pop ecx
pop ecx
jmp 0x40521e
mov edx, dword [0x4515d8]
mov dword [0x45f430], edx
mov dword [0x45f434], edx
mov ecx, dword [edx + 0x3c]
add ecx, 4
add ecx, edx
mov dword [0x45f438], ecx
mov eax, dword [edx + 0x3c]
add eax, 0x18
add eax, edx
mov dword [0x45f43c], eax
mov eax, dword [edx + 0x3c]
add eax, 0xf8
add eax, edx
mov dword [0x45f440], eax
movzx eax, word [ecx + 2]
imul ecx, eax, 0x28
mov eax, dword [edx + 0x3c]
add eax, 0xd0
add ecx, edx
add eax, ecx
mov dword [0x45f444], eax
mov eax, 0x5a4d
cmp word [edx], ax
je 0x4051e8
push str.IMAGE_DOS_SIGNATURE_not_found
jmp 0x4051f9
mov eax, dword [edx + 0x3c]
cmp dword [eax + edx], 0x4550
je 0x405225
push str.IMAGE_NT_SIGNATURE_not_found
call fcn.0040d967
push edi
push 0x445dac
call fcn.0040d967
add esp, 0xc
push dword [0x44f460]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [0x44f460], esi
xor eax, eax
jmp 0x405b7d
mov ecx, 0x5253
cmp word [eax + edx + 0x1a], cx
je 0x40525a
push str.IMAGE_SR_SIGNATURE_not_found
call fcn.0040d967
push edi
push 0x445dac
call fcn.0040d967
push str.Not_an_armadillo_protected_file_
call fcn.0040d967
add esp, 0x10
mov ebx, esi
jmp 0x405b68
xor ecx, ecx
lea edi, [ebp - 0x10]
mov word [eax + edx + 0x1a], cx
mov eax, dword [0x45f438]
mov ecx, dword [0x45f440]
movzx edx, word [eax + 2]
xor eax, eax
stosd dword es:[edi], eax
mov dword [ebp - 0x14], edx
stosd dword es:[edi], eax
stosb byte es:[edi], al
test ecx, ecx
je 0x405b38
mov ebx, dword [sym.imp.ucrtbased.dll_strncmp]
mov dword [0x45db9c], edx
test edx, edx
je 0x4053a5
mov edx, dword [0x45f444]
mov edi, dword [ebp - 0x18]
mov byte [ebp - 8], 0
mov eax, dword [edx]
mov ecx, dword [edx + 4]
mov dword [ebp - 0x10], eax
lea eax, [ebp - 0x10]
push eax
mov dword [ebp - 0xc], ecx
call dword [sym.imp.ucrtbased.dll__strupr]
push 6
mov esi, eax
push str..PDATA
push esi
call ebx
add esp, 0x10
test eax, eax
je 0x405302
push 5
push str.PDATA
push esi
call ebx
add esp, 0xc
test eax, eax
je 0x405302
mov edx, dword [0x45f444]
mov eax, dword [edx + 0x24]
add eax, 0x3fffffc0
cmp eax, 0xffffc0
ja 0x405380
cmp dword [edx + 0x10], 0
jbe 0x405380
jmp 0x405308
mov edx, dword [0x45f444]
cmp dword [0x45f408], 0
jne 0x405380
mov ecx, dword [edx + 0xc]
add ecx, dword [0x45f418]
push 0x451570
push 4
push 0x451554
push ecx
mov dword [0x45f408], ecx
mov eax, dword [edx + 8]
and dword [0x451554], 0
push edi
mov dword [0x45f40c], eax
call dword [sym.imp.KERNEL32.dll_ReadProcessMemory]
test eax, eax
jne 0x405363
push dword [0x45f408]
push str.ReadProcessMemory_Error_DetermineArmSections_address:__p
call fcn.0040d967
push 0
call fcn.0040d967
add esp, 0xc
jmp 0x40537a
cmp dword [0x451554], 0
jne 0x40539c
and dword [0x45f408], 0
and dword [0x45f40c], 0
mov edx, dword [0x45f444]
mov eax, dword [0x45db9c]
sub edx, 0x28
dec eax
mov dword [0x45f444], edx
mov dword [0x45db9c], eax
test eax, eax
jg 0x4052a0
mov ecx, dword [0x45f440]
mov edx, dword [ebp - 0x14]
and dword [0x45db9c], 0
xor eax, eax
cmp eax, edx
jge 0x405b35
xor eax, eax
lea edi, [ebp - 0x10]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosb byte es:[edi], al
mov eax, dword [ecx]
mov ecx, dword [ecx + 4]
mov dword [ebp - 0x10], eax
lea eax, [ebp - 0x10]
push eax
mov dword [ebp - 0xc], ecx
call dword [sym.imp.ucrtbased.dll__strupr]
push 4
mov esi, eax
push str.UPX0
push esi
call ebx
add esp, 0x10
test eax, eax
jne 0x40541c
cmp dword [0x45db9c], eax
jne 0x40541c
cmp dword [0x45f390], eax
jne 0x40541c
mov ecx, dword [0x45f440]
mov eax, dword [ecx + 0xc]
add eax, dword [0x45f418]
mov dword [0x4515ac], eax
mov dword [0x45f390], eax
mov eax, dword [ecx + 8]
mov dword [0x45f394], eax
jmp 0x40552b
push 4
push str.UPX1
push esi
call ebx
xor edi, edi
add esp, 0xc
inc edi
test eax, eax
jne 0x405461
cmp dword [0x45db9c], edi
jne 0x405461
cmp dword [0x45f398], eax
jne 0x405461
mov ecx, dword [0x45f440]
mov eax, dword [ecx + 0xc]
add eax, dword [0x45f418]
mov dword [0x4515ac], eax
mov dword [0x45f398], eax
mov eax, dword [ecx + 8]
mov dword [0x45f39c], eax
push 5
push str..TEXT
push esi
call ebx
add esp, 0xc
test eax, eax
je 0x4054ae
push 5
push str..CODE
push esi
call ebx
add esp, 0xc
test eax, eax
je 0x4054ae
push 4
push str.TEXT
push esi
call ebx
add esp, 0xc
test eax, eax
je 0x4054ae
push 4
push 0x447b94
push esi
call ebx
add esp, 0xc
test eax, eax
je 0x4054ae
cmp dword [0x45db9c], 0
jne 0x4054d1
mov ecx, dword [0x45f440]
mov eax, dword [ecx + 0x24]
cmp eax, 0xe0000020
jb 0x4054c5
cmp eax, 0xe1000000
jbe 0x40552b
add eax, 0x9fffffe0
cmp eax, 0xffffe0
jbe 0x40552b
push 6
push str..ITEXT
push esi
call ebx
add esp, 0xc
test eax, eax
je 0x4054ff
push 5
push str.ITEXT
push esi
call ebx
add esp, 0xc
test eax, eax
je 0x4054ff
cmp dword [0x45db9c], edi
jne 0x405588
mov ecx, dword [0x45f440]
mov eax, dword [ecx + 0x24]
cmp eax, 0xe0000020
jb 0x405516
cmp eax, 0xe1000000
jbe 0x405522
add eax, 0x9fffffe0
cmp eax, 0xffffe0
ja 0x405588
cmp dword [0x45f3a0], 0
jne 0x405552
cmp dword [0x45f3a0], 0
push 1
pop edi
jne 0x4054d1
mov eax, dword [ecx + 0xc]
add eax, dword [0x45f418]
mov dword [0x45f3a0], eax
mov eax, dword [ecx + 8]
mov dword [0x45f3a4], eax
jmp 0x405b19
cmp dword [0x45f3a8], 0
jne 0x405588
cmp dword [0x45db2c], 0
jne 0x405588
cmp dword [0x45f398], 0
jne 0x405588
mov eax, dword [ecx + 0xc]
add eax, dword [0x45f418]
mov dword [0x45f3a8], eax
mov eax, dword [ecx + 8]
mov dword [0x45f3ac], eax
jmp 0x405b19
push 6
push str..RDATA
push esi
call ebx
add esp, 0xc
test eax, eax
je 0x4056f3
push 5
push str.RDATA
push esi
call ebx
add esp, 0xc
test eax, eax
je 0x4056f3
mov ecx, dword [0x45f440]
mov eax, dword [ecx + 0x24]
sub eax, 0x40000040
cmp eax, 0x10ffffc0
jbe 0x4056f9
push 6
push str..TEXT1
push esi
call ebx
add esp, 0xc
test eax, eax
je 0x405731
push 5
push str.TEXT1
push esi
call ebx
add esp, 0xc
test eax, eax
je 0x405731
mov ecx, dword [0x45f440]
mov eax, dword [ecx + 0x24]
cmp eax, 0xe0000020
jb 0x405610
cmp eax, 0xe1000000
jbe 0x405737
add eax, 0x9fffffe0
cmp eax, 0xffffe0
jbe 0x405737
push 6
push str..ADATA
push esi
call ebx
add esp, 0xc
test eax, eax
je 0x40580a
push 5
push str.ADATA
push esi
call ebx
add esp, 0xc
test eax, eax
je 0x40580a
mov ecx, dword [0x45f440]
mov eax, dword [ecx + 0x24]
cmp eax, 0xe0000020
jb 0x405665
cmp eax, 0xe1000000
jbe 0x405810
add eax, 0x9fffffe0
cmp eax, 0xffffe0
jbe 0x405810
push 5
push str..RSRC
push esi
call ebx
add esp, 0xc
test eax, eax
je 0x405b13
push 4
push str.RSRC
push esi
call ebx
add esp, 0xc
test eax, eax
je 0x405b13
push 6
push str..RELOC
push esi
call ebx
add esp, 0xc
test eax, eax
je 0x4056c5
push 5
push str.RELOC
push esi
call ebx
add esp, 0xc
test eax, eax
jne 0x405845
cmp dword [0x45f3d0], 0
jne 0x405845
mov ecx, dword [0x45f440]
mov eax, dword [ecx + 0xc]
add eax, dword [0x45f418]
mov dword [0x45f3d0], eax
mov eax, dword [ecx + 8]
mov dword [0x45f3d4], eax
jmp 0x405b19
mov ecx, dword [0x45f440]
cmp dword [0x45f3bc], 0
jne 0x4055cb
mov eax, dword [ecx + 0xc]
mov dword [0x45f3b8], eax
mov eax, dword [ecx + 0xc]
add eax, dword [0x45f418]
mov dword [0x45f3bc], eax
mov eax, dword [ecx + 8]
mov dword [0x45f3c0], eax
mov eax, dword [ecx + 0x24]
mov dword [0x45f3cc], eax
jmp 0x405b19
mov ecx, dword [0x45f440]
cmp dword [0x45db9c], edi
jle 0x405620
cmp dword [ecx + 0x10], 0x10000
jb 0x405620
cmp dword [0x45f3b0], 0
je 0x4057e9
cmp dword [0x45f3e8], 0
je 0x405620
cmp dword [0x45f3f8], 0
je 0x405620
cmp dword [0x45f408], 0
je 0x405620
push esi
push str.PE_section_name:__s_nThere_appears_to_be_multiple_occurrences_nof_Armadillo_section_names_in_this_application__nCheck_the_PE_file_using_LordPE_or_similar_and_nlook_at_the_PE_section_names_and_or_characteristics._nIf_you_believe_this_message_to_be_a_FALSE_alert__npress_the_Cancel_button_to_resume_normal_processing__notherwise__press_the_OK_button_and_the_appropriate_action_nwill_be_taken_and_processing_will_resume..._n_nNote:_This_message_may_also_appear_for_PE_section_nnames_that_have_been_randomized__nIf_you_have_any_problems_after_pressing_the_Cancel_button__nRerun_and_try_pressing_the_OK_button_to_continue__n
mov esi, 0x45d578
push esi
call fcn.004150c6
add esp, 0xc
push 0x1031
push str.PE_section_names_alert_
push esi
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
mov ecx, dword [0x45f440]
cmp eax, 2
je 0x405b19
xor eax, eax
mov dword [0x45f3b0], eax
mov dword [0x45f3b4], eax
mov dword [0x45db5c], eax
mov dword [0x45f3e8], eax
mov dword [0x45f3ec], eax
mov dword [0x45f3f8], eax
mov dword [0x45f3fc], eax
mov dword [0x45f408], eax
mov dword [0x45f40c], eax
mov eax, dword [ecx + 0xc]
add eax, dword [0x45f418]
mov dword [0x45f3b0], eax
mov eax, dword [ecx + 8]
mov dword [0x45f3b4], eax
mov dword [0x45db5c], edi
jmp 0x405b19
mov ecx, dword [0x45f440]
cmp dword [0x45db5c], 0
je 0x405675
cmp dword [0x45f3e8], 0
jne 0x405675
mov eax, dword [ecx + 0xc]
add eax, dword [0x45f418]
mov dword [0x45f3e8], eax
mov eax, dword [ecx + 8]
mov dword [0x45f3ec], eax
jmp 0x405b19
push 6
push str..DEBUG
push esi
call ebx
add esp, 0xc
test eax, eax
je 0x405b13
push 5
push str.DEBUG
push esi
call ebx
add esp, 0xc
test eax, eax
je 0x405b13
push 4
push str..BSS
push esi
call ebx
add esp, 0xc
test eax, eax
je 0x405891
push 3
push 0x447e90
push esi
call ebx
add esp, 0xc
test eax, eax
jne 0x4058bb
cmp dword [0x45f3d8], 0
jne 0x4058bb
mov ecx, dword [0x45f440]
mov eax, dword [ecx + 0xc]
add eax, dword [0x45f418]
mov dword [0x45f3d8], eax
mov eax, dword [ecx + 8]
mov dword [0x45f3dc], eax
jmp 0x405b19
push 4
push str..TLS
push esi
call ebx
add esp, 0xc
test eax, eax
je 0x405b13
push 3
push 0x447e9c
push esi
call ebx
add esp, 0xc
test eax, eax
je 0x405b13
push 5
push str..DATA
push esi
call ebx
add esp, 0xc
test eax, eax
je 0x4059f8
push 4
push 0x447ea8
push esi
call ebx
add esp, 0xc
test eax, eax
je 0x4059f8
mov ecx, dword [0x45f440]
mov eax, dword [ecx + 0x24]
add eax, 0x3fffffc0
cmp eax, 0xffffc0
ja 0x40592e
cmp dword [ecx + 0x10], 0
ja 0x4059fe
push 6
push str..IDATA
push esi
call ebx
add esp, 0xc
test eax, eax
je 0x405a2c
push 5
push str.IDATA
push esi
call ebx
add esp, 0xc
test eax, eax
je 0x405a2c
mov ecx, dword [0x45f440]
mov edi, 0x3fffffc0
mov eax, dword [ecx + 0x24]
add eax, edi
cmp eax, 0xffffc0
jbe 0x405a37
push 6
push str..DATA1
push esi
call ebx
add esp, 0xc
test eax, eax
je 0x405a79
push 5
push str.DATA1
push esi
call ebx
add esp, 0xc
test eax, eax
je 0x405a79
mov ecx, dword [0x45f440]
mov eax, dword [ecx + 0x24]
add eax, edi
cmp eax, 0xffffc0
jbe 0x405a7f
push 6
push str..PDATA
push esi
call ebx
add esp, 0xc
test eax, eax
je 0x405add
push 5
push str.PDATA
push esi
call ebx
add esp, 0xc
test eax, eax
je 0x405add
mov ecx, dword [0x45f440]
mov eax, dword [ecx + 0x24]
add eax, edi
cmp eax, 0xffffc0
ja 0x405b19
jmp 0x405ae3
mov ecx, dword [0x45f440]
cmp dword [0x45f410], 0
jne 0x40592e
mov eax, dword [ecx + 0xc]
add eax, dword [0x45f418]
mov dword [0x45f410], eax
mov eax, dword [ecx + 8]
mov dword [0x45f414], eax
mov dword [0x45db60], edi
jmp 0x405b19
mov ecx, dword [0x45f440]
mov edi, 0x3fffffc0
cmp dword [ecx + 8], 0x10000
ja 0x405973
cmp dword [0x45db60], 0
je 0x405973
cmp dword [0x45f3e0], 0
jne 0x405973
mov eax, dword [ecx + 0xc]
add eax, dword [0x45f418]
mov dword [0x45f3e0], eax
mov eax, dword [ecx + 8]
mov dword [0x45f3e4], eax
jmp 0x405b19
mov ecx, dword [0x45f440]
cmp dword [ecx + 8], 0x10000
jb 0x4059b3
cmp dword [0x45db5c], 0
je 0x4059b3
cmp dword [0x45db60], 0
je 0x4059b3
mov edx, dword [ebp - 0x14]
lea eax, [edx - 1]
cmp dword [0x45db9c], eax
je 0x4059b3
cmp dword [0x45f3f8], 0
jne 0x4059b3
mov eax, dword [ecx + 0xc]
add eax, dword [0x45f418]
mov dword [0x45f3f8], eax
mov eax, dword [ecx + 8]
mov dword [0x45f3fc], eax
jmp 0x405b1c
mov ecx, dword [0x45f440]
cmp dword [ecx + 0x10], 0
jbe 0x405b19
cmp dword [0x45db5c], 0
je 0x405b19
cmp dword [0x45f408], 0
jne 0x405b19
mov eax, dword [ecx + 0xc]
add eax, dword [0x45f418]
mov dword [0x45f408], eax
mov eax, dword [ecx + 8]
mov dword [0x45f40c], eax
jmp 0x405b19
mov ecx, dword [0x45f440]
mov edx, dword [ebp - 0x14]
mov eax, dword [0x45db9c]
add ecx, 0x28
inc eax
mov dword [0x45f440], ecx
mov dword [0x45db9c], eax
jmp 0x4053ae
xor ebx, ebx
inc ebx
mov ecx, dword [0x45f43c]
xor edx, edx
cmp dword [ecx + 0xc8], edx
jbe 0x405b5f
mov dword [ecx + 0xc8], edx
mov eax, dword [0x45f43c]
mov dword [eax + 0xcc], edx
mov ecx, dword [0x45f43c]
mov ecx, dword [ecx + 0x38]
mov dword [0x45d560], ecx
push dword [0x44f460]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
and dword [0x44f460], 0
mov eax, ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
pop ebx
call fcn.00416750
leave
ret