Function at 0x40d940
Capabilities:
Get file size

Disassembly:
push ebx
push ebp
push esi
mov esi, dword [esp + 0x14]
push edi
push 0
push 0x80
push 3
push 0
push 0
push MenuHelp
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [0x427738], eax
jne 0x40d99a
push esi
push str._s_open_error_
push 0x4277a0
call dword [sym.imp.USER32.dll_wsprintfA]
mov eax, dword [esp + 0x20]
add esp, 0xc
push 0x10
push 0
push 0x4277a0
push eax
call dword [sym.imp.USER32.dll_MessageBoxA]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
ret
push 0
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
test eax, eax
mov dword [0x427780], eax
jne 0x40d9db
push esi
push str._s_open_error
push 0x4277a0
call dword [sym.imp.USER32.dll_wsprintfA]
mov ecx, dword [esp + 0x20]
add esp, 0xc
push 0x10
push 0
push 0x4277a0
push ecx
call dword [sym.imp.USER32.dll_MessageBoxA]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
ret
push 0x7f02
push 0
call dword [sym.imp.USER32.dll_LoadCursorA]
mov ebp, dword [sym.imp.USER32.dll_SetCursor]
push eax
mov dword [0x427658], eax
call ebp
mov edi, dword [sym.imp.KERNEL32.dll_GlobalLock]
mov ebx, dword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov dword [0x427788], eax
mov eax, dword [esp + 0x2c]
cmp eax, 1
je 0x40da46
cmp eax, 2
jne 0x40da7f
or al, 0xff
mov ecx, dword [0x424018]
mov byte [0x4241cc], al
test ecx, ecx
jne 0x40da6c
mov edx, dword [0x42777c]
push edx
call edi
test eax, eax
mov dword [0x427710], eax
je 0x40da7f
mov edx, dword [0x427760]
xor ecx, ecx
test edx, edx
jbe 0x40da62
jmp 0x40da4f
xor al, al
jmp 0x40da17
mov eax, dword [0x427710]
mov dl, byte [0x4241cc]
mov byte [eax + ecx], dl
mov eax, dword [0x427760]
inc ecx
cmp ecx, eax
jb 0x40da4a
mov eax, dword [0x42777c]
push eax
call ebx
jmp 0x40da7f
mov ecx, dword [0x427760]
push eax
dec ecx
push ecx
push 0
call fcn.00404ac0
add esp, 0xc
mov esi, dword [esp + 0x14]
mov dword [0x427740], 0
push esi
call fcn.004156d0
mov eax, dword [0x424018]
add esp, 4
test eax, eax
jne 0x40dacd
mov edx, dword [0x42777c]
push edx
call edi
test eax, eax
mov dword [0x427710], eax
jne 0x40dacd
mov eax, dword [0x427738]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [0x427788]
push ecx
call ebp
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
ret
mov eax, dword [esp + 0x1c]
mov dword [0x424228], 0
cmp eax, 8
ja case.default.0x40dae4
jmp dword [eax*4 + 0x40dbdc]
mov edx, dword [esp + 0x28]
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x20]
push edx
push eax
push ecx
push esi
call fcn.0040dc00
add esp, 0x10
mov edi, eax
jmp 0x40db7b
mov edx, dword [esp + 0x28]
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x20]
push edx
push eax
push ecx
push esi
call fcn.0040df70
add esp, 0x10
mov edi, eax
jmp 0x40db7b
mov edx, dword [esp + 0x28]
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x20]
push edx
push eax
push ecx
push esi
call fcn.0040e220
add esp, 0x10
mov edi, eax
jmp 0x40db7b
mov edx, dword [esp + 0x28]
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x20]
push edx
push eax
push ecx
push esi
call fcn.0040e4b0
add esp, 0x10
mov edi, eax
jmp 0x40db7b
mov edx, dword [esp + 0x28]
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x20]
push edx
push eax
push ecx
push esi
call fcn.0040dd60
add esp, 0x10
mov edi, eax
jmp 0x40db7b
mov edi, dword [esp + 0x28]
mov eax, dword [0x424018]
test eax, eax
jne 0x40db8d
mov edx, dword [0x42777c]
push edx
call ebx
cmp dword [0x424228], 1
jne 0x40dba6
push 0x10
push 0
push str.Some_BIN_code_out_of_range__
push esi
call dword [sym.imp.USER32.dll_MessageBoxA]
mov eax, dword [0x427780]
push esi
mov dword [0x427740], eax
call fcn.004156d0
add esp, 4
call fcn.004157b0
mov ecx, dword [0x427738]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [0x427788]
push edx
call ebp
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
ret