Function at 0x402110
Capabilities:
Extract resource via kernel32 functions
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4237b8
mov eax, dword fs:[0]
push eax
sub esp, 0x3c
mov eax, dword [0x43506c]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ebx, dword [ebp + 8]
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov esi, eax
test esi, esi
jne 0x402174
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, str.Error_extractResource___GetModuleHandle:
push eax
call fcn.004049c0
mov ecx, eax
call fcn.00402b40
push eax
call fcn.00404c70
add esp, 4
xor eax, eax
jmp 0x40236b
push 0x4317c0
push 0x66
push esi
call dword [sym.imp.KERNEL32.dll_FindResourceA]
mov edi, eax
test edi, edi
jne 0x402195
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, str.Error_extractResource___FindResource:
jmp 0x402157
push edi
push esi
call dword [sym.imp.KERNEL32.dll_LoadResource]
test eax, eax
jne 0x4021ae
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, str.Error_extractResource___LoadResource:
jmp 0x402157
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
mov dword [ebp - 0x18], eax
test eax, eax
je 0x4021a1
push edi
push esi
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov edi, eax
test edi, edi
jne 0x4021d7
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, str.Error_extractResource___SizeofResource:
jmp 0x402157
push edi
call fcn.0040e53d
mov esi, eax
add esp, 4
test esi, esi
je 0x40216d
push edi
push dword [ebp - 0x18]
push esi
call fcn.00409980
add esp, 0xc
mov edx, edi
mov ecx, esi
call fcn.00401fe0
test eax, eax
je 0x40216d
push ecx
mov edx, edi
mov ecx, esi
call fcn.00401e40
add esp, 4
test eax, eax
jne 0x40222f
mov edx, str.Error_extractResource___Unable_to_get_file_hash
call fcn.004049c0
push eax
call fcn.00404c70
add esp, 4
xor eax, eax
jmp 0x40236b
push eax
lea ecx, [ebp - 0x48]
call fcn.00402b00
push str..exe
mov edx, eax
mov dword [ebp - 4], 0
lea ecx, [ebp - 0x30]
call fcn.00404d20
add esp, 4
mov ecx, ebx
push eax
call fcn.00402a80
mov edx, dword [ebp - 0x1c]
cmp edx, 0x10
jb 0x40228d
mov ecx, dword [ebp - 0x30]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x402283
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x402387
push edx
push ecx
call fcn.0040838d
add esp, 8
mov dword [ebp - 4], 0xffffffff
mov edx, dword [ebp - 0x34]
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x1c], 0xf
mov byte [ebp - 0x30], 0
cmp edx, 0x10
jb 0x4022da
mov ecx, dword [ebp - 0x48]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x4022d0
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40238c
push edx
push ecx
call fcn.0040838d
add esp, 8
cmp dword [ebx + 0x14], 0x10
mov dword [ebp - 0x38], 0
mov dword [ebp - 0x34], 0xf
mov byte [ebp - 0x48], 0
jb 0x4022f4
mov ebx, dword [ebx]
push 0
push 0x80
push 2
push 0
push 0
push 0xc0000000
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x402324
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, str.Error_extractResource___CreateFile:
jmp 0x402157
push 0
lea eax, [ebp - 0x14]
push eax
push edi
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
push ebx
test eax, eax
jne 0x402357
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
call fcn.0040e43c
add esp, 4
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, str.Error_extractResource___WriteFile:
jmp 0x402157
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
call fcn.0040e43c
add esp, 4
mov eax, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00408096
mov esp, ebp
pop ebp
ret
call fcn.0040e1ef
call fcn.0040e1ef
int3